@tamagui/static 1.0.1-beta.19 → 1.0.1-beta.191
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/constants.js → constants.js} +9 -4
- package/dist/constants.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/accessSafe.js +14 -4
- package/dist/{esm/extractor → extractor}/accessSafe.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/babelParse.js +20 -17
- package/dist/extractor/babelParse.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/buildClassName.js +40 -11
- package/dist/extractor/buildClassName.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/createEvaluator.js +19 -14
- package/dist/extractor/createEvaluator.js.map +7 -0
- package/dist/extractor/createExtractor.js +1577 -0
- package/dist/extractor/createExtractor.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/ensureImportingConcat.js +18 -8
- package/dist/extractor/ensureImportingConcat.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/evaluateAstNode.js +14 -6
- package/dist/{esm/extractor → extractor}/evaluateAstNode.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/extractHelpers.js +56 -27
- package/dist/extractor/extractHelpers.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/extractMediaStyle.js +49 -50
- package/dist/extractor/extractMediaStyle.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/extractToClassNames.js +160 -109
- package/dist/extractor/extractToClassNames.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/findTopmostFunction.js +2 -3
- package/dist/{esm/extractor → extractor}/findTopmostFunction.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/generatedUid.js +9 -4
- package/dist/{cjs/extractor → extractor}/generatedUid.js.map +3 -3
- package/dist/{cjs/extractor → extractor}/getPrefixLogs.js +1 -2
- package/dist/extractor/getPrefixLogs.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/getPropValueFromAttributes.js +24 -15
- package/dist/extractor/getPropValueFromAttributes.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/getSourceModule.js +5 -3
- package/dist/{esm/extractor → extractor}/getSourceModule.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/getStaticBindingsForScope.js +88 -38
- package/dist/extractor/getStaticBindingsForScope.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/hoistClassNames.js +5 -4
- package/dist/{esm/extractor → extractor}/hoistClassNames.js.map +3 -3
- package/dist/{cjs/extractor → extractor}/literalToAst.js +26 -34
- package/dist/{cjs/extractor → extractor}/literalToAst.js.map +2 -2
- package/dist/extractor/loadFile.js +21 -0
- package/dist/extractor/loadFile.js.map +7 -0
- package/dist/extractor/loadTamagui.js +327 -0
- package/dist/extractor/loadTamagui.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/logLines.js +3 -3
- package/dist/{cjs/extractor → extractor}/logLines.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/normalizeTernaries.js +13 -36
- package/dist/extractor/normalizeTernaries.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/removeUnusedHooks.js +7 -5
- package/dist/{cjs/extractor → extractor}/removeUnusedHooks.js.map +2 -2
- package/dist/{cjs/extractor → extractor}/timer.js +11 -4
- package/dist/extractor/timer.js.map +7 -0
- package/dist/{cjs/extractor → extractor}/validHTMLAttributes.js +52 -0
- package/dist/extractor/validHTMLAttributes.js.map +7 -0
- package/dist/getPragmaOptions.js +68 -0
- package/dist/getPragmaOptions.js.map +7 -0
- package/dist/{cjs/index.js → index.js} +11 -7
- package/dist/index.js.map +7 -0
- package/dist/require.js +95 -0
- package/dist/require.js.map +7 -0
- package/dist/{cjs/types.js → types.js} +1 -0
- package/dist/types.js.map +7 -0
- package/dist/webpackPlugin.js +35 -0
- package/dist/webpackPlugin.js.map +7 -0
- package/package.json +46 -35
- package/src/constants.ts +14 -0
- package/src/extractor/accessSafe.ts +18 -0
- package/src/extractor/babelParse.ts +27 -0
- package/src/extractor/buildClassName.ts +77 -0
- package/src/extractor/createEvaluator.ts +73 -0
- package/src/extractor/createExtractor.ts +2044 -0
- package/src/extractor/ensureImportingConcat.ts +32 -0
- package/src/extractor/evaluateAstNode.ts +121 -0
- package/src/extractor/extractHelpers.ts +154 -0
- package/src/extractor/extractMediaStyle.ts +199 -0
- package/src/extractor/extractToClassNames.ts +442 -0
- package/src/extractor/findTopmostFunction.ts +22 -0
- package/src/extractor/generatedUid.ts +43 -0
- package/src/extractor/getPrefixLogs.ts +6 -0
- package/src/extractor/getPropValueFromAttributes.ts +92 -0
- package/src/extractor/getSourceModule.ts +101 -0
- package/src/extractor/getStaticBindingsForScope.ts +227 -0
- package/src/extractor/hoistClassNames.ts +45 -0
- package/src/extractor/literalToAst.ts +84 -0
- package/src/extractor/loadFile.ts +17 -0
- package/src/extractor/loadTamagui.ts +377 -0
- package/src/extractor/logLines.ts +16 -0
- package/src/extractor/normalizeTernaries.ts +63 -0
- package/src/extractor/removeUnusedHooks.ts +76 -0
- package/src/extractor/timer.ts +29 -0
- package/src/extractor/validHTMLAttributes.ts +99 -0
- package/src/getPragmaOptions.ts +52 -0
- package/src/index.ts +12 -0
- package/src/require.ts +112 -0
- package/src/types.ts +94 -0
- package/src/webpackPlugin.ts +9 -0
- package/tamagui.tsconfig.json +5 -0
- package/types/constants.d.ts +1 -1
- package/types/extractor/buildClassName.d.ts +5 -2
- package/types/extractor/createEvaluator.d.ts +4 -4
- package/types/extractor/createExtractor.d.ts +26 -11
- package/types/extractor/extractHelpers.d.ts +6 -4
- package/types/extractor/extractMediaStyle.d.ts +3 -3
- package/types/extractor/extractToClassNames.d.ts +4 -9
- package/types/extractor/findTopmostFunction.d.ts +1 -1
- package/types/extractor/getPrefixLogs.d.ts +1 -1
- package/types/extractor/getPropValueFromAttributes.d.ts +16 -0
- package/types/extractor/getStaticBindingsForScope.d.ts +2 -1
- package/types/extractor/loadFile.d.ts +1 -0
- package/types/extractor/loadTamagui.d.ts +15 -5
- package/types/extractor/normalizeTernaries.d.ts +1 -1
- package/types/extractor/validHTMLAttributes.d.ts +49 -0
- package/types/getPragmaOptions.d.ts +9 -0
- package/types/index.d.ts +10 -7
- package/types/require.d.ts +4 -0
- package/types/types.d.ts +29 -32
- package/types/webpackPlugin.d.ts +4 -0
- package/dist/cjs/constants.js.map +0 -7
- package/dist/cjs/extractor/accessSafe.js.map +0 -7
- package/dist/cjs/extractor/babelParse.js.map +0 -7
- package/dist/cjs/extractor/buildClassName.js.map +0 -7
- package/dist/cjs/extractor/createEvaluator.js.map +0 -7
- package/dist/cjs/extractor/createExtractor.js +0 -1221
- package/dist/cjs/extractor/createExtractor.js.map +0 -7
- package/dist/cjs/extractor/ensureImportingConcat.js.map +0 -7
- package/dist/cjs/extractor/evaluateAstNode.js.map +0 -7
- package/dist/cjs/extractor/extractHelpers.js.map +0 -7
- package/dist/cjs/extractor/extractMediaStyle.js.map +0 -7
- package/dist/cjs/extractor/extractToClassNames.js.map +0 -7
- package/dist/cjs/extractor/findTopmostFunction.js.map +0 -7
- package/dist/cjs/extractor/getPrefixLogs.js.map +0 -7
- package/dist/cjs/extractor/getPropValueFromAttributes.js.map +0 -7
- package/dist/cjs/extractor/getSourceModule.js.map +0 -7
- package/dist/cjs/extractor/getStaticBindingsForScope.js.map +0 -7
- package/dist/cjs/extractor/hoistClassNames.js.map +0 -7
- package/dist/cjs/extractor/loadTamagui.js +0 -106
- package/dist/cjs/extractor/loadTamagui.js.map +0 -7
- package/dist/cjs/extractor/normalizeTernaries.js.map +0 -7
- package/dist/cjs/extractor/timer.js.map +0 -7
- package/dist/cjs/extractor/validHTMLAttributes.js.map +0 -7
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/patchReactNativeWeb.js +0 -167
- package/dist/cjs/patchReactNativeWeb.js.map +0 -7
- package/dist/cjs/types.js.map +0 -7
- package/dist/esm/constants.js +0 -14
- package/dist/esm/constants.js.map +0 -7
- package/dist/esm/extractor/accessSafe.js +0 -11
- package/dist/esm/extractor/babelParse.js +0 -30
- package/dist/esm/extractor/babelParse.js.map +0 -7
- package/dist/esm/extractor/buildClassName.js +0 -40
- package/dist/esm/extractor/buildClassName.js.map +0 -7
- package/dist/esm/extractor/createEvaluator.js +0 -52
- package/dist/esm/extractor/createEvaluator.js.map +0 -7
- package/dist/esm/extractor/createExtractor.js +0 -1169
- package/dist/esm/extractor/createExtractor.js.map +0 -7
- package/dist/esm/extractor/ensureImportingConcat.js +0 -24
- package/dist/esm/extractor/ensureImportingConcat.js.map +0 -7
- package/dist/esm/extractor/evaluateAstNode.js +0 -94
- package/dist/esm/extractor/extractHelpers.js +0 -103
- package/dist/esm/extractor/extractHelpers.js.map +0 -7
- package/dist/esm/extractor/extractMediaStyle.js +0 -152
- package/dist/esm/extractor/extractMediaStyle.js.map +0 -7
- package/dist/esm/extractor/extractToClassNames.js +0 -293
- package/dist/esm/extractor/extractToClassNames.js.map +0 -7
- package/dist/esm/extractor/findTopmostFunction.js +0 -23
- package/dist/esm/extractor/generatedUid.js +0 -28
- package/dist/esm/extractor/generatedUid.js.map +0 -7
- package/dist/esm/extractor/getPrefixLogs.js +0 -12
- package/dist/esm/extractor/getPrefixLogs.js.map +0 -7
- package/dist/esm/extractor/getPropValueFromAttributes.js +0 -49
- package/dist/esm/extractor/getPropValueFromAttributes.js.map +0 -7
- package/dist/esm/extractor/getSourceModule.js +0 -69
- package/dist/esm/extractor/getStaticBindingsForScope.js +0 -137
- package/dist/esm/extractor/getStaticBindingsForScope.js.map +0 -7
- package/dist/esm/extractor/hoistClassNames.js +0 -44
- package/dist/esm/extractor/literalToAst.js +0 -80
- package/dist/esm/extractor/literalToAst.js.map +0 -7
- package/dist/esm/extractor/loadTamagui.js +0 -84
- package/dist/esm/extractor/loadTamagui.js.map +0 -7
- package/dist/esm/extractor/logLines.js +0 -22
- package/dist/esm/extractor/logLines.js.map +0 -7
- package/dist/esm/extractor/normalizeTernaries.js +0 -53
- package/dist/esm/extractor/normalizeTernaries.js.map +0 -7
- package/dist/esm/extractor/removeUnusedHooks.js +0 -80
- package/dist/esm/extractor/removeUnusedHooks.js.map +0 -7
- package/dist/esm/extractor/timer.js +0 -24
- package/dist/esm/extractor/timer.js.map +0 -7
- package/dist/esm/extractor/validHTMLAttributes.js +0 -52
- package/dist/esm/extractor/validHTMLAttributes.js.map +0 -7
- package/dist/esm/index.js +0 -14
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/patchReactNativeWeb.js +0 -142
- package/dist/esm/patchReactNativeWeb.js.map +0 -7
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -7
- package/dist/jsx/constants.js +0 -13
- package/dist/jsx/extractor/accessSafe.js +0 -10
- package/dist/jsx/extractor/babelParse.js +0 -29
- package/dist/jsx/extractor/buildClassName.js +0 -39
- package/dist/jsx/extractor/createEvaluator.js +0 -51
- package/dist/jsx/extractor/createExtractor.js +0 -1168
- package/dist/jsx/extractor/ensureImportingConcat.js +0 -23
- package/dist/jsx/extractor/evaluateAstNode.js +0 -93
- package/dist/jsx/extractor/extractHelpers.js +0 -102
- package/dist/jsx/extractor/extractMediaStyle.js +0 -151
- package/dist/jsx/extractor/extractToClassNames.js +0 -292
- package/dist/jsx/extractor/findTopmostFunction.js +0 -22
- package/dist/jsx/extractor/generatedUid.js +0 -27
- package/dist/jsx/extractor/getPrefixLogs.js +0 -11
- package/dist/jsx/extractor/getPropValueFromAttributes.js +0 -48
- package/dist/jsx/extractor/getSourceModule.js +0 -68
- package/dist/jsx/extractor/getStaticBindingsForScope.js +0 -136
- package/dist/jsx/extractor/hoistClassNames.js +0 -43
- package/dist/jsx/extractor/literalToAst.js +0 -79
- package/dist/jsx/extractor/loadTamagui.js +0 -83
- package/dist/jsx/extractor/logLines.js +0 -21
- package/dist/jsx/extractor/normalizeTernaries.js +0 -52
- package/dist/jsx/extractor/removeUnusedHooks.js +0 -79
- package/dist/jsx/extractor/timer.js +0 -23
- package/dist/jsx/extractor/validHTMLAttributes.js +0 -51
- package/dist/jsx/index.js +0 -13
- package/dist/jsx/patchReactNativeWeb.js +0 -141
- package/dist/jsx/types.js +0 -0
- package/types/constants.d.ts.map +0 -1
- package/types/extractor/accessSafe.d.ts.map +0 -1
- package/types/extractor/babelParse.d.ts.map +0 -1
- package/types/extractor/buildClassName.d.ts.map +0 -1
- package/types/extractor/createEvaluator.d.ts.map +0 -1
- package/types/extractor/createExtractor.d.ts.map +0 -1
- package/types/extractor/ensureImportingConcat.d.ts.map +0 -1
- package/types/extractor/evaluateAstNode.d.ts.map +0 -1
- package/types/extractor/extractHelpers.d.ts.map +0 -1
- package/types/extractor/extractMediaStyle.d.ts.map +0 -1
- package/types/extractor/extractToClassNames.d.ts.map +0 -1
- package/types/extractor/findTopmostFunction.d.ts.map +0 -1
- package/types/extractor/generatedUid.d.ts.map +0 -1
- package/types/extractor/getPrefixLogs.d.ts.map +0 -1
- package/types/extractor/getPropValueFromAttributes.d.ts.map +0 -1
- package/types/extractor/getSourceModule.d.ts.map +0 -1
- package/types/extractor/getStaticBindingsForScope.d.ts.map +0 -1
- package/types/extractor/hoistClassNames.d.ts.map +0 -1
- package/types/extractor/literalToAst.d.ts.map +0 -1
- package/types/extractor/loadTamagui.d.ts.map +0 -1
- package/types/extractor/logLines.d.ts.map +0 -1
- package/types/extractor/normalizeTernaries.d.ts.map +0 -1
- package/types/extractor/removeUnusedHooks.d.ts.map +0 -1
- package/types/extractor/timer.d.ts.map +0 -1
- package/types/extractor/validHTMLAttributes.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/patchReactNativeWeb.d.ts +0 -2
- package/types/patchReactNativeWeb.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
package/src/index.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
process.env.TAMAGUI_COMPILE_PROCESS = '1'
|
|
2
|
+
|
|
3
|
+
export { TamaguiOptions } from './types.js'
|
|
4
|
+
export { createExtractor } from './extractor/createExtractor.js'
|
|
5
|
+
export { literalToAst } from './extractor/literalToAst.js'
|
|
6
|
+
export * from './constants.js'
|
|
7
|
+
export * from './extractor/extractToClassNames.js'
|
|
8
|
+
export * from './extractor/extractHelpers.js'
|
|
9
|
+
export * from '@tamagui/patch-rnw'
|
|
10
|
+
export * from './extractor/loadTamagui.js'
|
|
11
|
+
export * from './require.js'
|
|
12
|
+
export * from './getPragmaOptions.js'
|
package/src/require.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { sep } from 'path'
|
|
2
|
+
|
|
3
|
+
import { SHOULD_DEBUG } from './constants.js'
|
|
4
|
+
|
|
5
|
+
const nameToPaths = {}
|
|
6
|
+
const Module = require('module')
|
|
7
|
+
const og = Module.prototype.require
|
|
8
|
+
globalThis['ogRequire'] = og
|
|
9
|
+
|
|
10
|
+
export const getNameToPaths = () => nameToPaths
|
|
11
|
+
|
|
12
|
+
// just for catching egregious amounts of errors in a tight loop
|
|
13
|
+
let tries = 0
|
|
14
|
+
setInterval(() => {
|
|
15
|
+
tries = 0
|
|
16
|
+
}, 50)
|
|
17
|
+
|
|
18
|
+
export function registerRequire(bubbleErrors?: boolean) {
|
|
19
|
+
if (Module.prototype.require !== globalThis['ogRequire']) {
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn('didnt unregister before re-registering')
|
|
22
|
+
process.exit(1)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const proxyWorm = require('@tamagui/proxy-worm')
|
|
26
|
+
// TODO can swap with react-native-web-lite
|
|
27
|
+
const rnw = require('react-native-web')
|
|
28
|
+
const core = require('@tamagui/core-node')
|
|
29
|
+
|
|
30
|
+
Module.prototype.require = function (path: string) {
|
|
31
|
+
if (SHOULD_DEBUG) {
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
console.log('tamagui:require', path)
|
|
34
|
+
}
|
|
35
|
+
if (path.endsWith('.css') || path.endsWith('.json') || path.endsWith('.ttf')) {
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
if (
|
|
39
|
+
path === '@gorhom/bottom-sheet' ||
|
|
40
|
+
path.startsWith('react-native-reanimated') ||
|
|
41
|
+
path === 'expo-linear-gradient' ||
|
|
42
|
+
path === '@expo/vector-icons'
|
|
43
|
+
) {
|
|
44
|
+
return proxyWorm
|
|
45
|
+
}
|
|
46
|
+
if (
|
|
47
|
+
path.startsWith('react-native') &&
|
|
48
|
+
// allow our rnw.tsx imports through
|
|
49
|
+
!path.startsWith('react-native-web/dist/cjs/exports'.replace(/\//g, sep))
|
|
50
|
+
) {
|
|
51
|
+
return rnw
|
|
52
|
+
}
|
|
53
|
+
if (path === '@tamagui/core') {
|
|
54
|
+
return core
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
const out = og.apply(this, arguments)
|
|
58
|
+
// only for studio disable for now
|
|
59
|
+
// if (!nameToPaths[path]) {
|
|
60
|
+
// if (out && typeof out === 'object') {
|
|
61
|
+
// for (const key in out) {
|
|
62
|
+
// try {
|
|
63
|
+
// const conf = out[key]?.staticConfig as StaticConfig
|
|
64
|
+
// if (conf) {
|
|
65
|
+
// if (conf.componentName) {
|
|
66
|
+
// nameToPaths[conf.componentName] ??= new Set()
|
|
67
|
+
// const fullName = path.startsWith('.')
|
|
68
|
+
// ? join(`${this.path.replace(/dist(\/cjs)?/, 'src')}`, path)
|
|
69
|
+
// : path
|
|
70
|
+
// nameToPaths[conf.componentName].add(fullName)
|
|
71
|
+
// } else {
|
|
72
|
+
// // console.log('no name component', path)
|
|
73
|
+
// }
|
|
74
|
+
// }
|
|
75
|
+
// } catch {
|
|
76
|
+
// // ok
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
return out
|
|
82
|
+
} catch (err: any) {
|
|
83
|
+
if (bubbleErrors) {
|
|
84
|
+
throw err
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// eslint-disable-next-line no-console
|
|
88
|
+
console.error(
|
|
89
|
+
`Tamagui failed requiring ${path} from your tamagui.config.ts file, ignoring\n`,
|
|
90
|
+
err.message,
|
|
91
|
+
err.stack
|
|
92
|
+
)
|
|
93
|
+
const max = process.env.TAMAGUI_MAX_ERRORS ? +process.env.TAMAGUI_MAX_ERRORS : 200
|
|
94
|
+
if (++tries > max) {
|
|
95
|
+
// eslint-disable-next-line no-console
|
|
96
|
+
console.log(
|
|
97
|
+
`Too many errors loading design system, exiting (set TAMAGUI_MAX_ERRORS to override)..`
|
|
98
|
+
)
|
|
99
|
+
// avoid infinite loops
|
|
100
|
+
process.exit(1)
|
|
101
|
+
}
|
|
102
|
+
// return proxyWorm by default
|
|
103
|
+
return proxyWorm
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return Module.prototype.require
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function unregisterRequire() {
|
|
111
|
+
Module.prototype.require = og
|
|
112
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { NodePath } from '@babel/traverse'
|
|
2
|
+
import * as t from '@babel/types'
|
|
3
|
+
import type { PseudoStyles, StaticConfig } from '@tamagui/core-node'
|
|
4
|
+
import type { StyleObject } from '@tamagui/helpers'
|
|
5
|
+
import type { TamaguiOptions } from '@tamagui/helpers-node'
|
|
6
|
+
import type { ViewStyle } from 'react-native'
|
|
7
|
+
|
|
8
|
+
export type { TamaguiOptions } from '@tamagui/helpers-node'
|
|
9
|
+
|
|
10
|
+
export type { StyleObject } from '@tamagui/helpers'
|
|
11
|
+
|
|
12
|
+
export type ClassNameObject = t.StringLiteral | t.Expression
|
|
13
|
+
|
|
14
|
+
export interface CacheObject {
|
|
15
|
+
[key: string]: any
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LogOptions {
|
|
19
|
+
clear?: boolean
|
|
20
|
+
timestamp?: boolean
|
|
21
|
+
error?: Error | null
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface Logger {
|
|
25
|
+
info(msg: string, options?: LogOptions): void
|
|
26
|
+
warn(msg: string, options?: LogOptions): void
|
|
27
|
+
error(msg: string, options?: LogOptions): void
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type ExtractorOptions = {
|
|
31
|
+
logger?: Logger
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ExtractedAttrAttr = {
|
|
35
|
+
type: 'attr'
|
|
36
|
+
value: t.JSXAttribute | t.JSXSpreadAttribute
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ExtractedAttrStyle = {
|
|
40
|
+
type: 'style'
|
|
41
|
+
value: ViewStyle & PseudoStyles
|
|
42
|
+
attr?: t.JSXAttribute | t.JSXSpreadAttribute
|
|
43
|
+
name?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ExtractedAttr =
|
|
47
|
+
| ExtractedAttrAttr
|
|
48
|
+
| { type: 'ternary'; value: Ternary }
|
|
49
|
+
| ExtractedAttrStyle
|
|
50
|
+
|
|
51
|
+
export type ExtractTagProps = {
|
|
52
|
+
attrs: ExtractedAttr[]
|
|
53
|
+
node: t.JSXOpeningElement
|
|
54
|
+
attemptEval: (exprNode: t.Node, evalFn?: ((node: t.Node) => any) | undefined) => any
|
|
55
|
+
jsxPath: NodePath<t.JSXElement>
|
|
56
|
+
programPath: NodePath<t.Program>
|
|
57
|
+
originalNodeName: string
|
|
58
|
+
lineNumbers: string
|
|
59
|
+
filePath: string
|
|
60
|
+
isFlattened: boolean
|
|
61
|
+
completeProps: Record<string, any>
|
|
62
|
+
staticConfig: StaticConfig
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type TamaguiOptionsWithFileInfo = TamaguiOptions & {
|
|
66
|
+
sourcePath: string
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type ExtractorParseProps = TamaguiOptionsWithFileInfo & {
|
|
70
|
+
target: 'native' | 'html'
|
|
71
|
+
shouldPrintDebug?: boolean | 'verbose'
|
|
72
|
+
onExtractTag: (props: ExtractTagProps) => void
|
|
73
|
+
getFlattenedNode?: (props: { isTextView: boolean; tag: string }) => string
|
|
74
|
+
extractStyledDefinitions?: boolean
|
|
75
|
+
// identifer, rule
|
|
76
|
+
onStyleRule?: (identifier: string, rules: string[]) => void
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface Ternary {
|
|
80
|
+
test: t.Expression
|
|
81
|
+
// shorthand props that don't use hooks
|
|
82
|
+
inlineMediaQuery?: string
|
|
83
|
+
remove: Function
|
|
84
|
+
consequent: Object | null
|
|
85
|
+
alternate: Object | null
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type ClassNameToStyleObj = {
|
|
89
|
+
[key: string]: StyleObject
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface PluginContext {
|
|
93
|
+
write: (path: string, rules: { [key: string]: string }) => any
|
|
94
|
+
}
|
package/types/constants.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export declare const CSS_FILE_NAME = "__snack.css";
|
|
|
2
2
|
export declare const MEDIA_SEP = "_";
|
|
3
3
|
export declare const cacheDir: any;
|
|
4
4
|
export declare const FAILED_EVAL: unique symbol;
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const SHOULD_DEBUG: boolean | undefined;
|
|
6
6
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as t from '@babel/types';
|
|
2
|
-
import { ClassNameObject } from '../types';
|
|
3
|
-
|
|
2
|
+
import type { ClassNameObject } from '../types.js';
|
|
3
|
+
declare 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 {};
|
|
4
7
|
//# sourceMappingURL=buildClassName.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import
|
|
4
|
-
export declare function createEvaluator({
|
|
5
|
-
|
|
3
|
+
import { TamaguiOptionsWithFileInfo } from '../types.js';
|
|
4
|
+
export declare function createEvaluator({ props, staticNamespace, sourcePath, traversePath, shouldPrintDebug, }: {
|
|
5
|
+
props: TamaguiOptionsWithFileInfo;
|
|
6
6
|
staticNamespace: Record<string, any>;
|
|
7
7
|
sourcePath: string;
|
|
8
|
-
traversePath
|
|
8
|
+
traversePath?: NodePath<t.JSXElement>;
|
|
9
9
|
shouldPrintDebug: boolean | 'verbose';
|
|
10
10
|
}): (n: t.Node) => any;
|
|
11
11
|
export declare function createSafeEvaluator(attemptEval: (n: t.Node) => any): (n: t.Node) => any;
|
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
import { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import type { ExtractorOptions, ExtractorParseProps, TamaguiOptions } from '../types.js';
|
|
4
|
+
import { cleanupBeforeExit } from './getStaticBindingsForScope.js';
|
|
5
|
+
import { TamaguiProjectInfo } from './loadTamagui.js';
|
|
5
6
|
export declare type Extractor = ReturnType<typeof createExtractor>;
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
declare type FileOrPath = NodePath<t.Program> | t.File;
|
|
8
|
+
export declare function createExtractor({ logger }?: ExtractorOptions): {
|
|
9
|
+
options: {
|
|
10
|
+
logger: import("../types.js").Logger;
|
|
11
|
+
};
|
|
12
|
+
cleanupBeforeExit: typeof cleanupBeforeExit;
|
|
13
|
+
loadTamagui: (props: TamaguiOptions) => Promise<TamaguiProjectInfo>;
|
|
14
|
+
loadTamaguiSync: (props: TamaguiOptions) => TamaguiProjectInfo;
|
|
15
|
+
getTamagui(): import("@tamagui/core-node").TamaguiInternalConfig<import("@tamagui/core-node").CreateTokens<import("@tamagui/core-node").VariableVal>, {
|
|
8
16
|
[key: string]: Partial<import("@tamagui/core-node").TamaguiBaseTheme> & {
|
|
9
17
|
[key: string]: import("@tamagui/core-node").VariableVal;
|
|
10
18
|
};
|
|
11
|
-
},
|
|
12
|
-
[
|
|
19
|
+
}, import("@tamagui/core-node").GenericShorthands, {
|
|
20
|
+
[key: string]: {
|
|
13
21
|
[key: string]: string | number;
|
|
14
22
|
};
|
|
15
23
|
}, {
|
|
16
|
-
[key: string]: string | {
|
|
24
|
+
[key: string]: string | any[] | {
|
|
17
25
|
[key: string]: any;
|
|
18
26
|
};
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
parse: (fileOrPath: NodePath<t.Program> | t.File, { config, importsWhitelist, evaluateVars, shouldPrintDebug, sourcePath, onExtractTag, getFlattenedNode, disable, disableExtraction, disableExtractInlineMedia, disableExtractVariables, disableDebugAttr, prefixLogs, excludeProps, ...props }: ExtractorParseProps) => {
|
|
27
|
+
}, import("@tamagui/core-node").GenericFonts> | undefined;
|
|
28
|
+
parseSync: (f: FileOrPath, props: ExtractorParseProps) => {
|
|
29
|
+
styled: number;
|
|
23
30
|
flattened: number;
|
|
24
31
|
optimized: number;
|
|
25
32
|
modified: number;
|
|
26
33
|
found: number;
|
|
27
34
|
} | null;
|
|
35
|
+
parse: (f: FileOrPath, props: ExtractorParseProps) => Promise<{
|
|
36
|
+
styled: number;
|
|
37
|
+
flattened: number;
|
|
38
|
+
optimized: number;
|
|
39
|
+
modified: number;
|
|
40
|
+
found: number;
|
|
41
|
+
} | null>;
|
|
28
42
|
};
|
|
43
|
+
export {};
|
|
29
44
|
//# sourceMappingURL=createExtractor.d.ts.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import { ExtractedAttr, Ternary } from '../types';
|
|
3
|
+
import type { ExtractedAttr, TamaguiOptionsWithFileInfo, Ternary } from '../types.js';
|
|
4
4
|
export declare function isPresent<T extends Object>(input: null | void | undefined | T): input is T;
|
|
5
5
|
export declare function isSimpleSpread(node: t.JSXSpreadAttribute): boolean;
|
|
6
|
-
export declare const attrStr: (attr?: ExtractedAttr
|
|
6
|
+
export declare const attrStr: (attr?: ExtractedAttr) => string | t.JSXIdentifier;
|
|
7
7
|
export declare const objToStr: (obj: any, spacer?: string) => any;
|
|
8
8
|
export declare const ternaryStr: (x: Ternary) => string;
|
|
9
9
|
export declare function findComponentName(scope: any): string | undefined;
|
|
10
|
-
export declare function isValidThemeHook(jsxPath: NodePath<t.JSXElement>, n: t.MemberExpression, sourcePath: string): boolean;
|
|
11
|
-
export declare const
|
|
10
|
+
export declare function isValidThemeHook(props: TamaguiOptionsWithFileInfo, jsxPath: NodePath<t.JSXElement>, n: t.MemberExpression, sourcePath: string): boolean;
|
|
11
|
+
export declare const isInsideComponentPackage: (props: TamaguiOptionsWithFileInfo, srcName: string) => boolean;
|
|
12
|
+
export declare const isComponentPackage: (props: TamaguiOptionsWithFileInfo, srcName: string) => boolean;
|
|
13
|
+
export declare const isValidImport: (props: TamaguiOptionsWithFileInfo, srcName: string) => boolean;
|
|
12
14
|
//# sourceMappingURL=extractHelpers.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
3
|
import { TamaguiInternalConfig } from '@tamagui/core-node';
|
|
4
|
-
import {
|
|
5
|
-
export declare function extractMediaStyle(ternary: Ternary, jsxPath: NodePath<t.JSXElement>, tamaguiConfig: TamaguiInternalConfig, sourcePath: string, importance?: number, shouldPrintDebug?: boolean | 'verbose'): {
|
|
4
|
+
import type { TamaguiOptionsWithFileInfo, Ternary } from '../types.js';
|
|
5
|
+
export declare function extractMediaStyle(props: TamaguiOptionsWithFileInfo, ternary: Ternary, jsxPath: NodePath<t.JSXElement>, tamaguiConfig: TamaguiInternalConfig, sourcePath: string, importance?: number, shouldPrintDebug?: boolean | 'verbose'): {
|
|
6
6
|
mediaStyles: StyleObject[];
|
|
7
7
|
ternaryWithoutMedia: Ternary | null;
|
|
8
8
|
} | null;
|
|
9
|
-
export declare function isValidMediaCall(jsxPath: NodePath<t.JSXElement>, init: t.Expression, sourcePath: string): boolean;
|
|
9
|
+
export declare function isValidMediaCall(props: TamaguiOptionsWithFileInfo, jsxPath: NodePath<t.JSXElement>, init: t.Expression, sourcePath: string): boolean;
|
|
10
10
|
//# sourceMappingURL=extractMediaStyle.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Extractor } from './createExtractor';
|
|
3
|
+
import type { TamaguiOptions } from '../types.js';
|
|
4
|
+
import { Extractor } from './createExtractor.js';
|
|
6
5
|
export declare type ExtractedResponse = {
|
|
7
6
|
js: string | Buffer;
|
|
8
7
|
styles: string;
|
|
@@ -10,15 +9,11 @@ export declare type ExtractedResponse = {
|
|
|
10
9
|
ast: t.File;
|
|
11
10
|
map: any;
|
|
12
11
|
};
|
|
13
|
-
export declare function extractToClassNames({
|
|
14
|
-
loader: LoaderContext<any>;
|
|
15
|
-
cssLoaderPath: string;
|
|
12
|
+
export declare function extractToClassNames({ extractor, source, sourcePath, options, shouldPrintDebug, }: {
|
|
16
13
|
extractor: Extractor;
|
|
17
14
|
source: string | Buffer;
|
|
18
15
|
sourcePath: string;
|
|
19
16
|
options: TamaguiOptions;
|
|
20
17
|
shouldPrintDebug: boolean | 'verbose';
|
|
21
|
-
|
|
22
|
-
threaded?: boolean;
|
|
23
|
-
}): ExtractedResponse | null;
|
|
18
|
+
}): Promise<ExtractedResponse | null>;
|
|
24
19
|
//# sourceMappingURL=extractToClassNames.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
export declare function findTopmostFunction(jsxPath: NodePath<t.JSXElement>):
|
|
3
|
+
export declare function findTopmostFunction(jsxPath: NodePath<t.JSXElement>): any;
|
|
4
4
|
//# sourceMappingURL=findTopmostFunction.d.ts.map
|
|
@@ -1,3 +1,19 @@
|
|
|
1
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
|
+
*/
|
|
2
18
|
export declare function getPropValueFromAttributes(propName: string, attrs: (t.JSXAttribute | t.JSXSpreadAttribute)[]): t.Expression | null;
|
|
3
19
|
//# sourceMappingURL=getPropValueFromAttributes.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
export declare function
|
|
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>>;
|
|
4
5
|
//# sourceMappingURL=getStaticBindingsForScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=loadFile.d.ts.map
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import type { TamaguiComponent, TamaguiInternalConfig } from '@tamagui/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { TamaguiComponent, TamaguiInternalConfig } from '@tamagui/core-node';
|
|
2
|
+
declare type NameToPaths = {
|
|
3
|
+
[key: string]: Set<string>;
|
|
4
|
+
};
|
|
5
|
+
export declare type TamaguiProjectInfo = {
|
|
6
6
|
components: Record<string, TamaguiComponent>;
|
|
7
7
|
tamaguiConfig: TamaguiInternalConfig;
|
|
8
|
+
nameToPaths: NameToPaths;
|
|
9
|
+
};
|
|
10
|
+
declare type Props = {
|
|
11
|
+
components: string[];
|
|
12
|
+
config?: string;
|
|
13
|
+
forceExports?: boolean;
|
|
14
|
+
bubbleErrors?: boolean;
|
|
8
15
|
};
|
|
16
|
+
export declare function loadTamagui(props: Props): Promise<TamaguiProjectInfo>;
|
|
17
|
+
export declare function loadTamaguiSync(props: Props): TamaguiProjectInfo;
|
|
18
|
+
export {};
|
|
9
19
|
//# sourceMappingURL=loadTamagui.d.ts.map
|
|
@@ -46,4 +46,53 @@ export declare const validHTMLAttributes: {
|
|
|
46
46
|
'aria-selected': boolean;
|
|
47
47
|
'aria-sort': boolean;
|
|
48
48
|
};
|
|
49
|
+
export declare const validAccessibilityAttributes: {
|
|
50
|
+
accessibilityRole: boolean;
|
|
51
|
+
accessibilityActiveDescendant: boolean;
|
|
52
|
+
accessibilityAtomic: boolean;
|
|
53
|
+
accessibilityAutoComplete: boolean;
|
|
54
|
+
accessibilityBusy: boolean;
|
|
55
|
+
accessibilityChecked: boolean;
|
|
56
|
+
accessibilityColumnCount: boolean;
|
|
57
|
+
accessibilityColumnIndex: boolean;
|
|
58
|
+
accessibilityColumnSpan: boolean;
|
|
59
|
+
accessibilityControls: boolean;
|
|
60
|
+
accessibilityCurrent: boolean;
|
|
61
|
+
accessibilityDescribedBy: boolean;
|
|
62
|
+
accessibilityDetails: boolean;
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
accessibilityErrorMessage: boolean;
|
|
65
|
+
accessibilityExpanded: boolean;
|
|
66
|
+
accessibilityFlowTo: boolean;
|
|
67
|
+
accessibilityHasPopup: boolean;
|
|
68
|
+
accessibilityHidden: boolean;
|
|
69
|
+
accessibilityInvalid: boolean;
|
|
70
|
+
accessibilityKeyShortcuts: boolean;
|
|
71
|
+
accessibilityLabel: boolean;
|
|
72
|
+
accessibilityLabelledBy: boolean;
|
|
73
|
+
accessibilityLevel: boolean;
|
|
74
|
+
accessibilityLiveRegion: boolean;
|
|
75
|
+
accessibilityModal: boolean;
|
|
76
|
+
accessibilityMultiline: boolean;
|
|
77
|
+
accessibilityMultiSelectable: boolean;
|
|
78
|
+
accessibilityOrientation: boolean;
|
|
79
|
+
accessibilityOwns: boolean;
|
|
80
|
+
accessibilityPlaceholder: boolean;
|
|
81
|
+
accessibilityPosInSet: boolean;
|
|
82
|
+
accessibilityPressed: boolean;
|
|
83
|
+
accessibilityReadOnly: boolean;
|
|
84
|
+
accessibilityRequired: boolean;
|
|
85
|
+
accessibilityRoleDescription: boolean;
|
|
86
|
+
accessibilityRowCount: boolean;
|
|
87
|
+
accessibilityRowIndex: boolean;
|
|
88
|
+
accessibilityRowSpan: boolean;
|
|
89
|
+
accessibilitySelected: boolean;
|
|
90
|
+
accessibilitySetSize: boolean;
|
|
91
|
+
accessibilitySort: boolean;
|
|
92
|
+
accessibilityValueMax: boolean;
|
|
93
|
+
accessibilityValueMin: boolean;
|
|
94
|
+
accessibilityValueNow: boolean;
|
|
95
|
+
accessibilityValueText: boolean;
|
|
96
|
+
nativeID: boolean;
|
|
97
|
+
};
|
|
49
98
|
//# sourceMappingURL=validHTMLAttributes.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function getPragmaOptions({ source, path, disableCommentCheck, }: {
|
|
2
|
+
source: string;
|
|
3
|
+
path: string;
|
|
4
|
+
disableCommentCheck?: boolean;
|
|
5
|
+
}): {
|
|
6
|
+
shouldPrintDebug: boolean | "verbose";
|
|
7
|
+
shouldDisable: boolean;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=getPragmaOptions.d.ts.map
|
package/types/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export { TamaguiOptions } from './types';
|
|
2
|
-
export { createExtractor } from './extractor/createExtractor';
|
|
3
|
-
export { literalToAst } from './extractor/literalToAst';
|
|
4
|
-
export * from './constants';
|
|
5
|
-
export * from './extractor/extractToClassNames';
|
|
6
|
-
export * from './extractor/extractHelpers';
|
|
7
|
-
export * from '
|
|
1
|
+
export { TamaguiOptions } from './types.js';
|
|
2
|
+
export { createExtractor } from './extractor/createExtractor.js';
|
|
3
|
+
export { literalToAst } from './extractor/literalToAst.js';
|
|
4
|
+
export * from './constants.js';
|
|
5
|
+
export * from './extractor/extractToClassNames.js';
|
|
6
|
+
export * from './extractor/extractHelpers.js';
|
|
7
|
+
export * from '@tamagui/patch-rnw';
|
|
8
|
+
export * from './extractor/loadTamagui.js';
|
|
9
|
+
export * from './require.js';
|
|
10
|
+
export * from './getPragmaOptions.js';
|
|
8
11
|
//# sourceMappingURL=index.d.ts.map
|
package/types/types.d.ts
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import { NodePath } from '@babel/traverse';
|
|
1
|
+
import type { NodePath } from '@babel/traverse';
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import { PseudoStyles } from '@tamagui/core-node';
|
|
4
|
-
import {
|
|
3
|
+
import type { PseudoStyles, StaticConfig } from '@tamagui/core-node';
|
|
4
|
+
import type { StyleObject } from '@tamagui/helpers';
|
|
5
|
+
import type { TamaguiOptions } from '@tamagui/helpers-node';
|
|
6
|
+
import type { ViewStyle } from 'react-native';
|
|
7
|
+
export type { TamaguiOptions } from '@tamagui/helpers-node';
|
|
8
|
+
export type { StyleObject } from '@tamagui/helpers';
|
|
5
9
|
export declare type ClassNameObject = t.StringLiteral | t.Expression;
|
|
6
10
|
export interface CacheObject {
|
|
7
11
|
[key: string]: any;
|
|
8
12
|
}
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
importsWhitelist?: string[];
|
|
14
|
-
disable?: boolean;
|
|
15
|
-
disableExtraction?: boolean;
|
|
16
|
-
disableDebugAttr?: boolean;
|
|
17
|
-
disableExtractInlineMedia?: boolean;
|
|
18
|
-
disableExtractVariables?: boolean;
|
|
19
|
-
excludeReactNativeWebExports?: string[];
|
|
20
|
-
exclude?: RegExp;
|
|
21
|
-
logTimings?: boolean;
|
|
22
|
-
prefixLogs?: string;
|
|
23
|
-
cssPath?: string;
|
|
24
|
-
cssData?: any;
|
|
25
|
-
deoptProps?: Set<string>;
|
|
26
|
-
excludeProps?: Set<string>;
|
|
27
|
-
inlineProps?: Set<string>;
|
|
13
|
+
export interface LogOptions {
|
|
14
|
+
clear?: boolean;
|
|
15
|
+
timestamp?: boolean;
|
|
16
|
+
error?: Error | null;
|
|
28
17
|
}
|
|
18
|
+
export interface Logger {
|
|
19
|
+
info(msg: string, options?: LogOptions): void;
|
|
20
|
+
warn(msg: string, options?: LogOptions): void;
|
|
21
|
+
error(msg: string, options?: LogOptions): void;
|
|
22
|
+
}
|
|
23
|
+
export declare type ExtractorOptions = {
|
|
24
|
+
logger?: Logger;
|
|
25
|
+
};
|
|
29
26
|
export declare type ExtractedAttrAttr = {
|
|
30
27
|
type: 'attr';
|
|
31
28
|
value: t.JSXAttribute | t.JSXSpreadAttribute;
|
|
@@ -50,15 +47,22 @@ export declare type ExtractTagProps = {
|
|
|
50
47
|
lineNumbers: string;
|
|
51
48
|
filePath: string;
|
|
52
49
|
isFlattened: boolean;
|
|
50
|
+
completeProps: Record<string, any>;
|
|
51
|
+
staticConfig: StaticConfig;
|
|
53
52
|
};
|
|
54
|
-
export declare type
|
|
55
|
-
sourcePath
|
|
53
|
+
export declare type TamaguiOptionsWithFileInfo = TamaguiOptions & {
|
|
54
|
+
sourcePath: string;
|
|
55
|
+
};
|
|
56
|
+
export declare type ExtractorParseProps = TamaguiOptionsWithFileInfo & {
|
|
57
|
+
target: 'native' | 'html';
|
|
56
58
|
shouldPrintDebug?: boolean | 'verbose';
|
|
57
59
|
onExtractTag: (props: ExtractTagProps) => void;
|
|
58
|
-
getFlattenedNode
|
|
60
|
+
getFlattenedNode?: (props: {
|
|
59
61
|
isTextView: boolean;
|
|
60
62
|
tag: string;
|
|
61
63
|
}) => string;
|
|
64
|
+
extractStyledDefinitions?: boolean;
|
|
65
|
+
onStyleRule?: (identifier: string, rules: string[]) => void;
|
|
62
66
|
};
|
|
63
67
|
export interface Ternary {
|
|
64
68
|
test: t.Expression;
|
|
@@ -67,13 +71,6 @@ export interface Ternary {
|
|
|
67
71
|
consequent: Object | null;
|
|
68
72
|
alternate: Object | null;
|
|
69
73
|
}
|
|
70
|
-
export declare type StyleObject = {
|
|
71
|
-
property: string;
|
|
72
|
-
value: string;
|
|
73
|
-
className: string;
|
|
74
|
-
identifier: string;
|
|
75
|
-
rules: string[];
|
|
76
|
-
};
|
|
77
74
|
export declare type ClassNameToStyleObj = {
|
|
78
75
|
[key: string]: StyleObject;
|
|
79
76
|
};
|