@tamagui/static 2.7.7 → 3.0.0-beta.643.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/check-dep-versions.cjs +355 -0
- package/dist/cjs/checkDeps.cjs +302 -0
- package/dist/cjs/compiler.cjs +286 -0
- package/dist/cjs/compilerHost.cjs +1695 -0
- package/dist/cjs/constants.cjs +33 -0
- package/dist/cjs/domStructuralPass.cjs +112 -0
- package/dist/cjs/exports.cjs +42 -0
- package/dist/cjs/extractor/addLocalExports.cjs +64 -0
- package/dist/cjs/extractor/bundle.cjs +203 -0
- package/dist/cjs/extractor/bundleConfig.cjs +747 -0
- package/dist/cjs/extractor/concatClassName.cjs +117 -0
- package/dist/cjs/extractor/detectModuleFormat.cjs +54 -0
- package/dist/cjs/extractor/esbuildAliasPlugin.cjs +47 -0
- package/dist/cjs/extractor/esbuildTsconfigPaths.cjs +92 -0
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.cjs +38 -0
- package/dist/cjs/extractor/loadTamagui.cjs +344 -0
- package/dist/cjs/extractor/regenerateConfig.cjs +161 -0
- package/dist/cjs/extractor/watchTamaguiConfig.cjs +64 -0
- package/dist/cjs/getPragmaOptions.cjs +67 -0
- package/dist/cjs/helpers/memoize.cjs +42 -0
- package/dist/cjs/helpers/requireTamaguiCore.cjs +40 -0
- package/dist/cjs/index.cjs +34 -0
- package/dist/cjs/registerRequire.cjs +220 -0
- package/dist/cjs/server.cjs +66 -0
- package/dist/cjs/staticEvaluationIgnoredModules.cjs +86 -0
- package/dist/cjs/types.cjs +17 -0
- package/dist/cjs/zero/artifact.cjs +145 -0
- package/dist/cjs/zero/graph.cjs +209 -0
- package/dist/cjs/zero/identity.cjs +61 -0
- package/dist/cjs/zero/index.cjs +26 -0
- package/dist/cjs/zero/islands.cjs +232 -0
- package/dist/cjs/zero/options.cjs +163 -0
- package/dist/cjs/zero/ownership.cjs +79 -0
- package/dist/cjs/zero/theme.cjs +328 -0
- package/dist/cjs/zero/transform.cjs +203 -0
- package/dist/esm/check-dep-versions.mjs +329 -0
- package/dist/esm/check-dep-versions.mjs.map +1 -0
- package/dist/esm/checkDeps.mjs +279 -0
- package/dist/esm/checkDeps.mjs.map +1 -0
- package/dist/esm/compiler.mjs +255 -0
- package/dist/esm/compiler.mjs.map +1 -0
- package/dist/esm/compilerHost.mjs +1675 -0
- package/dist/esm/compilerHost.mjs.map +1 -0
- package/dist/esm/constants.mjs +7 -0
- package/dist/esm/constants.mjs.map +1 -0
- package/dist/esm/domStructuralPass.mjs +92 -0
- package/dist/esm/domStructuralPass.mjs.map +1 -0
- package/dist/esm/exports.mjs +26 -0
- package/dist/esm/extractor/addLocalExports.mjs +44 -0
- package/dist/esm/extractor/addLocalExports.mjs.map +1 -0
- package/dist/esm/extractor/bundle.mjs +173 -0
- package/dist/esm/extractor/bundle.mjs.map +1 -0
- package/dist/esm/extractor/bundleConfig.mjs +706 -0
- package/dist/esm/extractor/bundleConfig.mjs.map +1 -0
- package/dist/esm/extractor/concatClassName.mjs +96 -0
- package/dist/esm/extractor/concatClassName.mjs.map +1 -0
- package/dist/esm/extractor/detectModuleFormat.mjs +31 -0
- package/dist/esm/extractor/detectModuleFormat.mjs.map +1 -0
- package/dist/esm/extractor/esbuildAliasPlugin.mjs +26 -0
- package/dist/esm/extractor/esbuildAliasPlugin.mjs.map +1 -0
- package/dist/esm/extractor/esbuildTsconfigPaths.mjs +63 -0
- package/dist/esm/extractor/esbuildTsconfigPaths.mjs.map +1 -0
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.mjs +18 -0
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.mjs.map +1 -0
- package/dist/esm/extractor/loadTamagui.mjs +306 -0
- package/dist/esm/extractor/loadTamagui.mjs.map +1 -0
- package/dist/esm/extractor/regenerateConfig.mjs +131 -0
- package/dist/esm/extractor/regenerateConfig.mjs.map +1 -0
- package/dist/esm/extractor/watchTamaguiConfig.mjs +43 -0
- package/dist/esm/extractor/watchTamaguiConfig.mjs.map +1 -0
- package/dist/esm/getPragmaOptions.mjs +46 -0
- package/dist/esm/getPragmaOptions.mjs.map +1 -0
- package/dist/esm/helpers/memoize.mjs +21 -0
- package/dist/esm/helpers/memoize.mjs.map +1 -0
- package/dist/esm/helpers/requireTamaguiCore.mjs +19 -0
- package/dist/esm/helpers/requireTamaguiCore.mjs.map +1 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/registerRequire.mjs +195 -0
- package/dist/esm/registerRequire.mjs.map +1 -0
- package/dist/esm/server.mjs +40 -0
- package/dist/esm/server.mjs.map +1 -0
- package/dist/esm/setup.mjs +0 -0
- package/dist/esm/staticEvaluationIgnoredModules.mjs +61 -0
- package/dist/esm/staticEvaluationIgnoredModules.mjs.map +1 -0
- package/dist/esm/types.mjs +0 -0
- package/dist/esm/zero/artifact.mjs +119 -0
- package/dist/esm/zero/artifact.mjs.map +1 -0
- package/dist/esm/zero/graph.mjs +170 -0
- package/dist/esm/zero/graph.mjs.map +1 -0
- package/dist/esm/zero/identity.mjs +36 -0
- package/dist/esm/zero/identity.mjs.map +1 -0
- package/dist/esm/zero/index.mjs +15 -0
- package/dist/esm/zero/islands.mjs +197 -0
- package/dist/esm/zero/islands.mjs.map +1 -0
- package/dist/esm/zero/options.mjs +129 -0
- package/dist/esm/zero/options.mjs.map +1 -0
- package/dist/esm/zero/ownership.mjs +48 -0
- package/dist/esm/zero/ownership.mjs.map +1 -0
- package/dist/esm/zero/theme.mjs +303 -0
- package/dist/esm/zero/theme.mjs.map +1 -0
- package/dist/esm/zero/transform.mjs +177 -0
- package/dist/esm/zero/transform.mjs.map +1 -0
- package/package.json +33 -43
- package/src/check-dep-versions.ts +2 -2
- package/src/checkDeps.ts +3 -2
- package/src/compiler.ts +425 -0
- package/src/compilerHost.ts +3125 -0
- package/src/constants.ts +0 -5
- package/src/domStructuralPass.ts +170 -0
- package/src/exports.ts +3 -6
- package/src/extractor/addLocalExports.ts +49 -0
- package/src/extractor/bundle.ts +20 -35
- package/src/extractor/bundleConfig.ts +334 -187
- package/src/extractor/concatClassName.ts +13 -20
- package/src/extractor/getTamaguiConfigPathFromOptionsConfig.ts +5 -4
- package/src/extractor/loadTamagui.ts +196 -143
- package/src/extractor/regenerateConfig.ts +65 -13
- package/src/extractor/watchTamaguiConfig.ts +6 -1
- package/src/helpers/requireTamaguiCore.ts +6 -1
- package/src/registerRequire.ts +94 -132
- package/src/staticEvaluationIgnoredModules.ts +74 -0
- package/src/types.ts +2 -107
- package/src/zero/artifact.ts +142 -0
- package/src/zero/graph.ts +359 -0
- package/src/zero/identity.ts +73 -0
- package/src/zero/index.ts +8 -0
- package/src/zero/islands.ts +262 -0
- package/src/zero/options.ts +239 -0
- package/src/zero/ownership.ts +113 -0
- package/src/zero/theme.ts +478 -0
- package/src/zero/transform.ts +320 -0
- package/types/check-dep-versions.d.ts.map +1 -1
- package/types/checkDeps.d.ts.map +1 -1
- package/types/compiler.d.ts +117 -0
- package/types/compiler.d.ts.map +1 -0
- package/types/compilerHost.d.ts +25 -0
- package/types/compilerHost.d.ts.map +1 -0
- package/types/constants.d.ts +0 -1
- package/types/constants.d.ts.map +1 -1
- package/types/domStructuralPass.d.ts +3 -0
- package/types/domStructuralPass.d.ts.map +1 -0
- package/types/exports.d.ts +3 -6
- package/types/exports.d.ts.map +1 -1
- package/types/extractor/addLocalExports.d.ts +3 -0
- package/types/extractor/addLocalExports.d.ts.map +1 -0
- package/types/extractor/bundle.d.ts +66 -65
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/bundleConfig.d.ts +19 -4
- package/types/extractor/bundleConfig.d.ts.map +1 -1
- package/types/extractor/esbuildAliasPlugin.d.ts.map +1 -1
- package/types/extractor/getTamaguiConfigPathFromOptionsConfig.d.ts +1 -1
- package/types/extractor/getTamaguiConfigPathFromOptionsConfig.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts +26 -3
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/extractor/regenerateConfig.d.ts +1 -1
- package/types/extractor/regenerateConfig.d.ts.map +1 -1
- package/types/extractor/watchTamaguiConfig.d.ts.map +1 -1
- package/types/getPragmaOptions.d.ts +1 -1
- package/types/helpers/memoize.d.ts +1 -1
- package/types/helpers/memoize.d.ts.map +1 -1
- package/types/helpers/requireTamaguiCore.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/registerRequire.d.ts +2 -2
- package/types/registerRequire.d.ts.map +1 -1
- package/types/staticEvaluationIgnoredModules.d.ts +9 -0
- package/types/staticEvaluationIgnoredModules.d.ts.map +1 -0
- package/types/types.d.ts +2 -90
- package/types/types.d.ts.map +1 -1
- package/types/zero/artifact.d.ts +44 -0
- package/types/zero/artifact.d.ts.map +1 -0
- package/types/zero/graph.d.ts +139 -0
- package/types/zero/graph.d.ts.map +1 -0
- package/types/zero/identity.d.ts +33 -0
- package/types/zero/identity.d.ts.map +1 -0
- package/types/zero/index.d.ts +9 -0
- package/types/zero/index.d.ts.map +1 -0
- package/types/zero/islands.d.ts +56 -0
- package/types/zero/islands.d.ts.map +1 -0
- package/types/zero/options.d.ts +58 -0
- package/types/zero/options.d.ts.map +1 -0
- package/types/zero/ownership.d.ts +51 -0
- package/types/zero/ownership.d.ts.map +1 -0
- package/types/zero/theme.d.ts +83 -0
- package/types/zero/theme.d.ts.map +1 -0
- package/types/zero/transform.d.ts +53 -0
- package/types/zero/transform.d.ts.map +1 -0
- package/dist/check-dep-versions.cjs +0 -372
- package/dist/checkDeps.cjs +0 -271
- package/dist/constants.cjs +0 -51
- package/dist/exports.cjs +0 -48
- package/dist/extractor/accessSafe.cjs +0 -48
- package/dist/extractor/babelParse.cjs +0 -56
- package/dist/extractor/buildClassName.cjs +0 -86
- package/dist/extractor/bundle.cjs +0 -234
- package/dist/extractor/bundleConfig.cjs +0 -729
- package/dist/extractor/concatClassName.cjs +0 -129
- package/dist/extractor/createEvaluator.cjs +0 -88
- package/dist/extractor/createExtractor.cjs +0 -1968
- package/dist/extractor/createLogger.cjs +0 -50
- package/dist/extractor/detectModuleFormat.cjs +0 -55
- package/dist/extractor/ensureImportingConcat.cjs +0 -54
- package/dist/extractor/errors.cjs +0 -28
- package/dist/extractor/esbuildAliasPlugin.cjs +0 -56
- package/dist/extractor/esbuildTsconfigPaths.cjs +0 -108
- package/dist/extractor/evaluateAstNode.cjs +0 -128
- package/dist/extractor/extractHelpers.cjs +0 -182
- package/dist/extractor/extractMediaStyle.cjs +0 -169
- package/dist/extractor/extractToClassNames.cjs +0 -475
- package/dist/extractor/extractToNative.cjs +0 -369
- package/dist/extractor/findTopmostFunction.cjs +0 -43
- package/dist/extractor/generatedUid.cjs +0 -58
- package/dist/extractor/getPrefixLogs.cjs +0 -31
- package/dist/extractor/getPropValueFromAttributes.cjs +0 -85
- package/dist/extractor/getSourceModule.cjs +0 -100
- package/dist/extractor/getStaticBindingsForScope.cjs +0 -213
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.cjs +0 -41
- package/dist/extractor/hasTopLevelAwait.cjs +0 -62
- package/dist/extractor/hoistClassNames.cjs +0 -76
- package/dist/extractor/literalToAst.cjs +0 -109
- package/dist/extractor/loadFile.cjs +0 -17
- package/dist/extractor/loadTamagui.cjs +0 -373
- package/dist/extractor/logLines.cjs +0 -43
- package/dist/extractor/normalizeTernaries.cjs +0 -100
- package/dist/extractor/propsToFontFamilyCache.cjs +0 -42
- package/dist/extractor/regenerateConfig.cjs +0 -178
- package/dist/extractor/removeUnusedHooks.cjs +0 -108
- package/dist/extractor/timer.cjs +0 -52
- package/dist/extractor/validHTMLAttributes.cjs +0 -79
- package/dist/extractor/watchTamaguiConfig.cjs +0 -70
- package/dist/getPragmaOptions.cjs +0 -73
- package/dist/helpers/memoize.cjs +0 -45
- package/dist/helpers/requireTamaguiCore.cjs +0 -40
- package/dist/index.cjs +0 -42
- package/dist/registerRequire.cjs +0 -209
- package/dist/server.cjs +0 -82
- package/dist/types.cjs +0 -18
- package/dist/worker.cjs +0 -111
- package/src/extractor/accessSafe.ts +0 -22
- package/src/extractor/babelParse.ts +0 -38
- package/src/extractor/buildClassName.ts +0 -76
- package/src/extractor/createEvaluator.ts +0 -82
- package/src/extractor/createExtractor.ts +0 -2970
- package/src/extractor/createLogger.ts +0 -41
- package/src/extractor/ensureImportingConcat.ts +0 -36
- package/src/extractor/errors.ts +0 -1
- package/src/extractor/evaluateAstNode.ts +0 -136
- package/src/extractor/extractHelpers.ts +0 -211
- package/src/extractor/extractMediaStyle.ts +0 -194
- package/src/extractor/extractToClassNames.ts +0 -733
- package/src/extractor/extractToNative.ts +0 -506
- package/src/extractor/findTopmostFunction.ts +0 -24
- package/src/extractor/generatedUid.ts +0 -41
- package/src/extractor/getPrefixLogs.ts +0 -9
- package/src/extractor/getPropValueFromAttributes.ts +0 -95
- package/src/extractor/getSourceModule.ts +0 -96
- package/src/extractor/getStaticBindingsForScope.ts +0 -237
- package/src/extractor/hasTopLevelAwait.ts +0 -28
- package/src/extractor/hoistClassNames.ts +0 -52
- package/src/extractor/literalToAst.ts +0 -85
- package/src/extractor/loadFile.ts +0 -17
- package/src/extractor/logLines.ts +0 -16
- package/src/extractor/normalizeTernaries.ts +0 -89
- package/src/extractor/propsToFontFamilyCache.ts +0 -18
- package/src/extractor/removeUnusedHooks.ts +0 -83
- package/src/extractor/timer.ts +0 -25
- package/src/extractor/validHTMLAttributes.ts +0 -52
- package/src/worker.ts +0 -142
- package/types/extractor/accessSafe.d.ts +0 -3
- package/types/extractor/accessSafe.d.ts.map +0 -1
- package/types/extractor/babelParse.d.ts +0 -5
- package/types/extractor/babelParse.d.ts.map +0 -1
- package/types/extractor/buildClassName.d.ts +0 -7
- package/types/extractor/buildClassName.d.ts.map +0 -1
- package/types/extractor/createEvaluator.d.ts +0 -12
- package/types/extractor/createEvaluator.d.ts.map +0 -1
- package/types/extractor/createExtractor.d.ts +0 -32
- package/types/extractor/createExtractor.d.ts.map +0 -1
- package/types/extractor/createLogger.d.ts +0 -3
- package/types/extractor/createLogger.d.ts.map +0 -1
- package/types/extractor/ensureImportingConcat.d.ts +0 -4
- package/types/extractor/ensureImportingConcat.d.ts.map +0 -1
- package/types/extractor/errors.d.ts +0 -3
- package/types/extractor/errors.d.ts.map +0 -1
- package/types/extractor/evaluateAstNode.d.ts +0 -3
- package/types/extractor/evaluateAstNode.d.ts.map +0 -1
- package/types/extractor/extractHelpers.d.ts +0 -28
- package/types/extractor/extractHelpers.d.ts.map +0 -1
- package/types/extractor/extractMediaStyle.d.ts +0 -11
- package/types/extractor/extractMediaStyle.d.ts.map +0 -1
- package/types/extractor/extractToClassNames.d.ts +0 -25
- package/types/extractor/extractToClassNames.d.ts.map +0 -1
- package/types/extractor/extractToNative.d.ts +0 -13
- package/types/extractor/extractToNative.d.ts.map +0 -1
- package/types/extractor/findTopmostFunction.d.ts +0 -4
- package/types/extractor/findTopmostFunction.d.ts.map +0 -1
- package/types/extractor/generatedUid.d.ts +0 -5
- package/types/extractor/generatedUid.d.ts.map +0 -1
- package/types/extractor/getPrefixLogs.d.ts +0 -3
- package/types/extractor/getPrefixLogs.d.ts.map +0 -1
- package/types/extractor/getPropValueFromAttributes.d.ts +0 -19
- package/types/extractor/getPropValueFromAttributes.d.ts.map +0 -1
- package/types/extractor/getSourceModule.d.ts +0 -16
- package/types/extractor/getSourceModule.d.ts.map +0 -1
- package/types/extractor/getStaticBindingsForScope.d.ts +0 -5
- package/types/extractor/getStaticBindingsForScope.d.ts.map +0 -1
- package/types/extractor/hasTopLevelAwait.d.ts +0 -2
- package/types/extractor/hasTopLevelAwait.d.ts.map +0 -1
- package/types/extractor/hoistClassNames.d.ts +0 -6
- package/types/extractor/hoistClassNames.d.ts.map +0 -1
- package/types/extractor/literalToAst.d.ts +0 -4
- package/types/extractor/literalToAst.d.ts.map +0 -1
- package/types/extractor/loadFile.d.ts +0 -1
- package/types/extractor/loadFile.d.ts.map +0 -1
- package/types/extractor/logLines.d.ts +0 -2
- package/types/extractor/logLines.d.ts.map +0 -1
- package/types/extractor/normalizeTernaries.d.ts +0 -5
- package/types/extractor/normalizeTernaries.d.ts.map +0 -1
- package/types/extractor/propsToFontFamilyCache.d.ts +0 -4
- package/types/extractor/propsToFontFamilyCache.d.ts.map +0 -1
- package/types/extractor/removeUnusedHooks.d.ts +0 -3
- package/types/extractor/removeUnusedHooks.d.ts.map +0 -1
- package/types/extractor/timer.d.ts +0 -5
- package/types/extractor/timer.d.ts.map +0 -1
- package/types/extractor/validHTMLAttributes.d.ts +0 -52
- package/types/extractor/validHTMLAttributes.d.ts.map +0 -1
- package/types/worker.d.ts +0 -46
- package/types/worker.d.ts.map +0 -1
- /package/dist/{setup.cjs → cjs/setup.cjs} +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse'
|
|
2
|
-
import * as t from '@babel/types'
|
|
3
|
-
|
|
4
|
-
const hooks = {
|
|
5
|
-
useMedia: true,
|
|
6
|
-
useTheme: true,
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function removeUnusedHooks(
|
|
10
|
-
compFn: NodePath<any>,
|
|
11
|
-
shouldPrintDebug: boolean | 'verbose'
|
|
12
|
-
) {
|
|
13
|
-
compFn.scope.crawl()
|
|
14
|
-
// check the top level statements
|
|
15
|
-
let bodyStatements = compFn?.get('body')
|
|
16
|
-
if (!bodyStatements) {
|
|
17
|
-
console.info('no body statemnts?', compFn)
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
if (!Array.isArray(bodyStatements)) {
|
|
21
|
-
if (bodyStatements.isFunctionExpression()) {
|
|
22
|
-
bodyStatements = bodyStatements.scope.path.get('body')
|
|
23
|
-
} else {
|
|
24
|
-
bodyStatements = bodyStatements.get('body')
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (!bodyStatements || !Array.isArray(bodyStatements)) {
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
const statements = bodyStatements as NodePath<any>[]
|
|
31
|
-
for (const statement of statements) {
|
|
32
|
-
if (!statement.isVariableDeclaration()) {
|
|
33
|
-
continue
|
|
34
|
-
}
|
|
35
|
-
const declarations = statement.get('declarations')
|
|
36
|
-
if (!Array.isArray(declarations)) {
|
|
37
|
-
continue
|
|
38
|
-
}
|
|
39
|
-
const isBindingReferenced = (name: string) => {
|
|
40
|
-
return !!statement.scope.getBinding(name)?.referenced
|
|
41
|
-
}
|
|
42
|
-
for (const declarator of declarations) {
|
|
43
|
-
const id = declarator.get('id')
|
|
44
|
-
const init = declarator.node.init
|
|
45
|
-
if (Array.isArray(id) || Array.isArray(init)) {
|
|
46
|
-
continue
|
|
47
|
-
}
|
|
48
|
-
const shouldRemove = (() => {
|
|
49
|
-
const isHook =
|
|
50
|
-
init &&
|
|
51
|
-
t.isCallExpression(init) &&
|
|
52
|
-
t.isIdentifier(init.callee) &&
|
|
53
|
-
hooks[init.callee.name]
|
|
54
|
-
if (!isHook) {
|
|
55
|
-
return false
|
|
56
|
-
}
|
|
57
|
-
if (t.isIdentifier(id.node)) {
|
|
58
|
-
// remove "const media = useMedia()"
|
|
59
|
-
const name = id.node.name
|
|
60
|
-
return !isBindingReferenced(name)
|
|
61
|
-
}
|
|
62
|
-
if (t.isObjectPattern(id.node)) {
|
|
63
|
-
// remove "const { sm } = useMedia()"
|
|
64
|
-
const propPaths = id.get('properties') as NodePath<any>[]
|
|
65
|
-
return propPaths.every((prop) => {
|
|
66
|
-
if (!prop.isObjectProperty()) return false
|
|
67
|
-
const value = prop.get('value')
|
|
68
|
-
if (Array.isArray(value) || !value.isIdentifier()) return false
|
|
69
|
-
const name = value.node.name
|
|
70
|
-
return !isBindingReferenced(name)
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
return false
|
|
74
|
-
})()
|
|
75
|
-
if (shouldRemove) {
|
|
76
|
-
declarator.remove()
|
|
77
|
-
if (shouldPrintDebug) {
|
|
78
|
-
console.info(` [🪝] removed ${id.node['name'] ?? ''}`)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
package/src/extractor/timer.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const timer = () => {
|
|
2
|
-
const start = Date.now()
|
|
3
|
-
let last = start
|
|
4
|
-
return {
|
|
5
|
-
mark: (name: string, print = false) => {
|
|
6
|
-
if (print) {
|
|
7
|
-
const took = Date.now() - last
|
|
8
|
-
last = Date.now()
|
|
9
|
-
console.info(`Time ${name}: ${took}ms`)
|
|
10
|
-
if (took > 10) {
|
|
11
|
-
console.info(' long timer')
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
done: (print = false) => {
|
|
16
|
-
if (print) {
|
|
17
|
-
const total = Date.now() - start
|
|
18
|
-
console.info(`Total time: ${total}ms`)
|
|
19
|
-
if (total > 50) {
|
|
20
|
-
console.info(' long timer')
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export const validHTMLAttributes = {
|
|
2
|
-
// SVG attributes that should pass through untouched
|
|
3
|
-
fill: true,
|
|
4
|
-
stroke: true,
|
|
5
|
-
autocomplete: true,
|
|
6
|
-
style: true,
|
|
7
|
-
tabIndex: true,
|
|
8
|
-
contenteditable: true,
|
|
9
|
-
crossorigin: true,
|
|
10
|
-
dir: true,
|
|
11
|
-
draggable: true,
|
|
12
|
-
enctype: true,
|
|
13
|
-
formenctype: true,
|
|
14
|
-
formmethod: true,
|
|
15
|
-
formtarget: true,
|
|
16
|
-
inputmode: true,
|
|
17
|
-
kind: true,
|
|
18
|
-
link: true,
|
|
19
|
-
method: true,
|
|
20
|
-
preload: true,
|
|
21
|
-
referrerpolicy: true,
|
|
22
|
-
rel: true,
|
|
23
|
-
rev: true,
|
|
24
|
-
role: true,
|
|
25
|
-
sandbox: true,
|
|
26
|
-
shape: true,
|
|
27
|
-
spellcheck: true,
|
|
28
|
-
target: true,
|
|
29
|
-
translate: true,
|
|
30
|
-
type: true,
|
|
31
|
-
wrap: true,
|
|
32
|
-
'aria-autocomplete': true,
|
|
33
|
-
'aria-busy': true,
|
|
34
|
-
'aria-checked': true,
|
|
35
|
-
'aria-current': true,
|
|
36
|
-
'aria-disabled': true,
|
|
37
|
-
'aria-expanded': true,
|
|
38
|
-
'aria-haspopup': true,
|
|
39
|
-
'aria-hidden': true,
|
|
40
|
-
'aria-invalid': true,
|
|
41
|
-
'aria-polite': true,
|
|
42
|
-
'aria-modal': true,
|
|
43
|
-
'aria-multiline': true,
|
|
44
|
-
'aria-multiselectable': true,
|
|
45
|
-
'aria-orientation': true,
|
|
46
|
-
'aria-pressed': true,
|
|
47
|
-
'aria-readonly': true,
|
|
48
|
-
'aria-relevant': true,
|
|
49
|
-
'aria-required': true,
|
|
50
|
-
'aria-selected': true,
|
|
51
|
-
'aria-sort': true,
|
|
52
|
-
}
|
package/src/worker.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Worker thread implementation for Tamagui extraction
|
|
3
|
-
* Used by both piscina (async) and synckit (sync for babel)
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type { BabelFileResult } from '@babel/core'
|
|
7
|
-
import { createExtractor } from './extractor/createExtractor'
|
|
8
|
-
import type { ExtractedResponse } from './extractor/extractToClassNames'
|
|
9
|
-
import { extractToClassNames as extractToClassNamesImpl } from './extractor/extractToClassNames'
|
|
10
|
-
import { extractToNative as extractToNativeImpl } from './extractor/extractToNative'
|
|
11
|
-
import type { TamaguiOptions } from './types'
|
|
12
|
-
|
|
13
|
-
// Create extractors lazily to avoid loading unused ones
|
|
14
|
-
let webExtractor: ReturnType<typeof createExtractor> | null = null
|
|
15
|
-
let nativeExtractor: ReturnType<typeof createExtractor> | null = null
|
|
16
|
-
|
|
17
|
-
function getWebExtractor() {
|
|
18
|
-
if (!webExtractor) {
|
|
19
|
-
webExtractor = createExtractor({ platform: 'web' })
|
|
20
|
-
}
|
|
21
|
-
return webExtractor
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function getNativeExtractor() {
|
|
25
|
-
if (!nativeExtractor) {
|
|
26
|
-
nativeExtractor = createExtractor({ platform: 'native' })
|
|
27
|
-
}
|
|
28
|
-
return nativeExtractor
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Cache config loading to avoid reloading
|
|
32
|
-
const configCache: Map<string, Promise<any>> = new Map()
|
|
33
|
-
|
|
34
|
-
export interface ExtractToClassNamesTask {
|
|
35
|
-
type: 'extractToClassNames'
|
|
36
|
-
source: string
|
|
37
|
-
sourcePath: string
|
|
38
|
-
options: TamaguiOptions
|
|
39
|
-
shouldPrintDebug: boolean | 'verbose'
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface ExtractToNativeTask {
|
|
43
|
-
type: 'extractToNative'
|
|
44
|
-
sourceFileName: string
|
|
45
|
-
sourceCode: string
|
|
46
|
-
options: TamaguiOptions
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface ClearCacheTask {
|
|
50
|
-
type: 'clearCache'
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type WorkerTask = ExtractToClassNamesTask | ExtractToNativeTask | ClearCacheTask
|
|
54
|
-
|
|
55
|
-
export type WorkerResult =
|
|
56
|
-
| { success: true; data: ExtractedResponse | null }
|
|
57
|
-
| { success: true; data: BabelFileResult }
|
|
58
|
-
| { success: false; error: string; stack?: string }
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Main worker function that handles both extraction types
|
|
62
|
-
* This is called by piscina for async usage
|
|
63
|
-
*/
|
|
64
|
-
export async function runTask(task: WorkerTask): Promise<WorkerResult> {
|
|
65
|
-
try {
|
|
66
|
-
if (task.type === 'extractToClassNames') {
|
|
67
|
-
// Load web config if needed (with caching)
|
|
68
|
-
// only skip if both extraction AND debug attrs are disabled (fully disabled)
|
|
69
|
-
const isFullyDisabled =
|
|
70
|
-
task.options.disableExtraction && task.options.disableDebugAttr
|
|
71
|
-
if (!isFullyDisabled && !task.options['_disableLoadTamagui']) {
|
|
72
|
-
const cacheKey = JSON.stringify({
|
|
73
|
-
config: task.options.config,
|
|
74
|
-
components: task.options.components,
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
if (!configCache.has(cacheKey)) {
|
|
78
|
-
configCache.set(cacheKey, getWebExtractor().loadTamagui(task.options))
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
await configCache.get(cacheKey)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const result = await extractToClassNamesImpl({
|
|
85
|
-
extractor: getWebExtractor(),
|
|
86
|
-
source: task.source,
|
|
87
|
-
sourcePath: task.sourcePath,
|
|
88
|
-
options: task.options,
|
|
89
|
-
shouldPrintDebug: task.shouldPrintDebug,
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
return { success: true, data: result }
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (task.type === 'extractToNative') {
|
|
96
|
-
// Load native config if needed (with caching)
|
|
97
|
-
const cacheKey = JSON.stringify({
|
|
98
|
-
config: task.options.config,
|
|
99
|
-
components: task.options.components,
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
if (!configCache.has(cacheKey)) {
|
|
103
|
-
configCache.set(cacheKey, getNativeExtractor().loadTamagui(task.options))
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
await configCache.get(cacheKey)
|
|
107
|
-
|
|
108
|
-
// extractToNative uses its own module-level extractor
|
|
109
|
-
// This is for babel plugin which uses visitor pattern
|
|
110
|
-
const result = extractToNativeImpl(
|
|
111
|
-
task.sourceFileName,
|
|
112
|
-
task.sourceCode,
|
|
113
|
-
task.options
|
|
114
|
-
)
|
|
115
|
-
|
|
116
|
-
return { success: true, data: result }
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (task.type === 'clearCache') {
|
|
120
|
-
// Clear config caches when files change
|
|
121
|
-
configCache.clear()
|
|
122
|
-
return { success: true, data: null }
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return {
|
|
126
|
-
success: false,
|
|
127
|
-
error: `Unknown task type: ${(task as any).type}`,
|
|
128
|
-
}
|
|
129
|
-
} catch (error) {
|
|
130
|
-
return {
|
|
131
|
-
success: false,
|
|
132
|
-
error: error instanceof Error ? error.message : String(error),
|
|
133
|
-
stack: error instanceof Error ? error.stack : undefined,
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* For synckit compatibility - exports the runTask as default
|
|
140
|
-
* Synckit will call this function synchronously using worker threads
|
|
141
|
-
*/
|
|
142
|
-
export default runTask
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessSafe.d.ts","sourceRoot":"","sources":["../../src/extractor/accessSafe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,wBAAgB,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAiBjF"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as babelParser from '@babel/parser';
|
|
2
|
-
import type * as t from '@babel/types';
|
|
3
|
-
export declare const parserOptions: babelParser.ParserOptions;
|
|
4
|
-
export declare function babelParse(code: string | Buffer, fileName?: string): t.File;
|
|
5
|
-
//# sourceMappingURL=babelParse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"babelParse.d.ts","sourceRoot":"","sources":["../../src/extractor/babelParse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAA;AAkBtC,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,aAGtC,CAAA;AAIF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,CAW3E"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as t from '@babel/types';
|
|
2
|
-
import type { ClassNameObject } from '../types';
|
|
3
|
-
type Builder = (objects: ClassNameObject[], extras?: string) => t.Expression | t.StringLiteral | null;
|
|
4
|
-
export declare const buildClassName: Builder;
|
|
5
|
-
export declare const buildClassNameLogic: Builder;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=buildClassName.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildClassName.d.ts","sourceRoot":"","sources":["../../src/extractor/buildClassName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,OAAO,GAAG,CACb,OAAO,EAAE,eAAe,EAAE,EAC1B,MAAM,CAAC,EAAE,MAAM,KACZ,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,aAAa,GAAG,IAAI,CAAA;AAE1C,eAAO,MAAM,cAAc,EAAE,OAU5B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,OAsDjC,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
import type { TamaguiOptionsWithFileInfo } from '../types';
|
|
4
|
-
export declare function createEvaluator({ props, staticNamespace, sourcePath, traversePath, shouldPrintDebug, }: {
|
|
5
|
-
props: TamaguiOptionsWithFileInfo;
|
|
6
|
-
staticNamespace: Record<string, any>;
|
|
7
|
-
sourcePath?: string;
|
|
8
|
-
traversePath?: NodePath<t.JSXElement>;
|
|
9
|
-
shouldPrintDebug: boolean | 'verbose';
|
|
10
|
-
}): (n: t.Node) => any;
|
|
11
|
-
export declare function createSafeEvaluator(attemptEval: (n: t.Node) => any): (n: t.Node) => any;
|
|
12
|
-
//# sourceMappingURL=createEvaluator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createEvaluator.d.ts","sourceRoot":"","sources":["../../src/extractor/createEvaluator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAG1D,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,eAAe,EACf,UAAU,EACV,YAAY,EACZ,gBAAgB,GACjB,EAAE;IACD,KAAK,EAAE,0BAA0B,CAAA;IACjC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IACrC,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,IA6CS,GAAG,CAAC,CAAC,IAAI,SAGlB;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,IACzD,GAAG,CAAC,CAAC,IAAI,SAOlB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
import type { ExtractorOptions, ExtractorParseProps, TamaguiOptions } from '../types';
|
|
4
|
-
import type { TamaguiProjectInfo } from './bundleConfig';
|
|
5
|
-
import { cleanupBeforeExit } from './getStaticBindingsForScope';
|
|
6
|
-
export type Extractor = ReturnType<typeof createExtractor>;
|
|
7
|
-
type FileOrPath = NodePath<t.Program> | t.File;
|
|
8
|
-
export declare function createExtractor({ logger, platform }?: ExtractorOptions): {
|
|
9
|
-
options: {
|
|
10
|
-
logger: import("../types").Logger;
|
|
11
|
-
};
|
|
12
|
-
cleanupBeforeExit: typeof cleanupBeforeExit;
|
|
13
|
-
loadTamagui: (props: TamaguiOptions) => Promise<TamaguiProjectInfo | null>;
|
|
14
|
-
loadTamaguiSync: (props: TamaguiOptions) => TamaguiProjectInfo | null;
|
|
15
|
-
getTamagui(): import("@tamagui/web").TamaguiInternalConfig | null | undefined;
|
|
16
|
-
parseSync: (f: FileOrPath, props: ExtractorParseProps) => {
|
|
17
|
-
styled: number;
|
|
18
|
-
flattened: number;
|
|
19
|
-
optimized: number;
|
|
20
|
-
modified: number;
|
|
21
|
-
found: number;
|
|
22
|
-
} | null;
|
|
23
|
-
parse: (f: FileOrPath, props: ExtractorParseProps) => Promise<{
|
|
24
|
-
styled: number;
|
|
25
|
-
flattened: number;
|
|
26
|
-
optimized: number;
|
|
27
|
-
modified: number;
|
|
28
|
-
found: number;
|
|
29
|
-
} | null>;
|
|
30
|
-
};
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=createExtractor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createExtractor.d.ts","sourceRoot":"","sources":["../../src/extractor/createExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,iBAAiB,CAAA;AAEhE,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAmBjC,OAAO,KAAK,EAGV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EAGf,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAoB,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAc1E,OAAO,EAAE,iBAAiB,EAA6B,MAAM,6BAA6B,CAAA;AAwB1F,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAE1D,KAAK,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AA6C9C,wBAAgB,eAAe,CAC7B,EAAE,MAAgB,EAAE,QAAgB,EAAE,GAAE,gBAAsC;;;;;yBAsJnD,cAAc;6BAPhB,cAAc;;mBAwBtB,UAAU,SAAS,mBAAmB;;;;;;;eAKpC,UAAU,SAAS,mBAAmB;;;;;;;EAynF1D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createLogger.d.ts","sourceRoot":"","sources":["../../src/extractor/createLogger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,IAQ9D,QAAG,UA2BZ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ensureImportingConcat.d.ts","sourceRoot":"","sources":["../../src/extractor/ensureImportingConcat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QA8B9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/extractor/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;CAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evaluateAstNode.d.ts","sourceRoot":"","sources":["../../src/extractor/evaluateAstNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,CAAC,CAAC,IAAI,GAAG,SAAS,GAAG,IAAI,EACnC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,GAAG,EAC9B,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,GACrC,GAAG,CAiIL"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
import type { ExtractedAttr, TamaguiOptionsWithFileInfo, Ternary } from '../types';
|
|
4
|
-
export declare function isPresent<T extends object>(input: null | void | undefined | T): input is T;
|
|
5
|
-
export declare function isSimpleSpread(node: t.JSXSpreadAttribute): boolean;
|
|
6
|
-
export declare const attrStr: (attr?: ExtractedAttr) => string | t.JSXIdentifier;
|
|
7
|
-
export declare const objToStr: (obj: any, spacer?: string) => any;
|
|
8
|
-
export declare const ternaryStr: (x: Ternary) => string;
|
|
9
|
-
export declare function findComponentName(scope: any): string | undefined;
|
|
10
|
-
export declare function isValidThemeHook(props: TamaguiOptionsWithFileInfo, jsxPath: NodePath<t.JSXElement>, n: t.MemberExpression, sourcePath?: string): boolean;
|
|
11
|
-
export declare const isInsideComponentPackage: (props: TamaguiOptionsWithFileInfo, moduleName: string) => any;
|
|
12
|
-
export declare const isComponentPackage: (props: TamaguiOptionsWithFileInfo, srcName: string) => any;
|
|
13
|
-
export declare function getValidComponent(props: TamaguiOptionsWithFileInfo, moduleName: string, componentName: string): false | {
|
|
14
|
-
staticConfig: import("@tamagui/web").StaticConfig;
|
|
15
|
-
} | null;
|
|
16
|
-
export declare const isValidModule: (props: TamaguiOptionsWithFileInfo, moduleName: string) => {
|
|
17
|
-
isLocal: boolean;
|
|
18
|
-
isValid: any;
|
|
19
|
-
};
|
|
20
|
-
export declare const getValidImport: (props: TamaguiOptionsWithFileInfo, moduleName: string, componentName?: string) => {
|
|
21
|
-
staticConfig: import("@tamagui/web").StaticConfig;
|
|
22
|
-
} | null;
|
|
23
|
-
export declare const isValidImport: (props: TamaguiOptionsWithFileInfo, moduleName: string, componentName?: string) => any;
|
|
24
|
-
export declare const getValidComponentsPaths: {
|
|
25
|
-
(...args: any[]): any;
|
|
26
|
-
cache: Map<any, any>;
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=extractHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractHelpers.d.ts","sourceRoot":"","sources":["../../src/extractor/extractHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAIlF,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EACxC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GACjC,KAAK,IAAI,CAAC,CAEZ;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,kBAAkB,WAExD;AAED,eAAO,MAAM,OAAO,GAAI,OAAO,aAAa,6BAQ3C,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,EAAE,eAAa,QAgB/C,CAAA;AASD,eAAO,MAAM,UAAU,GAAI,GAAG,OAAO,WAgBpC,CAAA;AAID,wBAAgB,iBAAiB,CAAC,KAAK,KAAA,sBAoBtC;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/B,CAAC,EAAE,CAAC,CAAC,gBAAgB,EACrB,UAAU,CAAC,EAAE,MAAM,WAkBpB;AAED,eAAO,MAAM,wBAAwB,GACnC,OAAO,0BAA0B,EACjC,YAAY,MAAM,QAKnB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAC7B,OAAO,0BAA0B,EACjC,SAAS,MAAM,QAKhB,CAAA;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,0BAA0B,EACjC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM;;SAiBtB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,0BAA0B,EAAE,YAAY,MAAM;;;CAWlF,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,OAAO,0BAA0B,EACjC,YAAY,MAAM,EAClB,gBAAgB,MAAM;;QAOvB,CAAA;AAED,eAAO,MAAM,aAAa,GACxB,OAAO,0BAA0B,EACjC,YAAY,MAAM,EAClB,gBAAgB,MAAM,QAMvB,CAAA;AAOD,eAAO,MAAM,uBAAuB;;;CAMlC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
import type { TamaguiInternalConfig } from '@tamagui/core';
|
|
4
|
-
import * as core from '@tamagui/core';
|
|
5
|
-
import type { TamaguiOptionsWithFileInfo, Ternary } from '../types';
|
|
6
|
-
export declare function extractMediaStyle(props: TamaguiOptionsWithFileInfo, ternary: Ternary, jsxPath: NodePath<t.JSXElement>, tamaguiConfig: TamaguiInternalConfig, sourcePath: string, importance?: number, shouldPrintDebug?: boolean | 'verbose'): {
|
|
7
|
-
mediaStyles: core.StyleObject[];
|
|
8
|
-
ternaryWithoutMedia: Ternary | null;
|
|
9
|
-
} | null;
|
|
10
|
-
export declare function isValidMediaCall(props: TamaguiOptionsWithFileInfo, jsxPath: NodePath<t.JSXElement>, init: t.Expression, sourcePath: string): boolean;
|
|
11
|
-
//# sourceMappingURL=extractMediaStyle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractMediaStyle.d.ts","sourceRoot":"","sources":["../../src/extractor/extractMediaStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,IAAI,MAAM,eAAe,CAAA;AAIrC,OAAO,KAAK,EAAe,0BAA0B,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAGhF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/B,aAAa,EAAE,qBAAqB,EACpC,UAAU,EAAE,MAAM,EAClB,UAAU,SAAI,EACd,gBAAgB,GAAE,OAAO,GAAG,SAAiB;;;SAmE9C;AA0FD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC/B,IAAI,EAAE,CAAC,CAAC,UAAU,EAClB,UAAU,EAAE,MAAM,WAenB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as t from '@babel/types';
|
|
2
|
-
import type { TamaguiOptions } from '../types';
|
|
3
|
-
import type { Extractor } from './createExtractor';
|
|
4
|
-
export type ExtractedResponse = {
|
|
5
|
-
js: string | Buffer;
|
|
6
|
-
styles: string;
|
|
7
|
-
stylesPath?: string;
|
|
8
|
-
ast: t.File;
|
|
9
|
-
map: any;
|
|
10
|
-
stats: {
|
|
11
|
-
styled: number;
|
|
12
|
-
flattened: number;
|
|
13
|
-
optimized: number;
|
|
14
|
-
found: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type ExtractToClassNamesProps = {
|
|
18
|
-
extractor: Extractor;
|
|
19
|
-
source: string | Buffer;
|
|
20
|
-
sourcePath?: string;
|
|
21
|
-
options: TamaguiOptions;
|
|
22
|
-
shouldPrintDebug: boolean | 'verbose';
|
|
23
|
-
};
|
|
24
|
-
export declare function extractToClassNames({ extractor, source, sourcePath, options, shouldPrintDebug, }: ExtractToClassNamesProps): Promise<ExtractedResponse | null>;
|
|
25
|
-
//# sourceMappingURL=extractToClassNames.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAKjC,OAAO,KAAK,EAAe,cAAc,EAAW,MAAM,UAAU,CAAA;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAYlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;IACX,GAAG,EAAE,GAAG,CAAA;IACR,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,CAAA;AAQD,wBAAsB,mBAAmB,CAAC,EACxC,SAAS,EACT,MAAM,EACN,UAAe,EACf,OAAO,EACP,gBAAgB,GACjB,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAinB9D"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type BabelFileResult } from '@babel/core';
|
|
2
|
-
import type { TamaguiOptions } from '../types';
|
|
3
|
-
export declare function extractToNative(sourceFileName: string, sourceCode: string, options: TamaguiOptions): BabelFileResult;
|
|
4
|
-
export declare function getBabelPlugin(): any;
|
|
5
|
-
export declare function getBabelParseDefinition(options: TamaguiOptions): {
|
|
6
|
-
name: string;
|
|
7
|
-
visitor: {
|
|
8
|
-
Program: {
|
|
9
|
-
enter(this: any, root: any): void;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=extractToNative.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractToNative.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToNative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,aAAa,CAAA;AAQxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAsB9C,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,eAAe,CAoBjB;AAED,wBAAgB,cAAc,QAK7B;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;wBAM3C,GAAG;;;EA0ZtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"findTopmostFunction.d.ts","sourceRoot":"","sources":["../../src/extractor/findTopmostFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,KAAK,CAAC,MAAM,cAAc,CAAA;AAEtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,wBAoBlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generatedUid.d.ts","sourceRoot":"","sources":["../../src/extractor/generatedUid.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,cAAc,CAAC;IAC5B,SAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACpD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAgC5D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPrefixLogs.d.ts","sourceRoot":"","sources":["../../src/extractor/getPrefixLogs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,cAAc,UAKrD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as t from '@babel/types';
|
|
2
|
-
/**
|
|
3
|
-
* getPropValueFromAttributes gets a prop by name from a list of attributes and accounts for potential spread operators.
|
|
4
|
-
* Here's an example. Given this component:
|
|
5
|
-
* ```
|
|
6
|
-
* <Block coolProp="wow" {...spread1} neatProp="ok" {...spread2} />```
|
|
7
|
-
* getPropValueFromAttributes will return the following:
|
|
8
|
-
* - for propName `coolProp`:
|
|
9
|
-
* ```
|
|
10
|
-
* accessSafe(spread1, 'coolProp') || accessSafe(spread2, 'coolProp') || 'wow'```
|
|
11
|
-
* - for propName `neatProp`:
|
|
12
|
-
* ```
|
|
13
|
-
* accessSafe(spread2, 'neatProp') || 'ok'```
|
|
14
|
-
* - for propName `notPresent`: `null`
|
|
15
|
-
*
|
|
16
|
-
* The returned value should (obviously) be placed after spread operators.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getPropValueFromAttributes(propName: string, attrs: (t.JSXAttribute | t.JSXSpreadAttribute)[]): t.Expression | null;
|
|
19
|
-
//# sourceMappingURL=getPropValueFromAttributes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPropValueFromAttributes.d.ts","sourceRoot":"","sources":["../../src/extractor/getPropValueFromAttributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAIjC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,EAAE,GAC/C,CAAC,CAAC,UAAU,GAAG,IAAI,CAsErB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as t from '@babel/types';
|
|
2
|
-
export interface SourceModule {
|
|
3
|
-
sourceModule?: string;
|
|
4
|
-
imported?: string;
|
|
5
|
-
local?: string;
|
|
6
|
-
destructured?: boolean;
|
|
7
|
-
usesImportSyntax: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function getSourceModule(itemName: string, itemBinding: {
|
|
10
|
-
constant?: boolean;
|
|
11
|
-
path: {
|
|
12
|
-
node: t.Node;
|
|
13
|
-
parent: any;
|
|
14
|
-
};
|
|
15
|
-
}): SourceModule | null;
|
|
16
|
-
//# sourceMappingURL=getSourceModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceModule.d.ts","sourceRoot":"","sources":["../../src/extractor/getSourceModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE;IACX,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;QAAC,MAAM,EAAE,GAAG,CAAA;KAAE,CAAA;CACpC,GACA,YAAY,GAAG,IAAI,CA+ErB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
export declare function cleanupBeforeExit(): void;
|
|
4
|
-
export declare function getStaticBindingsForScope(scope: NodePath<t.JSXElement>['scope'], whitelist: string[] | undefined, sourcePath: string, bindingCache: Record<string, string | null>, shouldPrintDebug: boolean | 'verbose'): Promise<Record<string, any>>;
|
|
5
|
-
//# sourceMappingURL=getStaticBindingsForScope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getStaticBindingsForScope.d.ts","sourceRoot":"","sources":["../../src/extractor/getStaticBindingsForScope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAuCjC,wBAAgB,iBAAiB,SAQhC;AA4CD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,EACtC,SAAS,EAAE,MAAM,EAAE,YAAK,EACxB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAC3C,gBAAgB,EAAE,OAAO,GAAG,SAAS,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAsI9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasTopLevelAwait.d.ts","sourceRoot":"","sources":["../../src/extractor/hasTopLevelAwait.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,WAwBnE"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { NodePath } from '@babel/traverse';
|
|
2
|
-
import * as t from '@babel/types';
|
|
3
|
-
export declare function hoistClassNames(path: NodePath<t.JSXElement>, existing: {
|
|
4
|
-
[key: string]: t.Identifier;
|
|
5
|
-
}, expr: t.Expression): any;
|
|
6
|
-
//# sourceMappingURL=hoistClassNames.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hoistClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/hoistClassNames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAEjC,wBAAgB,eAAe,CAC7B,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAC5B,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,CAAA;CAAE,EACzC,IAAI,EAAE,CAAC,CAAC,UAAU,OA6CnB"}
|