zyzz 0.0.28 → 0.0.30
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/binding/wasi/wasi-worker.mjs +186 -0
- package/binding/wasi/zyzz.wasi.cjs +2302 -0
- package/binding/wasi/zyzz.wasm32-wasi.wasm +0 -0
- package/binding/zyzz.linux-x64-gnu.node +0 -0
- package/dist/babel/index.d.ts.map +1 -1
- package/dist/babel/index.js +2 -4
- package/dist/babel/index.js.map +1 -1
- package/dist/babel/internal/Compilation.d.ts +0 -1
- package/dist/babel/internal/Compilation.d.ts.map +1 -1
- package/dist/compiler/Graph.d.ts +14 -11
- package/dist/compiler/Graph.d.ts.map +1 -1
- package/dist/compiler/Graph.js +57 -1442
- package/dist/compiler/Graph.js.map +1 -1
- package/dist/compiler/Native.d.ts +7 -9
- package/dist/compiler/Native.d.ts.map +1 -1
- package/dist/compiler/Native.js +12 -716
- package/dist/compiler/Native.js.map +1 -1
- package/dist/compiler/Source.d.ts +122 -24
- package/dist/compiler/Source.d.ts.map +1 -1
- package/dist/compiler/Source.js +10 -1267
- package/dist/compiler/Source.js.map +1 -1
- package/dist/compiler/Transform.d.ts +4 -3
- package/dist/compiler/Transform.d.ts.map +1 -1
- package/dist/compiler/Transform.js +13 -961
- package/dist/compiler/Transform.js.map +1 -1
- package/dist/compiler/internal/AtRules.d.ts +5 -1
- package/dist/compiler/internal/AtRules.d.ts.map +1 -1
- package/dist/compiler/internal/AtRules.js +12 -106
- package/dist/compiler/internal/AtRules.js.map +1 -1
- package/dist/compiler/internal/Context.d.ts +11 -0
- package/dist/compiler/internal/Context.d.ts.map +1 -0
- package/dist/compiler/internal/Context.js +11 -0
- package/dist/compiler/internal/Context.js.map +1 -0
- package/dist/compiler/internal/Results.d.ts +148 -0
- package/dist/compiler/internal/Results.d.ts.map +1 -0
- package/dist/compiler/internal/Results.js +259 -0
- package/dist/compiler/internal/Results.js.map +1 -0
- package/dist/compiler/internal/Syntax.d.ts +0 -2
- package/dist/compiler/internal/Syntax.d.ts.map +1 -1
- package/dist/compiler/internal/Syntax.js +0 -2
- package/dist/compiler/internal/Syntax.js.map +1 -1
- package/dist/compiler/internal/Wire.d.ts +17 -0
- package/dist/compiler/internal/Wire.d.ts.map +1 -0
- package/dist/compiler/internal/Wire.js +795 -0
- package/dist/compiler/internal/Wire.js.map +1 -0
- package/dist/internal/Addon.d.ts +28 -0
- package/dist/internal/Addon.d.ts.map +1 -0
- package/dist/internal/Addon.js +87 -0
- package/dist/internal/Addon.js.map +1 -0
- package/dist/internal/Literal.d.ts +4 -1
- package/dist/internal/Literal.d.ts.map +1 -1
- package/dist/internal/Literal.js +4 -2
- package/dist/internal/Literal.js.map +1 -1
- package/dist/internal/Token.d.ts +2 -1
- package/dist/internal/Token.d.ts.map +1 -1
- package/dist/internal/Token.js +2 -2
- package/dist/internal/Token.js.map +1 -1
- package/dist/internal/Vlq.d.ts +14 -0
- package/dist/internal/Vlq.d.ts.map +1 -0
- package/dist/internal/Vlq.js +47 -0
- package/dist/internal/Vlq.js.map +1 -0
- package/dist/internal/Wasm.d.ts +22 -0
- package/dist/internal/Wasm.d.ts.map +1 -0
- package/dist/internal/Wasm.js +83 -0
- package/dist/internal/Wasm.js.map +1 -0
- package/dist/metro/Graph.d.ts +0 -1
- package/dist/metro/Graph.d.ts.map +1 -1
- package/dist/metro/transformer.d.ts.map +1 -1
- package/dist/metro/transformer.js +0 -1
- package/dist/metro/transformer.js.map +1 -1
- package/dist/next/internal/Project.d.ts.map +1 -1
- package/dist/next/internal/Project.js +2 -5
- package/dist/next/internal/Project.js.map +1 -1
- package/dist/node/Host.d.ts.map +1 -1
- package/dist/node/Host.js +0 -2
- package/dist/node/Host.js.map +1 -1
- package/dist/node/internal/Contracts.d.ts.map +1 -1
- package/dist/node/internal/Contracts.js +3 -7
- package/dist/node/internal/Contracts.js.map +1 -1
- package/dist/node/internal/Snapshot.d.ts +0 -1
- package/dist/node/internal/Snapshot.d.ts.map +1 -1
- package/dist/node/internal/Snapshot.js +0 -6
- package/dist/node/internal/Snapshot.js.map +1 -1
- package/dist/runtime/Composition.d.ts +2 -3
- package/dist/runtime/Composition.d.ts.map +1 -1
- package/dist/runtime/Composition.js +51 -30
- package/dist/runtime/Composition.js.map +1 -1
- package/dist/runtime/Recipe.d.ts.map +1 -1
- package/dist/runtime/Recipe.js +16 -12
- package/dist/runtime/Recipe.js.map +1 -1
- package/dist/unplugin/index.d.ts.map +1 -1
- package/dist/unplugin/index.js +3 -6
- package/dist/unplugin/index.js.map +1 -1
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +696 -201
- package/dist/vite/index.js.map +1 -1
- package/dist/web/Css.d.ts +8 -3
- package/dist/web/Css.d.ts.map +1 -1
- package/dist/web/Css.js +5 -721
- package/dist/web/Css.js.map +1 -1
- package/dist/web/internal/Block.d.ts +0 -2
- package/dist/web/internal/Block.d.ts.map +1 -1
- package/dist/web/internal/Block.js +1 -12
- package/dist/web/internal/Block.js.map +1 -1
- package/dist/web/internal/ClassName.d.ts +23 -18
- package/dist/web/internal/ClassName.d.ts.map +1 -1
- package/dist/web/internal/ClassName.js +26 -55
- package/dist/web/internal/ClassName.js.map +1 -1
- package/dist/web/internal/Contributions.d.ts +3 -5
- package/dist/web/internal/Contributions.d.ts.map +1 -1
- package/dist/web/internal/Contributions.js +0 -45
- package/dist/web/internal/Contributions.js.map +1 -1
- package/dist/web/internal/Engine.browser.d.ts +8 -0
- package/dist/web/internal/Engine.browser.d.ts.map +1 -0
- package/dist/web/internal/Engine.browser.js +42 -0
- package/dist/web/internal/Engine.browser.js.map +1 -0
- package/dist/web/internal/Engine.d.ts +9 -0
- package/dist/web/internal/Engine.d.ts.map +1 -0
- package/dist/web/internal/Engine.js +14 -0
- package/dist/web/internal/Engine.js.map +1 -0
- package/dist/web/internal/Themes.d.ts +1 -9
- package/dist/web/internal/Themes.d.ts.map +1 -1
- package/dist/web/internal/Themes.js +3 -221
- package/dist/web/internal/Themes.js.map +1 -1
- package/dist/web/internal/Wasm.generated.d.ts +4 -0
- package/dist/web/internal/Wasm.generated.d.ts.map +1 -0
- package/dist/web/internal/Wasm.generated.js +4 -0
- package/dist/web/internal/Wasm.generated.js.map +1 -0
- package/dist/web/internal/Wire.d.ts +19 -0
- package/dist/web/internal/Wire.d.ts.map +1 -0
- package/dist/web/internal/Wire.js +387 -0
- package/dist/web/internal/Wire.js.map +1 -0
- package/package.json +20 -1
- package/src/babel/index.ts +2 -5
- package/src/babel/internal/Compilation.ts +0 -1
- package/src/compiler/Graph.ts +89 -1930
- package/src/compiler/Native.ts +18 -871
- package/src/compiler/Source.ts +144 -1803
- package/src/compiler/Transform.ts +16 -1315
- package/src/compiler/internal/AtRules.ts +27 -115
- package/src/compiler/internal/Context.ts +11 -0
- package/src/compiler/internal/Results.ts +406 -0
- package/src/compiler/internal/Syntax.ts +0 -3
- package/src/compiler/internal/Wire.ts +1045 -0
- package/src/internal/Addon.ts +118 -0
- package/src/internal/Literal.ts +4 -2
- package/src/internal/Token.ts +2 -2
- package/src/internal/Vlq.ts +59 -0
- package/src/internal/Wasm.ts +111 -0
- package/src/metro/transformer.ts +0 -1
- package/src/next/internal/Project.ts +2 -9
- package/src/node/Host.ts +0 -2
- package/src/node/internal/Contracts.ts +3 -7
- package/src/node/internal/Snapshot.ts +0 -8
- package/src/runtime/Composition.ts +48 -25
- package/src/runtime/Recipe.ts +21 -14
- package/src/unplugin/index.ts +6 -6
- package/src/vite/index.ts +922 -221
- package/src/web/Css.ts +12 -908
- package/src/web/internal/Block.ts +0 -14
- package/src/web/internal/ClassName.ts +52 -85
- package/src/web/internal/Contributions.ts +3 -59
- package/src/web/internal/Engine.browser.ts +51 -0
- package/src/web/internal/Engine.ts +17 -0
- package/src/web/internal/Themes.ts +3 -279
- package/src/web/internal/Wasm.generated.ts +3 -0
- package/src/web/internal/Wire.ts +466 -0
- package/src/web/internal/wasm.d.ts +9 -0
- package/dist/compiler/internal/Applications.d.ts +0 -55
- package/dist/compiler/internal/Applications.d.ts.map +0 -1
- package/dist/compiler/internal/Applications.js +0 -393
- package/dist/compiler/internal/Applications.js.map +0 -1
- package/dist/compiler/internal/ColorProfiles.d.ts +0 -3
- package/dist/compiler/internal/ColorProfiles.d.ts.map +0 -1
- package/dist/compiler/internal/ColorProfiles.js +0 -84
- package/dist/compiler/internal/ColorProfiles.js.map +0 -1
- package/dist/compiler/internal/CompositionBindings.d.ts +0 -16
- package/dist/compiler/internal/CompositionBindings.d.ts.map +0 -1
- package/dist/compiler/internal/CompositionBindings.js +0 -89
- package/dist/compiler/internal/CompositionBindings.js.map +0 -1
- package/dist/compiler/internal/Compositions.d.ts +0 -37
- package/dist/compiler/internal/Compositions.d.ts.map +0 -1
- package/dist/compiler/internal/Compositions.js +0 -494
- package/dist/compiler/internal/Compositions.js.map +0 -1
- package/dist/compiler/internal/Configurations.d.ts +0 -26
- package/dist/compiler/internal/Configurations.d.ts.map +0 -1
- package/dist/compiler/internal/Configurations.js +0 -259
- package/dist/compiler/internal/Configurations.js.map +0 -1
- package/dist/compiler/internal/Contract.d.ts +0 -30
- package/dist/compiler/internal/Contract.d.ts.map +0 -1
- package/dist/compiler/internal/Contract.js +0 -753
- package/dist/compiler/internal/Contract.js.map +0 -1
- package/dist/compiler/internal/Contributions.d.ts +0 -54
- package/dist/compiler/internal/Contributions.d.ts.map +0 -1
- package/dist/compiler/internal/Contributions.js +0 -1151
- package/dist/compiler/internal/Contributions.js.map +0 -1
- package/dist/compiler/internal/Descriptors.d.ts +0 -15
- package/dist/compiler/internal/Descriptors.d.ts.map +0 -1
- package/dist/compiler/internal/Descriptors.js +0 -192
- package/dist/compiler/internal/Descriptors.js.map +0 -1
- package/dist/compiler/internal/Dynamic.d.ts +0 -14
- package/dist/compiler/internal/Dynamic.d.ts.map +0 -1
- package/dist/compiler/internal/Dynamic.js +0 -175
- package/dist/compiler/internal/Dynamic.js.map +0 -1
- package/dist/compiler/internal/Expression.d.ts +0 -19
- package/dist/compiler/internal/Expression.d.ts.map +0 -1
- package/dist/compiler/internal/Expression.js +0 -164
- package/dist/compiler/internal/Expression.js.map +0 -1
- package/dist/compiler/internal/Functions.d.ts +0 -5
- package/dist/compiler/internal/Functions.d.ts.map +0 -1
- package/dist/compiler/internal/Functions.js +0 -191
- package/dist/compiler/internal/Functions.js.map +0 -1
- package/dist/compiler/internal/Keyframes.d.ts +0 -5
- package/dist/compiler/internal/Keyframes.d.ts.map +0 -1
- package/dist/compiler/internal/Keyframes.js +0 -51
- package/dist/compiler/internal/Keyframes.js.map +0 -1
- package/dist/compiler/internal/Names.d.ts +0 -5
- package/dist/compiler/internal/Names.d.ts.map +0 -1
- package/dist/compiler/internal/Names.js +0 -37
- package/dist/compiler/internal/Names.js.map +0 -1
- package/dist/compiler/internal/NativeBindings.d.ts +0 -72
- package/dist/compiler/internal/NativeBindings.d.ts.map +0 -1
- package/dist/compiler/internal/NativeBindings.js +0 -171
- package/dist/compiler/internal/NativeBindings.js.map +0 -1
- package/dist/compiler/internal/NativeMedia.d.ts +0 -14
- package/dist/compiler/internal/NativeMedia.d.ts.map +0 -1
- package/dist/compiler/internal/NativeMedia.js +0 -287
- package/dist/compiler/internal/NativeMedia.js.map +0 -1
- package/dist/compiler/internal/NativeVars.d.ts +0 -28
- package/dist/compiler/internal/NativeVars.d.ts.map +0 -1
- package/dist/compiler/internal/NativeVars.js +0 -160
- package/dist/compiler/internal/NativeVars.js.map +0 -1
- package/dist/compiler/internal/PackedStyles.d.ts +0 -37
- package/dist/compiler/internal/PackedStyles.d.ts.map +0 -1
- package/dist/compiler/internal/PackedStyles.js +0 -344
- package/dist/compiler/internal/PackedStyles.js.map +0 -1
- package/dist/compiler/internal/Properties.d.ts +0 -5
- package/dist/compiler/internal/Properties.d.ts.map +0 -1
- package/dist/compiler/internal/Properties.js +0 -82
- package/dist/compiler/internal/Properties.js.map +0 -1
- package/dist/compiler/internal/RecipeConditions.d.ts +0 -41
- package/dist/compiler/internal/RecipeConditions.d.ts.map +0 -1
- package/dist/compiler/internal/RecipeConditions.js +0 -82
- package/dist/compiler/internal/RecipeConditions.js.map +0 -1
- package/dist/compiler/internal/RecipePayloads.d.ts +0 -31
- package/dist/compiler/internal/RecipePayloads.d.ts.map +0 -1
- package/dist/compiler/internal/RecipePayloads.js +0 -99
- package/dist/compiler/internal/RecipePayloads.js.map +0 -1
- package/dist/compiler/internal/Recipes.d.ts +0 -32
- package/dist/compiler/internal/Recipes.d.ts.map +0 -1
- package/dist/compiler/internal/Recipes.js +0 -339
- package/dist/compiler/internal/Recipes.js.map +0 -1
- package/dist/compiler/internal/Selectors.d.ts +0 -13
- package/dist/compiler/internal/Selectors.d.ts.map +0 -1
- package/dist/compiler/internal/Selectors.js +0 -280
- package/dist/compiler/internal/Selectors.js.map +0 -1
- package/dist/compiler/internal/Static.d.ts +0 -39
- package/dist/compiler/internal/Static.d.ts.map +0 -1
- package/dist/compiler/internal/Static.js +0 -534
- package/dist/compiler/internal/Static.js.map +0 -1
- package/dist/compiler/internal/Themes.d.ts +0 -190
- package/dist/compiler/internal/Themes.d.ts.map +0 -1
- package/dist/compiler/internal/Themes.js +0 -1577
- package/dist/compiler/internal/Themes.js.map +0 -1
- package/dist/compiler/internal/Vars.d.ts +0 -33
- package/dist/compiler/internal/Vars.d.ts.map +0 -1
- package/dist/compiler/internal/Vars.js +0 -387
- package/dist/compiler/internal/Vars.js.map +0 -1
- package/dist/compiler/internal/ViewTransitions.d.ts +0 -3
- package/dist/compiler/internal/ViewTransitions.d.ts.map +0 -1
- package/dist/compiler/internal/ViewTransitions.js +0 -68
- package/dist/compiler/internal/ViewTransitions.js.map +0 -1
- package/dist/internal/Cascade.d.ts +0 -74
- package/dist/internal/Cascade.d.ts.map +0 -1
- package/dist/internal/Cascade.js +0 -210
- package/dist/internal/Cascade.js.map +0 -1
- package/src/compiler/internal/Applications.ts +0 -610
- package/src/compiler/internal/ColorProfiles.ts +0 -93
- package/src/compiler/internal/CompositionBindings.ts +0 -120
- package/src/compiler/internal/Compositions.ts +0 -678
- package/src/compiler/internal/Configurations.ts +0 -349
- package/src/compiler/internal/Contract.ts +0 -1028
- package/src/compiler/internal/Contributions.ts +0 -1561
- package/src/compiler/internal/Descriptors.ts +0 -242
- package/src/compiler/internal/Dynamic.ts +0 -275
- package/src/compiler/internal/Expression.ts +0 -218
- package/src/compiler/internal/Functions.ts +0 -206
- package/src/compiler/internal/Keyframes.ts +0 -62
- package/src/compiler/internal/Names.ts +0 -48
- package/src/compiler/internal/NativeBindings.ts +0 -235
- package/src/compiler/internal/NativeMedia.ts +0 -342
- package/src/compiler/internal/NativeVars.ts +0 -231
- package/src/compiler/internal/PackedStyles.ts +0 -473
- package/src/compiler/internal/Properties.ts +0 -121
- package/src/compiler/internal/RecipeConditions.ts +0 -139
- package/src/compiler/internal/RecipePayloads.ts +0 -132
- package/src/compiler/internal/Recipes.ts +0 -531
- package/src/compiler/internal/Selectors.ts +0 -353
- package/src/compiler/internal/Static.ts +0 -784
- package/src/compiler/internal/Themes.ts +0 -2398
- package/src/compiler/internal/Vars.ts +0 -516
- package/src/compiler/internal/ViewTransitions.ts +0 -82
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import * as StyleSheet from '../../react-native/StyleSheet.js';
|
|
2
|
+
import * as Variants from '../../react-native/Variants.js';
|
|
3
|
+
import * as Css from '../../web/Css.js';
|
|
4
|
+
import * as ClassName from '../../web/internal/ClassName.js';
|
|
5
|
+
import * as Engine from '../../web/internal/Engine.js';
|
|
6
|
+
import * as ThemeRules from '../../web/internal/Themes.js';
|
|
7
|
+
import * as Wire from '../../web/internal/Wire.js';
|
|
8
|
+
import * as Native from '../Native.js';
|
|
9
|
+
import * as Source from '../Source.js';
|
|
10
|
+
import * as Edits from './Edits.js';
|
|
11
|
+
import * as Stylesheets from './Stylesheets.js';
|
|
12
|
+
/**
|
|
13
|
+
* Runs an engine operation on JSON input.
|
|
14
|
+
* @param operation - Operation name, such as `graph.compile`.
|
|
15
|
+
* @param input - Input data, serialized as JSON.
|
|
16
|
+
* @returns The parsed result.
|
|
17
|
+
* @throws {Source.ExtractError} For source the compiler does not support.
|
|
18
|
+
* @throws {Css.CompileError} For CSS emission failures.
|
|
19
|
+
* @throws {Native.CompileError} For native features outside the static boundary.
|
|
20
|
+
*/
|
|
21
|
+
export function call(operation, input) {
|
|
22
|
+
return decode(Engine.call(operation, JSON.stringify(input)));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Runs `transform.compile`. JSON text never holds a raw NUL, so a string source follows one and
|
|
26
|
+
* crosses without escaping. The engine writes the module's records after one, and they decode
|
|
27
|
+
* when first read.
|
|
28
|
+
* @param input - Options, with the source when it is not a string.
|
|
29
|
+
* @param source - Module text.
|
|
30
|
+
* @returns The output `Transform.compile` returns.
|
|
31
|
+
* @throws {Source.ExtractError} For source the compiler does not support.
|
|
32
|
+
* @throws {Css.CompileError} For CSS emission failures.
|
|
33
|
+
*/
|
|
34
|
+
export function transform(input, source) {
|
|
35
|
+
const json = JSON.stringify(input);
|
|
36
|
+
const text = Engine.call('transform.compile', source === undefined ? json : `${json}\0${source}`);
|
|
37
|
+
const split = text.indexOf('\0');
|
|
38
|
+
// Failures write no records, and decoding throws them.
|
|
39
|
+
if (split === -1)
|
|
40
|
+
return module(decode(text), source);
|
|
41
|
+
return module(decode(text.slice(0, split)), source, text.slice(split + 1));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parses an engine result, throwing the failure it encodes.
|
|
45
|
+
* @param json - The engine's JSON result.
|
|
46
|
+
* @returns The parsed result.
|
|
47
|
+
* @throws {Source.ExtractError} For source the compiler does not support.
|
|
48
|
+
* @throws {Css.CompileError} For CSS emission failures.
|
|
49
|
+
* @throws {Native.CompileError} For native features outside the static boundary.
|
|
50
|
+
*/
|
|
51
|
+
export function decode(json) {
|
|
52
|
+
const output = JSON.parse(json);
|
|
53
|
+
if (output?.error)
|
|
54
|
+
throw failure(output.error);
|
|
55
|
+
return output;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Lists each packed stylesheet section's import chain of a library contract, which hosts
|
|
59
|
+
* resolve before compiling the graph.
|
|
60
|
+
* @param contract - Serialized library contract.
|
|
61
|
+
* @param moduleId - Host-resolved identity of the contract's module.
|
|
62
|
+
* @returns One specifier chain per stylesheet section, in section order.
|
|
63
|
+
* @throws {SyntaxError} For malformed contract JSON.
|
|
64
|
+
* @throws {Error} For unsupported or invalid contract metadata.
|
|
65
|
+
*/
|
|
66
|
+
export function dependencies(contract, moduleId) {
|
|
67
|
+
return call('contract.dependencies', { contract, moduleId }).dependencies;
|
|
68
|
+
}
|
|
69
|
+
function failure(error) {
|
|
70
|
+
if (error.name === 'Source.ExtractError')
|
|
71
|
+
return new Source.ExtractError(error.diagnostics);
|
|
72
|
+
if (error.name === 'Css.CompileError')
|
|
73
|
+
return new Css.CompileError(error.diagnostics);
|
|
74
|
+
if (error.name === 'Native.CompileError')
|
|
75
|
+
return new Native.CompileError(error.message);
|
|
76
|
+
if (error.name === 'StyleSheet.CompileError')
|
|
77
|
+
return new StyleSheet.CompileError(error.diagnostics);
|
|
78
|
+
if (error.name === 'StyleSheet.SelectionError')
|
|
79
|
+
return new StyleSheet.SelectionError(error.message);
|
|
80
|
+
if (error.name === 'Stylesheets.ConflictError')
|
|
81
|
+
return new Stylesheets.ConflictError(error.source ?? '', error.message);
|
|
82
|
+
if (error.name === 'Variants.CompileError')
|
|
83
|
+
return new Variants.CompileError(error.message);
|
|
84
|
+
if (error.name === 'SyntaxError')
|
|
85
|
+
return new SyntaxError(error.message);
|
|
86
|
+
return new Error(error.message);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Deeply freezes decoded JSON data, giving its objects null prototypes as compiled tables have.
|
|
90
|
+
* @param value - Data parsed from engine JSON.
|
|
91
|
+
* @returns The same data, frozen.
|
|
92
|
+
*/
|
|
93
|
+
export function frozen(value) {
|
|
94
|
+
if (Array.isArray(value))
|
|
95
|
+
return Object.freeze(value.map(frozen));
|
|
96
|
+
if (value === null || typeof value !== 'object')
|
|
97
|
+
return value;
|
|
98
|
+
return Object.freeze(Object.assign(Object.create(null), Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, frozen(entry)]))));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Rebuilds a frozen graph result, keeping the decoded module objects the engine reports
|
|
102
|
+
* unchanged.
|
|
103
|
+
* @param value - The encoded graph result.
|
|
104
|
+
* @param previous - The result of the same compiler's previous call.
|
|
105
|
+
* @param decoded - The same compiler's last decoded module per identity, updated in place.
|
|
106
|
+
* @returns The output `Graph.compile` returns.
|
|
107
|
+
*/
|
|
108
|
+
export function graph(value, previous, decoded) {
|
|
109
|
+
if (value.same && previous)
|
|
110
|
+
return previous;
|
|
111
|
+
const modules = Object.fromEntries(Object.entries(value.modules).map(([id, encoded]) => [
|
|
112
|
+
id,
|
|
113
|
+
(() => {
|
|
114
|
+
if (encoded === 0)
|
|
115
|
+
return decoded.get(id);
|
|
116
|
+
if ('edits' in encoded)
|
|
117
|
+
return nativeModule(encoded);
|
|
118
|
+
return module(encoded);
|
|
119
|
+
})(),
|
|
120
|
+
]));
|
|
121
|
+
if (decoded) {
|
|
122
|
+
for (const [id, output] of Object.entries(modules))
|
|
123
|
+
decoded.set(id, output);
|
|
124
|
+
if (value.prune)
|
|
125
|
+
for (const id of decoded.keys())
|
|
126
|
+
if (!Object.hasOwn(modules, id))
|
|
127
|
+
decoded.delete(id);
|
|
128
|
+
}
|
|
129
|
+
return Object.freeze({
|
|
130
|
+
...(value.reset
|
|
131
|
+
? { [Stylesheets.reset]: rendered(value.reset) }
|
|
132
|
+
: {}),
|
|
133
|
+
...(value.packed
|
|
134
|
+
? {
|
|
135
|
+
[Stylesheets.packed]: Object.freeze(value.packed.map((resource) => rendered(resource))),
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
...(value.shared
|
|
139
|
+
? {
|
|
140
|
+
sharedCss: value.shared.css,
|
|
141
|
+
sharedCssMap: value.shared.map,
|
|
142
|
+
sharedAssets: Object.freeze(Object.assign(Object.create(null), value.shared.assets)),
|
|
143
|
+
sharedAssetOwners: Object.freeze(Object.assign(Object.create(null), value.shared.owners)),
|
|
144
|
+
}
|
|
145
|
+
: {}),
|
|
146
|
+
contracts: Object.freeze({ ...value.contracts }),
|
|
147
|
+
dependencies: Object.freeze(Object.assign(Object.create(null), Object.fromEntries(Object.entries(value.dependencies).map(([id, targets]) => [
|
|
148
|
+
id,
|
|
149
|
+
Object.freeze([...targets]),
|
|
150
|
+
])))),
|
|
151
|
+
modules: Object.freeze(modules),
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/** Graph option for hosts that read module code, stylesheets, and configuration catalogs only. */
|
|
155
|
+
export const lean = Symbol('lean graph output');
|
|
156
|
+
/**
|
|
157
|
+
* Rebuilds one module's frozen transform output. Records decode when first read, so a module
|
|
158
|
+
* whose classes, rules, and units are never read skips their parsing.
|
|
159
|
+
* @param value - The encoded module, with its records unless `records` holds them.
|
|
160
|
+
* @param source - Module text the engine left out of the maps' `sourcesContent`.
|
|
161
|
+
* @param records - The encoded records, which `transform.compile` writes apart.
|
|
162
|
+
* @returns The output `Transform.compile` returns.
|
|
163
|
+
*/
|
|
164
|
+
export function module(value, source, records) {
|
|
165
|
+
// The engine writes `0` for content the caller supplied separately, so it crosses once.
|
|
166
|
+
if (source !== undefined)
|
|
167
|
+
for (const map of [value.cssMap, value.map]) {
|
|
168
|
+
const contents = map.sourcesContent;
|
|
169
|
+
for (let index = 0; index < (contents?.length ?? 0); index++)
|
|
170
|
+
if (contents[index] === 0)
|
|
171
|
+
contents[index] = source;
|
|
172
|
+
}
|
|
173
|
+
let decoded = records === undefined ? value : undefined;
|
|
174
|
+
let classes;
|
|
175
|
+
let rules;
|
|
176
|
+
let units;
|
|
177
|
+
const read = () => (decoded ??= JSON.parse(records));
|
|
178
|
+
const result = {
|
|
179
|
+
...(value.shared
|
|
180
|
+
? {
|
|
181
|
+
[ThemeRules.shared]: Object.freeze(value.shared.map((resource) => Object.freeze(resource))),
|
|
182
|
+
}
|
|
183
|
+
: {}),
|
|
184
|
+
// Parsed records are fresh, so they freeze in place rather than as copies.
|
|
185
|
+
get classes() {
|
|
186
|
+
return (classes ??= Object.freeze(read().classes));
|
|
187
|
+
},
|
|
188
|
+
code: value.code,
|
|
189
|
+
css: value.css,
|
|
190
|
+
cssMap: value.cssMap,
|
|
191
|
+
map: value.map,
|
|
192
|
+
vars: Object.freeze(Object.setPrototypeOf(value.vars, null)),
|
|
193
|
+
};
|
|
194
|
+
Object.defineProperties(result, {
|
|
195
|
+
[ClassName.rules]: {
|
|
196
|
+
enumerable: false,
|
|
197
|
+
get: () => (rules ??= Object.freeze(read().rules)),
|
|
198
|
+
},
|
|
199
|
+
[ClassName.units]: {
|
|
200
|
+
enumerable: false,
|
|
201
|
+
get: () => (units ??= new Map(read().units.map(([key, borrowed, name]) => [
|
|
202
|
+
key,
|
|
203
|
+
{ borrowed, name },
|
|
204
|
+
]))),
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
return Object.freeze(result);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Encodes native options as the engine reads them. Sets are written in the `Css.compile` wire
|
|
211
|
+
* format, so the engine decodes them as it decodes literal definitions.
|
|
212
|
+
* @param options - Native options of `Native.compile` or a native graph.
|
|
213
|
+
* @returns The engine's native input.
|
|
214
|
+
*/
|
|
215
|
+
export function native(options) {
|
|
216
|
+
return {
|
|
217
|
+
colorScheme: options.colorScheme,
|
|
218
|
+
contextual: options.contextual,
|
|
219
|
+
fonts: options.fonts,
|
|
220
|
+
platform: options.platform,
|
|
221
|
+
runtime: options[Edits.runtime],
|
|
222
|
+
set: options.set,
|
|
223
|
+
units: options.units,
|
|
224
|
+
vars: options.vars === undefined
|
|
225
|
+
? undefined
|
|
226
|
+
: Wire.encode({
|
|
227
|
+
styles: { styles: [] },
|
|
228
|
+
vars: options.vars,
|
|
229
|
+
}),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
// A graph's native module carries the web output shape with empty CSS.
|
|
233
|
+
function nativeModule(value) {
|
|
234
|
+
return Object.freeze({
|
|
235
|
+
[ClassName.rules]: Object.freeze({}),
|
|
236
|
+
classes: Object.freeze({}),
|
|
237
|
+
[Edits.key]: value.edits,
|
|
238
|
+
code: value.code,
|
|
239
|
+
css: '',
|
|
240
|
+
cssMap: {
|
|
241
|
+
version: 3,
|
|
242
|
+
names: [],
|
|
243
|
+
sources: [],
|
|
244
|
+
mappings: '',
|
|
245
|
+
},
|
|
246
|
+
map: value.map,
|
|
247
|
+
vars: Object.freeze({}),
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function rendered(value) {
|
|
251
|
+
return Object.freeze({
|
|
252
|
+
...(value.id === undefined ? {} : { id: value.id }),
|
|
253
|
+
css: value.css,
|
|
254
|
+
map: value.map,
|
|
255
|
+
assets: Object.freeze(Object.assign(Object.create(null), value.assets)),
|
|
256
|
+
owners: Object.freeze(Object.assign(Object.create(null), value.owners)),
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=Results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../src/compiler/internal/Results.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAA;AAC9D,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAA;AAC1D,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,iCAAiC,CAAA;AAC5D,OAAO,KAAK,MAAM,MAAM,8BAA8B,CAAA;AACtD,OAAO,KAAK,UAAU,MAAM,8BAA8B,CAAA;AAC1D,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAA;AAElD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;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EAAE;YACN,OAAO,EAAE,CAAU;YACnB,KAAK,EAAE,EAAE;YACT,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;SACb;QACD,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;KACxB,CAAiC,CAAA;AACpC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAe;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACnD,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACvE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KACxE,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Parses authoring modules while retaining TypeScript assertion syntax. @module */
|
|
2
2
|
import * as Parser from 'oxc-parser';
|
|
3
|
-
/** Parsed modules supplied by the host for a single compilation. */
|
|
4
|
-
export declare const cache: unique symbol;
|
|
5
3
|
/** Preserves JSX authoring and retries TypeScript files with assertion-aware grammar. */
|
|
6
4
|
export declare function parse(options: parse.Options): Parser.ParseResult;
|
|
7
5
|
/** Source identity and syntax inputs. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Syntax.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Syntax.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AAEpC,
|
|
1
|
+
{"version":3,"file":"Syntax.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Syntax.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AAEpC,yFAAyF;AACzF,wBAAgB,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,sBAY3C;AAED,yCAAyC;AACzC,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,6DAA6D;IAC7D,KAAK,OAAO,GAAG;QACb,+DAA+D;QAC/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,iCAAiC;QACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KACxB,CAAA;CACF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Parses authoring modules while retaining TypeScript assertion syntax. @module */
|
|
2
2
|
import * as Parser from 'oxc-parser';
|
|
3
|
-
/** Parsed modules supplied by the host for a single compilation. */
|
|
4
|
-
export const cache = Symbol('parsed modules');
|
|
5
3
|
/** Preserves JSX authoring and retries TypeScript files with assertion-aware grammar. */
|
|
6
4
|
export function parse(options) {
|
|
7
5
|
const settings = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Syntax.js","sourceRoot":"","sources":["../../../src/compiler/internal/Syntax.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AAEpC,
|
|
1
|
+
{"version":3,"file":"Syntax.js","sourceRoot":"","sources":["../../../src/compiler/internal/Syntax.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,KAAK,MAAM,MAAM,YAAY,CAAA;AAEpC,yFAAyF;AACzF,MAAM,UAAU,KAAK,CAAC,OAAsB;IAC1C,MAAM,QAAQ,GAAG;QACf,0CAA0C;QAC1C,uBAAuB,EAAE,MAAM,CAAC,oBAAoB,EAAE;QACtD,cAAc,EAAE,KAAK;QACrB,kBAAkB,EAAE,IAAI;QACxB,UAAU,EAAE,QAAiB;KAC9B,CAAA;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACvE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC7D,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChE,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Source from '../Source.js';
|
|
2
|
+
/**
|
|
3
|
+
* Decodes one extraction result, or throws the error the extraction failed with.
|
|
4
|
+
* @param text - JSON text returned by the `source.extract` operation.
|
|
5
|
+
* @returns Frozen calls, styles, theme data, and contributions.
|
|
6
|
+
* @throws {Source.ExtractError} With every source diagnostic of a failed extraction.
|
|
7
|
+
*/
|
|
8
|
+
export declare function decode(text: string, options?: decode.Options): Source.extract.ReturnType;
|
|
9
|
+
/** Extraction options that shape the decoded result. */
|
|
10
|
+
export declare namespace decode {
|
|
11
|
+
/** The options passed to the extraction. */
|
|
12
|
+
type Options = {
|
|
13
|
+
/** `false` when the extraction collected portable identities without source rewriting. */
|
|
14
|
+
readonly compiler?: boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=Wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Wire.d.ts","sourceRoot":"","sources":["../../../src/compiler/internal/Wire.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAyBtC;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,CAAC,OAAY,GAC3B,MAAM,CAAC,OAAO,CAAC,UAAU,CAa3B;AAED,wDAAwD;AACxD,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,4CAA4C;IAC5C,KAAK,OAAO,GAAG;QACb,0FAA0F;QAC1F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KACxC,CAAA;CACF"}
|