Skip to content

Commit f7f256d

Browse files
authored
Merge pull request #233 from objectstack-ai/copilot/upgrade-objectstack-to-latest-yet-again
2 parents bb7670f + 25076ae commit f7f256d

File tree

21 files changed

+297
-206
lines changed

21 files changed

+297
-206
lines changed

apps/web/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"test:watch": "vitest"
1313
},
1414
"dependencies": {
15-
"@objectstack/client": "2.0.1",
15+
"@objectstack/client": "2.0.4",
1616
"@radix-ui/react-dialog": "^1.1.15",
1717
"@radix-ui/react-dropdown-menu": "^2.1.16",
1818
"@radix-ui/react-select": "^2.2.6",
@@ -25,6 +25,7 @@
2525
"lucide-react": "^0.469.0",
2626
"react": "^19.0.0",
2727
"react-dom": "^19.0.0",
28+
"react-router": "^7.2.0",
2829
"react-router-dom": "^7.2.0",
2930
"tailwind-merge": "^3.0.2"
3031
},

apps/web/vite.config.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,46 @@ function htmlBaseUrl(): Plugin {
1515
};
1616
}
1717

18+
/**
19+
* Rollup plugin: stub Node.js built-in modules that leak into the browser
20+
* bundle via server-side transitive dependencies (e.g. @objectstack/core
21+
* imports "crypto" and "path").
22+
*
23+
* Each built-in is resolved to a virtual module whose default export is an
24+
* empty object and every named import becomes a no-op function, so that
25+
* `import { createHash } from "crypto"` does not crash the build.
26+
*/
27+
const nodeBuiltins = ['crypto', 'path'];
28+
const VIRTUAL_PREFIX = '\0node-stub:';
29+
function nodeBuiltinStubs(): Plugin {
30+
return {
31+
name: 'node-builtin-stubs',
32+
enforce: 'pre',
33+
resolveId(source) {
34+
if (nodeBuiltins.includes(source)) return VIRTUAL_PREFIX + source;
35+
},
36+
load(id) {
37+
if (id.startsWith(VIRTUAL_PREFIX)) {
38+
// Proxy-based default that returns no-op for any property access;
39+
// explicit named exports for identifiers Rollup needs to resolve
40+
// statically during tree-shaking.
41+
return `
42+
const noop = () => '';
43+
const chainable = () => ({ update: chainable, digest: noop });
44+
export default new Proxy({}, { get: () => noop });
45+
export const createHash = chainable;
46+
export const resolve = noop;
47+
export const join = noop;
48+
export const dirname = noop;
49+
export const basename = noop;
50+
`;
51+
}
52+
},
53+
};
54+
}
55+
1856
export default defineConfig({
19-
plugins: [react(), tailwindcss(), htmlBaseUrl()],
57+
plugins: [react(), tailwindcss(), htmlBaseUrl(), nodeBuiltinStubs()],
2058
base,
2159
resolve: {
2260
// Ensure every dependency resolves to exactly ONE copy of React, its DOM
@@ -32,11 +70,15 @@ export default defineConfig({
3270
'react',
3371
'react-dom',
3472
'react-dom/client',
73+
'react-router',
3574
'react-router-dom',
3675
'better-auth/react',
3776
'better-auth/client/plugins',
3877
'@tanstack/react-query',
3978
],
79+
// @objectstack/core contains Node.js built-ins (crypto, path).
80+
// Exclude it from pre-bundling so the stubs plugin resolves them.
81+
exclude: ['@objectstack/core'],
4082
},
4183
server: {
4284
port: 5321,

examples/crm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"test": "echo 'skipped — example project'"
1818
},
1919
"dependencies": {
20-
"@objectstack/spec": "2.0.1"
20+
"@objectstack/spec": "2.0.4"
2121
},
2222
"devDependencies": {
2323
"typescript": "^5.0.0",
24-
"@objectstack/cli": "^2.0.1"
24+
"@objectstack/cli": "^2.0.4"
2525
}
2626
}

examples/todo/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"test": "echo 'skipped — example project'"
1818
},
1919
"dependencies": {
20-
"@objectstack/client": "2.0.1",
21-
"@objectstack/driver-memory": "^2.0.1",
22-
"@objectstack/objectql": "^2.0.1",
23-
"@objectstack/runtime": "^2.0.1",
24-
"@objectstack/spec": "2.0.1"
20+
"@objectstack/client": "2.0.4",
21+
"@objectstack/driver-memory": "^2.0.4",
22+
"@objectstack/objectql": "^2.0.4",
23+
"@objectstack/runtime": "^2.0.4",
24+
"@objectstack/spec": "2.0.4"
2525
},
2626
"devDependencies": {
27-
"@objectstack/cli": "^2.0.1",
27+
"@objectstack/cli": "^2.0.4",
2828
"typescript": "^5.0.0"
2929
}
3030
}

objectstack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AppPlugin, DriverPlugin } from '@objectstack/runtime';
1010
import { ObjectQLPlugin } from '@objectstack/objectql';
1111
import { InMemoryDriver } from '@objectstack/driver-memory';
1212
import { AuditLogPlugin } from '@objectos/audit';
13-
import { BetterAuthPlugin } from '@objectos/auth';
13+
import { AuthPlugin } from '@objectstack/plugin-auth';
1414
import { AutomationPlugin } from '@objectos/automation';
1515
import { CachePlugin } from '@objectos/cache';
1616
import { I18nPlugin } from '@objectos/i18n';
@@ -65,7 +65,7 @@ export default defineStack({
6565
new StoragePlugin(),
6666

6767
// Core
68-
new BetterAuthPlugin(),
68+
new AuthPlugin(),
6969
new PermissionsPlugin(),
7070
new AuditLogPlugin(),
7171

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"devDependencies": {
5858
"@changesets/cli": "^2.29.8",
59-
"@objectstack/cli": "^2.0.1",
59+
"@objectstack/cli": "^2.0.4",
6060
"@types/jest": "^30.0.0",
6161
"@types/js-yaml": "^4.0.9",
6262
"@types/node": "^25.2.0",
@@ -75,7 +75,7 @@
7575
"dependencies": {
7676
"@hono/node-server": "^1.19.0",
7777
"@objectos/audit": "workspace:*",
78-
"@objectos/auth": "workspace:*",
78+
"@objectstack/plugin-auth": "2.0.3",
7979
"@objectos/automation": "workspace:*",
8080
"@objectos/cache": "workspace:*",
8181
"@objectos/i18n": "workspace:*",
@@ -90,11 +90,11 @@
9090
"@objectql/driver-mongo": "^4.2.0",
9191
"@objectql/driver-sql": "^4.2.0",
9292
"@objectql/platform-node": "^4.2.0",
93-
"@objectstack/driver-memory": "2.0.1",
94-
"@objectstack/objectql": "2.0.1",
95-
"@objectstack/plugin-hono-server": "2.0.1",
96-
"@objectstack/runtime": "2.0.1",
97-
"@objectstack/spec": "2.0.1",
93+
"@objectstack/driver-memory": "2.0.4",
94+
"@objectstack/objectql": "2.0.4",
95+
"@objectstack/plugin-hono-server": "2.0.4",
96+
"@objectstack/runtime": "2.0.4",
97+
"@objectstack/spec": "2.0.4",
9898
"build": "^0.1.4",
9999
"hono": "^4.11.0",
100100
"pino": "^10.3.0",

packages/audit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"test": "jest --forceExit --passWithNoTests"
1212
},
1313
"dependencies": {
14-
"@objectstack/runtime": "^2.0.1",
15-
"@objectstack/spec": "2.0.1"
14+
"@objectstack/runtime": "^2.0.4",
15+
"@objectstack/spec": "2.0.4"
1616
},
1717
"devDependencies": {
1818
"@objectos/permissions": "workspace:^",

packages/auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"test:integration": "vitest run"
1313
},
1414
"dependencies": {
15-
"@objectstack/runtime": "^2.0.1",
16-
"@objectstack/spec": "2.0.1",
15+
"@objectstack/runtime": "^2.0.4",
16+
"@objectstack/spec": "2.0.4",
1717
"better-auth": "^1.4.18",
1818
"better-sqlite3": "^12.6.0",
1919
"mongodb": "^7.0.0",

packages/automation/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"test": "vitest run"
1212
},
1313
"dependencies": {
14-
"@objectstack/runtime": "^2.0.1",
15-
"@objectstack/spec": "2.0.1",
14+
"@objectstack/runtime": "^2.0.4",
15+
"@objectstack/spec": "2.0.4",
1616
"cron-parser": "^4.9.0"
1717
},
1818
"devDependencies": {

packages/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"test": "jest --forceExit --passWithNoTests"
1313
},
1414
"dependencies": {
15-
"@objectstack/runtime": "^2.0.1",
16-
"@objectstack/spec": "2.0.1",
15+
"@objectstack/runtime": "^2.0.4",
16+
"@objectstack/spec": "2.0.4",
1717
"comlink": "^4.4.1",
1818
"idb": "^8.0.0",
1919
"sql.js": "^1.11.0"

0 commit comments

Comments
 (0)