Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- run: pnpm i

- name: Run unit tests ${{ matrix.name }}
run: pnpm --filter ${{ matrix.name }} test
run: pnpm --filter seven exec init-loaders && pnpm --filter ${{ matrix.name }} test

client:
name: '@plone/client'
Expand Down
4 changes: 2 additions & 2 deletions apps/seven/app/config/server.server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('config/server', () => {
name: 'ploneClient',
type: 'client',
})
.method().config.apiPath,
).toEqual('http://localhost:8080/Plone');
.method(),
).toHaveProperty('initialize');
});
});
6 changes: 1 addition & 5 deletions apps/seven/app/config/server.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ export default function install() {
config.settings.apiPath =
process.env.PLONE_API_PATH || 'http://localhost:8080/Plone';

const cli = PloneClient.initialize({
apiPath: config.settings.apiPath,
});

config.registerUtility({
name: 'ploneClient',
type: 'client',
method: () => cli,
method: () => PloneClient,
});

config.registerUtility({
Expand Down
3 changes: 3 additions & 0 deletions apps/seven/app/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import type PloneClient from '@plone/client';
import type { Value } from '@plone/plate/components/editor';
import type { Params } from 'react-router';

export type PloneClientUtility = typeof PloneClient;

declare module '@plone/types' {
interface UtilityTypeMap {
client: () => PloneClientUtility;
rootContentSubRequest: (args: LoaderUtilityArgs) => Promise<unknown>;
rootLoaderData: (
args: LoaderUtilityArgs,
Expand Down
Loading
Loading