Skip to content

Commit e3179b3

Browse files
authored
Merge pull request #270 from objectstack-ai/copilot/upgrade-objectstack-spec-v061
2 parents 85b272a + db72d19 commit e3179b3

File tree

8 files changed

+121
-40
lines changed

8 files changed

+121
-40
lines changed

.storybook/test-runner.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @type {import('@storybook/test-runner').TestRunnerConfig}
3+
*/
4+
module.exports = {
5+
async preVisit(page) {
6+
// Inject __test global to prevent ReferenceError during test execution
7+
// This addresses the error: "page.evaluate: ReferenceError: __test is not defined"
8+
// that occurs when running Storybook test-runner smoke tests
9+
await page.evaluate(() => {
10+
window.__test = true;
11+
});
12+
},
13+
};

.storybook/test-runner.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@object-ui/types": "workspace:*",
33-
"@objectstack/spec": "^0.4.1",
33+
"@objectstack/spec": "^0.6.1",
3434
"lodash": "^4.17.23",
3535
"zod": "^4.3.6"
3636
},

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@object-ui/core": "workspace:*",
33-
"@objectstack/spec": "^0.3.3",
33+
"@objectstack/spec": "^0.6.1",
3434
"react-hook-form": "^7.71.1"
3535
},
3636
"peerDependencies": {

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"directory": "packages/types"
8282
},
8383
"dependencies": {
84-
"@objectstack/spec": "^0.3.3",
84+
"@objectstack/spec": "^0.6.1",
8585
"zod": "^4.3.6"
8686
},
8787
"devDependencies": {
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* Test to verify ObjectStack Spec v0.6.1 namespace exports
3+
*/
4+
import { describe, it, expect } from 'vitest';
5+
import type { Data, UI, System, AI, API, Auth, Hub, Automation, Permission, Shared } from '../index';
6+
7+
describe('ObjectStack Spec v0.6.1 Namespace Exports', () => {
8+
it('should export Data namespace', () => {
9+
// Type check only - this verifies the namespace is exported
10+
const field: Data.Field = {
11+
name: 'test',
12+
type: 'text',
13+
label: 'Test Field',
14+
};
15+
expect(field.name).toBe('test');
16+
});
17+
18+
it('should export UI namespace', () => {
19+
// Type check only - verify UI namespace exists
20+
type UITest = UI.Component | undefined;
21+
const uiComponent: UITest = undefined;
22+
expect(uiComponent).toBeUndefined();
23+
});
24+
25+
it('should export System namespace', () => {
26+
// Type check only - verify System namespace exists
27+
type SystemTest = System.Environment | undefined;
28+
const systemEnv: SystemTest = undefined;
29+
expect(systemEnv).toBeUndefined();
30+
});
31+
32+
it('should export AI namespace', () => {
33+
// Type check only - verify AI namespace exists
34+
type AITest = AI.Model | undefined;
35+
const aiModel: AITest = undefined;
36+
expect(aiModel).toBeUndefined();
37+
});
38+
39+
it('should export API namespace', () => {
40+
// Type check only - verify API namespace exists
41+
type APITest = API.Endpoint | undefined;
42+
const apiEndpoint: APITest = undefined;
43+
expect(apiEndpoint).toBeUndefined();
44+
});
45+
46+
it('should export Auth namespace', () => {
47+
// Type check only - verify Auth namespace exists
48+
type AuthTest = Auth.User | undefined;
49+
const authUser: AuthTest = undefined;
50+
expect(authUser).toBeUndefined();
51+
});
52+
53+
it('should export Hub namespace', () => {
54+
// Type check only - verify Hub namespace exists
55+
type HubTest = Hub.Tenant | undefined;
56+
const hubTenant: HubTest = undefined;
57+
expect(hubTenant).toBeUndefined();
58+
});
59+
60+
it('should export Automation namespace', () => {
61+
// Type check only - verify Automation namespace exists
62+
type AutomationTest = Automation.Workflow | undefined;
63+
const workflow: AutomationTest = undefined;
64+
expect(workflow).toBeUndefined();
65+
});
66+
67+
it('should export Permission namespace', () => {
68+
// Type check only - verify Permission namespace exists
69+
type PermissionTest = Permission.PermissionSet | undefined;
70+
const permissionSet: PermissionTest = undefined;
71+
expect(permissionSet).toBeUndefined();
72+
});
73+
74+
it('should export Shared namespace', () => {
75+
// Type check only - verify Shared namespace exists
76+
type SharedTest = Shared.ObjectId | undefined;
77+
const objectId: SharedTest = undefined;
78+
expect(objectId).toBeUndefined();
79+
});
80+
});

packages/types/src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,22 @@ export type {
431431
SchemaRegistry,
432432
ComponentType,
433433
} from './registry';
434+
435+
// ============================================================================
436+
// ObjectStack Protocol Namespaces - Protocol Re-exports
437+
// ============================================================================
438+
/**
439+
* Re-export ObjectStack Protocol namespaces for convenience.
440+
*
441+
* This allows consumers to access the full ObjectStack protocol through
442+
* @object-ui/types without needing to install @objectstack/spec separately.
443+
*
444+
* @example
445+
* ```typescript
446+
* import { Data, UI, System, AI, API } from '@object-ui/types';
447+
*
448+
* const field: Data.Field = { name: 'task_name', type: 'text' };
449+
* const component: UI.Component = { type: 'button', label: 'Click me' };
450+
* ```
451+
*/
452+
export type { Data, UI, System, AI, API, Auth, Hub, Automation, Permission, Shared } from '@objectstack/spec';

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)