@multiplatform.one/node-graph 7.83.1 → 7.83.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/package.json +14 -11
- package/src/dom/domEntry.spec.ts +3 -2
- package/src/packageShape.spec.ts +33 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/node-graph",
|
|
3
|
-
"version": "7.83.
|
|
3
|
+
"version": "7.83.2",
|
|
4
4
|
"description": "Node graph editor — React Flow on web, Tamagui knob-aware nodes, an Expo DOM host on native",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"multiplatform",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"types": "./types/index.d.ts",
|
|
47
47
|
"import": "./dist/esm/index.mjs",
|
|
48
48
|
"require": "./dist/cjs/index.cjs",
|
|
49
|
-
"default": "./
|
|
49
|
+
"default": "./dist/esm/index.mjs"
|
|
50
50
|
},
|
|
51
51
|
"./model": {
|
|
52
52
|
"source": "./src/model/index.ts",
|
|
@@ -58,19 +58,22 @@
|
|
|
58
58
|
"source": "./src/dom/NodeGraphDom.ts",
|
|
59
59
|
"react-native": "./src/dom/NodeGraphDom.ts",
|
|
60
60
|
"types": "./types/dom/NodeGraphDom.d.ts",
|
|
61
|
-
"
|
|
61
|
+
"browser": "./src/dom/NodeGraphDom.ts"
|
|
62
62
|
},
|
|
63
63
|
"./dom-inner": {
|
|
64
64
|
"source": "./src/dom/NodeGraphDomShell.ts",
|
|
65
65
|
"react-native": "./src/dom/NodeGraphDomShell.ts",
|
|
66
66
|
"types": "./types/dom/NodeGraphDomShell.d.ts",
|
|
67
|
-
"
|
|
67
|
+
"browser": "./src/dom/NodeGraphDomShell.ts"
|
|
68
68
|
},
|
|
69
69
|
"./demo": {
|
|
70
70
|
"source": "./src/react-flow/demoNodeBody.tsx",
|
|
71
71
|
"react-native": "./src/react-flow/demoNodeBody.tsx",
|
|
72
72
|
"types": "./types/react-flow/demoNodeBody.d.ts",
|
|
73
|
-
"
|
|
73
|
+
"browser": "./src/react-flow/demoNodeBody.tsx",
|
|
74
|
+
"import": "./dist/esm/react-flow/demoNodeBody.mjs",
|
|
75
|
+
"require": "./dist/cjs/react-flow/demoNodeBody.cjs",
|
|
76
|
+
"default": "./dist/esm/react-flow/demoNodeBody.mjs"
|
|
74
77
|
},
|
|
75
78
|
"./metro": "./metro/index.js",
|
|
76
79
|
"./css/graph.css": "./css/graph.css"
|
|
@@ -80,17 +83,17 @@
|
|
|
80
83
|
},
|
|
81
84
|
"dependencies": {
|
|
82
85
|
"@dagrejs/dagre": "^3.1.1",
|
|
83
|
-
"@multiplatform.one/forms": "^7.83.
|
|
84
|
-
"@multiplatform.one/platform": "^7.83.
|
|
85
|
-
"@multiplatform.one/theme": "^7.83.
|
|
86
|
+
"@multiplatform.one/forms": "^7.83.2",
|
|
87
|
+
"@multiplatform.one/platform": "^7.83.2",
|
|
88
|
+
"@multiplatform.one/theme": "^7.83.2",
|
|
86
89
|
"@tamagui/web": "2.7.6",
|
|
87
90
|
"@xyflow/react": "^12.12.0",
|
|
88
91
|
"@xyflow/system": "0.0.83",
|
|
89
92
|
"tamagui": "2.7.6"
|
|
90
93
|
},
|
|
91
94
|
"devDependencies": {
|
|
92
|
-
"@multiplatform.one/config": "7.83.
|
|
93
|
-
"@multiplatform.one/test-utils": "7.83.
|
|
95
|
+
"@multiplatform.one/config": "7.83.2",
|
|
96
|
+
"@multiplatform.one/test-utils": "7.83.2",
|
|
94
97
|
"@tamagui/build": "2.7.6",
|
|
95
98
|
"@testing-library/react": "^16.3.3",
|
|
96
99
|
"@types/react-dom": "^19.2.3",
|
|
@@ -103,7 +106,7 @@
|
|
|
103
106
|
"vitest": "^4.1.5"
|
|
104
107
|
},
|
|
105
108
|
"peerDependencies": {
|
|
106
|
-
"@multiplatform.one/components": "^7.83.
|
|
109
|
+
"@multiplatform.one/components": "^7.83.2",
|
|
107
110
|
"expo": ">=55",
|
|
108
111
|
"expo-haptics": "*",
|
|
109
112
|
"react": "^19.1.0",
|
package/src/dom/domEntry.spec.ts
CHANGED
|
@@ -235,10 +235,11 @@ describe('package.json exports["./dom"]', () => {
|
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
it("declares source, react-native and
|
|
238
|
+
it("declares source, react-native and browser for DOM bundlers", () => {
|
|
239
239
|
expect(Object.keys(pkg.exports["./dom"] as object)).toEqual(
|
|
240
|
-
expect.arrayContaining(["source", "react-native", "
|
|
240
|
+
expect.arrayContaining(["source", "react-native", "browser"]),
|
|
241
241
|
);
|
|
242
|
+
expect(pkg.exports["./dom"]).not.toHaveProperty("default");
|
|
242
243
|
});
|
|
243
244
|
});
|
|
244
245
|
|
package/src/packageShape.spec.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The package's own shape is load-bearing, so it is specced like code.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* These assertions are about a resolver nobody can see failing
|
|
5
5
|
* until a bundle breaks: Metro picks the FIRST condition it recognises and
|
|
6
6
|
* never reconsiders `source` or `default` (MPO-185), and `./dom` has to stay
|
|
7
7
|
* pinned to source on every condition because storybook-expo's
|
|
@@ -100,16 +100,8 @@ describe("package shape", () => {
|
|
|
100
100
|
* `./dom-inner` is what an APP's `'use dom'` entry imports (design §9.3), so
|
|
101
101
|
* it lives under the same pin as `./dom`: every runtime condition on source.
|
|
102
102
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
* has: it must be the SAME MODULE INSTANCE the canvas's inner tree imports.
|
|
106
|
-
* An app's `'use dom'` entry supplies the schema by value, and a schema built
|
|
107
|
-
* from `dist/` would carry a second copy of `GraphNode` and `GraphPort` —
|
|
108
|
-
* Tamagui `styled()` components from a different build, rendering inside a
|
|
109
|
-
* provider from this one. One bundle, two node implementations.
|
|
110
|
-
*/
|
|
111
|
-
it("resolves ./dom, ./dom-inner and ./demo to a path under src/ on every condition", () => {
|
|
112
|
-
for (const subpath of ["./dom", "./dom-inner", "./demo"]) {
|
|
103
|
+
it("resolves ./dom and ./dom-inner to a path under src/ on every condition", () => {
|
|
104
|
+
for (const subpath of ["./dom", "./dom-inner"]) {
|
|
113
105
|
const leaves = targetLeaves(pkg.exports[subpath]);
|
|
114
106
|
expect(leaves.length, subpath).toBeGreaterThan(0);
|
|
115
107
|
for (const leaf of leaves) {
|
|
@@ -122,6 +114,36 @@ describe("package shape", () => {
|
|
|
122
114
|
}
|
|
123
115
|
});
|
|
124
116
|
|
|
117
|
+
/**
|
|
118
|
+
* `./demo` is pinned to source for bundlers: it must be the SAME MODULE
|
|
119
|
+
* INSTANCE the canvas's inner tree imports.
|
|
120
|
+
* An app's `'use dom'` entry supplies the schema by value, and a schema built
|
|
121
|
+
* from `dist/` would carry a second copy of `GraphNode` and `GraphPort` —
|
|
122
|
+
* Tamagui `styled()` components from a different build, rendering inside a
|
|
123
|
+
* provider from this one. One bundle, two node implementations.
|
|
124
|
+
*/
|
|
125
|
+
it("resolves ./demo to the inner tree's source module under every bundler condition", () => {
|
|
126
|
+
const inner = "./src/react-flow/demoNodeBody.tsx";
|
|
127
|
+
const bundlers = {
|
|
128
|
+
...metroPlatformConditions,
|
|
129
|
+
source: new Set(["source", "import", "require", "default"]),
|
|
130
|
+
};
|
|
131
|
+
for (const [bundler, conditions] of Object.entries(bundlers)) {
|
|
132
|
+
expect(metroExportTarget(pkg.exports["./demo"], conditions), bundler).toBe(inner);
|
|
133
|
+
}
|
|
134
|
+
expect(existsSync(path.join(packageRoot, inner))).toBe(true);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it("sends Node to the compiled ./demo", () => {
|
|
138
|
+
const demo = pkg.exports["./demo"];
|
|
139
|
+
expect(metroExportTarget(demo, new Set(["node", "import", "default"]))).toBe(
|
|
140
|
+
"./dist/esm/react-flow/demoNodeBody.mjs",
|
|
141
|
+
);
|
|
142
|
+
expect(metroExportTarget(demo, new Set(["node", "require", "default"]))).toBe(
|
|
143
|
+
"./dist/cjs/react-flow/demoNodeBody.cjs",
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
|
|
125
147
|
it("keeps @multiplatform.one/components an optional peer, never a dependency", () => {
|
|
126
148
|
expect(pkg.peerDependencies?.["@multiplatform.one/components"]).toBeDefined();
|
|
127
149
|
expect(pkg.dependencies?.["@multiplatform.one/components"]).toBeUndefined();
|