Skip to content

Commit dcc3ca9

Browse files
committed
feat: integrate SetupPlugin and add SETUP_APP_DEFAULTS to application configuration
1 parent 7bf362f commit dcc3ca9

File tree

5 files changed

+93
-6
lines changed

5 files changed

+93
-6
lines changed

apps/console/objectstack.shared.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ObjectStackDefinition } from '@objectstack/spec';
22
import { composeStacks } from '@objectstack/spec';
33
import { mergeViewsIntoObjects } from '@object-ui/core';
4+
import { SETUP_APP_DEFAULTS } from '@objectstack/plugin-setup';
45
import crmConfigImport from '@object-ui/example-crm/objectstack.config';
56
import todoConfigImport from '@object-ui/example-todo/objectstack.config';
67
import kitchenSinkConfigImport from '@object-ui/example-kitchen-sink/objectstack.config';
@@ -54,7 +55,7 @@ if (composed.objects && composed.views) {
5455

5556
// Patch CRM App Navigation to include Report using a supported navigation type
5657
// (type: 'url' passes schema validation while still routing correctly via React Router)
57-
const apps = JSON.parse(JSON.stringify(composed.apps || []));
58+
const apps = [...JSON.parse(JSON.stringify(composed.apps || [])), SETUP_APP_DEFAULTS];
5859
const crmApp = apps.find((a: any) => a.name === 'crm_app');
5960
if (crmApp?.navigation) {
6061
const dashboardIdx = crmApp.navigation.findIndex((n: any) => n.id === 'nav_dashboard');

apps/console/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"@objectstack/driver-memory": "^4.0.1",
7373
"@objectstack/objectql": "^4.0.1",
7474
"@objectstack/plugin-msw": "^4.0.1",
75+
"@objectstack/plugin-setup": "^4.0.1",
7576
"@objectstack/runtime": "^4.0.1",
7677
"@objectstack/spec": "^4.0.1",
7778
"@tailwindcss/postcss": "^4.2.2",

apps/console/src/mocks/createKernel.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ObjectQLPlugin } from '@objectstack/objectql';
1717
import { InMemoryDriver, MemoryAnalyticsService } from '@objectstack/driver-memory';
1818
import { MSWPlugin } from '@objectstack/plugin-msw';
1919
import type { MSWPluginOptions } from '@objectstack/plugin-msw';
20+
import { SetupPlugin } from '@objectstack/plugin-setup';
2021
import type { Cube } from '@objectstack/spec/data';
2122
import { http, HttpResponse } from 'msw';
2223

@@ -309,6 +310,7 @@ export async function createKernel(options: KernelOptions): Promise<KernelResult
309310
await kernel.use(new ObjectQLPlugin());
310311
await kernel.use(new DriverPlugin(driver, 'memory'));
311312
await kernel.use(new AppPlugin(appConfig));
313+
await kernel.use(new SetupPlugin());
312314

313315
// Register MemoryAnalyticsService so that HttpDispatcher can serve
314316
// /api/v1/analytics/* endpoints in demo/MSW/dev environments.

objectstack.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ObjectQLPlugin } from '@objectstack/objectql';
1919
import { InMemoryDriver } from '@objectstack/driver-memory';
2020
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
2121
import { AuthPlugin } from '@objectstack/plugin-auth';
22-
import { SetupPlugin } from '@objectstack/plugin-setup';
22+
import { SetupPlugin, SETUP_APP_DEFAULTS } from '@objectstack/plugin-setup';
2323
import { ConsolePlugin } from '@object-ui/console';
2424
import { composeStacks } from '@objectstack/spec';
2525
import { mergeViewsIntoObjects } from '@object-ui/core';
@@ -70,6 +70,7 @@ if (composed.objects && composed.views) {
7070

7171
const mergedApp = {
7272
...composed,
73+
apps: [...(composed.apps || []), SETUP_APP_DEFAULTS],
7374
manifest: {
7475
id: 'dev-workspace',
7576
name: 'dev_workspace',

pnpm-lock.yaml

Lines changed: 86 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)