Skip to content

Commit 34b3649

Browse files
committed
feat: enhance objectstack configuration with new plugins and patch for core compatibility
1 parent f6ec8f3 commit 34b3649

5 files changed

Lines changed: 237 additions & 48 deletions

File tree

apps/console/objectstack.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import { defineConfig } from './src/config';
2+
import { MSWPlugin } from '@objectstack/plugin-msw';
3+
import { ObjectQLPlugin } from '@objectstack/objectql';
4+
import ConsolePluginConfig from '@object-ui/console';
25
import crmConfig from '@object-ui/example-crm/objectstack.config';
36
import todoConfig from '@object-ui/example-todo/objectstack.config';
47
import kitchenSinkConfig from '@object-ui/example-kitchen-sink/objectstack.config';
58

9+
const FixedConsolePlugin = {
10+
...ConsolePluginConfig,
11+
init: () => {}
12+
};
13+
614
export default defineConfig({
715
// ============================================================================
816
// Project Metadata
@@ -38,7 +46,9 @@ export default defineConfig({
3846
// ============================================================================
3947

4048
plugins: [
41-
'@objectstack/plugin-msw' // In core config
49+
new ObjectQLPlugin(),
50+
new MSWPlugin(),
51+
FixedConsolePlugin
4252
],
4353

4454
// ============================================================================

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"shadcn:check": "node scripts/shadcn-sync.js --check",
4949
"shadcn:update": "node scripts/shadcn-sync.js --update",
5050
"shadcn:update-all": "node scripts/shadcn-sync.js --update-all --backup",
51-
"start:console": "node packages/cli/dist/cli.js start --dir apps/console/dist",
52-
"start": "node packages/cli/dist/cli.js start --dir apps/console/dist",
51+
"start:console": "tsx node_modules/@objectstack/cli/bin/objectstack.js serve apps/console/objectstack.config.ts",
52+
"start": "tsx node_modules/@objectstack/cli/bin/objectstack.js serve apps/console/objectstack.config.ts",
5353
"shadcn:diff": "node scripts/shadcn-sync.js --diff",
5454
"shadcn:list": "node scripts/shadcn-sync.js --list",
5555
"changeset": "changeset",
@@ -59,6 +59,7 @@
5959
"devDependencies": {
6060
"@changesets/cli": "^2.29.8",
6161
"@eslint/js": "^9.39.1",
62+
"@objectstack/cli": "^0.7.2",
6263
"@objectstack/core": "^0.7.2",
6364
"@objectstack/driver-memory": "^0.7.2",
6465
"@objectstack/objectql": "^0.7.2",
@@ -99,6 +100,7 @@
99100
"storybook": "^8.6.15",
100101
"tailwindcss": "^4.1.18",
101102
"tslib": "^2.6.0",
103+
"tsx": "^4.21.0",
102104
"turbo": "^2.7.6",
103105
"typescript": "^5.9.3",
104106
"typescript-eslint": "^8.53.1",
@@ -111,10 +113,15 @@
111113
"react-dom": "19.2.3",
112114
"@types/react": "19.2.9",
113115
"@types/react-dom": "19.2.3"
116+
},
117+
"patchedDependencies": {
118+
"@objectstack/core": "patches/@objectstack__core.patch"
114119
}
115120
},
116121
"dependencies": {
117-
"coverage-v8": "0.0.1-security"
122+
"coverage-v8": "0.0.1-security",
123+
"pino": "^10.3.0",
124+
"pino-pretty": "^13.1.3"
118125
},
119126
"msw": {
120127
"workerDirectory": [

patches/@objectstack__core.patch

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/dist/index.js b/dist/index.js
2+
index 0c953cd09a590946325a6f7f069fef6429e24eb3..877c792179de362ee2bad5028b7a63577b06017f 100644
3+
--- a/dist/index.js
4+
+++ b/dist/index.js
5+
@@ -10,3 +10,5 @@ export * from './types.js';
6+
export * from './logger.js';
7+
export * from './plugin-loader.js';
8+
export * from './enhanced-kernel.js';
9+
+export { ObjectKernel as ObjectStackKernel } from './kernel.js';
10+
+export { ObjectKernel as ObjectStackKernel } from './kernel.js';
11+
diff --git a/dist/kernel.js b/dist/kernel.js
12+
index 9064a04e9d4240e1c123b46331095dd68820227c..f9ebd2d3d7cf03a1f107455ba066701293be9627 100644
13+
--- a/dist/kernel.js
14+
+++ b/dist/kernel.js
15+
@@ -109,4 +109,11 @@ export class ObjectKernel extends ObjectKernelBase {
16+
isRunning() {
17+
return this.state === 'running';
18+
}
19+
+ // Patch for CLI compatibility
20+
+ registerPlugin(plugin) {
21+
+ return this.use(plugin);
22+
+ }
23+
+ async boot() {
24+
+ return this.bootstrap();
25+
+ }
26+
}
27+
diff --git a/dist/logger.js b/dist/logger.js
28+
index e0edf3605aad358224cd3dc01fcf3d9d693c9118..9dfe43fa47255a13f520b4a6915704773e4c3766 100644
29+
--- a/dist/logger.js
30+
+++ b/dist/logger.js
31+
@@ -13,6 +13,12 @@
32+
* - Browser console integration
33+
* - Distributed tracing support (traceId, spanId)
34+
*/
35+
+import { createRequire } from "module";
36+
+const require = createRequire(import.meta.url);
37+
+
38+
+import { createRequire } from "module";
39+
+const require = createRequire(import.meta.url);
40+
+
41+
export class ObjectLogger {
42+
constructor(config = {}) {
43+
// Detect runtime environment

0 commit comments

Comments
 (0)