@oceanum/eidos 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +262 -8
- package/dist/index.cjs +8 -0
- package/dist/index.js +4631 -0
- package/package.json +6 -3
- package/index.html +0 -13
- package/project.json +0 -4
- package/scripts/debug-schema.js +0 -30
- package/scripts/generate-interfaces.js +0 -48
- package/scripts/schema-bundler.js +0 -609
- package/scripts/schema-to-typescript.js +0 -604
- package/src/index.ts +0 -3
- package/src/lib/eidosmodel.ts +0 -46
- package/src/lib/react.tsx +0 -8
- package/src/lib/render.ts +0 -86
- package/src/schema/interfaces.ts +0 -1157
- package/test-example.js +0 -64
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -25
- package/tsconfig.spec.json +0 -31
- package/vite.config.ts +0 -44
- /package/{public → dist}/favicon.ico +0 -0
package/test-example.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Example usage of the new Valtio-based EIDOS bindings
|
|
2
|
-
import { embed } from './lib/index.js';
|
|
3
|
-
|
|
4
|
-
// Example EIDOS spec
|
|
5
|
-
const exampleSpec = {
|
|
6
|
-
id: 'test-app',
|
|
7
|
-
name: 'Test Application',
|
|
8
|
-
root: {
|
|
9
|
-
id: 'root',
|
|
10
|
-
nodeType: 'grid',
|
|
11
|
-
children: []
|
|
12
|
-
},
|
|
13
|
-
data: [],
|
|
14
|
-
transforms: [],
|
|
15
|
-
modalNodes: []
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// Usage example with validation testing
|
|
19
|
-
async function testEmbed() {
|
|
20
|
-
const container = document.createElement('div');
|
|
21
|
-
document.body.appendChild(container);
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
// Create EIDOS instance with full AJV schema validation
|
|
25
|
-
const eidos = await embed(container, exampleSpec, (event) => {
|
|
26
|
-
console.log('Received event from renderer:', event);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
console.log('EIDOS instance created and validated:', eidos);
|
|
30
|
-
|
|
31
|
-
// Now you can mutate the spec naturally!
|
|
32
|
-
eidos.name = 'Updated Application Name';
|
|
33
|
-
eidos.root.children.push({
|
|
34
|
-
id: 'new-child',
|
|
35
|
-
nodeType: 'world',
|
|
36
|
-
children: []
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
console.log('Spec updated via natural object assignment');
|
|
40
|
-
// These changes will automatically be sent as patches to the renderer
|
|
41
|
-
|
|
42
|
-
} catch (error) {
|
|
43
|
-
console.error('Failed to create EIDOS instance:', error);
|
|
44
|
-
// AJV will provide detailed validation error messages
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Test invalid spec to see AJV validation in action
|
|
49
|
-
async function testInvalidSpec() {
|
|
50
|
-
const invalidSpec = {
|
|
51
|
-
// Missing required 'id' and 'root' properties
|
|
52
|
-
name: 'Invalid Spec'
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
await embed(document.createElement('div'), invalidSpec);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.log('Expected validation error:', error.message);
|
|
59
|
-
// Should show detailed AJV validation errors
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Uncomment to test:
|
|
64
|
-
// testEmbed();
|
package/tsconfig.json
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"rootDir": "src",
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
|
|
8
|
-
"types": ["node", "vite/client"],
|
|
9
|
-
"skipLibCheck": true
|
|
10
|
-
},
|
|
11
|
-
"include": ["src/**/*.ts"],
|
|
12
|
-
"references": [],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"vite.config.ts",
|
|
15
|
-
"vitest.config.ts",
|
|
16
|
-
"src/**/*.test.ts",
|
|
17
|
-
"src/**/*.spec.ts",
|
|
18
|
-
"src/**/*.test.tsx",
|
|
19
|
-
"src/**/*.spec.tsx",
|
|
20
|
-
"src/**/*.test.js",
|
|
21
|
-
"src/**/*.spec.js",
|
|
22
|
-
"src/**/*.test.jsx",
|
|
23
|
-
"src/**/*.spec.jsx"
|
|
24
|
-
]
|
|
25
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc/packages/datamesh",
|
|
5
|
-
"types": [
|
|
6
|
-
"vitest/globals",
|
|
7
|
-
"vitest/importMeta",
|
|
8
|
-
"vite/client",
|
|
9
|
-
"node",
|
|
10
|
-
"vitest"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"include": [
|
|
14
|
-
"vite.config.ts",
|
|
15
|
-
"vitest.config.ts",
|
|
16
|
-
"src/**/*.test.ts",
|
|
17
|
-
"src/**/*.spec.ts",
|
|
18
|
-
"src/**/*.test.tsx",
|
|
19
|
-
"src/**/*.spec.tsx",
|
|
20
|
-
"src/**/*.test.js",
|
|
21
|
-
"src/**/*.spec.js",
|
|
22
|
-
"src/**/*.test.jsx",
|
|
23
|
-
"src/**/*.spec.jsx",
|
|
24
|
-
"src/**/*.d.ts"
|
|
25
|
-
],
|
|
26
|
-
"references": [
|
|
27
|
-
{
|
|
28
|
-
"path": "./tsconfig.lib.json"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { NodeGlobalsPolyfillPlugin } from "@esbuild-plugins/node-globals-polyfill";
|
|
2
|
-
import { defineConfig } from "vite";
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
define: {
|
|
6
|
-
"process.env": {},
|
|
7
|
-
},
|
|
8
|
-
build: {
|
|
9
|
-
outDir: "./dist",
|
|
10
|
-
emptyOutDir: true,
|
|
11
|
-
reportCompressedSize: true,
|
|
12
|
-
commonjsOptions: {
|
|
13
|
-
transformMixedEsModules: true,
|
|
14
|
-
},
|
|
15
|
-
lib: {
|
|
16
|
-
// Could also be a dictionary or array of multiple entry points.
|
|
17
|
-
entry: "src/index.ts",
|
|
18
|
-
name: "eidos",
|
|
19
|
-
fileName: "index",
|
|
20
|
-
// Change this to the formats you want to support.
|
|
21
|
-
// Don't forget to update your package.json as well.
|
|
22
|
-
formats: ["es", "cjs"],
|
|
23
|
-
},
|
|
24
|
-
rollupOptions: {
|
|
25
|
-
// External packages that should not be bundled into your library.
|
|
26
|
-
external: ["react"],
|
|
27
|
-
},
|
|
28
|
-
watch: true,
|
|
29
|
-
},
|
|
30
|
-
optimizeDeps: {
|
|
31
|
-
esbuildOptions: {
|
|
32
|
-
// Node.js global to browser globalThis
|
|
33
|
-
define: {
|
|
34
|
-
global: "globalThis",
|
|
35
|
-
},
|
|
36
|
-
// Enable esbuild polyfill plugins
|
|
37
|
-
plugins: [
|
|
38
|
-
NodeGlobalsPolyfillPlugin({
|
|
39
|
-
buffer: true,
|
|
40
|
-
}),
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
});
|
|
File without changes
|