Skip to content

Commit 55d2f62

Browse files
committed
feat(app-host): update scripts for testing and add objectstack.config for app composition
1 parent dbd0870 commit 55d2f62

6 files changed

Lines changed: 38 additions & 7 deletions

File tree

examples/app-crm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dev": "objectstack dev",
1414
"build": "objectstack compile objectstack.config.ts dist/crm.json",
1515
"typecheck": "tsc --noEmit",
16-
"test": "echo \"No test specified\" && exit 0"
16+
"test": "objectstack test:run"
1717
},
1818
"dependencies": {
1919
"@objectstack/spec": "workspace:*"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineStack } from '@objectstack/spec';
2+
import { AppPlugin } from '@objectstack/runtime';
3+
import CrmApp from '@example/app-crm/objectstack.config';
4+
import TodoApp from '@example/app-todo/objectstack.config';
5+
import BiPluginManifest from '@example/plugin-bi/objectstack.config';
6+
7+
// App Host Example
8+
// This project acts as a "Platform Server" that loads multiple apps and plugins.
9+
// It effectively replaces the manual composition in `src/index.ts`.
10+
11+
export default defineStack({
12+
manifest: {
13+
id: 'app-host',
14+
name: 'app_host',
15+
version: '1.0.0',
16+
description: 'Host application aggregating CRM, Todo and BI plugins',
17+
type: 'app',
18+
},
19+
20+
// Explicitly Load Plugins and Apps
21+
// The Runtime CLI will iterate this list and call kernel.use()
22+
plugins: [
23+
// Wrap Manifests/Stacks in AppPlugin adapter
24+
new AppPlugin(CrmApp),
25+
new AppPlugin(TodoApp),
26+
new AppPlugin(BiPluginManifest)
27+
]
28+
});

examples/app-host/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
"version": "0.9.2",
44
"private": true,
55
"scripts": {
6-
"dev": "tsx src/index.ts",
6+
"dev": "objectstack serve --dev",
7+
"start": "tsx src/index.ts",
78
"build": "tsc --noEmit",
89
"typecheck": "tsc --noEmit",
9-
"test": "echo \"No test specified\" && exit 0",
10+
"test": "objectstack test:run",
1011
"clean": "rm -rf dist node_modules"
1112
},
1213
"dependencies": {
@@ -22,6 +23,7 @@
2223
"devDependencies": {
2324
"ts-node": "^10.9.1",
2425
"tsx": "^4.21.0",
25-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@objectstack/cli": "workspace:*"
2628
}
2729
}

examples/app-react-crud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dev": "pnpm msw:init && vite",
1010
"build": "pnpm msw:init && tsc && vite build",
1111
"typecheck": "tsc --noEmit",
12-
"test": "echo \"No test specified\" && exit 0",
12+
"test": "objectstack test:run",
1313
"preview": "vite preview"
1414
},
1515
"dependencies": {

examples/app-todo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"dev": "objectstack dev",
1414
"build": "objectstack compile objectstack.config.ts dist/objectstack.json",
1515
"typecheck": "tsc --noEmit",
16-
"test": "echo \"No test specified\" && exit 0"
16+
"test": "objectstack test:run"
1717
},
1818
"dependencies": {
1919
"@objectstack/client": "workspace:*",

examples/features/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"type": "module",
77
"scripts": {
88
"build": "tsc --noEmit",
9-
"typecheck": "tsc --noEmit"
9+
"typecheck": "tsc --noEmit",
10+
"test": "objectstack test:run"
1011
},
1112
"dependencies": {
1213
"@objectstack/spec": "workspace:*",

0 commit comments

Comments
 (0)