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,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes declaration fallbacks and separates importance from scalar values.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import type * as Binding from './Binding.js'
|
|
6
|
+
import type * as FunctionValue from './FunctionValue.js'
|
|
7
|
+
import type * as RuleReference from './RuleReference.js'
|
|
8
|
+
import type * as Grid from './Grid.js'
|
|
9
|
+
import * as Lexical from './Lexical.js'
|
|
10
|
+
import * as Literal from './Literal.js'
|
|
11
|
+
import type * as Numeric from './Numeric.js'
|
|
12
|
+
import * as Token from './Token.js'
|
|
13
|
+
|
|
14
|
+
/** Scalar declarations optionally carrying a trailing importance marker. */
|
|
15
|
+
export type Atom<value> =
|
|
16
|
+
| value
|
|
17
|
+
| `${Extract<value, string | number>} !important`
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Accepts canonical and case-insensitive CSS literals without folding token names or emitted data.
|
|
21
|
+
* Checks authored properties and retains validated input types to avoid expanding whole-property fallback unions.
|
|
22
|
+
*/
|
|
23
|
+
export type Accepted<style, properties> = {
|
|
24
|
+
[property in keyof style]: property extends keyof properties
|
|
25
|
+
? style[property] extends Binding.Reference
|
|
26
|
+
? Binding.Reference<style[property]['type']> extends Exclude<
|
|
27
|
+
properties[property],
|
|
28
|
+
undefined
|
|
29
|
+
>
|
|
30
|
+
? style[property]
|
|
31
|
+
: never
|
|
32
|
+
: FunctionValue.Is<style[property]> extends true
|
|
33
|
+
? FunctionValue.Accepted<
|
|
34
|
+
style[property],
|
|
35
|
+
Exclude<properties[property], undefined>,
|
|
36
|
+
property
|
|
37
|
+
>
|
|
38
|
+
: Exclude<style[property], undefined> extends Exclude<
|
|
39
|
+
properties[property],
|
|
40
|
+
undefined
|
|
41
|
+
>
|
|
42
|
+
? Exclude<style[property], undefined>
|
|
43
|
+
: property extends keyof Literal.Properties
|
|
44
|
+
? style[property] extends string | readonly (number | string)[]
|
|
45
|
+
? Fold<style[property]> extends Input<
|
|
46
|
+
| Lowercase<Extract<Literal.Properties[property], string>>
|
|
47
|
+
| Extract<Literal.Properties[property], number>
|
|
48
|
+
>
|
|
49
|
+
? style[property]
|
|
50
|
+
: Exclude<properties[property], undefined>
|
|
51
|
+
: Exclude<properties[property], undefined>
|
|
52
|
+
: Exclude<properties[property], undefined>
|
|
53
|
+
: never
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type Fold<value> = value extends string
|
|
57
|
+
? Lexical.Fold<Canonical<Spaces<Normalized<Lexical.Normalized<value>>>>>
|
|
58
|
+
: value extends readonly unknown[]
|
|
59
|
+
? { [key in keyof value]: Fold<value[key]> }
|
|
60
|
+
: value
|
|
61
|
+
|
|
62
|
+
/** Refines concrete scalar spellings; already-broad property contracts need no literal refinement. */
|
|
63
|
+
export type Checked<style, tokens = {}> = {
|
|
64
|
+
[property in keyof style]: style[property] extends string & Binding.Reference
|
|
65
|
+
? style[property] extends Binding.Reference<'*'>
|
|
66
|
+
? unknown
|
|
67
|
+
: Checked<
|
|
68
|
+
{ [key in property]: Binding.Reference<style[property]['type']> },
|
|
69
|
+
tokens
|
|
70
|
+
>[property]
|
|
71
|
+
: Literal.Properties extends style
|
|
72
|
+
? unknown
|
|
73
|
+
: Importance<style[property]> &
|
|
74
|
+
RuleReference.Check<style[property], property> &
|
|
75
|
+
(property extends keyof typeof Literal.rules
|
|
76
|
+
? style[property] extends (property extends
|
|
77
|
+
| 'gridArea'
|
|
78
|
+
| 'gridColumn'
|
|
79
|
+
| 'gridColumnEnd'
|
|
80
|
+
| 'gridColumnStart'
|
|
81
|
+
| 'gridRow'
|
|
82
|
+
| 'gridRowEnd'
|
|
83
|
+
| 'gridRowStart'
|
|
84
|
+
? Fold<style[property]> extends Grid.Checked<
|
|
85
|
+
Fold<style[property]>,
|
|
86
|
+
property extends 'gridArea'
|
|
87
|
+
? 4
|
|
88
|
+
: property extends 'gridColumn' | 'gridRow'
|
|
89
|
+
? 2
|
|
90
|
+
: 1
|
|
91
|
+
>
|
|
92
|
+
? unknown
|
|
93
|
+
: never
|
|
94
|
+
: unknown) &
|
|
95
|
+
Check<
|
|
96
|
+
style[property],
|
|
97
|
+
Token.Names<tokens, property>,
|
|
98
|
+
(typeof Literal.rules)[property]
|
|
99
|
+
>
|
|
100
|
+
? unknown
|
|
101
|
+
: never
|
|
102
|
+
: unknown)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type Importance<value> = value extends readonly unknown[]
|
|
106
|
+
? { [key in keyof value]: Importance<value[key]> }
|
|
107
|
+
: value extends `${infer body}!${infer suffix}`
|
|
108
|
+
? body extends `${string}\\`
|
|
109
|
+
? unknown
|
|
110
|
+
: Lowercase<TrimStart<Trim<Lexical.Normalized<suffix>>>> extends
|
|
111
|
+
| ''
|
|
112
|
+
| 'important'
|
|
113
|
+
? value extends `${string} !important`
|
|
114
|
+
? unknown
|
|
115
|
+
: never
|
|
116
|
+
: unknown
|
|
117
|
+
: unknown
|
|
118
|
+
|
|
119
|
+
type Check<input, names, rule> =
|
|
120
|
+
FunctionValue.Is<input> extends true
|
|
121
|
+
? input
|
|
122
|
+
: input extends readonly unknown[]
|
|
123
|
+
? { [key in keyof input]: Check<input[key], names, rule> }
|
|
124
|
+
: input extends names
|
|
125
|
+
? input
|
|
126
|
+
: input extends string
|
|
127
|
+
? Plain<input> extends names
|
|
128
|
+
? input
|
|
129
|
+
: Literal.Checked<
|
|
130
|
+
Lexical.Fold<Plain<Normalized<Lexical.Normalized<input>>>>
|
|
131
|
+
> extends never
|
|
132
|
+
? never
|
|
133
|
+
: Scalar<
|
|
134
|
+
Lexical.Fold<Plain<Normalized<Lexical.Normalized<input>>>>,
|
|
135
|
+
rule
|
|
136
|
+
> extends never
|
|
137
|
+
? never
|
|
138
|
+
: input
|
|
139
|
+
: Scalar<input, rule>
|
|
140
|
+
|
|
141
|
+
type Scalar<input, rule> = number extends input
|
|
142
|
+
? input
|
|
143
|
+
: input extends number | `${number}`
|
|
144
|
+
? Numeric.Checked<
|
|
145
|
+
input,
|
|
146
|
+
rule extends { integer: true } ? true : false
|
|
147
|
+
> extends never
|
|
148
|
+
? never
|
|
149
|
+
: Range<input, rule>
|
|
150
|
+
: input extends `${infer amount}${Literal.Unit | 'ms' | 's'}`
|
|
151
|
+
? Range<amount, rule> extends never
|
|
152
|
+
? never
|
|
153
|
+
: input
|
|
154
|
+
: input
|
|
155
|
+
|
|
156
|
+
type Range<input, rule> = rule extends
|
|
157
|
+
| { kind: 'number' | 'percentage'; min: 0 | 1 }
|
|
158
|
+
| { negative: false }
|
|
159
|
+
? input extends number | string
|
|
160
|
+
? `${input}` extends `-${string}`
|
|
161
|
+
? Numeric.Zero<input> extends true
|
|
162
|
+
? rule extends { kind: 'number'; min: 1 }
|
|
163
|
+
? never
|
|
164
|
+
: input
|
|
165
|
+
: never
|
|
166
|
+
: rule extends { kind: 'number'; min: 1 }
|
|
167
|
+
? Numeric.Zero<input> extends true
|
|
168
|
+
? never
|
|
169
|
+
: input
|
|
170
|
+
: input
|
|
171
|
+
: input
|
|
172
|
+
: input
|
|
173
|
+
|
|
174
|
+
type Canonical<value extends string> = value extends `${infer body}!important`
|
|
175
|
+
? `${Zeros<body>}!important`
|
|
176
|
+
: Zeros<value>
|
|
177
|
+
|
|
178
|
+
type Zeros<value extends string> =
|
|
179
|
+
value extends `${infer before} ${infer after}`
|
|
180
|
+
? `${Zeros<before>} ${Zeros<after>}`
|
|
181
|
+
: value extends `${infer before}/${infer after}`
|
|
182
|
+
? `${Zeros<before>}/${Zeros<after>}`
|
|
183
|
+
: value extends `${infer before},${infer after}`
|
|
184
|
+
? `${Zeros<before>},${Zeros<after>}`
|
|
185
|
+
: Zero<value>
|
|
186
|
+
|
|
187
|
+
type Zero<value extends string> = [Numeric.Checked<value>] extends [never]
|
|
188
|
+
? value
|
|
189
|
+
: Numeric.Zero<value> extends true
|
|
190
|
+
? '0'
|
|
191
|
+
: value
|
|
192
|
+
|
|
193
|
+
type Replace<
|
|
194
|
+
value extends string,
|
|
195
|
+
character extends string,
|
|
196
|
+
output extends string = '',
|
|
197
|
+
> = value extends `${infer before}${character}${infer after}`
|
|
198
|
+
? Replace<after, character, `${output}${before} `>
|
|
199
|
+
: `${output}${value}`
|
|
200
|
+
|
|
201
|
+
type Collapse<value extends string> =
|
|
202
|
+
value extends `${infer before} ${infer after}`
|
|
203
|
+
? Collapse<`${before} ${after}`>
|
|
204
|
+
: value
|
|
205
|
+
|
|
206
|
+
type Spaces<value extends string> = Collapse<
|
|
207
|
+
Replace<Replace<Replace<Replace<value, '\t'>, '\r'>, '\n'>, '\f'>
|
|
208
|
+
>
|
|
209
|
+
|
|
210
|
+
type Normalized<value extends string> =
|
|
211
|
+
TrimStart<Trim<value>> extends infer text extends string
|
|
212
|
+
? text extends `${infer body}!${infer suffix}`
|
|
213
|
+
? Lowercase<TrimStart<Trim<suffix>>> extends '' | 'important'
|
|
214
|
+
? `${Trim<body>} !important`
|
|
215
|
+
: `${body}!${Normalized<suffix>}`
|
|
216
|
+
: text
|
|
217
|
+
: never
|
|
218
|
+
|
|
219
|
+
type TrimStart<value extends string> =
|
|
220
|
+
value extends `${' ' | '\n' | '\r' | '\t' | '\f'}${infer body}`
|
|
221
|
+
? TrimStart<body>
|
|
222
|
+
: value
|
|
223
|
+
|
|
224
|
+
type Plain<value extends string> = value extends `${infer body}!${infer suffix}`
|
|
225
|
+
? Lowercase<suffix> extends '' | 'important'
|
|
226
|
+
? Trim<body>
|
|
227
|
+
: `${body}!${Plain<suffix>}`
|
|
228
|
+
: value
|
|
229
|
+
|
|
230
|
+
type Trim<value extends string> =
|
|
231
|
+
value extends `${infer body}${' ' | '\n' | '\r' | '\t' | '\f'}`
|
|
232
|
+
? Trim<body>
|
|
233
|
+
: value
|
|
234
|
+
|
|
235
|
+
/** One atom or a nonempty ordered sequence of declaration fallback atoms. */
|
|
236
|
+
export type Fallbacks<atom> = atom | readonly [atom, ...atom[]]
|
|
237
|
+
|
|
238
|
+
/** One declaration or a nonempty ordered sequence of declaration fallbacks. */
|
|
239
|
+
export type Input<value> = Fallbacks<Atom<Exclude<value, undefined>>>
|
|
240
|
+
|
|
241
|
+
/** Splits a trailing importance marker without interpreting quoted or escaped text. */
|
|
242
|
+
export function parse(
|
|
243
|
+
input: unknown,
|
|
244
|
+
property: keyof Literal.Properties,
|
|
245
|
+
):
|
|
246
|
+
| { invalid: true }
|
|
247
|
+
| { important: boolean; value: number | string | Token.Expression }
|
|
248
|
+
| undefined {
|
|
249
|
+
if (Token.isExpression(input)) {
|
|
250
|
+
const text = input.parts
|
|
251
|
+
.map((part) => (typeof part === 'string' ? part : 'var(--z)'))
|
|
252
|
+
.join('')
|
|
253
|
+
const parsed = parse(text, property)
|
|
254
|
+
if (!parsed || 'invalid' in parsed) return parsed
|
|
255
|
+
if (typeof parsed.value === 'object') return undefined
|
|
256
|
+
|
|
257
|
+
const parts = [...input.parts]
|
|
258
|
+
let remaining = text.length - String(parsed.value).length
|
|
259
|
+
|
|
260
|
+
for (let index = parts.length - 1; remaining > 0 && index >= 0; index--) {
|
|
261
|
+
const part = parts[index]
|
|
262
|
+
if (typeof part !== 'string') return undefined
|
|
263
|
+
|
|
264
|
+
const count = Math.min(remaining, part.length)
|
|
265
|
+
|
|
266
|
+
parts[index] = part.slice(0, part.length - count)
|
|
267
|
+
remaining -= count
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return { important: parsed.important, value: Token.compose(parts) }
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (typeof input !== 'string') return undefined
|
|
274
|
+
|
|
275
|
+
const valueText = input
|
|
276
|
+
|
|
277
|
+
function escaped(index: number): boolean {
|
|
278
|
+
let count = 0
|
|
279
|
+
|
|
280
|
+
while (index > 0 && valueText[index - 1] === '\\') {
|
|
281
|
+
count++
|
|
282
|
+
index--
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return count % 2 === 1
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
let marker = input.lastIndexOf('!')
|
|
289
|
+
|
|
290
|
+
while (marker >= 0) {
|
|
291
|
+
const suffix = Lexical.normalize(input.slice(marker + 1)).replace(
|
|
292
|
+
/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g,
|
|
293
|
+
'',
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
if (!escaped(marker) && (suffix === '' || suffix === 'important')) break
|
|
297
|
+
|
|
298
|
+
marker = marker === 0 ? -1 : input.lastIndexOf('!', marker - 1)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (marker < 0) return undefined
|
|
302
|
+
if (input.slice(marker - 1) !== ' !important' || escaped(marker - 1))
|
|
303
|
+
return { invalid: true }
|
|
304
|
+
|
|
305
|
+
let end = marker
|
|
306
|
+
|
|
307
|
+
while (end > 0 && /[ \t\n\r\f]/.test(input[end - 1]!) && !escaped(end - 1))
|
|
308
|
+
end--
|
|
309
|
+
|
|
310
|
+
const text = input.slice(0, end)
|
|
311
|
+
const numeric =
|
|
312
|
+
Literal.rule(property)?.kind === 'number' ||
|
|
313
|
+
Literal.rule(property)?.kind === 'grid-line'
|
|
314
|
+
const value =
|
|
315
|
+
numeric && /^[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]?\d+)?$/.test(text)
|
|
316
|
+
? Number(text)
|
|
317
|
+
: text
|
|
318
|
+
|
|
319
|
+
return { important: true as const, value }
|
|
320
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Reads a closed local source graph for native authoring without evaluating modules. @module */
|
|
2
|
+
import * as Fs from 'node:fs'
|
|
3
|
+
import * as Path from 'node:path'
|
|
4
|
+
import * as Parser from 'oxc-parser'
|
|
5
|
+
import type * as Graph from '../compiler/Graph.js'
|
|
6
|
+
|
|
7
|
+
/** Collects relative source imports; package and asset imports remain owned by Metro. */
|
|
8
|
+
export function read(
|
|
9
|
+
filename: string,
|
|
10
|
+
source: string,
|
|
11
|
+
platform: string,
|
|
12
|
+
root: string,
|
|
13
|
+
) {
|
|
14
|
+
const files = new Set<string>()
|
|
15
|
+
const modules: Record<string, string> = Object.create(null)
|
|
16
|
+
const imports: Record<string, Record<string, string | null>> = Object.create(
|
|
17
|
+
null,
|
|
18
|
+
)
|
|
19
|
+
function identity(filename: string) {
|
|
20
|
+
const relative = Path.relative(root, filename).split(Path.sep).join('/')
|
|
21
|
+
if (relative.startsWith('../'))
|
|
22
|
+
throw new Error(
|
|
23
|
+
`Native authoring must be inside Metro's project root: ${filename}`,
|
|
24
|
+
)
|
|
25
|
+
return relative
|
|
26
|
+
}
|
|
27
|
+
function visit(filename: string, source: string) {
|
|
28
|
+
files.add(filename)
|
|
29
|
+
const id = identity(filename)
|
|
30
|
+
if (Object.hasOwn(modules, id)) return
|
|
31
|
+
modules[id] = source
|
|
32
|
+
const resolved: Record<string, string | null> = Object.create(null)
|
|
33
|
+
imports[id] = resolved
|
|
34
|
+
for (const statement of Parser.parseSync(filename, source).program.body) {
|
|
35
|
+
if (
|
|
36
|
+
!('source' in statement) ||
|
|
37
|
+
!statement.source ||
|
|
38
|
+
typeof statement.source !== 'object' ||
|
|
39
|
+
!('value' in statement.source) ||
|
|
40
|
+
typeof statement.source.value !== 'string'
|
|
41
|
+
)
|
|
42
|
+
continue
|
|
43
|
+
const specifier = statement.source.value
|
|
44
|
+
resolved[specifier] = null
|
|
45
|
+
if (!specifier.startsWith('.')) continue
|
|
46
|
+
const base = Path.resolve(Path.dirname(filename), specifier)
|
|
47
|
+
const stem = base.replace(/\.[cm]?jsx?$/, '')
|
|
48
|
+
const candidates = [
|
|
49
|
+
...['.ts', '.tsx', '.js', '.jsx'].flatMap((extension) => [
|
|
50
|
+
`${stem}.${platform}${extension}`,
|
|
51
|
+
`${stem}.native${extension}`,
|
|
52
|
+
`${stem}${extension}`,
|
|
53
|
+
]),
|
|
54
|
+
base,
|
|
55
|
+
...['.ts', '.tsx', '.js', '.jsx'].map((extension) =>
|
|
56
|
+
Path.join(base, `index${extension}`),
|
|
57
|
+
),
|
|
58
|
+
]
|
|
59
|
+
for (const candidate of candidates) files.add(candidate)
|
|
60
|
+
const target = candidates.find(
|
|
61
|
+
(path) => Fs.existsSync(path) && Fs.statSync(path).isFile(),
|
|
62
|
+
)
|
|
63
|
+
if (!target || !/\.[cm]?[jt]sx?$/.test(target)) continue
|
|
64
|
+
resolved[specifier] = identity(target)
|
|
65
|
+
visit(target, Fs.readFileSync(target, 'utf8'))
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
visit(filename, source)
|
|
69
|
+
return {
|
|
70
|
+
moduleId: identity(filename),
|
|
71
|
+
modules,
|
|
72
|
+
imports,
|
|
73
|
+
files: [...files],
|
|
74
|
+
} satisfies Pick<Graph.compile.Options, 'modules' | 'imports'> & {
|
|
75
|
+
moduleId: string
|
|
76
|
+
files: readonly string[]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Keeps Metro's transform cache and delta graph aligned with imported authoring. @module */
|
|
2
|
+
import * as Crypto from 'node:crypto'
|
|
3
|
+
import * as Fs from 'node:fs'
|
|
4
|
+
import * as Path from 'node:path'
|
|
5
|
+
import type { EventEmitter } from 'node:events'
|
|
6
|
+
import * as Graph from './Graph.js'
|
|
7
|
+
|
|
8
|
+
type Options = {
|
|
9
|
+
readonly platform?: string
|
|
10
|
+
readonly customTransformOptions?: Readonly<Record<string, unknown>>
|
|
11
|
+
}
|
|
12
|
+
type Bundler = {
|
|
13
|
+
getDependencyGraph(): Promise<{ getWatcher(): EventEmitter }>
|
|
14
|
+
transformFile(
|
|
15
|
+
filename: string,
|
|
16
|
+
options: Options,
|
|
17
|
+
buffer?: Buffer,
|
|
18
|
+
): Promise<unknown>
|
|
19
|
+
}
|
|
20
|
+
/** Metro server methods used by its own serializers and development middleware. */
|
|
21
|
+
export type Server = { getBundler(): { getBundler(): Bundler } }
|
|
22
|
+
type Changes = {
|
|
23
|
+
rootDir: string
|
|
24
|
+
changes: {
|
|
25
|
+
addedFiles: Iterable<readonly [string, unknown]>
|
|
26
|
+
modifiedFiles: Iterable<readonly [string, unknown]>
|
|
27
|
+
removedFiles: Iterable<readonly [string, unknown]>
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Includes imported source contents in transform keys and invalidates their consumers on edits. */
|
|
32
|
+
export async function attach(server: Server, root: string) {
|
|
33
|
+
const bundler = server.getBundler().getBundler()
|
|
34
|
+
const graph = await bundler.getDependencyGraph()
|
|
35
|
+
const dependencies = new Map<string, Map<string, Set<string>>>()
|
|
36
|
+
const transform = bundler.transformFile.bind(bundler)
|
|
37
|
+
bundler.transformFile = (filename, options, buffer) => {
|
|
38
|
+
if (
|
|
39
|
+
(options.platform !== 'ios' && options.platform !== 'android') ||
|
|
40
|
+
!/\.[cm]?[jt]sx?$/.test(filename) ||
|
|
41
|
+
Path.relative(root, filename).startsWith(`..${Path.sep}`) ||
|
|
42
|
+
filename.split(Path.sep).includes('node_modules')
|
|
43
|
+
)
|
|
44
|
+
return transform(filename, options, buffer)
|
|
45
|
+
const source = buffer?.toString('utf8') ?? Fs.readFileSync(filename, 'utf8')
|
|
46
|
+
const input = Graph.read(filename, source, options.platform, root)
|
|
47
|
+
const platforms =
|
|
48
|
+
dependencies.get(filename) ?? new Map<string, Set<string>>()
|
|
49
|
+
platforms.set(options.platform, new Set(input.files))
|
|
50
|
+
dependencies.set(filename, platforms)
|
|
51
|
+
const hash = Crypto.hash('sha256', JSON.stringify(input))
|
|
52
|
+
return transform(
|
|
53
|
+
filename,
|
|
54
|
+
{
|
|
55
|
+
...options,
|
|
56
|
+
customTransformOptions: {
|
|
57
|
+
...options.customTransformOptions,
|
|
58
|
+
zyzzGraph: hash,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
buffer,
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
graph.getWatcher().prependListener('change', (event: Changes) => {
|
|
65
|
+
const entries = [
|
|
66
|
+
...event.changes.addedFiles,
|
|
67
|
+
...event.changes.modifiedFiles,
|
|
68
|
+
...event.changes.removedFiles,
|
|
69
|
+
]
|
|
70
|
+
const changed = new Set(
|
|
71
|
+
entries.map(([path]) => Path.join(event.rootDir, path)),
|
|
72
|
+
)
|
|
73
|
+
const modified = new Map(event.changes.modifiedFiles)
|
|
74
|
+
const metadata = { isSymlink: false, modifiedTime: Date.now() }
|
|
75
|
+
for (const [filename, imports] of dependencies) {
|
|
76
|
+
if (
|
|
77
|
+
changed.has(filename) ||
|
|
78
|
+
![...imports.values()].some((paths) =>
|
|
79
|
+
[...paths].some((path) => changed.has(path)),
|
|
80
|
+
) ||
|
|
81
|
+
!Fs.existsSync(filename)
|
|
82
|
+
)
|
|
83
|
+
continue
|
|
84
|
+
modified.set(Path.relative(event.rootDir, filename), metadata)
|
|
85
|
+
}
|
|
86
|
+
event.changes = { ...event.changes, modifiedFiles: modified }
|
|
87
|
+
})
|
|
88
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** Configures native Zyzz compilation in Metro without a separate generation command. @module */
|
|
2
|
+
import type { NativeOptions } from '../babel/index.js'
|
|
3
|
+
import * as Crypto from 'node:crypto'
|
|
4
|
+
import * as Fs from 'node:fs'
|
|
5
|
+
import * as Module from 'node:module'
|
|
6
|
+
import * as Path from 'node:path'
|
|
7
|
+
import * as Watch from './Watch.js'
|
|
8
|
+
|
|
9
|
+
/** Minimum Metro configuration consumed by the adapter. */
|
|
10
|
+
export type Config = {
|
|
11
|
+
/** Existing development middleware settings. */
|
|
12
|
+
readonly server?: object | undefined
|
|
13
|
+
/** Application root used for the adapter cache. */
|
|
14
|
+
readonly projectRoot?: string | undefined
|
|
15
|
+
/** Existing transformer configuration, including Expo's Babel transformer. */
|
|
16
|
+
readonly transformer?:
|
|
17
|
+
| {
|
|
18
|
+
/** Upstream Babel transformer to preserve. */
|
|
19
|
+
readonly babelTransformerPath?: string | undefined
|
|
20
|
+
}
|
|
21
|
+
| undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Preserves Metro configuration and chains Zyzz before the existing Babel transformer.
|
|
26
|
+
* Writes an immutable adapter entrypoint under `.zyzz/metro`, not compiled application files.
|
|
27
|
+
*/
|
|
28
|
+
export function zyzz<const config extends Config>(
|
|
29
|
+
config: config,
|
|
30
|
+
options: Omit<
|
|
31
|
+
NativeOptions,
|
|
32
|
+
'platform' | 'target' | 'moduleId' | 'modules' | 'imports' | 'colorScheme'
|
|
33
|
+
> = {},
|
|
34
|
+
): zyzz.ReturnType<config> {
|
|
35
|
+
if (Object.hasOwn(options, 'colorScheme'))
|
|
36
|
+
throw new Error(
|
|
37
|
+
'Select colorScheme through the React provider, not Metro configuration.',
|
|
38
|
+
)
|
|
39
|
+
const root = Path.resolve(config.projectRoot ?? process.cwd())
|
|
40
|
+
const require = Module.createRequire(Path.join(root, 'package.json'))
|
|
41
|
+
const upstream = config.transformer?.babelTransformerPath
|
|
42
|
+
if (!upstream)
|
|
43
|
+
throw new Error('Zyzz requires a configured Metro Babel transformer.')
|
|
44
|
+
|
|
45
|
+
const adapter = Module.createRequire(import.meta.url).resolve(
|
|
46
|
+
'zyzz/metro/transformer',
|
|
47
|
+
)
|
|
48
|
+
const code = `module.exports = require(${JSON.stringify(adapter)}).create(${JSON.stringify(require.resolve(upstream))}, ${JSON.stringify({ ...options, root })});\n`
|
|
49
|
+
const directory = Path.join(root, '.zyzz', 'metro')
|
|
50
|
+
const filename = Path.join(directory, `${Crypto.hash('sha256', code)}.cjs`)
|
|
51
|
+
Fs.mkdirSync(directory, { recursive: true })
|
|
52
|
+
try {
|
|
53
|
+
Fs.writeFileSync(filename, code, { flag: 'wx' })
|
|
54
|
+
} catch (error) {
|
|
55
|
+
if (!(error instanceof Error && 'code' in error && error.code === 'EEXIST'))
|
|
56
|
+
throw error
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const enhance =
|
|
60
|
+
config.server &&
|
|
61
|
+
(Reflect.get(config.server, 'enhanceMiddleware') as
|
|
62
|
+
| ((middleware: Middleware, server: Watch.Server) => Middleware)
|
|
63
|
+
| undefined)
|
|
64
|
+
type Middleware = (...args: unknown[]) => unknown
|
|
65
|
+
return {
|
|
66
|
+
...config,
|
|
67
|
+
server: {
|
|
68
|
+
...config.server,
|
|
69
|
+
enhanceMiddleware(middleware: Middleware, server: Watch.Server) {
|
|
70
|
+
const ready = Watch.attach(server, root)
|
|
71
|
+
const next = enhance
|
|
72
|
+
? enhance.call(config.server, middleware, server)
|
|
73
|
+
: middleware
|
|
74
|
+
return (...args: unknown[]) =>
|
|
75
|
+
ready.then(
|
|
76
|
+
() => next(...args),
|
|
77
|
+
(error: unknown) => {
|
|
78
|
+
const report = args[2]
|
|
79
|
+
if (typeof report === 'function') return report(error)
|
|
80
|
+
throw error
|
|
81
|
+
},
|
|
82
|
+
)
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
transformer: { ...config.transformer, babelTransformerPath: filename },
|
|
86
|
+
} as zyzz.ReturnType<config>
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Configuration returned by the Metro adapter. */
|
|
90
|
+
export declare namespace zyzz {
|
|
91
|
+
/** Preserves caller configuration fields and the existing transformer options. */
|
|
92
|
+
type ReturnType<config extends Config> = Omit<config, 'transformer'> & {
|
|
93
|
+
/** Existing transformer configuration with the native compilation entrypoint. */
|
|
94
|
+
transformer: Omit<
|
|
95
|
+
NonNullable<config['transformer']>,
|
|
96
|
+
'babelTransformerPath'
|
|
97
|
+
> & { babelTransformerPath: string }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Chains native authoring compilation into the configured Metro Babel transformer. @module */
|
|
2
|
+
import type * as Babel from '@babel/core'
|
|
3
|
+
import * as Crypto from 'node:crypto'
|
|
4
|
+
import * as Fs from 'node:fs'
|
|
5
|
+
import * as Module from 'node:module'
|
|
6
|
+
import * as Path from 'node:path'
|
|
7
|
+
import * as Graph from './Graph.js'
|
|
8
|
+
import { type NativeOptions, zyzz } from '../babel/index.js'
|
|
9
|
+
|
|
10
|
+
/** Babel transformer inputs passed through without removing upstream fields. */
|
|
11
|
+
type Input = {
|
|
12
|
+
readonly filename: string
|
|
13
|
+
readonly options: { readonly platform?: string | undefined }
|
|
14
|
+
readonly plugins?: readonly Babel.PluginItem[] | undefined
|
|
15
|
+
readonly src: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type Upstream = {
|
|
19
|
+
getCacheKey?: ((...args: readonly unknown[]) => string) | undefined
|
|
20
|
+
transform: (input: Input) => unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Creates a transformer with isolated options and the existing upstream implementation. */
|
|
24
|
+
export function create(
|
|
25
|
+
upstreamPath: string,
|
|
26
|
+
options: Omit<
|
|
27
|
+
NativeOptions,
|
|
28
|
+
'platform' | 'target' | 'moduleId' | 'modules' | 'imports' | 'colorScheme'
|
|
29
|
+
> & { readonly root: string },
|
|
30
|
+
) {
|
|
31
|
+
const upstream: Upstream = Module.createRequire(import.meta.url)(upstreamPath)
|
|
32
|
+
return {
|
|
33
|
+
getCacheKey(...args: readonly unknown[]) {
|
|
34
|
+
const hash = Crypto.createHash('sha256')
|
|
35
|
+
hash.update(upstream.getCacheKey?.(...args) ?? '')
|
|
36
|
+
hash.update(JSON.stringify(options))
|
|
37
|
+
function sources(directory: string) {
|
|
38
|
+
for (const entry of Fs.readdirSync(directory, {
|
|
39
|
+
withFileTypes: true,
|
|
40
|
+
}).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
41
|
+
if (
|
|
42
|
+
entry.name.startsWith('.') ||
|
|
43
|
+
['node_modules', 'dist'].includes(entry.name)
|
|
44
|
+
)
|
|
45
|
+
continue
|
|
46
|
+
const path = Path.join(directory, entry.name)
|
|
47
|
+
if (entry.isDirectory()) sources(path)
|
|
48
|
+
else if (entry.isFile() && /\.[cm]?[jt]sx?$/.test(entry.name)) {
|
|
49
|
+
hash.update(path)
|
|
50
|
+
hash.update(Fs.readFileSync(path))
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
sources(options.root)
|
|
55
|
+
// Metro only hashes the generated entrypoint. Include the library implementation it delegates to.
|
|
56
|
+
const root = Path.resolve(import.meta.dirname, '..')
|
|
57
|
+
for (const name of Fs.readdirSync(root, { recursive: true })
|
|
58
|
+
.map(String)
|
|
59
|
+
.sort()) {
|
|
60
|
+
if (
|
|
61
|
+
/\.[cm]?[jt]sx?$/.test(name) &&
|
|
62
|
+
!/\.(?:d|test|test-d|bench|bench-d)\.[cm]?[jt]sx?$/.test(name)
|
|
63
|
+
) {
|
|
64
|
+
hash.update(name)
|
|
65
|
+
hash.update(Fs.readFileSync(Path.join(root, name)))
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return hash.digest('hex')
|
|
69
|
+
},
|
|
70
|
+
transform(input: Input) {
|
|
71
|
+
const platform = input.options.platform
|
|
72
|
+
const filename = Path.resolve(options.root, input.filename)
|
|
73
|
+
if (
|
|
74
|
+
(platform !== 'ios' && platform !== 'android') ||
|
|
75
|
+
!/\.[cm]?[jt]sx?$/.test(input.filename) ||
|
|
76
|
+
input.filename.split(/[\\/]/).includes('node_modules') ||
|
|
77
|
+
Path.relative(options.root, filename).startsWith(`..${Path.sep}`)
|
|
78
|
+
)
|
|
79
|
+
return upstream.transform(input)
|
|
80
|
+
return upstream.transform({
|
|
81
|
+
...input,
|
|
82
|
+
plugins: [
|
|
83
|
+
[
|
|
84
|
+
zyzz,
|
|
85
|
+
{
|
|
86
|
+
...options,
|
|
87
|
+
platform,
|
|
88
|
+
target: 'native',
|
|
89
|
+
...Graph.read(filename, input.src, platform, options.root),
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
...(input.plugins ?? []),
|
|
93
|
+
],
|
|
94
|
+
})
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
}
|