Skip to content

Commit cf52c38

Browse files
committed
feat: Integrate platform-objects and update references in studio and tests
1 parent 3a96722 commit cf52c38

8 files changed

Lines changed: 13 additions & 22 deletions

File tree

apps/studio/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@objectstack/hono": "workspace:*",
3636
"@objectstack/metadata": "workspace:*",
3737
"@objectstack/objectql": "workspace:*",
38+
"@objectstack/platform-objects": "workspace:*",
3839
"@objectstack/plugin-audit": "workspace:*",
3940
"@objectstack/plugin-auth": "workspace:*",
4041
"@objectstack/plugin-msw": "workspace:*",

apps/studio/src/mocks/createKernel.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import { MetadataPlugin } from '@objectstack/metadata';
1111
import { AIServicePlugin } from '@objectstack/service-ai';
1212
import { FeedServicePlugin } from '@objectstack/service-feed';
1313

14-
// System object definitions — resolved via Vite aliases to plugin source (no runtime deps)
1514
import {
1615
SysUser, SysSession, SysAccount, SysVerification,
1716
SysOrganization, SysMember, SysInvitation,
1817
SysTeam, SysTeamMember,
1918
SysApiKey, SysTwoFactor,
20-
} from '@objectstack/plugin-auth/objects';
21-
import { SysRole, SysPermissionSet } from '@objectstack/plugin-security/objects';
22-
import { SysAuditLog } from '@objectstack/plugin-audit/objects';
19+
} from '@objectstack/platform-objects/identity';
20+
import { SysRole, SysPermissionSet } from '@objectstack/platform-objects/security';
21+
import { SysAuditLog } from '@objectstack/platform-objects/audit';
2322

2423
/** All system objects from auth, security, and audit plugins */
2524
const SYSTEM_OBJECTS = [

apps/studio/vite.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ export default defineConfig({
1717
'react': path.resolve(__dirname, './node_modules/react'),
1818
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
1919
'@': path.resolve(__dirname, './src'),
20-
// System object definitions — resolve to plugin source (no runtime deps)
21-
'@objectstack/plugin-auth/objects': path.resolve(__dirname, '../../packages/plugins/plugin-auth/src/objects/index.ts'),
22-
'@objectstack/plugin-security/objects': path.resolve(__dirname, '../../packages/plugins/plugin-security/src/objects/index.ts'),
23-
'@objectstack/plugin-audit/objects': path.resolve(__dirname, '../../packages/plugins/plugin-audit/src/objects/index.ts'),
2420
'node:fs/promises': path.resolve(__dirname, './mocks/node-polyfills.ts'),
2521
'node:fs': path.resolve(__dirname, './mocks/node-polyfills.ts'),
2622
'node:events': path.resolve(__dirname, './mocks/node-polyfills.ts'),

apps/studio/vitest.config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import react from '@vitejs/plugin-react';
77
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
88
import path from 'path';
99

10-
// NOTE: Keep the resolve.alias block in sync with vite.config.ts.
11-
// Studio depends on package subpaths (e.g. `@objectstack/plugin-auth/objects`)
12-
// that are not declared in those packages' exports maps; we alias them to
13-
// source files here so both `vite dev/build` and `vitest` can resolve them.
1410
const polyfillPath = path.resolve(__dirname, './mocks/node-polyfills.ts');
1511

1612
export default defineConfig({
@@ -43,10 +39,6 @@ export default defineConfig({
4339
'react': path.resolve(__dirname, './node_modules/react'),
4440
'react-dom': path.resolve(__dirname, './node_modules/react-dom'),
4541
'@': path.resolve(__dirname, './src'),
46-
// System object definitions — resolve to plugin source (no runtime deps)
47-
'@objectstack/plugin-auth/objects': path.resolve(__dirname, '../../packages/plugins/plugin-auth/src/objects/index.ts'),
48-
'@objectstack/plugin-security/objects': path.resolve(__dirname, '../../packages/plugins/plugin-security/src/objects/index.ts'),
49-
'@objectstack/plugin-audit/objects': path.resolve(__dirname, '../../packages/plugins/plugin-audit/src/objects/index.ts'),
5042
// Node built-ins stubbed for browser-like test env
5143
'node:fs/promises': polyfillPath,
5244
'node:fs': polyfillPath,

content/docs/concepts/north-star.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ without explicit project-level buy-in.
528528

529529
- <AlertTriangle className="inline" /> **JSON is not an authoring form.** Phase 1 authors produce metadata via TypeScript and the CLI. If you find yourself editing JSON payloads directly in `sys_metadata`, you are patching around a missing CLI affordance.
530530
- <AlertTriangle className="inline" /> **TS is not a wire form.** ObjectOS runtimes never consume `.ts` files directly. The only runtime inputs are a compiled `dist/objectstack.json` or the control plane's Artifact API response (also JSON).
531-
- <AlertTriangle className="inline" /> **No bypassing Zod for TS <-> JSON conversion.** Any hand-rolled serializer will diverge from the schema on the Nth protocol bump and silently corrupt data. `z.toJSONSchema()` + `schema.parse()` **is** the contract.
531+
- <AlertTriangle className="inline" /> **No bypassing Zod for TS-to-JSON conversion.** Any hand-rolled serializer will diverge from the schema on the Nth protocol bump and silently corrupt data. `z.toJSONSchema()` + `schema.parse()` **is** the contract.
532532

533533
### Prior anti-patterns (still in force)
534534

packages/objectql/src/plugin.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ describe('ObjectQLPlugin - Metadata Service Integration', () => {
880880
// Assert — sys_metadata should have been queried
881881
const metaQuery = findCalls.find((c) => c.object === 'sys_metadata');
882882
expect(metaQuery).toBeDefined();
883-
expect(metaQuery!.query.where).toEqual({ state: 'active' });
883+
expect(metaQuery!.query.where).toEqual({ state: 'active', env_id: null });
884884

885885
// Assert — items should be restored into the registry
886886
const registry = (kernel.getService('objectql') as any).registry;

packages/objectql/src/protocol-meta.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('ObjectStackProtocolImplementation - Metadata Persistence', () => {
172172

173173
expect(result.item).toEqual(sampleApp);
174174
expect(mockEngine.findOne).toHaveBeenCalledWith('sys_metadata', {
175-
where: { type: 'app', name: 'test_app', state: 'active' }
175+
where: { type: 'app', name: 'test_app', state: 'active', env_id: null }
176176
});
177177
});
178178

@@ -272,7 +272,7 @@ describe('ObjectStackProtocolImplementation - Metadata Persistence', () => {
272272
// DB *is* queried (always-merge semantics) so seeded metadata
273273
// surfaces even when the registry already has unrelated items.
274274
expect(mockEngine.find).toHaveBeenCalledWith('sys_metadata', {
275-
where: { type: 'app', state: 'active' }
275+
where: { type: 'app', state: 'active', env_id: null }
276276
});
277277
});
278278

@@ -291,7 +291,7 @@ describe('ObjectStackProtocolImplementation - Metadata Persistence', () => {
291291
expect(result.items).toHaveLength(1);
292292
expect(result.items[0]).toEqual(sampleApp);
293293
expect(mockEngine.find).toHaveBeenCalledWith('sys_metadata', {
294-
where: { type: 'app', state: 'active' }
294+
where: { type: 'app', state: 'active', env_id: null }
295295
});
296296
});
297297

@@ -370,7 +370,7 @@ describe('ObjectStackProtocolImplementation - Metadata Persistence', () => {
370370
await protocol.loadMetaFromDb();
371371

372372
expect(mockEngine.find).toHaveBeenCalledWith('sys_metadata', {
373-
where: { state: 'active' }
373+
where: { state: 'active', env_id: null }
374374
});
375375
});
376376

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)