@oceanum/eidos 0.9.1 → 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/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
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "files": [],
4
- "include": [],
5
- "references": [
6
- {
7
- "path": "./tsconfig.lib.json"
8
- },
9
- {
10
- "path": "./tsconfig.spec.json"
11
- }
12
- ]
13
- }
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
- }
@@ -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