@object-ui/sdui-parser 16.1.0 → 17.1.0
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/dist/index.d.ts +22 -0
- package/dist/index.js +24 -0
- package/package.json +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,29 @@ export interface RegistryConfigLike {
|
|
|
43
43
|
binding?: 'object' | 'field';
|
|
44
44
|
description?: string;
|
|
45
45
|
}>;
|
|
46
|
+
/**
|
|
47
|
+
* True when the registry entry is a pending lazy stub — registered, but its
|
|
48
|
+
* plugin module has not been imported, so it carries metadata and no
|
|
49
|
+
* `inputs`. See {@link assertFullyLoaded}.
|
|
50
|
+
*/
|
|
51
|
+
lazy?: boolean;
|
|
46
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Build-time guard for the manifest generators.
|
|
55
|
+
*
|
|
56
|
+
* A manifest is the contract's frozen form: the parser's tag whitelist and the
|
|
57
|
+
* save gate's prop validator both read it. So it has to be generated from
|
|
58
|
+
* FULLY LOADED registrations. A `lazy: true` entry means the generator never
|
|
59
|
+
* imported that plugin, and the block would be written out with empty
|
|
60
|
+
* `inputs` — indistinguishable from a block that legitimately takes no props,
|
|
61
|
+
* which turns every prop an author writes on it into an `unknown-prop`
|
|
62
|
+
* diagnostic. Wrong quietly, in the artifact everything downstream trusts.
|
|
63
|
+
*
|
|
64
|
+
* The generators keep their own eager import list, so this is what catches it
|
|
65
|
+
* drifting behind the app's registration list (objectui#2953 was the same
|
|
66
|
+
* class of bug one layer down).
|
|
67
|
+
*/
|
|
68
|
+
export declare function assertFullyLoaded(configs: RegistryConfigLike[]): void;
|
|
47
69
|
export declare function manifestFromConfigs(configs: RegistryConfigLike[], opts?: {
|
|
48
70
|
only?: Set<string>;
|
|
49
71
|
publicOnly?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,30 @@ export function compile(source, manifest) {
|
|
|
28
28
|
ok: !diagnostics.some((d) => d.severity === 'error'),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Build-time guard for the manifest generators.
|
|
33
|
+
*
|
|
34
|
+
* A manifest is the contract's frozen form: the parser's tag whitelist and the
|
|
35
|
+
* save gate's prop validator both read it. So it has to be generated from
|
|
36
|
+
* FULLY LOADED registrations. A `lazy: true` entry means the generator never
|
|
37
|
+
* imported that plugin, and the block would be written out with empty
|
|
38
|
+
* `inputs` — indistinguishable from a block that legitimately takes no props,
|
|
39
|
+
* which turns every prop an author writes on it into an `unknown-prop`
|
|
40
|
+
* diagnostic. Wrong quietly, in the artifact everything downstream trusts.
|
|
41
|
+
*
|
|
42
|
+
* The generators keep their own eager import list, so this is what catches it
|
|
43
|
+
* drifting behind the app's registration list (objectui#2953 was the same
|
|
44
|
+
* class of bug one layer down).
|
|
45
|
+
*/
|
|
46
|
+
export function assertFullyLoaded(configs) {
|
|
47
|
+
const stubs = configs.filter((c) => c.lazy).map((c) => c.type).sort();
|
|
48
|
+
if (stubs.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
throw new Error(`Manifest generation saw ${stubs.length} not-yet-loaded lazy block(s): ${stubs.join(', ')}.\n` +
|
|
51
|
+
`A manifest must describe loaded registrations — these would be written out with no \`inputs\`, ` +
|
|
52
|
+
`so every prop an author passes them would be reported as unknown.\n` +
|
|
53
|
+
`Add an eager \`import\` of each block's plugin to the generator entry.`);
|
|
54
|
+
}
|
|
31
55
|
const INPUT_TYPES = new Set([
|
|
32
56
|
'string',
|
|
33
57
|
'number',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/sdui-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,11 +24,14 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
|
-
"devDependencies": {
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@object-ui/core": "17.1.0",
|
|
29
|
+
"@object-ui/react": "17.1.0"
|
|
30
|
+
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"build": "tsc",
|
|
30
33
|
"test": "vitest run",
|
|
31
|
-
"type-check": "tsc --noEmit",
|
|
34
|
+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
32
35
|
"lint": "eslint ."
|
|
33
36
|
}
|
|
34
37
|
}
|