zyzz 0.0.0 → 0.0.3
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 +170 -0
- package/dist/Style.d.ts.map +1 -0
- package/dist/Style.js +325 -0
- package/dist/Style.js.map +1 -0
- package/dist/Theme.d.ts +157 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +273 -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 +167 -0
- package/dist/compiler/Source.d.ts.map +1 -0
- package/dist/compiler/Source.js +1012 -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 +886 -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 +607 -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 +3225 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +547 -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 +50 -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/Typography.d.ts +23 -0
- package/dist/internal/Typography.d.ts.map +1 -0
- package/dist/internal/Typography.js +18 -0
- package/dist/internal/Typography.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 +691 -0
- package/src/Props.ts +8 -0
- package/src/Style.ts +812 -0
- package/src/Theme.ts +784 -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 +1579 -0
- package/src/compiler/Transform.ts +1241 -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 +860 -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 +1177 -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 +122 -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/Typography.ts +51 -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,114 @@
|
|
|
1
|
+
/** Connects Next.js configuration to the shared static compiler. @module */
|
|
2
|
+
import type { NextConfig } from 'next'
|
|
3
|
+
import * as Fs from 'node:fs'
|
|
4
|
+
import * as Module from 'node:module'
|
|
5
|
+
import * as Path from 'node:path'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Adds source transformation, CSS delivery, and project dependency watching to both bundlers.
|
|
9
|
+
* Preserves existing configuration hooks and creates `.zyzz/next` beneath the working directory.
|
|
10
|
+
* Throws file-system errors during setup; compilation errors are reported by the bundler.
|
|
11
|
+
*/
|
|
12
|
+
export function zyzz(config: NextConfig): NextConfig
|
|
13
|
+
export function zyzz(config: zyzz.Factory): zyzz.Factory
|
|
14
|
+
export function zyzz(config: Promise<NextConfig>): Promise<NextConfig>
|
|
15
|
+
export function zyzz(
|
|
16
|
+
config: NextConfig | zyzz.Factory | Promise<NextConfig>,
|
|
17
|
+
): NextConfig | zyzz.Factory | Promise<NextConfig> {
|
|
18
|
+
if (typeof config === 'function')
|
|
19
|
+
return async (phase, context) => zyzz(await config(phase, context))
|
|
20
|
+
if (config instanceof Promise) return config.then(zyzz)
|
|
21
|
+
|
|
22
|
+
const loader = Module.createRequire(import.meta.url).resolve(
|
|
23
|
+
'zyzz/next/loader',
|
|
24
|
+
)
|
|
25
|
+
const options = { root: process.cwd() }
|
|
26
|
+
const shared = Path.join(options.root, '.zyzz', 'next', 'shared.css')
|
|
27
|
+
Fs.mkdirSync(Path.dirname(shared), { recursive: true })
|
|
28
|
+
try {
|
|
29
|
+
Fs.writeFileSync(shared, '', { flag: 'wx' })
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error
|
|
32
|
+
}
|
|
33
|
+
const pattern = '*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}'
|
|
34
|
+
const existing = config.turbopack?.rules?.[pattern]
|
|
35
|
+
const rule = {
|
|
36
|
+
condition: {
|
|
37
|
+
all: [{ not: 'foreign' as const }, { not: { query: /zyzz-style/ } }],
|
|
38
|
+
},
|
|
39
|
+
loaders: [
|
|
40
|
+
{ loader, options: { ...options, bundler: 'turbopack', mode: 'source' } },
|
|
41
|
+
],
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
...config,
|
|
46
|
+
experimental: {
|
|
47
|
+
...config.experimental,
|
|
48
|
+
lightningCssFeatures: {
|
|
49
|
+
...config.experimental?.lightningCssFeatures,
|
|
50
|
+
exclude: [
|
|
51
|
+
...new Set([
|
|
52
|
+
...(config.experimental?.lightningCssFeatures?.exclude ?? []),
|
|
53
|
+
'light-dark' as const,
|
|
54
|
+
]),
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
turbopack: {
|
|
59
|
+
...config.turbopack,
|
|
60
|
+
rules: {
|
|
61
|
+
...config.turbopack?.rules,
|
|
62
|
+
[pattern]: [
|
|
63
|
+
...(Array.isArray(existing) ? existing : existing ? [existing] : []),
|
|
64
|
+
rule,
|
|
65
|
+
{
|
|
66
|
+
condition: { query: /zyzz-style/ },
|
|
67
|
+
loaders: [
|
|
68
|
+
{
|
|
69
|
+
loader,
|
|
70
|
+
options: { ...options, bundler: 'turbopack', mode: 'style' },
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
as: '*.css',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
'**/.zyzz/next/shared.css': {
|
|
77
|
+
loaders: [
|
|
78
|
+
{
|
|
79
|
+
loader,
|
|
80
|
+
options: { ...options, bundler: 'turbopack', mode: 'shared' },
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
webpack(value, context) {
|
|
87
|
+
const result = config.webpack?.(value, context) ?? value
|
|
88
|
+
result.module ??= {}
|
|
89
|
+
result.module.rules ??= []
|
|
90
|
+
result.module.rules.push({
|
|
91
|
+
enforce: 'pre',
|
|
92
|
+
exclude: /node_modules/,
|
|
93
|
+
include: options.root,
|
|
94
|
+
test: /\.[cm]?[jt]sx?$/,
|
|
95
|
+
use: [
|
|
96
|
+
{
|
|
97
|
+
loader,
|
|
98
|
+
options: { ...options, bundler: 'webpack', mode: 'source' },
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
})
|
|
102
|
+
return result
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Next.js configuration callback contracts. */
|
|
108
|
+
export declare namespace zyzz {
|
|
109
|
+
/** Receives the Next.js phase and defaults and returns application options. */
|
|
110
|
+
type Factory = (
|
|
111
|
+
phase: string,
|
|
112
|
+
context: { defaultConfig: NextConfig },
|
|
113
|
+
) => NextConfig | Promise<NextConfig>
|
|
114
|
+
}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/** Loads a physical source graph through Next.js resolution and emits cache-owned CSS. @module */
|
|
2
|
+
import * as Crypto from 'node:crypto'
|
|
3
|
+
import * as Fs from 'node:fs/promises'
|
|
4
|
+
import * as Path from 'node:path'
|
|
5
|
+
import * as Parser from 'oxc-parser'
|
|
6
|
+
import * as Graph from '../compiler/Graph.js'
|
|
7
|
+
import * as AtRules from '../compiler/internal/AtRules.js'
|
|
8
|
+
import * as Contract from '../compiler/internal/Contract.js'
|
|
9
|
+
|
|
10
|
+
type Context = {
|
|
11
|
+
addContextDependency(directory: string): void
|
|
12
|
+
addDependency(file: string): void
|
|
13
|
+
async(): (error: Error | null, code?: string, map?: object) => void
|
|
14
|
+
getOptions(): {
|
|
15
|
+
bundler: string
|
|
16
|
+
mode: 'shared' | 'source' | 'style'
|
|
17
|
+
root: string
|
|
18
|
+
}
|
|
19
|
+
getResolve(
|
|
20
|
+
options: object,
|
|
21
|
+
): (
|
|
22
|
+
directory: string,
|
|
23
|
+
specifier: string,
|
|
24
|
+
callback: (error: Error | null, file?: string | false) => void,
|
|
25
|
+
) => void
|
|
26
|
+
resourcePath: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Loader-runner boundary used by Webpack and Turbopack. */
|
|
30
|
+
export default function loader(this: Context, source: string): void {
|
|
31
|
+
const callback = this.async()
|
|
32
|
+
compile(this, source).then(
|
|
33
|
+
(result) => callback(null, result.code, result.map),
|
|
34
|
+
(error: unknown) =>
|
|
35
|
+
callback(error instanceof Error ? error : new Error(String(error))),
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function compile(context: Context, source: string) {
|
|
40
|
+
const options = context.getOptions()
|
|
41
|
+
const root = options.root
|
|
42
|
+
const directory = Path.resolve(root, '.zyzz', 'next')
|
|
43
|
+
const modules: Record<string, string> = Object.create(null)
|
|
44
|
+
const imports: Record<string, Record<string, string | null>> = Object.create(
|
|
45
|
+
null,
|
|
46
|
+
)
|
|
47
|
+
const contracts: Record<string, string> = Object.create(null)
|
|
48
|
+
const resolve = context.getResolve({})
|
|
49
|
+
const id = (file: string) =>
|
|
50
|
+
`app/${Path.relative(root, file).split(Path.sep).join('/')}`
|
|
51
|
+
const eligible = (file: string) =>
|
|
52
|
+
/\.[cm]?[jt]sx?$/.test(file) &&
|
|
53
|
+
!/\.(?:d|test|test-d|bench|bench-d)\.[cm]?[jt]sx?$/.test(file) &&
|
|
54
|
+
!Path.relative(root, file)
|
|
55
|
+
.split(Path.sep)
|
|
56
|
+
.some(
|
|
57
|
+
(part) =>
|
|
58
|
+
part === '..' || part === 'node_modules' || part.startsWith('.'),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if (options.mode !== 'shared' && !eligible(context.resourcePath))
|
|
62
|
+
return { code: source, map: undefined }
|
|
63
|
+
|
|
64
|
+
async function visit(file: string, text?: string): Promise<void> {
|
|
65
|
+
const name = id(file)
|
|
66
|
+
if (Object.hasOwn(modules, name)) return
|
|
67
|
+
|
|
68
|
+
context.addDependency(file)
|
|
69
|
+
modules[name] = text ?? (await Fs.readFile(file, 'utf8'))
|
|
70
|
+
const links: Record<string, string | null> = Object.create(null)
|
|
71
|
+
imports[name] = links
|
|
72
|
+
const parsed = Parser.parseSync(file, modules[name]!, {
|
|
73
|
+
sourceType: 'module',
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
for (const node of parsed.program.body) {
|
|
77
|
+
if (
|
|
78
|
+
(node.type !== 'ImportDeclaration' &&
|
|
79
|
+
node.type !== 'ExportNamedDeclaration' &&
|
|
80
|
+
node.type !== 'ExportAllDeclaration') ||
|
|
81
|
+
!node.source
|
|
82
|
+
)
|
|
83
|
+
continue
|
|
84
|
+
if (
|
|
85
|
+
node.type === 'ImportDeclaration'
|
|
86
|
+
? node.importKind === 'type'
|
|
87
|
+
: node.exportKind === 'type'
|
|
88
|
+
)
|
|
89
|
+
continue
|
|
90
|
+
|
|
91
|
+
const specifier = node.source.value
|
|
92
|
+
links[specifier] = null
|
|
93
|
+
if (
|
|
94
|
+
specifier === 'zyzz' ||
|
|
95
|
+
(specifier.startsWith('zyzz/') &&
|
|
96
|
+
specifier !== 'zyzz/default') ||
|
|
97
|
+
specifier.startsWith('node:')
|
|
98
|
+
)
|
|
99
|
+
continue
|
|
100
|
+
|
|
101
|
+
const resolved = await new Promise<string | false | undefined>(
|
|
102
|
+
(accept, reject) => {
|
|
103
|
+
resolve(Path.dirname(file), specifier, (error, value) =>
|
|
104
|
+
error ? reject(error) : accept(value),
|
|
105
|
+
)
|
|
106
|
+
},
|
|
107
|
+
)
|
|
108
|
+
if (!resolved || !/\.[cm]?[jt]sx?$/.test(resolved)) continue
|
|
109
|
+
if (eligible(resolved)) {
|
|
110
|
+
links[specifier] = id(resolved)
|
|
111
|
+
await visit(resolved)
|
|
112
|
+
continue
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const sidecar = `${resolved}.zyzz.json`
|
|
116
|
+
try {
|
|
117
|
+
contracts[resolved] = await Fs.readFile(sidecar, 'utf8')
|
|
118
|
+
context.addDependency(sidecar)
|
|
119
|
+
links[specifier] = resolved
|
|
120
|
+
} catch (error) {
|
|
121
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async function discover(directory: string): Promise<void> {
|
|
127
|
+
const items = await Fs.readdir(directory, { withFileTypes: true })
|
|
128
|
+
|
|
129
|
+
// Recursive tracking of a package root follows every installed dependency.
|
|
130
|
+
// A dependency symlink back to an ancestor, as a package linked from its
|
|
131
|
+
// own repository, is rejected as a loop, so such a root is tracked through
|
|
132
|
+
// its files and subdirectories instead.
|
|
133
|
+
if (
|
|
134
|
+
!items.some((item) => item.name === 'node_modules') ||
|
|
135
|
+
!(await loops(directory))
|
|
136
|
+
)
|
|
137
|
+
context.addContextDependency(directory)
|
|
138
|
+
|
|
139
|
+
for (const item of items) {
|
|
140
|
+
if (
|
|
141
|
+
item.name.startsWith('.') ||
|
|
142
|
+
[
|
|
143
|
+
'node_modules',
|
|
144
|
+
'dist',
|
|
145
|
+
'build',
|
|
146
|
+
'coverage',
|
|
147
|
+
'test',
|
|
148
|
+
'tests',
|
|
149
|
+
'__tests__',
|
|
150
|
+
].includes(item.name)
|
|
151
|
+
)
|
|
152
|
+
continue
|
|
153
|
+
const file = Path.join(directory, item.name)
|
|
154
|
+
if (item.isDirectory()) await discover(file)
|
|
155
|
+
else if (item.isFile() && eligible(file)) await visit(file)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (options.mode !== 'shared') await visit(context.resourcePath, source)
|
|
160
|
+
await discover(root)
|
|
161
|
+
const loaded = new Set<string>()
|
|
162
|
+
async function dependencies(file: string): Promise<void> {
|
|
163
|
+
if (loaded.has(file)) return
|
|
164
|
+
loaded.add(file)
|
|
165
|
+
|
|
166
|
+
const metadata = Contract.read(contracts[file]!, new Map(), file)
|
|
167
|
+
for (const section of metadata.stylesheets) {
|
|
168
|
+
let owner = file
|
|
169
|
+
for (const specifier of section.dependency ?? []) {
|
|
170
|
+
const target = await new Promise<string | false | undefined>(
|
|
171
|
+
(accept, reject) => {
|
|
172
|
+
resolve(Path.dirname(owner), specifier, (error, value) =>
|
|
173
|
+
error ? reject(error) : accept(value),
|
|
174
|
+
)
|
|
175
|
+
},
|
|
176
|
+
)
|
|
177
|
+
if (!target || !Path.isAbsolute(target))
|
|
178
|
+
throw new Error('Unable to resolve packed stylesheet dependency.')
|
|
179
|
+
|
|
180
|
+
const links = (imports[owner] ??= Object.create(null))
|
|
181
|
+
links[specifier] = target
|
|
182
|
+
if (!Object.hasOwn(contracts, target)) {
|
|
183
|
+
const sidecar = `${target}.zyzz.json`
|
|
184
|
+
contracts[target] = await Fs.readFile(sidecar, 'utf8')
|
|
185
|
+
context.addDependency(sidecar)
|
|
186
|
+
}
|
|
187
|
+
await dependencies(target)
|
|
188
|
+
owner = target
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const file of Object.keys(contracts)) await dependencies(file)
|
|
193
|
+
|
|
194
|
+
const graph = Graph.compile({ contracts, imports, modules })
|
|
195
|
+
const output = graph.modules[id(context.resourcePath)]
|
|
196
|
+
|
|
197
|
+
const assets = new Map<string, string>()
|
|
198
|
+
for (const [placeholder, target] of Object.entries(
|
|
199
|
+
graph.sharedAssets ?? {},
|
|
200
|
+
)) {
|
|
201
|
+
const raw = target.split(/[?#]/)[0]!
|
|
202
|
+
const file = await Fs.realpath(
|
|
203
|
+
target.startsWith('app/')
|
|
204
|
+
? Path.join(root, decodeURIComponent(raw.slice(4)))
|
|
205
|
+
: decodeURIComponent(raw),
|
|
206
|
+
)
|
|
207
|
+
const identity = graph.sharedAssetOwners?.[placeholder]
|
|
208
|
+
let owner = root
|
|
209
|
+
if (identity && Path.isAbsolute(identity)) {
|
|
210
|
+
owner = Path.dirname(identity)
|
|
211
|
+
for (;;) {
|
|
212
|
+
try {
|
|
213
|
+
await Fs.access(Path.join(owner, 'package.json'))
|
|
214
|
+
break
|
|
215
|
+
} catch (error) {
|
|
216
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error
|
|
217
|
+
const parent = Path.dirname(owner)
|
|
218
|
+
if (parent === owner)
|
|
219
|
+
throw new Error('Packed assets require an owning package.json.')
|
|
220
|
+
owner = parent
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const relative = Path.relative(await Fs.realpath(owner), file)
|
|
226
|
+
if (
|
|
227
|
+
!identity ||
|
|
228
|
+
relative === '..' ||
|
|
229
|
+
relative.startsWith(`..${Path.sep}`) ||
|
|
230
|
+
Path.isAbsolute(relative)
|
|
231
|
+
)
|
|
232
|
+
throw new Error('Asset path escapes its owning package.')
|
|
233
|
+
|
|
234
|
+
context.addDependency(file)
|
|
235
|
+
assets.set(
|
|
236
|
+
placeholder,
|
|
237
|
+
Path.relative(
|
|
238
|
+
options.bundler === 'turbopack'
|
|
239
|
+
? Path.dirname(context.resourcePath)
|
|
240
|
+
: directory,
|
|
241
|
+
file,
|
|
242
|
+
)
|
|
243
|
+
.split(Path.sep)
|
|
244
|
+
.map(encodeURIComponent)
|
|
245
|
+
.join('/') + target.slice(raw.length),
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const shared = graph.sharedCss
|
|
250
|
+
? AtRules.transform({
|
|
251
|
+
code: Buffer.from(graph.sharedCss),
|
|
252
|
+
filename: 'shared.css',
|
|
253
|
+
inputSourceMap: JSON.stringify(graph.sharedCssMap),
|
|
254
|
+
sourceMap: true,
|
|
255
|
+
visitor: {
|
|
256
|
+
Url: (url) =>
|
|
257
|
+
assets.has(url.url)
|
|
258
|
+
? { ...url, url: assets.get(url.url)! }
|
|
259
|
+
: undefined,
|
|
260
|
+
},
|
|
261
|
+
})
|
|
262
|
+
: undefined
|
|
263
|
+
if (options.mode === 'shared')
|
|
264
|
+
return {
|
|
265
|
+
code: shared?.code.toString() ?? '',
|
|
266
|
+
map: shared?.map
|
|
267
|
+
? (JSON.parse(shared.map.toString()) as object)
|
|
268
|
+
: undefined,
|
|
269
|
+
}
|
|
270
|
+
if (!output) throw new Error('Missing Next.js source compilation.')
|
|
271
|
+
// Bundlers resolve map sources relative to the loader resource, not graph identities.
|
|
272
|
+
const sources = (names: readonly (string | null)[]) =>
|
|
273
|
+
names.map((name) =>
|
|
274
|
+
name?.startsWith('app/') ? Path.resolve(root, name.slice(4)) : name,
|
|
275
|
+
)
|
|
276
|
+
const map = {
|
|
277
|
+
...output.map,
|
|
278
|
+
file: context.resourcePath,
|
|
279
|
+
sources: sources(output.map.sources),
|
|
280
|
+
}
|
|
281
|
+
const cssMap = { ...output.cssMap, sources: sources(output.cssMap.sources) }
|
|
282
|
+
if (options.mode === 'style') return { code: output.css, map: cssMap }
|
|
283
|
+
|
|
284
|
+
if (options.bundler === 'turbopack') {
|
|
285
|
+
const sharedFile = Path.relative(
|
|
286
|
+
Path.dirname(context.resourcePath),
|
|
287
|
+
Path.join(directory, 'shared.css'),
|
|
288
|
+
)
|
|
289
|
+
.split(Path.sep)
|
|
290
|
+
.join('/')
|
|
291
|
+
const requests = [
|
|
292
|
+
...(graph.sharedCss
|
|
293
|
+
? [
|
|
294
|
+
`import ${JSON.stringify(sharedFile.startsWith('.') ? sharedFile : `./${sharedFile}`)};`,
|
|
295
|
+
]
|
|
296
|
+
: []),
|
|
297
|
+
...(output.css
|
|
298
|
+
? [
|
|
299
|
+
`import ${JSON.stringify(`./${Path.basename(context.resourcePath)}?zyzz-style`)};`,
|
|
300
|
+
]
|
|
301
|
+
: []),
|
|
302
|
+
]
|
|
303
|
+
return { code: `${output.code}\n${requests.join('\n')}`, map }
|
|
304
|
+
}
|
|
305
|
+
const styles = [
|
|
306
|
+
{ css: shared?.code.toString(), map: shared?.map?.toString() },
|
|
307
|
+
{ css: output.css, map: JSON.stringify(cssMap) },
|
|
308
|
+
]
|
|
309
|
+
const requests: string[] = []
|
|
310
|
+
await Fs.mkdir(directory, { recursive: true })
|
|
311
|
+
for (const stylesheet of styles) {
|
|
312
|
+
if (!stylesheet.css) continue
|
|
313
|
+
const css =
|
|
314
|
+
stylesheet.css +
|
|
315
|
+
(stylesheet.map
|
|
316
|
+
? `\n/*# sourceMappingURL=data:application/json;base64,${Buffer.from(stylesheet.map).toString('base64')} */`
|
|
317
|
+
: '')
|
|
318
|
+
const hash = Crypto.createHash('sha256').update(css).digest('hex')
|
|
319
|
+
const file = Path.join(directory, `${hash}.css`)
|
|
320
|
+
try {
|
|
321
|
+
await Fs.writeFile(file, css, { flag: 'wx' })
|
|
322
|
+
} catch (error) {
|
|
323
|
+
if ((error as NodeJS.ErrnoException).code !== 'EEXIST') throw error
|
|
324
|
+
}
|
|
325
|
+
const relative = Path.relative(Path.dirname(context.resourcePath), file)
|
|
326
|
+
.split(Path.sep)
|
|
327
|
+
.join('/')
|
|
328
|
+
requests.push(
|
|
329
|
+
`import ${JSON.stringify(relative.startsWith('.') ? relative : `./${relative}`)};`,
|
|
330
|
+
)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return { code: `${output.code}\n${requests.join('\n')}`, map }
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** Whether an installed dependency links back to the directory or one of its ancestors. */
|
|
337
|
+
async function loops(directory: string): Promise<boolean> {
|
|
338
|
+
const installed = Path.join(directory, 'node_modules')
|
|
339
|
+
const entries = await Fs.readdir(installed, { withFileTypes: true }).catch(
|
|
340
|
+
() => [],
|
|
341
|
+
)
|
|
342
|
+
const candidates = (
|
|
343
|
+
await Promise.all(
|
|
344
|
+
entries.map(async (entry) => {
|
|
345
|
+
if (!entry.name.startsWith('@'))
|
|
346
|
+
return [Path.join(installed, entry.name)]
|
|
347
|
+
|
|
348
|
+
const scoped = Path.join(installed, entry.name)
|
|
349
|
+
|
|
350
|
+
return (await Fs.readdir(scoped).catch(() => [])).map((name) =>
|
|
351
|
+
Path.join(scoped, name),
|
|
352
|
+
)
|
|
353
|
+
}),
|
|
354
|
+
)
|
|
355
|
+
).flat()
|
|
356
|
+
|
|
357
|
+
for (const candidate of candidates) {
|
|
358
|
+
const stat = await Fs.lstat(candidate).catch(() => undefined)
|
|
359
|
+
if (!stat?.isSymbolicLink()) continue
|
|
360
|
+
|
|
361
|
+
const target = await Fs.realpath(candidate).catch(() => undefined)
|
|
362
|
+
if (target === undefined) continue
|
|
363
|
+
|
|
364
|
+
const relative = Path.relative(target, directory)
|
|
365
|
+
if (!relative.startsWith('..') && !Path.isAbsolute(relative)) return true
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return false
|
|
369
|
+
}
|