zyzz 0.0.0 → 0.0.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/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/Config.d.ts +170 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +249 -0
- package/dist/Config.js.map +1 -0
- package/dist/Props.d.ts +7 -0
- package/dist/Props.d.ts.map +1 -0
- package/dist/Props.js +3 -0
- package/dist/Props.js.map +1 -0
- package/dist/Style.d.ts +167 -0
- package/dist/Style.d.ts.map +1 -0
- package/dist/Style.js +284 -0
- package/dist/Style.js.map +1 -0
- package/dist/Theme.d.ts +154 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +257 -0
- package/dist/Theme.js.map +1 -0
- package/dist/babel/NativeEdits.d.ts +8 -0
- package/dist/babel/NativeEdits.d.ts.map +1 -0
- package/dist/babel/NativeEdits.js +233 -0
- package/dist/babel/NativeEdits.js.map +1 -0
- package/dist/babel/NativeJsx.d.ts +10 -0
- package/dist/babel/NativeJsx.d.ts.map +1 -0
- package/dist/babel/NativeJsx.js +204 -0
- package/dist/babel/NativeJsx.js.map +1 -0
- package/dist/babel/index.d.ts +51 -0
- package/dist/babel/index.d.ts.map +1 -0
- package/dist/babel/index.js +220 -0
- package/dist/babel/index.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +178 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compiler/Graph.d.ts +64 -0
- package/dist/compiler/Graph.d.ts.map +1 -0
- package/dist/compiler/Graph.js +1111 -0
- package/dist/compiler/Graph.js.map +1 -0
- package/dist/compiler/Native.d.ts +53 -0
- package/dist/compiler/Native.d.ts.map +1 -0
- package/dist/compiler/Native.js +617 -0
- package/dist/compiler/Native.js.map +1 -0
- package/dist/compiler/Source.d.ts +165 -0
- package/dist/compiler/Source.d.ts.map +1 -0
- package/dist/compiler/Source.js +990 -0
- package/dist/compiler/Source.js.map +1 -0
- package/dist/compiler/Transform.d.ts +57 -0
- package/dist/compiler/Transform.d.ts.map +1 -0
- package/dist/compiler/Transform.js +884 -0
- package/dist/compiler/Transform.js.map +1 -0
- package/dist/compiler/index.d.ts +13 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +13 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/internal/Applications.d.ts +35 -0
- package/dist/compiler/internal/Applications.d.ts.map +1 -0
- package/dist/compiler/internal/Applications.js +248 -0
- package/dist/compiler/internal/Applications.js.map +1 -0
- package/dist/compiler/internal/AtRules.d.ts +8 -0
- package/dist/compiler/internal/AtRules.d.ts.map +1 -0
- package/dist/compiler/internal/AtRules.js +180 -0
- package/dist/compiler/internal/AtRules.js.map +1 -0
- package/dist/compiler/internal/Catalogs.d.ts +19 -0
- package/dist/compiler/internal/Catalogs.d.ts.map +1 -0
- package/dist/compiler/internal/Catalogs.js +68 -0
- package/dist/compiler/internal/Catalogs.js.map +1 -0
- package/dist/compiler/internal/ColorProfiles.d.ts +3 -0
- package/dist/compiler/internal/ColorProfiles.d.ts.map +1 -0
- package/dist/compiler/internal/ColorProfiles.js +84 -0
- package/dist/compiler/internal/ColorProfiles.js.map +1 -0
- package/dist/compiler/internal/CompositionBindings.d.ts +16 -0
- package/dist/compiler/internal/CompositionBindings.d.ts.map +1 -0
- package/dist/compiler/internal/CompositionBindings.js +89 -0
- package/dist/compiler/internal/CompositionBindings.js.map +1 -0
- package/dist/compiler/internal/Compositions.d.ts +32 -0
- package/dist/compiler/internal/Compositions.d.ts.map +1 -0
- package/dist/compiler/internal/Compositions.js +464 -0
- package/dist/compiler/internal/Compositions.js.map +1 -0
- package/dist/compiler/internal/Configurations.d.ts +21 -0
- package/dist/compiler/internal/Configurations.d.ts.map +1 -0
- package/dist/compiler/internal/Configurations.js +171 -0
- package/dist/compiler/internal/Configurations.js.map +1 -0
- package/dist/compiler/internal/Contract.d.ts +27 -0
- package/dist/compiler/internal/Contract.d.ts.map +1 -0
- package/dist/compiler/internal/Contract.js +600 -0
- package/dist/compiler/internal/Contract.js.map +1 -0
- package/dist/compiler/internal/Contributions.d.ts +54 -0
- package/dist/compiler/internal/Contributions.d.ts.map +1 -0
- package/dist/compiler/internal/Contributions.js +1109 -0
- package/dist/compiler/internal/Contributions.js.map +1 -0
- package/dist/compiler/internal/Descriptors.d.ts +15 -0
- package/dist/compiler/internal/Descriptors.d.ts.map +1 -0
- package/dist/compiler/internal/Descriptors.js +183 -0
- package/dist/compiler/internal/Descriptors.js.map +1 -0
- package/dist/compiler/internal/Dynamic.d.ts +14 -0
- package/dist/compiler/internal/Dynamic.d.ts.map +1 -0
- package/dist/compiler/internal/Dynamic.js +172 -0
- package/dist/compiler/internal/Dynamic.js.map +1 -0
- package/dist/compiler/internal/Edits.d.ts +12 -0
- package/dist/compiler/internal/Edits.d.ts.map +1 -0
- package/dist/compiler/internal/Edits.js +5 -0
- package/dist/compiler/internal/Edits.js.map +1 -0
- package/dist/compiler/internal/Expression.d.ts +12 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -0
- package/dist/compiler/internal/Expression.js +98 -0
- package/dist/compiler/internal/Expression.js.map +1 -0
- package/dist/compiler/internal/Functions.d.ts +5 -0
- package/dist/compiler/internal/Functions.d.ts.map +1 -0
- package/dist/compiler/internal/Functions.js +191 -0
- package/dist/compiler/internal/Functions.js.map +1 -0
- package/dist/compiler/internal/Identifiers.d.ts +9 -0
- package/dist/compiler/internal/Identifiers.d.ts.map +1 -0
- package/dist/compiler/internal/Identifiers.js +106 -0
- package/dist/compiler/internal/Identifiers.js.map +1 -0
- package/dist/compiler/internal/Keyframes.d.ts +5 -0
- package/dist/compiler/internal/Keyframes.d.ts.map +1 -0
- package/dist/compiler/internal/Keyframes.js +51 -0
- package/dist/compiler/internal/Keyframes.js.map +1 -0
- package/dist/compiler/internal/Namespaces.d.ts +17 -0
- package/dist/compiler/internal/Namespaces.d.ts.map +1 -0
- package/dist/compiler/internal/Namespaces.js +265 -0
- package/dist/compiler/internal/Namespaces.js.map +1 -0
- package/dist/compiler/internal/NativeBindings.d.ts +74 -0
- package/dist/compiler/internal/NativeBindings.d.ts.map +1 -0
- package/dist/compiler/internal/NativeBindings.js +117 -0
- package/dist/compiler/internal/NativeBindings.js.map +1 -0
- package/dist/compiler/internal/PackedStyles.d.ts +35 -0
- package/dist/compiler/internal/PackedStyles.d.ts.map +1 -0
- package/dist/compiler/internal/PackedStyles.js +345 -0
- package/dist/compiler/internal/PackedStyles.js.map +1 -0
- package/dist/compiler/internal/Properties.d.ts +5 -0
- package/dist/compiler/internal/Properties.d.ts.map +1 -0
- package/dist/compiler/internal/Properties.js +82 -0
- package/dist/compiler/internal/Properties.js.map +1 -0
- package/dist/compiler/internal/RecipeConditions.d.ts +41 -0
- package/dist/compiler/internal/RecipeConditions.d.ts.map +1 -0
- package/dist/compiler/internal/RecipeConditions.js +82 -0
- package/dist/compiler/internal/RecipeConditions.js.map +1 -0
- package/dist/compiler/internal/RecipePayloads.d.ts +31 -0
- package/dist/compiler/internal/RecipePayloads.d.ts.map +1 -0
- package/dist/compiler/internal/RecipePayloads.js +99 -0
- package/dist/compiler/internal/RecipePayloads.js.map +1 -0
- package/dist/compiler/internal/Recipes.d.ts +32 -0
- package/dist/compiler/internal/Recipes.d.ts.map +1 -0
- package/dist/compiler/internal/Recipes.js +339 -0
- package/dist/compiler/internal/Recipes.js.map +1 -0
- package/dist/compiler/internal/Relative.d.ts +19 -0
- package/dist/compiler/internal/Relative.d.ts.map +1 -0
- package/dist/compiler/internal/Relative.js +62 -0
- package/dist/compiler/internal/Relative.js.map +1 -0
- package/dist/compiler/internal/Scope.d.ts +10 -0
- package/dist/compiler/internal/Scope.d.ts.map +1 -0
- package/dist/compiler/internal/Scope.js +28 -0
- package/dist/compiler/internal/Scope.js.map +1 -0
- package/dist/compiler/internal/Selectors.d.ts +12 -0
- package/dist/compiler/internal/Selectors.d.ts.map +1 -0
- package/dist/compiler/internal/Selectors.js +265 -0
- package/dist/compiler/internal/Selectors.js.map +1 -0
- package/dist/compiler/internal/Static.d.ts +39 -0
- package/dist/compiler/internal/Static.d.ts.map +1 -0
- package/dist/compiler/internal/Static.js +532 -0
- package/dist/compiler/internal/Static.js.map +1 -0
- package/dist/compiler/internal/Stylesheets.d.ts +47 -0
- package/dist/compiler/internal/Stylesheets.d.ts.map +1 -0
- package/dist/compiler/internal/Stylesheets.js +272 -0
- package/dist/compiler/internal/Stylesheets.js.map +1 -0
- package/dist/compiler/internal/Syntax.d.ts +17 -0
- package/dist/compiler/internal/Syntax.d.ts.map +1 -0
- package/dist/compiler/internal/Syntax.js +19 -0
- package/dist/compiler/internal/Syntax.js.map +1 -0
- package/dist/compiler/internal/Themes.d.ts +158 -0
- package/dist/compiler/internal/Themes.d.ts.map +1 -0
- package/dist/compiler/internal/Themes.js +1169 -0
- package/dist/compiler/internal/Themes.js.map +1 -0
- package/dist/compiler/internal/Variables.d.ts +31 -0
- package/dist/compiler/internal/Variables.d.ts.map +1 -0
- package/dist/compiler/internal/Variables.js +376 -0
- package/dist/compiler/internal/Variables.js.map +1 -0
- package/dist/compiler/internal/ViewTransitions.d.ts +3 -0
- package/dist/compiler/internal/ViewTransitions.d.ts.map +1 -0
- package/dist/compiler/internal/ViewTransitions.js +68 -0
- package/dist/compiler/internal/ViewTransitions.js.map +1 -0
- package/dist/cx.d.ts +18 -0
- package/dist/cx.d.ts.map +1 -0
- package/dist/cx.js +60 -0
- package/dist/cx.js.map +1 -0
- package/dist/default.d.ts +2008 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +243 -0
- package/dist/default.js.map +7 -0
- package/dist/default.js.zyzz.json +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Authoring.d.ts +26 -0
- package/dist/internal/Authoring.d.ts.map +1 -0
- package/dist/internal/Authoring.js +134 -0
- package/dist/internal/Authoring.js.map +1 -0
- package/dist/internal/Binding.d.ts +64 -0
- package/dist/internal/Binding.d.ts.map +1 -0
- package/dist/internal/Binding.js +27 -0
- package/dist/internal/Binding.js.map +1 -0
- package/dist/internal/BindingDomains.d.ts +11 -0
- package/dist/internal/BindingDomains.d.ts.map +1 -0
- package/dist/internal/BindingDomains.js +459 -0
- package/dist/internal/BindingDomains.js.map +1 -0
- package/dist/internal/Cascade.d.ts +45 -0
- package/dist/internal/Cascade.d.ts.map +1 -0
- package/dist/internal/Cascade.js +165 -0
- package/dist/internal/Cascade.js.map +1 -0
- package/dist/internal/Compound.d.ts +132 -0
- package/dist/internal/Compound.d.ts.map +1 -0
- package/dist/internal/Compound.js +2 -0
- package/dist/internal/Compound.js.map +1 -0
- package/dist/internal/Condition.d.ts +33 -0
- package/dist/internal/Condition.d.ts.map +1 -0
- package/dist/internal/Condition.js +180 -0
- package/dist/internal/Condition.js.map +1 -0
- package/dist/internal/Corner.d.ts +9 -0
- package/dist/internal/Corner.d.ts.map +1 -0
- package/dist/internal/Corner.js +14 -0
- package/dist/internal/Corner.js.map +1 -0
- package/dist/internal/FunctionSyntax.d.ts +27 -0
- package/dist/internal/FunctionSyntax.d.ts.map +1 -0
- package/dist/internal/FunctionSyntax.js +91 -0
- package/dist/internal/FunctionSyntax.js.map +1 -0
- package/dist/internal/FunctionValue.d.ts +19 -0
- package/dist/internal/FunctionValue.d.ts.map +1 -0
- package/dist/internal/FunctionValue.js +2 -0
- package/dist/internal/FunctionValue.js.map +1 -0
- package/dist/internal/Geometry.d.ts +8 -0
- package/dist/internal/Geometry.d.ts.map +1 -0
- package/dist/internal/Geometry.js +2 -0
- package/dist/internal/Geometry.js.map +1 -0
- package/dist/internal/Grid.d.ts +15 -0
- package/dist/internal/Grid.d.ts.map +1 -0
- package/dist/internal/Grid.js +2 -0
- package/dist/internal/Grid.js.map +1 -0
- package/dist/internal/Identifier.d.ts +15 -0
- package/dist/internal/Identifier.d.ts.map +1 -0
- package/dist/internal/Identifier.js +2 -0
- package/dist/internal/Identifier.js.map +1 -0
- package/dist/internal/Identity.d.ts +16 -0
- package/dist/internal/Identity.d.ts.map +1 -0
- package/dist/internal/Identity.js +78 -0
- package/dist/internal/Identity.js.map +1 -0
- package/dist/internal/Lexical.d.ts +89 -0
- package/dist/internal/Lexical.d.ts.map +1 -0
- package/dist/internal/Lexical.js +15 -0
- package/dist/internal/Lexical.js.map +1 -0
- package/dist/internal/Literal.d.ts +3459 -0
- package/dist/internal/Literal.d.ts.map +1 -0
- package/dist/internal/Literal.js +3371 -0
- package/dist/internal/Literal.js.map +1 -0
- package/dist/internal/NativeProperties.d.ts +596 -0
- package/dist/internal/NativeProperties.d.ts.map +1 -0
- package/dist/internal/NativeProperties.js +2 -0
- package/dist/internal/NativeProperties.js.map +1 -0
- package/dist/internal/Numeric.d.ts +23 -0
- package/dist/internal/Numeric.d.ts.map +1 -0
- package/dist/internal/Numeric.js +2 -0
- package/dist/internal/Numeric.js.map +1 -0
- package/dist/internal/Query.d.ts +15 -0
- package/dist/internal/Query.d.ts.map +1 -0
- package/dist/internal/Query.js +58 -0
- package/dist/internal/Query.js.map +1 -0
- package/dist/internal/Recipe.d.ts +17 -0
- package/dist/internal/Recipe.d.ts.map +1 -0
- package/dist/internal/Recipe.js +2 -0
- package/dist/internal/Recipe.js.map +1 -0
- package/dist/internal/RuleReference.d.ts +23 -0
- package/dist/internal/RuleReference.d.ts.map +1 -0
- package/dist/internal/RuleReference.js +65 -0
- package/dist/internal/RuleReference.js.map +1 -0
- package/dist/internal/Scheme.d.ts +12 -0
- package/dist/internal/Scheme.d.ts.map +1 -0
- package/dist/internal/Scheme.js +16 -0
- package/dist/internal/Scheme.js.map +1 -0
- package/dist/internal/Shorthands.d.ts +20 -0
- package/dist/internal/Shorthands.d.ts.map +1 -0
- package/dist/internal/Shorthands.js +49 -0
- package/dist/internal/Shorthands.js.map +1 -0
- package/dist/internal/Targets.d.ts +43 -0
- package/dist/internal/Targets.d.ts.map +1 -0
- package/dist/internal/Targets.js +60 -0
- package/dist/internal/Targets.js.map +1 -0
- package/dist/internal/Token.d.ts +104 -0
- package/dist/internal/Token.d.ts.map +1 -0
- package/dist/internal/Token.js +162 -0
- package/dist/internal/Token.js.map +1 -0
- package/dist/internal/Tuple.d.ts +23 -0
- package/dist/internal/Tuple.d.ts.map +1 -0
- package/dist/internal/Tuple.js +2 -0
- package/dist/internal/Tuple.js.map +1 -0
- package/dist/internal/Value.d.ts +74 -0
- package/dist/internal/Value.d.ts.map +1 -0
- package/dist/internal/Value.js +60 -0
- package/dist/internal/Value.js.map +1 -0
- package/dist/metro/Graph.d.ts +8 -0
- package/dist/metro/Graph.d.ts.map +1 -0
- package/dist/metro/Graph.js +63 -0
- package/dist/metro/Graph.js.map +1 -0
- package/dist/metro/Watch.d.ts +21 -0
- package/dist/metro/Watch.d.ts.map +1 -0
- package/dist/metro/Watch.js +51 -0
- package/dist/metro/Watch.js.map +1 -0
- package/dist/metro/index.d.ts +30 -0
- package/dist/metro/index.d.ts.map +1 -0
- package/dist/metro/index.js +52 -0
- package/dist/metro/index.js.map +1 -0
- package/dist/metro/transformer.d.ts +21 -0
- package/dist/metro/transformer.d.ts.map +1 -0
- package/dist/metro/transformer.js +71 -0
- package/dist/metro/transformer.js.map +1 -0
- package/dist/next/index.d.ts +18 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +92 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/loader.d.ts +16 -0
- package/dist/next/loader.d.ts.map +1 -0
- package/dist/next/loader.js +282 -0
- package/dist/next/loader.js.map +1 -0
- package/dist/node/Host.d.ts +80 -0
- package/dist/node/Host.d.ts.map +1 -0
- package/dist/node/Host.js +882 -0
- package/dist/node/Host.js.map +1 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +7 -0
- package/dist/node/index.js.map +1 -0
- package/dist/react-native/Host.d.ts +76 -0
- package/dist/react-native/Host.d.ts.map +1 -0
- package/dist/react-native/Host.js +209 -0
- package/dist/react-native/Host.js.map +1 -0
- package/dist/react-native/StyleSheet.d.ts +226 -0
- package/dist/react-native/StyleSheet.d.ts.map +1 -0
- package/dist/react-native/StyleSheet.js +606 -0
- package/dist/react-native/StyleSheet.js.map +1 -0
- package/dist/react-native/Variants.d.ts +38 -0
- package/dist/react-native/Variants.d.ts.map +1 -0
- package/dist/react-native/Variants.js +66 -0
- package/dist/react-native/Variants.js.map +1 -0
- package/dist/react-native/index.d.ts +8 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +8 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/internal/Color.d.ts +7 -0
- package/dist/react-native/internal/Color.d.ts.map +1 -0
- package/dist/react-native/internal/Color.js +93 -0
- package/dist/react-native/internal/Color.js.map +1 -0
- package/dist/react-native/internal/NativeSchema.d.ts +5138 -0
- package/dist/react-native/internal/NativeSchema.d.ts.map +1 -0
- package/dist/react-native/internal/NativeSchema.js +3097 -0
- package/dist/react-native/internal/NativeSchema.js.map +1 -0
- package/dist/react-native/internal/Scalar.d.ts +95 -0
- package/dist/react-native/internal/Scalar.d.ts.map +1 -0
- package/dist/react-native/internal/Scalar.js +199 -0
- package/dist/react-native/internal/Scalar.js.map +1 -0
- package/dist/react-native/internal/Values.d.ts +5 -0
- package/dist/react-native/internal/Values.d.ts.map +1 -0
- package/dist/react-native/internal/Values.js +65 -0
- package/dist/react-native/internal/Values.js.map +1 -0
- package/dist/react-native/react.d.ts +22 -0
- package/dist/react-native/react.d.ts.map +1 -0
- package/dist/react-native/react.js +26 -0
- package/dist/react-native/react.js.map +1 -0
- package/dist/reset.css +244 -0
- package/dist/runtime/Appearance.d.ts +55 -0
- package/dist/runtime/Appearance.d.ts.map +1 -0
- package/dist/runtime/Appearance.js +84 -0
- package/dist/runtime/Appearance.js.map +1 -0
- package/dist/runtime/Composition.d.ts +46 -0
- package/dist/runtime/Composition.d.ts.map +1 -0
- package/dist/runtime/Composition.js +52 -0
- package/dist/runtime/Composition.js.map +1 -0
- package/dist/runtime/CompositionHtml.d.ts +15 -0
- package/dist/runtime/CompositionHtml.d.ts.map +1 -0
- package/dist/runtime/CompositionHtml.js +20 -0
- package/dist/runtime/CompositionHtml.js.map +1 -0
- package/dist/runtime/ConditionalRecipe.d.ts +30 -0
- package/dist/runtime/ConditionalRecipe.d.ts.map +1 -0
- package/dist/runtime/ConditionalRecipe.js +39 -0
- package/dist/runtime/ConditionalRecipe.js.map +1 -0
- package/dist/runtime/Dynamic.d.ts +19 -0
- package/dist/runtime/Dynamic.d.ts.map +1 -0
- package/dist/runtime/Dynamic.js +22 -0
- package/dist/runtime/Dynamic.js.map +1 -0
- package/dist/runtime/Html.d.ts +32 -0
- package/dist/runtime/Html.d.ts.map +1 -0
- package/dist/runtime/Html.js +63 -0
- package/dist/runtime/Html.js.map +1 -0
- package/dist/runtime/Native.d.ts +48 -0
- package/dist/runtime/Native.d.ts.map +1 -0
- package/dist/runtime/Native.js +78 -0
- package/dist/runtime/Native.js.map +1 -0
- package/dist/runtime/NativeContext.d.ts +17 -0
- package/dist/runtime/NativeContext.d.ts.map +1 -0
- package/dist/runtime/NativeContext.js +47 -0
- package/dist/runtime/NativeContext.js.map +1 -0
- package/dist/runtime/NativeDynamic.d.ts +47 -0
- package/dist/runtime/NativeDynamic.d.ts.map +1 -0
- package/dist/runtime/NativeDynamic.js +141 -0
- package/dist/runtime/NativeDynamic.js.map +1 -0
- package/dist/runtime/PayloadRecipe.d.ts +22 -0
- package/dist/runtime/PayloadRecipe.d.ts.map +1 -0
- package/dist/runtime/PayloadRecipe.js +59 -0
- package/dist/runtime/PayloadRecipe.js.map +1 -0
- package/dist/runtime/Props.d.ts +21 -0
- package/dist/runtime/Props.d.ts.map +1 -0
- package/dist/runtime/Props.js +17 -0
- package/dist/runtime/Props.js.map +1 -0
- package/dist/runtime/Recipe.d.ts +52 -0
- package/dist/runtime/Recipe.d.ts.map +1 -0
- package/dist/runtime/Recipe.js +30 -0
- package/dist/runtime/Recipe.js.map +1 -0
- package/dist/runtime/Selection.d.ts +31 -0
- package/dist/runtime/Selection.d.ts.map +1 -0
- package/dist/runtime/Selection.js +30 -0
- package/dist/runtime/Selection.js.map +1 -0
- package/dist/runtime/Variable.d.ts +6 -0
- package/dist/runtime/Variable.d.ts.map +1 -0
- package/dist/runtime/Variable.js +10 -0
- package/dist/runtime/Variable.js.map +1 -0
- package/dist/runtime/index.d.ts +33 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +33 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/styleFunction.d.ts +72 -0
- package/dist/styleFunction.d.ts.map +1 -0
- package/dist/styleFunction.js +18 -0
- package/dist/styleFunction.js.map +1 -0
- package/dist/themes/LICENSE.tailwind +21 -0
- package/dist/variable.d.ts +50 -0
- package/dist/variable.d.ts.map +1 -0
- package/dist/variable.js +20 -0
- package/dist/variable.js.map +1 -0
- package/dist/variants.d.ts +84 -0
- package/dist/variants.d.ts.map +1 -0
- package/dist/variants.js +21 -0
- package/dist/variants.js.map +1 -0
- package/dist/vite/index.d.ts +24 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +1089 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/web/Css.d.ts +81 -0
- package/dist/web/Css.d.ts.map +1 -0
- package/dist/web/Css.js +593 -0
- package/dist/web/Css.js.map +1 -0
- package/dist/web/colorProfile.d.ts +28 -0
- package/dist/web/colorProfile.d.ts.map +1 -0
- package/dist/web/colorProfile.js +8 -0
- package/dist/web/colorProfile.js.map +1 -0
- package/dist/web/counterStyle.d.ts +48 -0
- package/dist/web/counterStyle.d.ts.map +1 -0
- package/dist/web/counterStyle.js +8 -0
- package/dist/web/counterStyle.js.map +1 -0
- package/dist/web/cssFunction.d.ts +80 -0
- package/dist/web/cssFunction.d.ts.map +1 -0
- package/dist/web/cssFunction.js +18 -0
- package/dist/web/cssFunction.js.map +1 -0
- package/dist/web/customMedia.d.ts +12 -0
- package/dist/web/customMedia.d.ts.map +1 -0
- package/dist/web/customMedia.js +7 -0
- package/dist/web/customMedia.js.map +1 -0
- package/dist/web/fontFace.d.ts +26 -0
- package/dist/web/fontFace.d.ts.map +1 -0
- package/dist/web/fontFace.js +7 -0
- package/dist/web/fontFace.js.map +1 -0
- package/dist/web/fontFeatureValues.d.ts +40 -0
- package/dist/web/fontFeatureValues.d.ts.map +1 -0
- package/dist/web/fontFeatureValues.js +7 -0
- package/dist/web/fontFeatureValues.js.map +1 -0
- package/dist/web/fontPaletteValues.d.ts +21 -0
- package/dist/web/fontPaletteValues.d.ts.map +1 -0
- package/dist/web/fontPaletteValues.js +9 -0
- package/dist/web/fontPaletteValues.js.map +1 -0
- package/dist/web/global.d.ts +19 -0
- package/dist/web/global.d.ts.map +1 -0
- package/dist/web/global.js +6 -0
- package/dist/web/global.js.map +1 -0
- package/dist/web/importCss.d.ts +18 -0
- package/dist/web/importCss.d.ts.map +1 -0
- package/dist/web/importCss.js +7 -0
- package/dist/web/importCss.js.map +1 -0
- package/dist/web/index.d.ts +22 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +22 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/internal/Block.d.ts +18 -0
- package/dist/web/internal/Block.d.ts.map +1 -0
- package/dist/web/internal/Block.js +13 -0
- package/dist/web/internal/Block.js.map +1 -0
- package/dist/web/internal/ClassName.d.ts +19 -0
- package/dist/web/internal/ClassName.d.ts.map +1 -0
- package/dist/web/internal/ClassName.js +77 -0
- package/dist/web/internal/ClassName.js.map +1 -0
- package/dist/web/internal/Context.d.ts +11 -0
- package/dist/web/internal/Context.d.ts.map +1 -0
- package/dist/web/internal/Context.js +2 -0
- package/dist/web/internal/Context.js.map +1 -0
- package/dist/web/internal/Contributions.d.ts +70 -0
- package/dist/web/internal/Contributions.d.ts.map +1 -0
- package/dist/web/internal/Contributions.js +109 -0
- package/dist/web/internal/Contributions.js.map +1 -0
- package/dist/web/internal/Namespace.d.ts +13 -0
- package/dist/web/internal/Namespace.d.ts.map +1 -0
- package/dist/web/internal/Namespace.js +13 -0
- package/dist/web/internal/Namespace.js.map +1 -0
- package/dist/web/internal/Themes.d.ts +13 -0
- package/dist/web/internal/Themes.d.ts.map +1 -0
- package/dist/web/internal/Themes.js +96 -0
- package/dist/web/internal/Themes.js.map +1 -0
- package/dist/web/keyframes.d.ts +14 -0
- package/dist/web/keyframes.d.ts.map +1 -0
- package/dist/web/keyframes.js +8 -0
- package/dist/web/keyframes.js.map +1 -0
- package/dist/web/layers.d.ts +4 -0
- package/dist/web/layers.d.ts.map +1 -0
- package/dist/web/layers.js +7 -0
- package/dist/web/layers.js.map +1 -0
- package/dist/web/namespace.d.ts +14 -0
- package/dist/web/namespace.d.ts.map +1 -0
- package/dist/web/namespace.js +7 -0
- package/dist/web/namespace.js.map +1 -0
- package/dist/web/page.d.ts +38 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +7 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/positionTry.d.ts +14 -0
- package/dist/web/positionTry.d.ts.map +1 -0
- package/dist/web/positionTry.js +9 -0
- package/dist/web/positionTry.js.map +1 -0
- package/dist/web/property.d.ts +24 -0
- package/dist/web/property.d.ts.map +1 -0
- package/dist/web/property.js +7 -0
- package/dist/web/property.js.map +1 -0
- package/dist/web/viewTransition.d.ts +29 -0
- package/dist/web/viewTransition.d.ts.map +1 -0
- package/dist/web/viewTransition.js +7 -0
- package/dist/web/viewTransition.js.map +1 -0
- package/package.json +136 -10
- package/src/Config.ts +690 -0
- package/src/Props.ts +8 -0
- package/src/Style.ts +748 -0
- package/src/Theme.ts +713 -0
- package/src/babel/NativeEdits.ts +273 -0
- package/src/babel/NativeJsx.ts +260 -0
- package/src/babel/index.ts +332 -0
- package/src/cli/index.ts +196 -0
- package/src/compiler/Graph.ts +1586 -0
- package/src/compiler/Native.ts +801 -0
- package/src/compiler/Source.ts +1550 -0
- package/src/compiler/Transform.ts +1235 -0
- package/src/compiler/index.ts +12 -0
- package/src/compiler/internal/Applications.ts +378 -0
- package/src/compiler/internal/AtRules.ts +202 -0
- package/src/compiler/internal/Catalogs.ts +114 -0
- package/src/compiler/internal/ColorProfiles.ts +93 -0
- package/src/compiler/internal/CompositionBindings.ts +120 -0
- package/src/compiler/internal/Compositions.ts +629 -0
- package/src/compiler/internal/Configurations.ts +244 -0
- package/src/compiler/internal/Contract.ts +846 -0
- package/src/compiler/internal/Contributions.ts +1507 -0
- package/src/compiler/internal/Descriptors.ts +238 -0
- package/src/compiler/internal/Dynamic.ts +266 -0
- package/src/compiler/internal/Edits.ts +13 -0
- package/src/compiler/internal/Expression.ts +135 -0
- package/src/compiler/internal/Functions.ts +206 -0
- package/src/compiler/internal/Identifiers.ts +124 -0
- package/src/compiler/internal/Keyframes.ts +62 -0
- package/src/compiler/internal/Namespaces.ts +296 -0
- package/src/compiler/internal/NativeBindings.ts +151 -0
- package/src/compiler/internal/PackedStyles.ts +464 -0
- package/src/compiler/internal/Properties.ts +121 -0
- package/src/compiler/internal/RecipeConditions.ts +139 -0
- package/src/compiler/internal/RecipePayloads.ts +132 -0
- package/src/compiler/internal/Recipes.ts +531 -0
- package/src/compiler/internal/Relative.ts +87 -0
- package/src/compiler/internal/Scope.ts +36 -0
- package/src/compiler/internal/Selectors.ts +334 -0
- package/src/compiler/internal/Static.ts +783 -0
- package/src/compiler/internal/Stylesheets.ts +361 -0
- package/src/compiler/internal/Syntax.ts +31 -0
- package/src/compiler/internal/Themes.ts +1794 -0
- package/src/compiler/internal/Variables.ts +497 -0
- package/src/compiler/internal/ViewTransitions.ts +82 -0
- package/src/cx.ts +98 -0
- package/src/default.ts +484 -0
- package/src/index.ts +20 -0
- package/src/internal/Authoring.ts +199 -0
- package/src/internal/Binding.ts +187 -0
- package/src/internal/BindingDomains.ts +458 -0
- package/src/internal/Cascade.ts +165 -0
- package/src/internal/Compound.ts +522 -0
- package/src/internal/Condition.ts +283 -0
- package/src/internal/Corner.ts +17 -0
- package/src/internal/FunctionSyntax.ts +271 -0
- package/src/internal/FunctionValue.ts +96 -0
- package/src/internal/Geometry.ts +30 -0
- package/src/internal/Grid.ts +67 -0
- package/src/internal/Identifier.ts +14 -0
- package/src/internal/Identity.ts +89 -0
- package/src/internal/Lexical.ts +202 -0
- package/src/internal/Literal.ts +3820 -0
- package/src/internal/NativeProperties.ts +936 -0
- package/src/internal/Numeric.ts +77 -0
- package/src/internal/Query.ts +87 -0
- package/src/internal/Recipe.ts +17 -0
- package/src/internal/RuleReference.ts +102 -0
- package/src/internal/Scheme.ts +20 -0
- package/src/internal/Shorthands.ts +120 -0
- package/src/internal/Targets.ts +162 -0
- package/src/internal/Token.ts +380 -0
- package/src/internal/Tuple.ts +29 -0
- package/src/internal/Value.ts +320 -0
- package/src/metro/Graph.ts +78 -0
- package/src/metro/Watch.ts +88 -0
- package/src/metro/index.ts +99 -0
- package/src/metro/transformer.ts +97 -0
- package/src/next/index.ts +114 -0
- package/src/next/loader.ts +369 -0
- package/src/node/Host.ts +1204 -0
- package/src/node/index.ts +6 -0
- package/src/react-native/Host.ts +289 -0
- package/src/react-native/StyleSheet.ts +1084 -0
- package/src/react-native/Variants.ts +122 -0
- package/src/react-native/index.ts +7 -0
- package/src/react-native/internal/Color.ts +110 -0
- package/src/react-native/internal/NativeSchema.ts +3096 -0
- package/src/react-native/internal/Scalar.ts +253 -0
- package/src/react-native/internal/Values.ts +87 -0
- package/src/react-native/react.ts +47 -0
- package/src/reset.css +244 -0
- package/src/runtime/Appearance.ts +155 -0
- package/src/runtime/Composition.ts +87 -0
- package/src/runtime/CompositionHtml.ts +38 -0
- package/src/runtime/ConditionalRecipe.ts +70 -0
- package/src/runtime/Dynamic.ts +51 -0
- package/src/runtime/Html.ts +91 -0
- package/src/runtime/Native.ts +144 -0
- package/src/runtime/NativeContext.ts +74 -0
- package/src/runtime/NativeDynamic.ts +246 -0
- package/src/runtime/PayloadRecipe.ts +96 -0
- package/src/runtime/Props.ts +33 -0
- package/src/runtime/Recipe.ts +74 -0
- package/src/runtime/Selection.ts +82 -0
- package/src/runtime/Variable.ts +15 -0
- package/src/runtime/index.ts +45 -0
- package/src/styleFunction.ts +138 -0
- package/src/themes/LICENSE.tailwind +21 -0
- package/src/variable.ts +105 -0
- package/src/variants.ts +218 -0
- package/src/vite/index.ts +1473 -0
- package/src/web/Css.ts +801 -0
- package/src/web/colorProfile.ts +60 -0
- package/src/web/counterStyle.ts +82 -0
- package/src/web/cssFunction.ts +181 -0
- package/src/web/customMedia.ts +16 -0
- package/src/web/fontFace.ts +41 -0
- package/src/web/fontFeatureValues.ts +79 -0
- package/src/web/fontPaletteValues.ts +42 -0
- package/src/web/global.ts +39 -0
- package/src/web/importCss.ts +23 -0
- package/src/web/index.ts +22 -0
- package/src/web/internal/Block.ts +29 -0
- package/src/web/internal/ClassName.ts +112 -0
- package/src/web/internal/Context.ts +16 -0
- package/src/web/internal/Contributions.ts +219 -0
- package/src/web/internal/Namespace.ts +21 -0
- package/src/web/internal/Themes.ts +133 -0
- package/src/web/keyframes.ts +43 -0
- package/src/web/layers.ts +6 -0
- package/src/web/namespace.ts +19 -0
- package/src/web/page.ts +140 -0
- package/src/web/positionTry.ts +71 -0
- package/src/web/property.ts +35 -0
- package/src/web/viewTransition.ts +89 -0
|
@@ -0,0 +1,1089 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connects static Zyzz source compilation to Vite resolution and CSS delivery.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import * as Namespaces from '../compiler/internal/Namespaces.js';
|
|
6
|
+
import * as AtRules from '../compiler/internal/AtRules.js';
|
|
7
|
+
import * as Catalogs from '../compiler/internal/Catalogs.js';
|
|
8
|
+
import * as Mapping from '@jridgewell/gen-mapping';
|
|
9
|
+
import * as Lightning from 'lightningcss';
|
|
10
|
+
import * as Crypto from 'node:crypto';
|
|
11
|
+
import * as Fs from 'node:fs/promises';
|
|
12
|
+
import * as Path from 'node:path';
|
|
13
|
+
import * as Parser from 'oxc-parser';
|
|
14
|
+
import * as Walker from 'oxc-walker';
|
|
15
|
+
import * as Scope from '../compiler/internal/Scope.js';
|
|
16
|
+
import * as Graph from '../compiler/Graph.js';
|
|
17
|
+
import * as Source from '../compiler/Source.js';
|
|
18
|
+
/**
|
|
19
|
+
* Compiles physical project source without executing authoring code.
|
|
20
|
+
* Vite owns resolution, transpilation, CSS processing, watching, and HMR.
|
|
21
|
+
* @returns A Vite 8 plugin with isolated state for each environment.
|
|
22
|
+
*/
|
|
23
|
+
export function zyzz(options = {}) {
|
|
24
|
+
const native = options.native
|
|
25
|
+
? Object.freeze({
|
|
26
|
+
...options.native,
|
|
27
|
+
fonts: options.native.fonts && Object.freeze({ ...options.native.fonts }),
|
|
28
|
+
themes: options.native.themes && Object.freeze({ ...options.native.themes }),
|
|
29
|
+
units: options.native.units && Object.freeze({ ...options.native.units }),
|
|
30
|
+
})
|
|
31
|
+
: undefined;
|
|
32
|
+
if (native && options.compiler === false)
|
|
33
|
+
throw new Error('Native builds require source compilation.');
|
|
34
|
+
const states = new WeakMap();
|
|
35
|
+
const discoveries = new WeakMap();
|
|
36
|
+
const contributionFiles = new WeakMap();
|
|
37
|
+
const assets = new Map();
|
|
38
|
+
const catalogs = new Map();
|
|
39
|
+
const edges = new Map();
|
|
40
|
+
const graphs = new Map();
|
|
41
|
+
const initializers = new WeakMap();
|
|
42
|
+
const sourceEntrypoints = new Set();
|
|
43
|
+
let root;
|
|
44
|
+
function entries(environment) {
|
|
45
|
+
let state = states.get(environment);
|
|
46
|
+
if (!state) {
|
|
47
|
+
state = new Map();
|
|
48
|
+
states.set(environment, state);
|
|
49
|
+
}
|
|
50
|
+
return state;
|
|
51
|
+
}
|
|
52
|
+
function sourceId(file) {
|
|
53
|
+
return `app/${Path.relative(root, file).split(Path.sep).join('/')}`;
|
|
54
|
+
}
|
|
55
|
+
function resource(id) {
|
|
56
|
+
const query = id.split('?')[1]?.split('#')[0];
|
|
57
|
+
return (query !== undefined &&
|
|
58
|
+
[...new URLSearchParams(query).keys()].some((key) => !['v', 't', 'import'].includes(key)));
|
|
59
|
+
}
|
|
60
|
+
function normalize(id) {
|
|
61
|
+
return resource(id) ? id : id.split('?')[0];
|
|
62
|
+
}
|
|
63
|
+
function eligible(id) {
|
|
64
|
+
if (sourceEntrypoints.has(normalize(id)))
|
|
65
|
+
return true;
|
|
66
|
+
// Ids carrying foreign queries are Vite resources such as inline-module proxies, not source.
|
|
67
|
+
if (resource(id))
|
|
68
|
+
return false;
|
|
69
|
+
const relative = Path.relative(root, id);
|
|
70
|
+
return (Path.isAbsolute(id) &&
|
|
71
|
+
!relative.startsWith('..') &&
|
|
72
|
+
!relative.split(Path.sep).includes('node_modules') &&
|
|
73
|
+
/\.[cm]?[jt]sx?$/.test(id) &&
|
|
74
|
+
!/\.(?:d|test|test-d|bench)\.[cm]?[jt]sx?$/.test(id));
|
|
75
|
+
}
|
|
76
|
+
function discover(environment, host) {
|
|
77
|
+
let pending = discoveries.get(environment);
|
|
78
|
+
if (!pending) {
|
|
79
|
+
pending = (async () => {
|
|
80
|
+
const sources = new Map();
|
|
81
|
+
const eagerFiles = new Set();
|
|
82
|
+
contributionFiles.set(environment, eagerFiles);
|
|
83
|
+
async function collect(directory) {
|
|
84
|
+
for (const item of await Fs.readdir(directory, {
|
|
85
|
+
withFileTypes: true,
|
|
86
|
+
})) {
|
|
87
|
+
if (item.name.startsWith('.') ||
|
|
88
|
+
[
|
|
89
|
+
'node_modules',
|
|
90
|
+
'dist',
|
|
91
|
+
'build',
|
|
92
|
+
'coverage',
|
|
93
|
+
'test',
|
|
94
|
+
'tests',
|
|
95
|
+
'__tests__',
|
|
96
|
+
'fixtures',
|
|
97
|
+
'__fixtures__',
|
|
98
|
+
].includes(item.name))
|
|
99
|
+
continue;
|
|
100
|
+
const file = Path.join(directory, item.name);
|
|
101
|
+
if (item.isDirectory())
|
|
102
|
+
await collect(file);
|
|
103
|
+
else if (item.isFile() && eager(file)) {
|
|
104
|
+
host.watch(file);
|
|
105
|
+
const source = await Fs.readFile(file, 'utf8');
|
|
106
|
+
sources.set(file, source);
|
|
107
|
+
if (contributes(source))
|
|
108
|
+
eagerFiles.add(file);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
await collect(root);
|
|
113
|
+
return sources;
|
|
114
|
+
})();
|
|
115
|
+
discoveries.set(environment, pending);
|
|
116
|
+
}
|
|
117
|
+
return pending;
|
|
118
|
+
}
|
|
119
|
+
function eager(file) {
|
|
120
|
+
return (eligible(file) &&
|
|
121
|
+
!Path.relative(root, file)
|
|
122
|
+
.split(Path.sep)
|
|
123
|
+
.some((part) => ['test', 'tests', '__tests__', 'fixtures', '__fixtures__'].includes(part)));
|
|
124
|
+
}
|
|
125
|
+
function contributes(source) {
|
|
126
|
+
const { program } = Parser.parseSync('source.tsx', source, {
|
|
127
|
+
sourceType: 'module',
|
|
128
|
+
});
|
|
129
|
+
const imports = new Map();
|
|
130
|
+
for (const node of program.body) {
|
|
131
|
+
if (node.type !== 'ImportDeclaration' || node.importKind === 'type')
|
|
132
|
+
continue;
|
|
133
|
+
for (const specifier of node.specifiers) {
|
|
134
|
+
if (specifier.type !== 'ImportSpecifier' ||
|
|
135
|
+
specifier.importKind === 'type')
|
|
136
|
+
continue;
|
|
137
|
+
const name = specifier.imported.type === 'Identifier'
|
|
138
|
+
? specifier.imported.name
|
|
139
|
+
: specifier.imported.value;
|
|
140
|
+
if (node.source.value === 'zyzz/web'
|
|
141
|
+
? [
|
|
142
|
+
'colorProfile',
|
|
143
|
+
'counterStyle',
|
|
144
|
+
'cssFunction',
|
|
145
|
+
'customMedia',
|
|
146
|
+
'fontFace',
|
|
147
|
+
'fontFeatureValues',
|
|
148
|
+
'fontPaletteValues',
|
|
149
|
+
'global',
|
|
150
|
+
'importCss',
|
|
151
|
+
'keyframes',
|
|
152
|
+
'layers',
|
|
153
|
+
'namespace',
|
|
154
|
+
'page',
|
|
155
|
+
'positionTry',
|
|
156
|
+
'viewTransition',
|
|
157
|
+
].includes(name)
|
|
158
|
+
: name === 'Config' || node.source.value !== 'zyzz')
|
|
159
|
+
imports.set(specifier.start, name);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// Local call imports are candidates; Graph follows their re-exports before emission.
|
|
163
|
+
if (!imports.size)
|
|
164
|
+
return false;
|
|
165
|
+
const scopeTracker = new Scope.Tracker({ preserveExitedScopes: true });
|
|
166
|
+
Walker.walk(program, { scopeTracker });
|
|
167
|
+
scopeTracker.freeze();
|
|
168
|
+
let found = false;
|
|
169
|
+
Walker.walk(program, {
|
|
170
|
+
scopeTracker,
|
|
171
|
+
enter(node) {
|
|
172
|
+
if (node.type !== 'CallExpression')
|
|
173
|
+
return;
|
|
174
|
+
const callee = node.callee;
|
|
175
|
+
if (callee.type === 'Identifier') {
|
|
176
|
+
const binding = scopeTracker.getDeclaration(callee.name);
|
|
177
|
+
if (binding?.type === 'Import' &&
|
|
178
|
+
imports.has(binding.node.start) &&
|
|
179
|
+
imports.get(binding.node.start) !== 'Config')
|
|
180
|
+
found = true;
|
|
181
|
+
}
|
|
182
|
+
else if (callee.type === 'MemberExpression' &&
|
|
183
|
+
callee.object.type === 'Identifier' &&
|
|
184
|
+
!callee.computed &&
|
|
185
|
+
callee.property.type === 'Identifier' &&
|
|
186
|
+
callee.property.name === 'create') {
|
|
187
|
+
const binding = scopeTracker.getDeclaration(callee.object.name);
|
|
188
|
+
const argument = node.arguments[0];
|
|
189
|
+
if (binding?.type === 'Import' &&
|
|
190
|
+
imports.get(binding.node.start) === 'Config' &&
|
|
191
|
+
argument?.type === 'ObjectExpression' &&
|
|
192
|
+
argument.properties.some((property) => property.type === 'Property' &&
|
|
193
|
+
(property.key.type === 'Identifier'
|
|
194
|
+
? property.key.name === 'layers'
|
|
195
|
+
: property.key.type === 'Literal' &&
|
|
196
|
+
property.key.value === 'layers')))
|
|
197
|
+
found = true;
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
return found;
|
|
202
|
+
}
|
|
203
|
+
async function updateDiscovery(environment, file, event) {
|
|
204
|
+
if (event === 'delete')
|
|
205
|
+
entries(environment).delete(file);
|
|
206
|
+
const pending = discoveries.get(environment);
|
|
207
|
+
if (!pending || !eager(file))
|
|
208
|
+
return;
|
|
209
|
+
const sources = await pending;
|
|
210
|
+
if (event === 'delete')
|
|
211
|
+
sources.delete(file);
|
|
212
|
+
else {
|
|
213
|
+
const source = await Fs.readFile(file, 'utf8');
|
|
214
|
+
sources.set(file, source);
|
|
215
|
+
if (contributes(source))
|
|
216
|
+
contributionFiles.get(environment)?.add(file);
|
|
217
|
+
else
|
|
218
|
+
contributionFiles.get(environment)?.delete(file);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async function compile(entry, host, code, allSources = false, everything = false) {
|
|
222
|
+
async function resolve(source, importer) {
|
|
223
|
+
const resolved = await host.resolve(source, importer);
|
|
224
|
+
if (!resolved)
|
|
225
|
+
return resolved;
|
|
226
|
+
if (entry.environment.mode === 'dev') {
|
|
227
|
+
const optimized = Object.values({
|
|
228
|
+
...entry.environment.depsOptimizer?.metadata.optimized,
|
|
229
|
+
...entry.environment.depsOptimizer?.metadata.discovered,
|
|
230
|
+
}).find((item) => item.file === resolved.id.split('?')[0]);
|
|
231
|
+
if (optimized?.src)
|
|
232
|
+
return { ...resolved, id: optimized.src };
|
|
233
|
+
}
|
|
234
|
+
return { ...resolved, id: normalize(resolved.id) };
|
|
235
|
+
}
|
|
236
|
+
const imports = Object.create(null);
|
|
237
|
+
const contracts = Object.create(null);
|
|
238
|
+
const lazy = Object.create(null);
|
|
239
|
+
const modules = Object.create(null);
|
|
240
|
+
const files = new Set();
|
|
241
|
+
async function visit(file, source) {
|
|
242
|
+
if (files.has(file))
|
|
243
|
+
return;
|
|
244
|
+
files.add(file);
|
|
245
|
+
host.watch(file);
|
|
246
|
+
const id = sourceId(file);
|
|
247
|
+
const text = source ?? (await Fs.readFile(file, 'utf8'));
|
|
248
|
+
modules[id] = text;
|
|
249
|
+
const resolutions = Object.create(null);
|
|
250
|
+
imports[id] = resolutions;
|
|
251
|
+
const parsed = Parser.parseSync('source.tsx', text, {
|
|
252
|
+
sourceType: 'module',
|
|
253
|
+
});
|
|
254
|
+
for (const node of parsed.program.body) {
|
|
255
|
+
if ((node.type !== 'ImportDeclaration' &&
|
|
256
|
+
node.type !== 'ExportNamedDeclaration' &&
|
|
257
|
+
node.type !== 'ExportAllDeclaration') ||
|
|
258
|
+
!node.source)
|
|
259
|
+
continue;
|
|
260
|
+
if (node.type === 'ImportDeclaration'
|
|
261
|
+
? node.importKind === 'type'
|
|
262
|
+
: node.exportKind === 'type')
|
|
263
|
+
continue;
|
|
264
|
+
if ('specifiers' in node &&
|
|
265
|
+
node.specifiers.length &&
|
|
266
|
+
node.specifiers.every((specifier) => specifier.type === 'ImportSpecifier'
|
|
267
|
+
? specifier.importKind === 'type'
|
|
268
|
+
: specifier.type === 'ExportSpecifier' &&
|
|
269
|
+
specifier.exportKind === 'type'))
|
|
270
|
+
continue;
|
|
271
|
+
const specifier = node.source.value;
|
|
272
|
+
// Zyzz authoring and runtime entrypoints are handled by the static transform.
|
|
273
|
+
if (specifier === 'zyzz' ||
|
|
274
|
+
(specifier.startsWith('zyzz/') && specifier !== 'zyzz/default')) {
|
|
275
|
+
resolutions[specifier] = null;
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
const resolved = await resolve(specifier, file);
|
|
279
|
+
if (!resolved)
|
|
280
|
+
throw new Source.ExtractError([
|
|
281
|
+
{
|
|
282
|
+
code: 'unsupported_syntax',
|
|
283
|
+
end: node.end,
|
|
284
|
+
message: `Unable to resolve ${JSON.stringify(specifier)}`,
|
|
285
|
+
source: file,
|
|
286
|
+
start: node.start,
|
|
287
|
+
},
|
|
288
|
+
]);
|
|
289
|
+
if (resource(specifier) || resource(resolved.id)) {
|
|
290
|
+
resolutions[specifier] = null;
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
if (specifier === 'zyzz/default' &&
|
|
294
|
+
/[/\\]src[/\\]default\.[cm]?ts$/.test(resolved.id)) {
|
|
295
|
+
sourceEntrypoints.add(normalize(resolved.id));
|
|
296
|
+
resolutions[specifier] = sourceId(resolved.id);
|
|
297
|
+
await visit(resolved.id);
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if (resolved.external || !eligible(resolved.id)) {
|
|
301
|
+
const physical = resolved.id.split('?')[0].split('#')[0];
|
|
302
|
+
const sidecar = `${physical}.zyzz.json`;
|
|
303
|
+
if (Path.isAbsolute(physical) && /\.[cm]?[jt]sx?$/.test(physical)) {
|
|
304
|
+
try {
|
|
305
|
+
contracts[resolved.id] = await Fs.readFile(sidecar, 'utf8');
|
|
306
|
+
host.watch(sidecar);
|
|
307
|
+
files.add(sidecar);
|
|
308
|
+
resolutions[specifier] = resolved.id;
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
if (error.code !== 'ENOENT')
|
|
313
|
+
throw error;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
resolutions[specifier] = null;
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
resolutions[specifier] = sourceId(resolved.id);
|
|
320
|
+
await visit(resolved.id);
|
|
321
|
+
}
|
|
322
|
+
// Lazy imports stay outside this compile but scope the documents that load them.
|
|
323
|
+
const specifiers = [];
|
|
324
|
+
Walker.walk(parsed.program, {
|
|
325
|
+
enter(node) {
|
|
326
|
+
if (node.type === 'ImportExpression' &&
|
|
327
|
+
node.source.type === 'Literal' &&
|
|
328
|
+
typeof node.source.value === 'string')
|
|
329
|
+
specifiers.push(node.source.value);
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
const targets = new Set();
|
|
333
|
+
for (const specifier of specifiers) {
|
|
334
|
+
if (specifier === 'zyzz' || specifier.startsWith('zyzz/'))
|
|
335
|
+
continue;
|
|
336
|
+
const resolved = await resolve(specifier, file);
|
|
337
|
+
if (!resolved || resource(specifier) || resource(resolved.id))
|
|
338
|
+
continue;
|
|
339
|
+
targets.add(eligible(resolved.id) ? sourceId(resolved.id) : resolved.id);
|
|
340
|
+
}
|
|
341
|
+
lazy[id] = targets;
|
|
342
|
+
}
|
|
343
|
+
await visit(entry.file, code);
|
|
344
|
+
const connected = new Set(files);
|
|
345
|
+
const entryContracts = new Set(Object.keys(contracts));
|
|
346
|
+
for (const [file, source] of await discover(entry.environment, host)) {
|
|
347
|
+
if (files.has(file) && !allSources)
|
|
348
|
+
continue;
|
|
349
|
+
const selected = contributionFiles.get(entry.environment)?.has(file);
|
|
350
|
+
if (allSources) {
|
|
351
|
+
const { program } = Parser.parseSync('source.tsx', source, {
|
|
352
|
+
sourceType: 'module',
|
|
353
|
+
});
|
|
354
|
+
const dynamic = [];
|
|
355
|
+
Walker.walk(program, {
|
|
356
|
+
enter(node) {
|
|
357
|
+
if (node.type === 'ImportExpression' &&
|
|
358
|
+
node.source.type === 'Literal' &&
|
|
359
|
+
typeof node.source.value === 'string')
|
|
360
|
+
dynamic.push(node);
|
|
361
|
+
},
|
|
362
|
+
});
|
|
363
|
+
for (const node of [...program.body, ...dynamic]) {
|
|
364
|
+
if ((node.type !== 'ImportExpression' &&
|
|
365
|
+
node.type !== 'ImportDeclaration' &&
|
|
366
|
+
node.type !== 'ExportNamedDeclaration' &&
|
|
367
|
+
node.type !== 'ExportAllDeclaration') ||
|
|
368
|
+
!node.source)
|
|
369
|
+
continue;
|
|
370
|
+
if (node.type === 'ImportExpression'
|
|
371
|
+
? false
|
|
372
|
+
: node.type === 'ImportDeclaration'
|
|
373
|
+
? node.importKind === 'type'
|
|
374
|
+
: node.exportKind === 'type')
|
|
375
|
+
continue;
|
|
376
|
+
if ('specifiers' in node &&
|
|
377
|
+
node.specifiers.length &&
|
|
378
|
+
node.specifiers.every((specifier) => specifier.type === 'ImportSpecifier'
|
|
379
|
+
? specifier.importKind === 'type'
|
|
380
|
+
: specifier.type === 'ExportSpecifier' &&
|
|
381
|
+
specifier.exportKind === 'type'))
|
|
382
|
+
continue;
|
|
383
|
+
if (node.source.type !== 'Literal' ||
|
|
384
|
+
typeof node.source.value !== 'string')
|
|
385
|
+
continue;
|
|
386
|
+
const specifier = node.source.value;
|
|
387
|
+
if (specifier === 'zyzz' ||
|
|
388
|
+
(specifier.startsWith('zyzz/') &&
|
|
389
|
+
specifier !== 'zyzz/default'))
|
|
390
|
+
continue;
|
|
391
|
+
const resolved = await resolve(specifier, file);
|
|
392
|
+
if (!resolved || (!resolved.external && eligible(resolved.id)))
|
|
393
|
+
continue;
|
|
394
|
+
if (resource(specifier) || resource(resolved.id))
|
|
395
|
+
continue;
|
|
396
|
+
const physical = resolved.id.split(/[?#]/)[0];
|
|
397
|
+
if (!Path.isAbsolute(physical) || !/\.[cm]?[jt]sx?$/.test(physical))
|
|
398
|
+
continue;
|
|
399
|
+
try {
|
|
400
|
+
const sidecar = `${physical}.zyzz.json`;
|
|
401
|
+
contracts[resolved.id] = await Fs.readFile(sidecar, 'utf8');
|
|
402
|
+
host.watch(sidecar);
|
|
403
|
+
files.add(sidecar);
|
|
404
|
+
// Discover the package contribution without compiling unrelated authoring
|
|
405
|
+
// expressions in an otherwise unreachable source file.
|
|
406
|
+
const discovery = `${sourceId(file)}.zyzz-discovery`;
|
|
407
|
+
modules[discovery] =
|
|
408
|
+
(modules[discovery] ?? '') +
|
|
409
|
+
`import ${JSON.stringify(specifier)};\n`;
|
|
410
|
+
(imports[discovery] ??= Object.create(null))[specifier] =
|
|
411
|
+
resolved.id;
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
if (error.code !== 'ENOENT')
|
|
415
|
+
throw error;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// A whole-project compile reads disk so the document never trails the watcher.
|
|
420
|
+
if (everything)
|
|
421
|
+
await visit(file);
|
|
422
|
+
else if (selected)
|
|
423
|
+
await visit(file, source);
|
|
424
|
+
}
|
|
425
|
+
const loaded = new Set();
|
|
426
|
+
async function dependencies(id) {
|
|
427
|
+
if (loaded.has(id))
|
|
428
|
+
return;
|
|
429
|
+
loaded.add(id);
|
|
430
|
+
const metadata = (() => {
|
|
431
|
+
try {
|
|
432
|
+
return JSON.parse(contracts[id]);
|
|
433
|
+
}
|
|
434
|
+
catch (error) {
|
|
435
|
+
Graph.compile({ modules: {}, contracts: { [id]: contracts[id] } });
|
|
436
|
+
throw error;
|
|
437
|
+
}
|
|
438
|
+
})();
|
|
439
|
+
if (!Array.isArray(metadata?.stylesheets))
|
|
440
|
+
return;
|
|
441
|
+
for (const section of metadata.stylesheets) {
|
|
442
|
+
if (!Array.isArray(section?.dependency))
|
|
443
|
+
continue;
|
|
444
|
+
let owner = id;
|
|
445
|
+
for (const specifier of section.dependency) {
|
|
446
|
+
if (typeof specifier !== 'string' ||
|
|
447
|
+
!specifier ||
|
|
448
|
+
specifier.includes('\0'))
|
|
449
|
+
throw new Error('Invalid packed stylesheet dependency.');
|
|
450
|
+
const target = await resolve(specifier, owner);
|
|
451
|
+
if (!target || !Path.isAbsolute(target.id))
|
|
452
|
+
throw new Error('Unable to resolve packed stylesheet dependency.');
|
|
453
|
+
imports[owner] ??= Object.create(null);
|
|
454
|
+
imports[owner][specifier] = target.id;
|
|
455
|
+
if (!Object.hasOwn(contracts, target.id)) {
|
|
456
|
+
const sidecar = `${target.id.split(/[?#]/)[0]}.zyzz.json`;
|
|
457
|
+
contracts[target.id] = await Fs.readFile(sidecar, 'utf8');
|
|
458
|
+
host.watch(sidecar);
|
|
459
|
+
files.add(sidecar);
|
|
460
|
+
}
|
|
461
|
+
await dependencies(target.id);
|
|
462
|
+
owner = target.id;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
for (const id of Object.keys(contracts))
|
|
467
|
+
await dependencies(id);
|
|
468
|
+
// The entry's authored import closure scopes document initialization in
|
|
469
|
+
// builds, including packed contracts reached through other contracts.
|
|
470
|
+
for (const id of entryContracts)
|
|
471
|
+
for (const target of Object.values(imports[id] ?? {}))
|
|
472
|
+
if (target !== null)
|
|
473
|
+
entryContracts.add(target);
|
|
474
|
+
// Static and lazy edges let a served document keep only the catalogs its scripts reach.
|
|
475
|
+
const staged = new Map();
|
|
476
|
+
for (const [id, resolutions] of Object.entries(imports))
|
|
477
|
+
staged.set(id, new Set([
|
|
478
|
+
...Object.values(resolutions).filter((target) => target !== null),
|
|
479
|
+
...(lazy[id] ?? []),
|
|
480
|
+
]));
|
|
481
|
+
const result = entry.compiler.compile({
|
|
482
|
+
compiler: options.compiler,
|
|
483
|
+
native,
|
|
484
|
+
contracts,
|
|
485
|
+
development: entry.environment.mode !== 'build',
|
|
486
|
+
imports,
|
|
487
|
+
modules,
|
|
488
|
+
});
|
|
489
|
+
if (native) {
|
|
490
|
+
const output = result.modules[sourceId(entry.file)];
|
|
491
|
+
entry.files = files;
|
|
492
|
+
const map = Mapping.toEncodedMap(new Mapping.GenMapping());
|
|
493
|
+
return {
|
|
494
|
+
code: output.code,
|
|
495
|
+
contractIds: Object.keys(result.contracts),
|
|
496
|
+
css: '',
|
|
497
|
+
sharedCss: '',
|
|
498
|
+
cssMap: map,
|
|
499
|
+
sharedCssMap: map,
|
|
500
|
+
map: {
|
|
501
|
+
...output.map,
|
|
502
|
+
sources: output.map.sources.map((source) => source === null ? null : Path.join(root, source.slice(4))),
|
|
503
|
+
},
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
// The graph publishes after the compile succeeds, so a broken edit keeps
|
|
507
|
+
// scoping documents through the last good graph beside the kept catalogs.
|
|
508
|
+
graphs.set(entry.file, new Set([...[...connected].map(sourceId), ...entryContracts]));
|
|
509
|
+
for (const [id, targets] of staged)
|
|
510
|
+
edges.set(id, targets);
|
|
511
|
+
// Packed dependencies contribute catalogs beside the modules compiled here.
|
|
512
|
+
const compiled = { ...contracts, ...result.contracts };
|
|
513
|
+
// A module owns its catalog keys; recompiling it replaces every
|
|
514
|
+
// configuration it had, including a module that no longer emits a contract.
|
|
515
|
+
for (const id of new Set([
|
|
516
|
+
...Object.keys(modules),
|
|
517
|
+
...Object.keys(compiled),
|
|
518
|
+
]))
|
|
519
|
+
for (const key of catalogs.keys())
|
|
520
|
+
if (key.startsWith(`${id}\0`))
|
|
521
|
+
catalogs.delete(key);
|
|
522
|
+
for (const [id, contract] of Object.entries(compiled))
|
|
523
|
+
for (const configuration of Catalogs.read(contract))
|
|
524
|
+
catalogs.set(`${id}\0${configuration.identity}`, configuration);
|
|
525
|
+
const map = new Mapping.GenMapping();
|
|
526
|
+
const styles = [];
|
|
527
|
+
let line = 0;
|
|
528
|
+
for (const [id, output] of Object.entries(result.modules)) {
|
|
529
|
+
if (!connected.has(Path.join(root, id.slice(4))))
|
|
530
|
+
continue;
|
|
531
|
+
if (!output.css)
|
|
532
|
+
continue;
|
|
533
|
+
for (const mapping of Mapping.allMappings(Mapping.fromMap(JSON.stringify(output.cssMap)))) {
|
|
534
|
+
const generated = {
|
|
535
|
+
column: mapping.generated.column,
|
|
536
|
+
line: mapping.generated.line + line,
|
|
537
|
+
};
|
|
538
|
+
if (mapping.source !== undefined && mapping.original !== undefined) {
|
|
539
|
+
const location = {
|
|
540
|
+
generated,
|
|
541
|
+
original: mapping.original,
|
|
542
|
+
source: Path.join(root, mapping.source.slice(4)),
|
|
543
|
+
};
|
|
544
|
+
if (mapping.name === undefined)
|
|
545
|
+
Mapping.addMapping(map, location);
|
|
546
|
+
else
|
|
547
|
+
Mapping.addMapping(map, { ...location, name: mapping.name });
|
|
548
|
+
}
|
|
549
|
+
else
|
|
550
|
+
Mapping.addMapping(map, { generated });
|
|
551
|
+
}
|
|
552
|
+
for (const [index, source] of output.cssMap.sources.entries())
|
|
553
|
+
if (source !== null)
|
|
554
|
+
Mapping.setSourceContent(map, Path.join(root, source.slice(4)), output.cssMap.sourcesContent?.[index] ?? null);
|
|
555
|
+
styles.push(output.css);
|
|
556
|
+
line += output.css.split('\n').length;
|
|
557
|
+
}
|
|
558
|
+
const appRoot = await Fs.realpath(root);
|
|
559
|
+
const owners = new Map();
|
|
560
|
+
for (const id of new Set(Object.values(result.sharedAssetOwners ?? {}))) {
|
|
561
|
+
if (!Path.isAbsolute(id))
|
|
562
|
+
continue;
|
|
563
|
+
let directory = Path.dirname(id.split(/[?#]/)[0]);
|
|
564
|
+
for (;;) {
|
|
565
|
+
try {
|
|
566
|
+
await Fs.access(Path.join(directory, 'package.json'));
|
|
567
|
+
owners.set(id, await Fs.realpath(directory));
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
if (error.code !== 'ENOENT')
|
|
572
|
+
throw error;
|
|
573
|
+
}
|
|
574
|
+
const parent = Path.dirname(directory);
|
|
575
|
+
if (parent === directory)
|
|
576
|
+
throw new Error('Packed assets require an owning package.json.');
|
|
577
|
+
directory = parent;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const assetUrls = new Map();
|
|
581
|
+
for (const [key, target] of Object.entries(result.sharedAssets ?? {})) {
|
|
582
|
+
const raw = target.split(/[?#]/)[0];
|
|
583
|
+
const file = await Fs.realpath(target.startsWith('app/')
|
|
584
|
+
? Path.join(root, decodeURIComponent(raw.slice(4)))
|
|
585
|
+
: Path.isAbsolute(raw)
|
|
586
|
+
? decodeURIComponent(raw)
|
|
587
|
+
: (() => {
|
|
588
|
+
throw new Error('Asset path escapes the Vite graph.');
|
|
589
|
+
})());
|
|
590
|
+
const identity = result.sharedAssetOwners?.[key];
|
|
591
|
+
const owner = identity?.startsWith('app/')
|
|
592
|
+
? appRoot
|
|
593
|
+
: identity
|
|
594
|
+
? owners.get(identity)
|
|
595
|
+
: undefined;
|
|
596
|
+
const relative = owner ? Path.relative(owner, file) : '..';
|
|
597
|
+
if (relative === '..' ||
|
|
598
|
+
relative.startsWith(`..${Path.sep}`) ||
|
|
599
|
+
Path.isAbsolute(relative))
|
|
600
|
+
throw new Error('Asset path escapes its owning package.');
|
|
601
|
+
host.watch(file);
|
|
602
|
+
files.add(file);
|
|
603
|
+
let url;
|
|
604
|
+
if (/[?#%]/.test(file)) {
|
|
605
|
+
if (entry.environment.mode === 'build') {
|
|
606
|
+
url = await host.asset(file);
|
|
607
|
+
if (target.slice(raw.length))
|
|
608
|
+
url += `$_${target.slice(raw.length)}__`;
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
url = `/@zyzz/asset/${Crypto.hash('sha256', file)}/${encodeURIComponent(Path.basename(file))}`;
|
|
612
|
+
assets.set(url, file);
|
|
613
|
+
url += target.slice(raw.length);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
const pathname = file
|
|
618
|
+
.replaceAll('\\', '/')
|
|
619
|
+
.split('/')
|
|
620
|
+
.map((part, index) => index === 0 && /^[a-z]:$/i.test(part)
|
|
621
|
+
? part
|
|
622
|
+
: encodeURIComponent(part))
|
|
623
|
+
.join('/');
|
|
624
|
+
url = `/@fs/${pathname}${target.slice(raw.length)}`;
|
|
625
|
+
}
|
|
626
|
+
assetUrls.set(target, url);
|
|
627
|
+
}
|
|
628
|
+
const shared = !Object.keys(result.sharedAssets ?? {}).length
|
|
629
|
+
? {
|
|
630
|
+
code: new TextEncoder().encode(result.sharedCss ?? ''),
|
|
631
|
+
map: new TextEncoder().encode(JSON.stringify(result.sharedCssMap ??
|
|
632
|
+
Mapping.toEncodedMap(new Mapping.GenMapping()))),
|
|
633
|
+
}
|
|
634
|
+
: AtRules.transform({
|
|
635
|
+
filename: 'zyzz.shared.css',
|
|
636
|
+
code: new TextEncoder().encode(result.sharedCss ?? ''),
|
|
637
|
+
sourceMap: true,
|
|
638
|
+
inputSourceMap: JSON.stringify(result.sharedCssMap ??
|
|
639
|
+
Mapping.toEncodedMap(new Mapping.GenMapping())),
|
|
640
|
+
visitor: {
|
|
641
|
+
Rule(rule) {
|
|
642
|
+
if (rule.type !== 'import')
|
|
643
|
+
return;
|
|
644
|
+
const target = result.sharedAssets?.[rule.value.url];
|
|
645
|
+
if (target)
|
|
646
|
+
return AtRules.relocateImport(rule.value, assetUrls.get(target));
|
|
647
|
+
},
|
|
648
|
+
Url(url) {
|
|
649
|
+
const target = result.sharedAssets?.[url.url];
|
|
650
|
+
if (!target)
|
|
651
|
+
return;
|
|
652
|
+
return { ...url, url: assetUrls.get(target) };
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
});
|
|
656
|
+
const sharedMap = JSON.parse(new TextDecoder().decode(shared.map));
|
|
657
|
+
sharedMap.sources = sharedMap.sources.map((source) => source?.startsWith('app/') ? Path.join(root, source.slice(4)) : source);
|
|
658
|
+
const output = result.modules[sourceId(entry.file)];
|
|
659
|
+
entry.files = files;
|
|
660
|
+
return {
|
|
661
|
+
code: output.code,
|
|
662
|
+
contractIds: Object.keys(compiled),
|
|
663
|
+
css: styles.join('\n'),
|
|
664
|
+
sharedCss: new TextDecoder().decode(shared.code),
|
|
665
|
+
sharedCssMap: sharedMap,
|
|
666
|
+
cssMap: Mapping.toEncodedMap(map),
|
|
667
|
+
map: {
|
|
668
|
+
...output.map,
|
|
669
|
+
sources: output.map.sources.map((source) => source === null ? null : Path.join(root, source.slice(4))),
|
|
670
|
+
},
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
/** Compiles every discovered source once so index.html can inline each configuration's script before modules load. */
|
|
674
|
+
async function initializations(server) {
|
|
675
|
+
const environment = server.environments.client;
|
|
676
|
+
const host = {
|
|
677
|
+
asset: async (file) => file,
|
|
678
|
+
resolve: (source, importer) => environment.pluginContainer.resolveId(source, importer),
|
|
679
|
+
watch: (file) => server.watcher.add(file),
|
|
680
|
+
};
|
|
681
|
+
const sources = await discover(environment, host);
|
|
682
|
+
let entry = initializers.get(environment);
|
|
683
|
+
// The seed only anchors the compile, which visits every discovered source.
|
|
684
|
+
if (!entry || !sources.has(entry.file)) {
|
|
685
|
+
const file = sources.keys().next().value;
|
|
686
|
+
if (file === undefined)
|
|
687
|
+
return [];
|
|
688
|
+
entry = {
|
|
689
|
+
compiler: Graph.create(),
|
|
690
|
+
environment,
|
|
691
|
+
file,
|
|
692
|
+
files: new Set([file]),
|
|
693
|
+
};
|
|
694
|
+
initializers.set(environment, entry);
|
|
695
|
+
}
|
|
696
|
+
// A source error surfaces through that module's own transform and overlay.
|
|
697
|
+
// The document keeps loading with the catalogs collected before the edit.
|
|
698
|
+
const output = await compile(entry, host, undefined, true, true).catch(() => undefined);
|
|
699
|
+
// This compile saw the whole project, so contracts it no longer produces are gone.
|
|
700
|
+
if (output)
|
|
701
|
+
for (const key of catalogs.keys())
|
|
702
|
+
if (!output.contractIds.some((id) => key.startsWith(`${id}\0`)))
|
|
703
|
+
catalogs.delete(key);
|
|
704
|
+
return [...catalogs.values()];
|
|
705
|
+
}
|
|
706
|
+
/** Catalogs reachable from a served document's module scripts; every catalog when none resolve. */
|
|
707
|
+
async function documentCatalogs(html, filename, resolve) {
|
|
708
|
+
const reachable = new Set();
|
|
709
|
+
const add = (specifier) => {
|
|
710
|
+
if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(specifier))
|
|
711
|
+
return;
|
|
712
|
+
const path = specifier.split(/[?#]/)[0];
|
|
713
|
+
// Vite's inline-module proxies point back at the document itself.
|
|
714
|
+
if (/\.html?$/i.test(path))
|
|
715
|
+
return;
|
|
716
|
+
reachable.add(sourceId(path.startsWith('/')
|
|
717
|
+
? Path.join(root, path)
|
|
718
|
+
: Path.resolve(Path.dirname(filename), path)));
|
|
719
|
+
};
|
|
720
|
+
// Vite rewrites inline modules into proxy URLs before this hook runs, so
|
|
721
|
+
// the document on disk supplies their imports beside the served markup.
|
|
722
|
+
const original = await Fs.readFile(filename, 'utf8').catch(() => html);
|
|
723
|
+
for (const document of new Set([html, original]))
|
|
724
|
+
for (const [, attributes, content] of document.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)) {
|
|
725
|
+
if (!/\btype\s*=\s*["']?module["']?/i.test(attributes))
|
|
726
|
+
continue;
|
|
727
|
+
const source = /\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+))/i.exec(attributes);
|
|
728
|
+
const src = source?.[1] ?? source?.[2] ?? source?.[3];
|
|
729
|
+
if (src) {
|
|
730
|
+
add(src);
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
// Inline modules import relative to the document, as Vite's HTML
|
|
734
|
+
// proxy resolves them; aliases and packages resolve through Vite.
|
|
735
|
+
for (const specifier of inlineImports(content)) {
|
|
736
|
+
if (/^\.{0,2}\//.test(specifier)) {
|
|
737
|
+
add(specifier);
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
if (specifier === 'zyzz' || specifier.startsWith('zyzz/'))
|
|
741
|
+
continue;
|
|
742
|
+
const resolved = await resolve(specifier, filename).catch(() => null);
|
|
743
|
+
if (!resolved || resource(resolved.id))
|
|
744
|
+
continue;
|
|
745
|
+
reachable.add(eligible(resolved.id) ? sourceId(resolved.id) : resolved.id);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
if (![...reachable].some((id) => edges.has(id)))
|
|
749
|
+
return [...catalogs.values()];
|
|
750
|
+
for (const id of reachable)
|
|
751
|
+
for (const target of edges.get(id) ?? [])
|
|
752
|
+
reachable.add(target);
|
|
753
|
+
return [...catalogs]
|
|
754
|
+
.filter(([key]) => reachable.has(key.split('\0')[0]))
|
|
755
|
+
.map(([, configuration]) => configuration);
|
|
756
|
+
}
|
|
757
|
+
/** Static and literal dynamic import specifiers of an inline module script; none when it fails to parse. */
|
|
758
|
+
function inlineImports(content) {
|
|
759
|
+
const specifiers = [];
|
|
760
|
+
try {
|
|
761
|
+
const { program } = Parser.parseSync('inline.ts', content, {
|
|
762
|
+
sourceType: 'module',
|
|
763
|
+
});
|
|
764
|
+
Walker.walk(program, {
|
|
765
|
+
enter(node) {
|
|
766
|
+
if ((node.type === 'ImportDeclaration' ||
|
|
767
|
+
node.type === 'ExportNamedDeclaration' ||
|
|
768
|
+
node.type === 'ExportAllDeclaration') &&
|
|
769
|
+
node.source)
|
|
770
|
+
specifiers.push(node.source.value);
|
|
771
|
+
if (node.type === 'ImportExpression' &&
|
|
772
|
+
node.source.type === 'Literal' &&
|
|
773
|
+
typeof node.source.value === 'string')
|
|
774
|
+
specifiers.push(node.source.value);
|
|
775
|
+
},
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
catch {
|
|
779
|
+
return [];
|
|
780
|
+
}
|
|
781
|
+
return specifiers;
|
|
782
|
+
}
|
|
783
|
+
/** Catalogs contributed by the modules an HTML entry bundles; every catalog without an entry chunk. */
|
|
784
|
+
function entryCatalogs(bundle, chunk) {
|
|
785
|
+
if (!bundle || !chunk)
|
|
786
|
+
return [...catalogs.values()];
|
|
787
|
+
const contracts = new Set();
|
|
788
|
+
const visited = new Set();
|
|
789
|
+
function collect(name) {
|
|
790
|
+
if (visited.has(name))
|
|
791
|
+
return;
|
|
792
|
+
visited.add(name);
|
|
793
|
+
const output = bundle[name];
|
|
794
|
+
if (output?.type !== 'chunk')
|
|
795
|
+
return;
|
|
796
|
+
// Source graphs follow authored imports, so a configuration compiled away
|
|
797
|
+
// from the bundle still initializes the pages that authored it.
|
|
798
|
+
for (const id of Object.keys(output.modules))
|
|
799
|
+
for (const contract of graphs.get(normalize(id)) ?? [])
|
|
800
|
+
contracts.add(contract);
|
|
801
|
+
for (const imported of [...output.imports, ...output.dynamicImports])
|
|
802
|
+
collect(imported);
|
|
803
|
+
}
|
|
804
|
+
collect(chunk.fileName);
|
|
805
|
+
return [...catalogs]
|
|
806
|
+
.filter(([key]) => contracts.has(key.split('\0')[0]))
|
|
807
|
+
.map(([, configuration]) => configuration);
|
|
808
|
+
}
|
|
809
|
+
return {
|
|
810
|
+
config: {
|
|
811
|
+
order: 'post',
|
|
812
|
+
handler(config) {
|
|
813
|
+
if (native)
|
|
814
|
+
return;
|
|
815
|
+
// Inline color-scheme changes cannot initialize Lightning's lowered helpers.
|
|
816
|
+
return {
|
|
817
|
+
build: {
|
|
818
|
+
cssTarget: config.build?.cssTarget ??
|
|
819
|
+
config.build?.target ?? [
|
|
820
|
+
'chrome123',
|
|
821
|
+
'edge123',
|
|
822
|
+
'firefox120',
|
|
823
|
+
'safari17.5',
|
|
824
|
+
],
|
|
825
|
+
},
|
|
826
|
+
css: {
|
|
827
|
+
lightningcss: {
|
|
828
|
+
targets: config.css?.lightningcss?.targets ?? {
|
|
829
|
+
chrome: 123 << 16,
|
|
830
|
+
edge: 123 << 16,
|
|
831
|
+
firefox: 120 << 16,
|
|
832
|
+
safari: (17 << 16) | (5 << 8),
|
|
833
|
+
},
|
|
834
|
+
exclude: (config.css?.lightningcss?.exclude ?? 0) |
|
|
835
|
+
Lightning.Features.LightDark,
|
|
836
|
+
},
|
|
837
|
+
},
|
|
838
|
+
};
|
|
839
|
+
},
|
|
840
|
+
},
|
|
841
|
+
configureServer(server) {
|
|
842
|
+
server.middlewares.use((request, response, next) => {
|
|
843
|
+
const path = new URL(request.url ?? '/', 'http://localhost').pathname;
|
|
844
|
+
const file = assets.get(path);
|
|
845
|
+
if (!file)
|
|
846
|
+
return next();
|
|
847
|
+
Fs.readFile(file).then((content) => {
|
|
848
|
+
response.setHeader('Content-Type', file.endsWith('.svg')
|
|
849
|
+
? 'image/svg+xml'
|
|
850
|
+
: 'application/octet-stream');
|
|
851
|
+
response.setHeader('Cache-Control', 'no-cache');
|
|
852
|
+
response.end(content);
|
|
853
|
+
}, next);
|
|
854
|
+
});
|
|
855
|
+
},
|
|
856
|
+
configResolved(config) {
|
|
857
|
+
root = config.root;
|
|
858
|
+
if (native)
|
|
859
|
+
return;
|
|
860
|
+
const lightning = (config.css.lightningcss ??= {});
|
|
861
|
+
lightning.include =
|
|
862
|
+
(lightning.include ?? 0) & ~Lightning.Features.LightDark;
|
|
863
|
+
lightning.exclude =
|
|
864
|
+
(lightning.exclude ?? 0) | Lightning.Features.LightDark;
|
|
865
|
+
// The exclusion also affects imported application CSS.
|
|
866
|
+
const target = config.build.cssTarget;
|
|
867
|
+
const browsers = (Array.isArray(target) ? target : [target]).flatMap((value) => {
|
|
868
|
+
if (!value)
|
|
869
|
+
throw new Error('Zyzz requires an explicit browser CSS target.');
|
|
870
|
+
const match = /^(chrome|edge|firefox|safari|ios|opera|ie)([0-9.]+)$/.exec(value);
|
|
871
|
+
if (!match)
|
|
872
|
+
throw new Error(`Zyzz cannot verify light-dark() support for CSS target: ${value}`);
|
|
873
|
+
return [`${match[1] === 'ios' ? 'ios_saf' : match[1]} ${match[2]}`];
|
|
874
|
+
});
|
|
875
|
+
for (const targets of [
|
|
876
|
+
Lightning.browserslistToTargets(browsers),
|
|
877
|
+
lightning.targets ?? {},
|
|
878
|
+
]) {
|
|
879
|
+
const result = Lightning.transform({
|
|
880
|
+
code: new TextEncoder().encode('.theme{color:light-dark(white,black)}'),
|
|
881
|
+
filename: 'zyzz-theme-target.css',
|
|
882
|
+
targets,
|
|
883
|
+
});
|
|
884
|
+
if (!new TextDecoder().decode(result.code).includes('light-dark('))
|
|
885
|
+
throw new Error('Zyzz theme colours require native light-dark() support. Set CSS targets to Chrome/Edge 123+, Firefox 120+, or Safari/iOS 17.5+.');
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
enforce: 'pre',
|
|
889
|
+
generateBundle: {
|
|
890
|
+
order: 'post',
|
|
891
|
+
handler(_, bundle) {
|
|
892
|
+
if (native)
|
|
893
|
+
return;
|
|
894
|
+
for (const output of Object.values(bundle)) {
|
|
895
|
+
if (output.type !== 'asset' || !output.fileName.endsWith('.css'))
|
|
896
|
+
continue;
|
|
897
|
+
const css = typeof output.source === 'string'
|
|
898
|
+
? output.source
|
|
899
|
+
: new TextDecoder().decode(output.source);
|
|
900
|
+
const external = bundle[`${output.fileName}.map`];
|
|
901
|
+
const inline = css.match(/\/\*# sourceMappingURL=data:application\/json(?:;charset=[^;,]+)?;base64,([A-Za-z0-9+/=]+)\s*\*\//);
|
|
902
|
+
const previous = external?.type === 'asset'
|
|
903
|
+
? JSON.parse(typeof external.source === 'string'
|
|
904
|
+
? external.source
|
|
905
|
+
: new TextDecoder().decode(external.source))
|
|
906
|
+
: inline
|
|
907
|
+
? JSON.parse(Buffer.from(inline[1], 'base64').toString())
|
|
908
|
+
: undefined;
|
|
909
|
+
const result = Namespaces.bundle(css, previous);
|
|
910
|
+
let restored = AtRules.rename(AtRules.rename(result.css, '-zyzz-ffv-000000000', 'font-feature-values'), '-zyzz-fpv-000000000', 'font-palette-values');
|
|
911
|
+
if (result.map && external?.type === 'asset')
|
|
912
|
+
external.source = JSON.stringify(result.map);
|
|
913
|
+
if (result.map && inline)
|
|
914
|
+
restored = restored.replace(inline[0], `/*# sourceMappingURL=data:application/json;base64,${Buffer.from(JSON.stringify(result.map)).toString('base64')} */`);
|
|
915
|
+
output.source = restored;
|
|
916
|
+
}
|
|
917
|
+
},
|
|
918
|
+
},
|
|
919
|
+
async watchChange(file, change) {
|
|
920
|
+
await updateDiscovery(this.environment, file, change.event);
|
|
921
|
+
},
|
|
922
|
+
async hotUpdate({ file, modules, timestamp, type }) {
|
|
923
|
+
await updateDiscovery(this.environment, file, type);
|
|
924
|
+
const affected = new Set(modules);
|
|
925
|
+
for (const entry of entries(this.environment).values()) {
|
|
926
|
+
if (!entry.files.has(file) && !eager(file))
|
|
927
|
+
continue;
|
|
928
|
+
// Theme scopes affect CSS even when Vite's JavaScript import was erased.
|
|
929
|
+
for (const id of [entry.file, cssId(entry.file), sharedId]) {
|
|
930
|
+
const module = this.environment.moduleGraph.getModuleById(id);
|
|
931
|
+
if (!module)
|
|
932
|
+
continue;
|
|
933
|
+
this.environment.moduleGraph.invalidateModule(module, new Set(), timestamp, true);
|
|
934
|
+
affected.add(module);
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
return [...affected];
|
|
938
|
+
},
|
|
939
|
+
async load(id) {
|
|
940
|
+
if (!id.startsWith(prefix))
|
|
941
|
+
return;
|
|
942
|
+
const file = id === sharedId
|
|
943
|
+
? undefined
|
|
944
|
+
: decodeURIComponent(id.slice(prefix.length, -4));
|
|
945
|
+
const entry = file === undefined
|
|
946
|
+
? entries(this.environment).values().next().value
|
|
947
|
+
: entries(this.environment).get(file);
|
|
948
|
+
if (!entry)
|
|
949
|
+
throw new Error(`Unknown Zyzz stylesheet: ${file}`);
|
|
950
|
+
const output = await compile(entry, {
|
|
951
|
+
resolve: (source, importer) => this.resolve(source, importer),
|
|
952
|
+
watch: (file) => this.addWatchFile(file),
|
|
953
|
+
asset: async (file) => {
|
|
954
|
+
const reference = this.emitFile({
|
|
955
|
+
type: 'asset',
|
|
956
|
+
name: Path.basename(file).replace(/[?#%]/g, '_'),
|
|
957
|
+
source: await Fs.readFile(file),
|
|
958
|
+
});
|
|
959
|
+
// Vite's CSS asset placeholder preserves its configured base and output naming.
|
|
960
|
+
return `__VITE_ASSET__${reference}__`;
|
|
961
|
+
},
|
|
962
|
+
}, undefined, id === sharedId);
|
|
963
|
+
const transport = (css) => this.environment.config.command === 'build'
|
|
964
|
+
? AtRules.rename(AtRules.rename(Namespaces.protect(css), 'font-feature-values', '-zyzz-ffv-000000000'), 'font-palette-values', '-zyzz-fpv-000000000')
|
|
965
|
+
: css;
|
|
966
|
+
if (id === sharedId)
|
|
967
|
+
return {
|
|
968
|
+
code: transport(output.sharedCss),
|
|
969
|
+
map: JSON.stringify(output.sharedCssMap),
|
|
970
|
+
};
|
|
971
|
+
return { code: transport(output.css), map: JSON.stringify(output.cssMap) };
|
|
972
|
+
},
|
|
973
|
+
name: 'zyzz',
|
|
974
|
+
resolveId(id) {
|
|
975
|
+
if (id.startsWith(prefix))
|
|
976
|
+
return id;
|
|
977
|
+
},
|
|
978
|
+
async transform(code, id) {
|
|
979
|
+
id = normalize(id);
|
|
980
|
+
if (!eligible(id))
|
|
981
|
+
return;
|
|
982
|
+
const state = entries(this.environment);
|
|
983
|
+
let entry = state.get(id);
|
|
984
|
+
if (!entry) {
|
|
985
|
+
entry = {
|
|
986
|
+
compiler: Graph.create(),
|
|
987
|
+
environment: this.environment,
|
|
988
|
+
file: id,
|
|
989
|
+
files: new Set([id]),
|
|
990
|
+
};
|
|
991
|
+
state.set(id, entry);
|
|
992
|
+
}
|
|
993
|
+
const output = await compile(entry, {
|
|
994
|
+
resolve: (source, importer) => this.resolve(source, importer),
|
|
995
|
+
watch: (file) => this.addWatchFile(file),
|
|
996
|
+
asset: async (file) => {
|
|
997
|
+
const reference = this.emitFile({
|
|
998
|
+
type: 'asset',
|
|
999
|
+
name: Path.basename(file).replace(/[?#%]/g, '_'),
|
|
1000
|
+
source: await Fs.readFile(file),
|
|
1001
|
+
});
|
|
1002
|
+
// Vite's CSS asset placeholder preserves its configured base and output naming.
|
|
1003
|
+
return `__VITE_ASSET__${reference}__`;
|
|
1004
|
+
},
|
|
1005
|
+
}, code);
|
|
1006
|
+
if (native)
|
|
1007
|
+
return { code: output.code, map: JSON.stringify(output.map) };
|
|
1008
|
+
// Keep the CSS dependency even when the current graph has no live rules.
|
|
1009
|
+
// Later edits can introduce styles without changing this import boundary.
|
|
1010
|
+
const parsed = Parser.parseSync('source.tsx', output.code, {
|
|
1011
|
+
sourceType: 'module',
|
|
1012
|
+
});
|
|
1013
|
+
let offset = output.code.startsWith('#!')
|
|
1014
|
+
? output.code.indexOf('\n') + 1
|
|
1015
|
+
: 0;
|
|
1016
|
+
for (const node of parsed.program.body) {
|
|
1017
|
+
if (node.type !== 'ExpressionStatement' || !node.directive)
|
|
1018
|
+
break;
|
|
1019
|
+
offset = node.end;
|
|
1020
|
+
}
|
|
1021
|
+
const sharedImport = `\nimport ${JSON.stringify(sharedId)};\n`;
|
|
1022
|
+
const map = Mapping.fromMap(JSON.stringify(output.map));
|
|
1023
|
+
// The inserted dependency shifts only generated positions after the prologue.
|
|
1024
|
+
const before = output.code.slice(0, offset);
|
|
1025
|
+
const insertionLine = before.split('\n').length;
|
|
1026
|
+
const insertionColumn = before.length - (before.lastIndexOf('\n') + 1);
|
|
1027
|
+
const shifted = new Mapping.GenMapping();
|
|
1028
|
+
for (const mapping of Mapping.allMappings(map)) {
|
|
1029
|
+
const generated = { ...mapping.generated };
|
|
1030
|
+
if (generated.line > insertionLine ||
|
|
1031
|
+
(generated.line === insertionLine &&
|
|
1032
|
+
generated.column >= insertionColumn)) {
|
|
1033
|
+
if (generated.line === insertionLine)
|
|
1034
|
+
generated.column -= insertionColumn;
|
|
1035
|
+
generated.line += 2;
|
|
1036
|
+
}
|
|
1037
|
+
if (mapping.source !== undefined && mapping.original !== undefined) {
|
|
1038
|
+
const location = {
|
|
1039
|
+
generated,
|
|
1040
|
+
original: mapping.original,
|
|
1041
|
+
source: mapping.source,
|
|
1042
|
+
};
|
|
1043
|
+
if (mapping.name === undefined)
|
|
1044
|
+
Mapping.addMapping(shifted, location);
|
|
1045
|
+
else
|
|
1046
|
+
Mapping.addMapping(shifted, { ...location, name: mapping.name });
|
|
1047
|
+
}
|
|
1048
|
+
else
|
|
1049
|
+
Mapping.addMapping(shifted, { generated });
|
|
1050
|
+
}
|
|
1051
|
+
for (const [index, source] of output.map.sources.entries())
|
|
1052
|
+
if (source !== null)
|
|
1053
|
+
Mapping.setSourceContent(shifted, source, output.map.sourcesContent?.[index] ?? null);
|
|
1054
|
+
return {
|
|
1055
|
+
code: `${before}${sharedImport}${output.code.slice(offset)}\nimport ${JSON.stringify(cssId(id))};`,
|
|
1056
|
+
map: JSON.stringify(Mapping.toEncodedMap(shifted)),
|
|
1057
|
+
};
|
|
1058
|
+
},
|
|
1059
|
+
transformIndexHtml: {
|
|
1060
|
+
order: 'post',
|
|
1061
|
+
async handler(html, context) {
|
|
1062
|
+
if (native || options.script === false)
|
|
1063
|
+
return;
|
|
1064
|
+
// Development compiles the whole project on request and keeps the
|
|
1065
|
+
// catalogs the document's scripts reach; a build scopes them to the
|
|
1066
|
+
// source graphs its entry chunk bundles.
|
|
1067
|
+
const configurations = await (async () => {
|
|
1068
|
+
if (!context.server)
|
|
1069
|
+
return entryCatalogs(context.bundle, context.chunk);
|
|
1070
|
+
await initializations(context.server);
|
|
1071
|
+
const environment = context.server.environments.client;
|
|
1072
|
+
return await documentCatalogs(html, context.filename, (source, importer) => environment.pluginContainer.resolveId(source, importer));
|
|
1073
|
+
})();
|
|
1074
|
+
// Saved preferences apply before any other script or visible content.
|
|
1075
|
+
return Catalogs.scripts(configurations).map((children) => ({
|
|
1076
|
+
children,
|
|
1077
|
+
injectTo: 'head-prepend',
|
|
1078
|
+
tag: 'script',
|
|
1079
|
+
}));
|
|
1080
|
+
},
|
|
1081
|
+
},
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
const prefix = '\0zyzz:';
|
|
1085
|
+
const sharedId = `${prefix}shared.css`;
|
|
1086
|
+
function cssId(file) {
|
|
1087
|
+
return `${prefix}${encodeURIComponent(file)}.css`;
|
|
1088
|
+
}
|
|
1089
|
+
//# sourceMappingURL=index.js.map
|