@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.
Files changed (329) hide show
  1. package/dist/cjs/check-dep-versions.cjs +355 -0
  2. package/dist/cjs/checkDeps.cjs +302 -0
  3. package/dist/cjs/compiler.cjs +286 -0
  4. package/dist/cjs/compilerHost.cjs +1695 -0
  5. package/dist/cjs/constants.cjs +33 -0
  6. package/dist/cjs/domStructuralPass.cjs +112 -0
  7. package/dist/cjs/exports.cjs +42 -0
  8. package/dist/cjs/extractor/addLocalExports.cjs +64 -0
  9. package/dist/cjs/extractor/bundle.cjs +203 -0
  10. package/dist/cjs/extractor/bundleConfig.cjs +747 -0
  11. package/dist/cjs/extractor/concatClassName.cjs +117 -0
  12. package/dist/cjs/extractor/detectModuleFormat.cjs +54 -0
  13. package/dist/cjs/extractor/esbuildAliasPlugin.cjs +47 -0
  14. package/dist/cjs/extractor/esbuildTsconfigPaths.cjs +92 -0
  15. package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.cjs +38 -0
  16. package/dist/cjs/extractor/loadTamagui.cjs +344 -0
  17. package/dist/cjs/extractor/regenerateConfig.cjs +161 -0
  18. package/dist/cjs/extractor/watchTamaguiConfig.cjs +64 -0
  19. package/dist/cjs/getPragmaOptions.cjs +67 -0
  20. package/dist/cjs/helpers/memoize.cjs +42 -0
  21. package/dist/cjs/helpers/requireTamaguiCore.cjs +40 -0
  22. package/dist/cjs/index.cjs +34 -0
  23. package/dist/cjs/registerRequire.cjs +220 -0
  24. package/dist/cjs/server.cjs +66 -0
  25. package/dist/cjs/staticEvaluationIgnoredModules.cjs +86 -0
  26. package/dist/cjs/types.cjs +17 -0
  27. package/dist/cjs/zero/artifact.cjs +145 -0
  28. package/dist/cjs/zero/graph.cjs +209 -0
  29. package/dist/cjs/zero/identity.cjs +61 -0
  30. package/dist/cjs/zero/index.cjs +26 -0
  31. package/dist/cjs/zero/islands.cjs +232 -0
  32. package/dist/cjs/zero/options.cjs +163 -0
  33. package/dist/cjs/zero/ownership.cjs +79 -0
  34. package/dist/cjs/zero/theme.cjs +328 -0
  35. package/dist/cjs/zero/transform.cjs +203 -0
  36. package/dist/esm/check-dep-versions.mjs +329 -0
  37. package/dist/esm/check-dep-versions.mjs.map +1 -0
  38. package/dist/esm/checkDeps.mjs +279 -0
  39. package/dist/esm/checkDeps.mjs.map +1 -0
  40. package/dist/esm/compiler.mjs +255 -0
  41. package/dist/esm/compiler.mjs.map +1 -0
  42. package/dist/esm/compilerHost.mjs +1675 -0
  43. package/dist/esm/compilerHost.mjs.map +1 -0
  44. package/dist/esm/constants.mjs +7 -0
  45. package/dist/esm/constants.mjs.map +1 -0
  46. package/dist/esm/domStructuralPass.mjs +92 -0
  47. package/dist/esm/domStructuralPass.mjs.map +1 -0
  48. package/dist/esm/exports.mjs +26 -0
  49. package/dist/esm/extractor/addLocalExports.mjs +44 -0
  50. package/dist/esm/extractor/addLocalExports.mjs.map +1 -0
  51. package/dist/esm/extractor/bundle.mjs +173 -0
  52. package/dist/esm/extractor/bundle.mjs.map +1 -0
  53. package/dist/esm/extractor/bundleConfig.mjs +706 -0
  54. package/dist/esm/extractor/bundleConfig.mjs.map +1 -0
  55. package/dist/esm/extractor/concatClassName.mjs +96 -0
  56. package/dist/esm/extractor/concatClassName.mjs.map +1 -0
  57. package/dist/esm/extractor/detectModuleFormat.mjs +31 -0
  58. package/dist/esm/extractor/detectModuleFormat.mjs.map +1 -0
  59. package/dist/esm/extractor/esbuildAliasPlugin.mjs +26 -0
  60. package/dist/esm/extractor/esbuildAliasPlugin.mjs.map +1 -0
  61. package/dist/esm/extractor/esbuildTsconfigPaths.mjs +63 -0
  62. package/dist/esm/extractor/esbuildTsconfigPaths.mjs.map +1 -0
  63. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.mjs +18 -0
  64. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.mjs.map +1 -0
  65. package/dist/esm/extractor/loadTamagui.mjs +306 -0
  66. package/dist/esm/extractor/loadTamagui.mjs.map +1 -0
  67. package/dist/esm/extractor/regenerateConfig.mjs +131 -0
  68. package/dist/esm/extractor/regenerateConfig.mjs.map +1 -0
  69. package/dist/esm/extractor/watchTamaguiConfig.mjs +43 -0
  70. package/dist/esm/extractor/watchTamaguiConfig.mjs.map +1 -0
  71. package/dist/esm/getPragmaOptions.mjs +46 -0
  72. package/dist/esm/getPragmaOptions.mjs.map +1 -0
  73. package/dist/esm/helpers/memoize.mjs +21 -0
  74. package/dist/esm/helpers/memoize.mjs.map +1 -0
  75. package/dist/esm/helpers/requireTamaguiCore.mjs +19 -0
  76. package/dist/esm/helpers/requireTamaguiCore.mjs.map +1 -0
  77. package/dist/esm/index.mjs +8 -0
  78. package/dist/esm/index.mjs.map +1 -0
  79. package/dist/esm/registerRequire.mjs +195 -0
  80. package/dist/esm/registerRequire.mjs.map +1 -0
  81. package/dist/esm/server.mjs +40 -0
  82. package/dist/esm/server.mjs.map +1 -0
  83. package/dist/esm/setup.mjs +0 -0
  84. package/dist/esm/staticEvaluationIgnoredModules.mjs +61 -0
  85. package/dist/esm/staticEvaluationIgnoredModules.mjs.map +1 -0
  86. package/dist/esm/types.mjs +0 -0
  87. package/dist/esm/zero/artifact.mjs +119 -0
  88. package/dist/esm/zero/artifact.mjs.map +1 -0
  89. package/dist/esm/zero/graph.mjs +170 -0
  90. package/dist/esm/zero/graph.mjs.map +1 -0
  91. package/dist/esm/zero/identity.mjs +36 -0
  92. package/dist/esm/zero/identity.mjs.map +1 -0
  93. package/dist/esm/zero/index.mjs +15 -0
  94. package/dist/esm/zero/islands.mjs +197 -0
  95. package/dist/esm/zero/islands.mjs.map +1 -0
  96. package/dist/esm/zero/options.mjs +129 -0
  97. package/dist/esm/zero/options.mjs.map +1 -0
  98. package/dist/esm/zero/ownership.mjs +48 -0
  99. package/dist/esm/zero/ownership.mjs.map +1 -0
  100. package/dist/esm/zero/theme.mjs +303 -0
  101. package/dist/esm/zero/theme.mjs.map +1 -0
  102. package/dist/esm/zero/transform.mjs +177 -0
  103. package/dist/esm/zero/transform.mjs.map +1 -0
  104. package/package.json +33 -43
  105. package/src/check-dep-versions.ts +2 -2
  106. package/src/checkDeps.ts +3 -2
  107. package/src/compiler.ts +425 -0
  108. package/src/compilerHost.ts +3125 -0
  109. package/src/constants.ts +0 -5
  110. package/src/domStructuralPass.ts +170 -0
  111. package/src/exports.ts +3 -6
  112. package/src/extractor/addLocalExports.ts +49 -0
  113. package/src/extractor/bundle.ts +20 -35
  114. package/src/extractor/bundleConfig.ts +334 -187
  115. package/src/extractor/concatClassName.ts +13 -20
  116. package/src/extractor/getTamaguiConfigPathFromOptionsConfig.ts +5 -4
  117. package/src/extractor/loadTamagui.ts +196 -143
  118. package/src/extractor/regenerateConfig.ts +65 -13
  119. package/src/extractor/watchTamaguiConfig.ts +6 -1
  120. package/src/helpers/requireTamaguiCore.ts +6 -1
  121. package/src/registerRequire.ts +94 -132
  122. package/src/staticEvaluationIgnoredModules.ts +74 -0
  123. package/src/types.ts +2 -107
  124. package/src/zero/artifact.ts +142 -0
  125. package/src/zero/graph.ts +359 -0
  126. package/src/zero/identity.ts +73 -0
  127. package/src/zero/index.ts +8 -0
  128. package/src/zero/islands.ts +262 -0
  129. package/src/zero/options.ts +239 -0
  130. package/src/zero/ownership.ts +113 -0
  131. package/src/zero/theme.ts +478 -0
  132. package/src/zero/transform.ts +320 -0
  133. package/types/check-dep-versions.d.ts.map +1 -1
  134. package/types/checkDeps.d.ts.map +1 -1
  135. package/types/compiler.d.ts +117 -0
  136. package/types/compiler.d.ts.map +1 -0
  137. package/types/compilerHost.d.ts +25 -0
  138. package/types/compilerHost.d.ts.map +1 -0
  139. package/types/constants.d.ts +0 -1
  140. package/types/constants.d.ts.map +1 -1
  141. package/types/domStructuralPass.d.ts +3 -0
  142. package/types/domStructuralPass.d.ts.map +1 -0
  143. package/types/exports.d.ts +3 -6
  144. package/types/exports.d.ts.map +1 -1
  145. package/types/extractor/addLocalExports.d.ts +3 -0
  146. package/types/extractor/addLocalExports.d.ts.map +1 -0
  147. package/types/extractor/bundle.d.ts +66 -65
  148. package/types/extractor/bundle.d.ts.map +1 -1
  149. package/types/extractor/bundleConfig.d.ts +19 -4
  150. package/types/extractor/bundleConfig.d.ts.map +1 -1
  151. package/types/extractor/esbuildAliasPlugin.d.ts.map +1 -1
  152. package/types/extractor/getTamaguiConfigPathFromOptionsConfig.d.ts +1 -1
  153. package/types/extractor/getTamaguiConfigPathFromOptionsConfig.d.ts.map +1 -1
  154. package/types/extractor/loadTamagui.d.ts +26 -3
  155. package/types/extractor/loadTamagui.d.ts.map +1 -1
  156. package/types/extractor/regenerateConfig.d.ts +1 -1
  157. package/types/extractor/regenerateConfig.d.ts.map +1 -1
  158. package/types/extractor/watchTamaguiConfig.d.ts.map +1 -1
  159. package/types/getPragmaOptions.d.ts +1 -1
  160. package/types/helpers/memoize.d.ts +1 -1
  161. package/types/helpers/memoize.d.ts.map +1 -1
  162. package/types/helpers/requireTamaguiCore.d.ts.map +1 -1
  163. package/types/index.d.ts.map +1 -1
  164. package/types/registerRequire.d.ts +2 -2
  165. package/types/registerRequire.d.ts.map +1 -1
  166. package/types/staticEvaluationIgnoredModules.d.ts +9 -0
  167. package/types/staticEvaluationIgnoredModules.d.ts.map +1 -0
  168. package/types/types.d.ts +2 -90
  169. package/types/types.d.ts.map +1 -1
  170. package/types/zero/artifact.d.ts +44 -0
  171. package/types/zero/artifact.d.ts.map +1 -0
  172. package/types/zero/graph.d.ts +139 -0
  173. package/types/zero/graph.d.ts.map +1 -0
  174. package/types/zero/identity.d.ts +33 -0
  175. package/types/zero/identity.d.ts.map +1 -0
  176. package/types/zero/index.d.ts +9 -0
  177. package/types/zero/index.d.ts.map +1 -0
  178. package/types/zero/islands.d.ts +56 -0
  179. package/types/zero/islands.d.ts.map +1 -0
  180. package/types/zero/options.d.ts +58 -0
  181. package/types/zero/options.d.ts.map +1 -0
  182. package/types/zero/ownership.d.ts +51 -0
  183. package/types/zero/ownership.d.ts.map +1 -0
  184. package/types/zero/theme.d.ts +83 -0
  185. package/types/zero/theme.d.ts.map +1 -0
  186. package/types/zero/transform.d.ts +53 -0
  187. package/types/zero/transform.d.ts.map +1 -0
  188. package/dist/check-dep-versions.cjs +0 -372
  189. package/dist/checkDeps.cjs +0 -271
  190. package/dist/constants.cjs +0 -51
  191. package/dist/exports.cjs +0 -48
  192. package/dist/extractor/accessSafe.cjs +0 -48
  193. package/dist/extractor/babelParse.cjs +0 -56
  194. package/dist/extractor/buildClassName.cjs +0 -86
  195. package/dist/extractor/bundle.cjs +0 -234
  196. package/dist/extractor/bundleConfig.cjs +0 -729
  197. package/dist/extractor/concatClassName.cjs +0 -129
  198. package/dist/extractor/createEvaluator.cjs +0 -88
  199. package/dist/extractor/createExtractor.cjs +0 -1968
  200. package/dist/extractor/createLogger.cjs +0 -50
  201. package/dist/extractor/detectModuleFormat.cjs +0 -55
  202. package/dist/extractor/ensureImportingConcat.cjs +0 -54
  203. package/dist/extractor/errors.cjs +0 -28
  204. package/dist/extractor/esbuildAliasPlugin.cjs +0 -56
  205. package/dist/extractor/esbuildTsconfigPaths.cjs +0 -108
  206. package/dist/extractor/evaluateAstNode.cjs +0 -128
  207. package/dist/extractor/extractHelpers.cjs +0 -182
  208. package/dist/extractor/extractMediaStyle.cjs +0 -169
  209. package/dist/extractor/extractToClassNames.cjs +0 -475
  210. package/dist/extractor/extractToNative.cjs +0 -369
  211. package/dist/extractor/findTopmostFunction.cjs +0 -43
  212. package/dist/extractor/generatedUid.cjs +0 -58
  213. package/dist/extractor/getPrefixLogs.cjs +0 -31
  214. package/dist/extractor/getPropValueFromAttributes.cjs +0 -85
  215. package/dist/extractor/getSourceModule.cjs +0 -100
  216. package/dist/extractor/getStaticBindingsForScope.cjs +0 -213
  217. package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.cjs +0 -41
  218. package/dist/extractor/hasTopLevelAwait.cjs +0 -62
  219. package/dist/extractor/hoistClassNames.cjs +0 -76
  220. package/dist/extractor/literalToAst.cjs +0 -109
  221. package/dist/extractor/loadFile.cjs +0 -17
  222. package/dist/extractor/loadTamagui.cjs +0 -373
  223. package/dist/extractor/logLines.cjs +0 -43
  224. package/dist/extractor/normalizeTernaries.cjs +0 -100
  225. package/dist/extractor/propsToFontFamilyCache.cjs +0 -42
  226. package/dist/extractor/regenerateConfig.cjs +0 -178
  227. package/dist/extractor/removeUnusedHooks.cjs +0 -108
  228. package/dist/extractor/timer.cjs +0 -52
  229. package/dist/extractor/validHTMLAttributes.cjs +0 -79
  230. package/dist/extractor/watchTamaguiConfig.cjs +0 -70
  231. package/dist/getPragmaOptions.cjs +0 -73
  232. package/dist/helpers/memoize.cjs +0 -45
  233. package/dist/helpers/requireTamaguiCore.cjs +0 -40
  234. package/dist/index.cjs +0 -42
  235. package/dist/registerRequire.cjs +0 -209
  236. package/dist/server.cjs +0 -82
  237. package/dist/types.cjs +0 -18
  238. package/dist/worker.cjs +0 -111
  239. package/src/extractor/accessSafe.ts +0 -22
  240. package/src/extractor/babelParse.ts +0 -38
  241. package/src/extractor/buildClassName.ts +0 -76
  242. package/src/extractor/createEvaluator.ts +0 -82
  243. package/src/extractor/createExtractor.ts +0 -2970
  244. package/src/extractor/createLogger.ts +0 -41
  245. package/src/extractor/ensureImportingConcat.ts +0 -36
  246. package/src/extractor/errors.ts +0 -1
  247. package/src/extractor/evaluateAstNode.ts +0 -136
  248. package/src/extractor/extractHelpers.ts +0 -211
  249. package/src/extractor/extractMediaStyle.ts +0 -194
  250. package/src/extractor/extractToClassNames.ts +0 -733
  251. package/src/extractor/extractToNative.ts +0 -506
  252. package/src/extractor/findTopmostFunction.ts +0 -24
  253. package/src/extractor/generatedUid.ts +0 -41
  254. package/src/extractor/getPrefixLogs.ts +0 -9
  255. package/src/extractor/getPropValueFromAttributes.ts +0 -95
  256. package/src/extractor/getSourceModule.ts +0 -96
  257. package/src/extractor/getStaticBindingsForScope.ts +0 -237
  258. package/src/extractor/hasTopLevelAwait.ts +0 -28
  259. package/src/extractor/hoistClassNames.ts +0 -52
  260. package/src/extractor/literalToAst.ts +0 -85
  261. package/src/extractor/loadFile.ts +0 -17
  262. package/src/extractor/logLines.ts +0 -16
  263. package/src/extractor/normalizeTernaries.ts +0 -89
  264. package/src/extractor/propsToFontFamilyCache.ts +0 -18
  265. package/src/extractor/removeUnusedHooks.ts +0 -83
  266. package/src/extractor/timer.ts +0 -25
  267. package/src/extractor/validHTMLAttributes.ts +0 -52
  268. package/src/worker.ts +0 -142
  269. package/types/extractor/accessSafe.d.ts +0 -3
  270. package/types/extractor/accessSafe.d.ts.map +0 -1
  271. package/types/extractor/babelParse.d.ts +0 -5
  272. package/types/extractor/babelParse.d.ts.map +0 -1
  273. package/types/extractor/buildClassName.d.ts +0 -7
  274. package/types/extractor/buildClassName.d.ts.map +0 -1
  275. package/types/extractor/createEvaluator.d.ts +0 -12
  276. package/types/extractor/createEvaluator.d.ts.map +0 -1
  277. package/types/extractor/createExtractor.d.ts +0 -32
  278. package/types/extractor/createExtractor.d.ts.map +0 -1
  279. package/types/extractor/createLogger.d.ts +0 -3
  280. package/types/extractor/createLogger.d.ts.map +0 -1
  281. package/types/extractor/ensureImportingConcat.d.ts +0 -4
  282. package/types/extractor/ensureImportingConcat.d.ts.map +0 -1
  283. package/types/extractor/errors.d.ts +0 -3
  284. package/types/extractor/errors.d.ts.map +0 -1
  285. package/types/extractor/evaluateAstNode.d.ts +0 -3
  286. package/types/extractor/evaluateAstNode.d.ts.map +0 -1
  287. package/types/extractor/extractHelpers.d.ts +0 -28
  288. package/types/extractor/extractHelpers.d.ts.map +0 -1
  289. package/types/extractor/extractMediaStyle.d.ts +0 -11
  290. package/types/extractor/extractMediaStyle.d.ts.map +0 -1
  291. package/types/extractor/extractToClassNames.d.ts +0 -25
  292. package/types/extractor/extractToClassNames.d.ts.map +0 -1
  293. package/types/extractor/extractToNative.d.ts +0 -13
  294. package/types/extractor/extractToNative.d.ts.map +0 -1
  295. package/types/extractor/findTopmostFunction.d.ts +0 -4
  296. package/types/extractor/findTopmostFunction.d.ts.map +0 -1
  297. package/types/extractor/generatedUid.d.ts +0 -5
  298. package/types/extractor/generatedUid.d.ts.map +0 -1
  299. package/types/extractor/getPrefixLogs.d.ts +0 -3
  300. package/types/extractor/getPrefixLogs.d.ts.map +0 -1
  301. package/types/extractor/getPropValueFromAttributes.d.ts +0 -19
  302. package/types/extractor/getPropValueFromAttributes.d.ts.map +0 -1
  303. package/types/extractor/getSourceModule.d.ts +0 -16
  304. package/types/extractor/getSourceModule.d.ts.map +0 -1
  305. package/types/extractor/getStaticBindingsForScope.d.ts +0 -5
  306. package/types/extractor/getStaticBindingsForScope.d.ts.map +0 -1
  307. package/types/extractor/hasTopLevelAwait.d.ts +0 -2
  308. package/types/extractor/hasTopLevelAwait.d.ts.map +0 -1
  309. package/types/extractor/hoistClassNames.d.ts +0 -6
  310. package/types/extractor/hoistClassNames.d.ts.map +0 -1
  311. package/types/extractor/literalToAst.d.ts +0 -4
  312. package/types/extractor/literalToAst.d.ts.map +0 -1
  313. package/types/extractor/loadFile.d.ts +0 -1
  314. package/types/extractor/loadFile.d.ts.map +0 -1
  315. package/types/extractor/logLines.d.ts +0 -2
  316. package/types/extractor/logLines.d.ts.map +0 -1
  317. package/types/extractor/normalizeTernaries.d.ts +0 -5
  318. package/types/extractor/normalizeTernaries.d.ts.map +0 -1
  319. package/types/extractor/propsToFontFamilyCache.d.ts +0 -4
  320. package/types/extractor/propsToFontFamilyCache.d.ts.map +0 -1
  321. package/types/extractor/removeUnusedHooks.d.ts +0 -3
  322. package/types/extractor/removeUnusedHooks.d.ts.map +0 -1
  323. package/types/extractor/timer.d.ts +0 -5
  324. package/types/extractor/timer.d.ts.map +0 -1
  325. package/types/extractor/validHTMLAttributes.d.ts +0 -52
  326. package/types/extractor/validHTMLAttributes.d.ts.map +0 -1
  327. package/types/worker.d.ts +0 -46
  328. package/types/worker.d.ts.map +0 -1
  329. /package/dist/{setup.cjs → cjs/setup.cjs} +0 -0
@@ -1,17 +1,17 @@
1
1
  import { dirname, join } from 'node:path'
2
+ import { createRequire } from 'node:module'
2
3
 
3
4
  import { generateThemes, writeGeneratedThemes } from '@tamagui/generate-themes'
5
+ import { stylePropsAll } from '@tamagui/helpers'
6
+ import { grammarEntries } from '@tamagui/style-grammar'
4
7
  import type { TamaguiOptions } from '@tamagui/types'
5
- import * as FS from 'fs-extra'
8
+ import FS from 'fs-extra'
6
9
 
7
10
  import { requireTamaguiCore } from '../helpers/requireTamaguiCore'
8
11
  import type { TamaguiPlatform } from '../types'
9
12
  import type { BundledConfig } from './bundleConfig'
10
13
  import { getBundledConfig } from './bundleConfig'
11
14
 
12
- const tamaguiDir = join(process.cwd(), '.tamagui')
13
- const confFile = join(tamaguiDir, 'tamagui.config.json')
14
-
15
15
  /**
16
16
  * Sort of a super-set of bundleConfig(), this code needs some refactoring ideally
17
17
  */
@@ -27,6 +27,7 @@ export async function regenerateConfig(
27
27
  const config = configIn ?? (await getBundledConfig(tamaguiOptions, rebuild))
28
28
  if (!config) return
29
29
  const out = transformConfig(config, tamaguiOptions.platform || 'web')
30
+ const confFile = getConfigFile(tamaguiOptions)
30
31
 
31
32
  await FS.ensureDir(dirname(confFile))
32
33
  await FS.writeJSON(confFile, out, {
@@ -41,14 +42,15 @@ export async function regenerateConfig(
41
42
  }
42
43
 
43
44
  export function regenerateConfigSync(
44
- _tamaguiOptions: TamaguiOptions,
45
+ tamaguiOptions: TamaguiOptions,
45
46
  config: BundledConfig
46
47
  ) {
47
48
  try {
49
+ const confFile = getConfigFile(tamaguiOptions)
48
50
  FS.ensureDirSync(dirname(confFile))
49
51
  FS.writeJSONSync(
50
52
  confFile,
51
- transformConfig(config, _tamaguiOptions.platform || 'web'),
53
+ transformConfig(config, tamaguiOptions.platform || 'web'),
52
54
  {
53
55
  spaces: 2,
54
56
  }
@@ -70,8 +72,11 @@ export async function generateTamaguiThemes(
70
72
  }
71
73
 
72
74
  const { input, output } = tamaguiOptions.themeBuilder
73
- const inPath = resolveRelativePath(input)
74
- const outPath = resolveRelativePath(output)
75
+ const root = tamaguiOptions.root || process.cwd()
76
+ const tamaguiDir = join(root, '.tamagui')
77
+ const projectRequire = createRequire(join(root, 'package.json'))
78
+ const inPath = resolveRelativePath(input, root, projectRequire)
79
+ const outPath = resolveRelativePath(output, root, projectRequire)
75
80
  const generatedOutput = await generateThemes(inPath)
76
81
 
77
82
  // because this runs in parallel (its cheap) lets avoid logging a bunch, so check to see if changed:
@@ -96,8 +101,15 @@ export async function generateTamaguiThemes(
96
101
  return hasChanged
97
102
  }
98
103
 
99
- const resolveRelativePath = (inputPath: string) =>
100
- inputPath.startsWith('.') ? join(process.cwd(), inputPath) : require.resolve(inputPath)
104
+ const getConfigFile = (options: TamaguiOptions) =>
105
+ join(options.root || process.cwd(), '.tamagui', 'tamagui.config.json')
106
+
107
+ const resolveRelativePath = (
108
+ inputPath: string,
109
+ root: string,
110
+ projectRequire: NodeRequire
111
+ ) =>
112
+ inputPath.startsWith('.') ? join(root, inputPath) : projectRequire.resolve(inputPath)
101
113
 
102
114
  function cloneDeepSafe(x: any, excludeKeys = {}) {
103
115
  if (!x) return x
@@ -110,6 +122,40 @@ function cloneDeepSafe(x: any, excludeKeys = {}) {
110
122
  )
111
123
  }
112
124
 
125
+ /**
126
+ * Which token category each style prop draws its values from, emitted so the
127
+ * language server can offer `bg=""` colors and `p=""` spaces instead of every
128
+ * token in the config.
129
+ *
130
+ * Derived from the style-grammar registry rather than restated here: that
131
+ * registry is already the contract the runtime resolver is pinned to
132
+ * (see core-test/tokenCategoryParity.web.test.tsx), so a second table would be
133
+ * a second thing to keep true.
134
+ *
135
+ * A prefix shared by props of different categories (`border` is both
136
+ * borderWidth/space and borderColor/color) is left out rather than guessed at;
137
+ * an unmapped prop offers the whole vocabulary, which is the honest answer.
138
+ */
139
+ function buildPropCategories(): Record<string, string> {
140
+ const out: Record<string, string> = {}
141
+ const byPrefix: Record<string, Set<string | undefined>> = {}
142
+
143
+ for (const entry of grammarEntries) {
144
+ if (entry.tokenCategory) out[entry.prop] = entry.tokenCategory
145
+ if (entry.prefix) (byPrefix[entry.prefix] ||= new Set()).add(entry.tokenCategory)
146
+ }
147
+
148
+ for (const [prefix, categories] of Object.entries(byPrefix)) {
149
+ // `out[prefix]` may already be set when a prop is its own prefix (`gap`,
150
+ // `color`); the registry agrees with itself there, so this is a no-op
151
+ if (categories.size !== 1) continue
152
+ const [only] = categories
153
+ if (only) out[prefix] = only
154
+ }
155
+
156
+ return out
157
+ }
158
+
113
159
  function transformConfig(config: BundledConfig, platform: TamaguiPlatform) {
114
160
  if (!config) {
115
161
  return null
@@ -127,11 +173,9 @@ function transformConfig(config: BundledConfig, platform: TamaguiPlatform) {
127
173
 
128
174
  // reduce down to usable, smaller json
129
175
 
130
- // slim themes, add name
176
+ // slim themes
131
177
  for (const key in themes) {
132
178
  const theme = themes[key]
133
- // @ts-ignore
134
- theme.id = key
135
179
  for (const tkey in theme) {
136
180
  theme[tkey] = getVariableValue(theme[tkey])
137
181
  }
@@ -177,10 +221,18 @@ function transformConfig(config: BundledConfig, platform: TamaguiPlatform) {
177
221
  return {
178
222
  components,
179
223
  nameToPaths,
224
+ tamaguiConfigMetadata: {
225
+ themeFields: 'values-only',
226
+ },
180
227
  tamaguiConfig: {
181
228
  ...cleanedConfig,
182
229
  // Output userShorthands as shorthands (excludes built-ins)
183
230
  shorthands: userShorthands,
231
+ propCategories: buildPropCategories(),
232
+ // every prop that can carry a style value. the shorthand tables alone
233
+ // miss any long-form prop with no shorthand (`gap`, `backgroundColor`),
234
+ // and the language server was silent inside exactly those.
235
+ styleProps: Object.keys(stylePropsAll),
184
236
  },
185
237
  }
186
238
  }
@@ -1,7 +1,12 @@
1
1
  import type { TamaguiOptions } from '@tamagui/types'
2
+ import { createRequire } from 'node:module'
2
3
  import { esbuildWatchFiles, generateThemesAndLog, getOptions } from './loadTamagui'
3
4
  import { regenerateConfig } from './regenerateConfig'
4
5
 
6
+ const nodeRequire = createRequire(
7
+ typeof __filename === 'string' ? __filename : import.meta.url
8
+ )
9
+
5
10
  let isWatching = false
6
11
 
7
12
  export async function watchTamaguiConfig(tamaguiOptions: TamaguiOptions) {
@@ -43,7 +48,7 @@ export async function watchTamaguiConfig(tamaguiOptions: TamaguiOptions) {
43
48
  if (themeBuilderInput) {
44
49
  let inputPath = themeBuilderInput
45
50
  try {
46
- inputPath = require.resolve(themeBuilderInput)
51
+ inputPath = nodeRequire.resolve(themeBuilderInput)
47
52
  } catch {
48
53
  // ok
49
54
  }
@@ -1,10 +1,15 @@
1
1
  // this allows us to swap between core native and web in the same process:
2
2
 
3
3
  import type { TamaguiPlatform } from '../types'
4
+ import { createRequire } from 'node:module'
5
+
6
+ const nodeRequire = createRequire(
7
+ typeof __filename === 'string' ? __filename : import.meta.url
8
+ )
4
9
 
5
10
  export function requireTamaguiCore(
6
11
  platform: TamaguiPlatform,
7
- ogRequire: Function = require
12
+ ogRequire: Function = nodeRequire
8
13
  ): typeof import('@tamagui/core') {
9
14
  if (!platform) {
10
15
  throw new Error(`No platform given to requireTamaguiCore`)
@@ -1,21 +1,43 @@
1
+ import { dirname } from 'node:path'
2
+ import { buildSync } from 'esbuild'
1
3
  import { register } from 'esbuild-register/dist/node'
4
+ import { createRequire } from 'node:module'
2
5
 
3
6
  import { esbuildIgnoreFilesRegex } from './extractor/bundle'
4
7
  import { requireTamaguiCore } from './helpers/requireTamaguiCore'
8
+ import {
9
+ getStaticEvaluationModuleReplacement,
10
+ isIgnoredStaticEvaluationModule,
11
+ } from './staticEvaluationIgnoredModules'
5
12
  import type { TamaguiPlatform } from './types'
6
13
 
7
14
  const nameToPaths = {}
15
+ const nodeRequire = createRequire(
16
+ typeof __filename === 'string' ? __filename : import.meta.url
17
+ )
8
18
 
9
19
  export const getNameToPaths = () => nameToPaths
10
20
 
11
- const Module = require('node:module')
12
- const proxyWorm = require('@tamagui/proxy-worm')
21
+ const Module = nodeRequire('node:module')
13
22
 
14
23
  let isRegistered = false
15
24
  let og: any
16
25
 
17
- const whitelisted = {
18
- react: true,
26
+ class StaticEvaluationError extends Error {
27
+ code = 'TAMAGUI_STATIC_EVALUATION_ERROR' as const
28
+
29
+ constructor(
30
+ readonly moduleName: string,
31
+ readonly importer: string,
32
+ readonly failedModule: string,
33
+ readonly reason: string,
34
+ options: ErrorOptions
35
+ ) {
36
+ super(
37
+ `[tamagui] Failed to evaluate module "${failedModule}" imported from "${importer}" while loading the Tamagui config and configured components.\nReason: ${reason}\nFix the module so it can run in Node during the build. If it is runtime-only and none of its exports create your Tamagui config or components, add "${moduleName}" to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,
38
+ options
39
+ )
40
+ }
19
41
  }
20
42
 
21
43
  const compiled = {}
@@ -48,6 +70,35 @@ function getStaticExtractionStub(path: string) {
48
70
  fetchUpdateAsync: async () => ({ isNew: false }),
49
71
  reloadAsync: async () => {},
50
72
  }
73
+ case 'react-native-reanimated': {
74
+ const identity = <T>(value: T) => value
75
+ const sharedValue = <T>(value: T) => ({
76
+ value,
77
+ get: () => value,
78
+ set: (next: T | ((current: T) => T)) => {
79
+ value = typeof next === 'function' ? (next as (current: T) => T)(value) : next
80
+ },
81
+ })
82
+ const Animated = {
83
+ createAnimatedComponent: identity,
84
+ View: () => null,
85
+ Text: () => null,
86
+ }
87
+ return {
88
+ __esModule: true,
89
+ default: Animated,
90
+ cancelAnimation: () => {},
91
+ runOnJS: identity,
92
+ runOnUI: identity,
93
+ useAnimatedReaction: () => {},
94
+ useAnimatedStyle: (callback: () => unknown) => callback(),
95
+ useDerivedValue: (callback: () => unknown) => sharedValue(callback()),
96
+ useSharedValue: sharedValue,
97
+ withDelay: (_delay: number, animation: unknown) => animation,
98
+ withSpring: identity,
99
+ withTiming: identity,
100
+ }
101
+ }
51
102
  default:
52
103
  return null
53
104
  }
@@ -55,14 +106,14 @@ function getStaticExtractionStub(path: string) {
55
106
 
56
107
  export function registerRequire(
57
108
  platform: TamaguiPlatform,
58
- { proxyWormImports } = {
59
- proxyWormImports: false,
109
+ { ignoredModules = [] }: { ignoredModules?: string[] } = {
110
+ ignoredModules: [],
60
111
  }
61
112
  ) {
62
113
  // already registered
63
114
  if (isRegistered) {
64
115
  return {
65
- tamaguiRequire: require,
116
+ tamaguiRequire: nodeRequire,
66
117
  unregister: () => {},
67
118
  }
68
119
  }
@@ -122,12 +173,35 @@ export function registerRequire(
122
173
  })
123
174
  }
124
175
 
176
+ const staticEvaluationReplacement = getStaticEvaluationModuleReplacement(path)
177
+ if (staticEvaluationReplacement) {
178
+ if (!(path in compiled)) {
179
+ const replacementPath = nodeRequire.resolve(staticEvaluationReplacement)
180
+ const output = buildSync({
181
+ entryPoints: [replacementPath],
182
+ bundle: true,
183
+ format: 'cjs',
184
+ platform: 'node',
185
+ write: false,
186
+ }).outputFiles[0].text
187
+ const replacementModule = new Module(replacementPath, this)
188
+ replacementModule.filename = replacementPath
189
+ replacementModule.paths = Module._nodeModulePaths(dirname(replacementPath))
190
+ replacementModule._compile(output, replacementPath)
191
+ compiled[path] = replacementModule.exports
192
+ }
193
+ return compiled[path]
194
+ }
195
+
125
196
  if (
126
- path in knownIgnorableModules ||
127
- path.startsWith('react-native-reanimated') ||
128
- esbuildIgnoreFilesRegex.test(path)
197
+ staticEvaluationReplacement === null ||
198
+ isIgnoredStaticEvaluationModule(path, ignoredModules)
129
199
  ) {
130
- return proxyWorm
200
+ return {}
201
+ }
202
+
203
+ if (esbuildIgnoreFilesRegex.test(path)) {
204
+ return {}
131
205
  }
132
206
 
133
207
  if (path in compiled) {
@@ -156,141 +230,29 @@ export function registerRequire(
156
230
  }
157
231
  }
158
232
 
159
- if (!whitelisted[path]) {
160
- if (proxyWormImports && !path.includes('.tamagui-dynamic-eval')) {
161
- // allow tamagui and its sub-packages through - they re-export components
162
- // with staticConfig needed for dynamic eval optimization.
163
- // also allow requires FROM within tamagui packages (relative imports like ./Separator.cjs)
164
- const callerFile = this?.filename || this?.id || ''
165
- const isFromTamaguiPkg =
166
- callerFile.includes('@tamagui') ||
167
- callerFile.includes('node_modules/tamagui/') ||
168
- /\/tamagui\/code\/(core|ui|packages)\//.test(callerFile)
169
- const isFromStaticLoader =
170
- !callerFile ||
171
- callerFile === '.' ||
172
- callerFile === '[eval]' ||
173
- callerFile.endsWith('/[eval]') ||
174
- callerFile.includes('/code/compiler/static/') ||
175
- callerFile.includes('/.tamagui/')
176
- // relative requires from within a whitelisted package's own files
177
- // (e.g. react/index.js does require('./cjs/react.development.js')).
178
- // proxy-worming these breaks the package's own internals.
179
- const isRelativeFromWhitelisted =
180
- path.startsWith('.') &&
181
- Object.keys(whitelisted).some((pkg) =>
182
- callerFile.includes(`/node_modules/${pkg}/`)
183
- )
184
-
185
- if (
186
- path === 'tamagui' ||
187
- path.startsWith('@tamagui/') ||
188
- isRelativeFromWhitelisted ||
189
- isFromTamaguiPkg ||
190
- isFromStaticLoader
191
- ) {
192
- return og.apply(this, [path])
193
- }
194
- return proxyWorm
195
- }
196
- }
197
-
198
233
  try {
199
234
  const out = og.apply(this, arguments)
200
- // only for studio disable for now
201
- // if (!nameToPaths[path]) {
202
- // if (out && typeof out === 'object') {
203
- // for (const key in out) {
204
- // try {
205
- // const conf = out[key]?.staticConfig as StaticConfig
206
- // if (conf) {
207
- // if (conf.componentName) {
208
- // nameToPaths[conf.componentName] ??= new Set()
209
- // const fullName = path.startsWith('.')
210
- // ? join(`${this.path.replace(/dist(\/cjs)?/, 'src')}`, path)
211
- // : path
212
- // nameToPaths[conf.componentName].add(fullName)
213
- // } else {
214
- // // console.log('no name component', path)
215
- // }
216
- // }
217
- // } catch {
218
- // // ok
219
- // }
220
- // }
221
- // }
222
- // }
223
235
  return out
224
236
  } catch (err: any) {
225
- if (
226
- !process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD &&
227
- path.includes('tamagui-dynamic-eval')
228
- ) {
229
- // ok, dynamic eval fails
230
- return
237
+ if (err?.code === 'TAMAGUI_STATIC_EVALUATION_ERROR') {
238
+ throw err
231
239
  }
232
- if (allowedIgnores[path] || IGNORES === 'true') {
233
- // ignore
234
- } else if (!process.env.TAMAGUI_SHOW_FULL_BUNDLE_ERRORS && !process.env.DEBUG) {
235
- if (hasWarnedForModules.has(path)) {
236
- // ignore
237
- } else {
238
- hasWarnedForModules.add(path)
239
- }
240
- } else {
241
- /**
242
- * Allow errors to happen, we're just reading config and components but sometimes external modules cause problems
243
- * We can't fix every problem, so just swap them out with proxyWorm which is a sort of generic object that can be read.
244
- */
245
-
246
- console.warn(
247
- ` [tamagui] skipped "${path}" (set TAMAGUI_IGNORE_BUNDLE_ERRORS="${path}" to silence)`
248
- )
249
- }
250
-
251
- return proxyWorm
240
+ const importer = this?.filename || this?.id || '<unknown module>'
241
+ const reason = err instanceof Error ? err.message : String(err)
242
+ const failedModule =
243
+ reason.match(/Cannot find native module ['"]([^'"]+)['"]/)?.[1] || path
244
+ throw new StaticEvaluationError(path, importer, failedModule, reason, {
245
+ cause: err,
246
+ })
252
247
  }
253
248
  }
254
249
 
255
250
  return {
256
251
  tamaguiRequire,
257
252
  unregister: () => {
258
- if (hasWarnedForModules.size) {
259
- console.info(
260
- ` [tamagui] skipped loading ${hasWarnedForModules.size} module, see: https://tamagui.dev/docs/intro/errors#warning-001`
261
- )
262
- hasWarnedForModules.clear()
263
- }
264
-
265
253
  unregister()
266
254
  isRegistered = false
267
255
  Module.prototype.require = og
268
256
  },
269
257
  }
270
258
  }
271
-
272
- const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS
273
- const extraIgnores =
274
- IGNORES === 'true' ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(',')
275
-
276
- const knownIgnorableModules = {
277
- '@gorhom/bottom-sheet': true,
278
- 'expo-modules': true,
279
- solito: true,
280
- 'expo-linear-gradient': true,
281
- '@expo/vector-icons': true,
282
- 'tamagui/linear-gradient': true,
283
- // animation libraries not needed for static extraction
284
- '@emotion/is-prop-valid': true,
285
- 'framer-motion': true,
286
- motion: true,
287
- ...Object.fromEntries(extraIgnores?.map((k) => [k, true]) || []),
288
- }
289
-
290
- const hasWarnedForModules = new Set<string>()
291
-
292
- const allowedIgnores = {
293
- 'expo-constants': true,
294
- './ExpoHaptics': true,
295
- './js/MaskedView': true,
296
- }
@@ -0,0 +1,74 @@
1
+ import { readFile } from 'node:fs/promises'
2
+ import { dirname } from 'node:path'
3
+ import type { Plugin } from 'esbuild'
4
+
5
+ export const tamaguiStaticEvaluationModules = Object.freeze({
6
+ // react-native-safe-area-context evaluates its native codegen spec in Node and
7
+ // calls codegenNativeComponent, which is unavailable during static evaluation.
8
+ 'react-native-safe-area-context': null,
9
+ // react-native-worklets initializes native JSI in Node, so static evaluation
10
+ // inlines the package's own mock while preserving the authored animation config.
11
+ // the vendor mock mutates _WORKLET, __RUNTIME_KIND, _log,
12
+ // _getAnimationTimestamp, and requestAnimationFrame in the compiler process.
13
+ 'react-native-worklets': 'react-native-worklets/lib/module/mock.js',
14
+ } as const)
15
+
16
+ export function getStaticEvaluationModuleReplacement(moduleName: string) {
17
+ return Object.hasOwn(tamaguiStaticEvaluationModules, moduleName)
18
+ ? tamaguiStaticEvaluationModules[
19
+ moduleName as keyof typeof tamaguiStaticEvaluationModules
20
+ ]
21
+ : undefined
22
+ }
23
+
24
+ export function isIgnoredStaticEvaluationModule(
25
+ moduleName: string,
26
+ userIgnoredModules: readonly string[] = []
27
+ ) {
28
+ return (
29
+ getStaticEvaluationModuleReplacement(moduleName) !== undefined ||
30
+ userIgnoredModules.includes(moduleName)
31
+ )
32
+ }
33
+
34
+ export function staticEvaluationIgnorePlugin(
35
+ userIgnoredModules: readonly string[] = []
36
+ ): Plugin {
37
+ return {
38
+ name: 'tamagui-static-evaluation-ignore',
39
+ setup(build) {
40
+ build.onResolve({ filter: /.*/ }, (args) => {
41
+ if (isIgnoredStaticEvaluationModule(args.path, userIgnoredModules)) {
42
+ return { path: args.path, namespace: 'tamagui-static-evaluation-ignore' }
43
+ }
44
+ return null
45
+ })
46
+ build.onLoad(
47
+ { filter: /.*/, namespace: 'tamagui-static-evaluation-ignore' },
48
+ async (args) => {
49
+ const replacement = getStaticEvaluationModuleReplacement(args.path)
50
+ if (replacement) {
51
+ const resolved = await build.resolve(replacement, {
52
+ kind: 'require-call',
53
+ resolveDir: build.initialOptions.absWorkingDir || process.cwd(),
54
+ })
55
+ if (resolved.errors.length) {
56
+ return { errors: resolved.errors, warnings: resolved.warnings }
57
+ }
58
+ return {
59
+ contents: await readFile(resolved.path, 'utf8'),
60
+ loader: 'js',
61
+ resolveDir: dirname(resolved.path),
62
+ warnings: resolved.warnings,
63
+ }
64
+ }
65
+ return {
66
+ contents: 'module.exports = {}',
67
+ loader: 'js',
68
+ resolveDir: build.initialOptions.absWorkingDir || process.cwd(),
69
+ }
70
+ }
71
+ )
72
+ },
73
+ }
74
+ }
package/src/types.ts CHANGED
@@ -1,109 +1,4 @@
1
- import type { NodePath } from '@babel/traverse'
2
- import type * as t from '@babel/types'
3
- import type { PseudoStyles, StaticConfig, TamaguiConfig } from '@tamagui/core'
4
- import type { StyleObject } from '@tamagui/helpers'
5
- import type { TamaguiOptions } from '@tamagui/types'
6
- import type { ViewStyle } from 'react-native'
7
-
8
- import type { LoadedComponents } from './extractor/bundleConfig'
9
-
10
- export type TamaguiPlatform = 'native' | 'web'
11
-
12
- export type { TamaguiOptions, TamaguiBuildOptions } from '@tamagui/types'
13
-
1
+ export type { TamaguiBuildOptions, TamaguiOptions } from '@tamagui/types'
14
2
  export type { StyleObject } from '@tamagui/helpers'
15
3
 
16
- export type ClassNameObject = t.StringLiteral | t.Expression
17
-
18
- export interface CacheObject {
19
- [key: string]: any
20
- }
21
-
22
- export interface LogOptions {
23
- clear?: boolean
24
- timestamp?: boolean
25
- error?: Error | null
26
- }
27
-
28
- export interface Logger {
29
- info(msg: string, options?: LogOptions): void
30
- warn(msg: string, options?: LogOptions): void
31
- error(msg: string, options?: LogOptions): void
32
- }
33
-
34
- export type ExtractorOptions = {
35
- logger?: Logger
36
- platform?: TamaguiPlatform
37
- }
38
-
39
- export type ExtractedAttrAttr = {
40
- type: 'attr'
41
- value: t.JSXAttribute | t.JSXSpreadAttribute
42
- extraClassNames?: string
43
- }
44
-
45
- export type ExtractedAttrStyle = {
46
- type: 'style'
47
- value: ViewStyle & PseudoStyles
48
- attr?: t.JSXAttribute | t.JSXSpreadAttribute
49
- name?: string
50
- extraClassNames?: string
51
- }
52
-
53
- export type ExtractedTernaryAttr = {
54
- type: 'ternary'
55
- value: Ternary
56
- }
57
-
58
- export type ExtractedAttr = ExtractedAttrAttr | ExtractedTernaryAttr | ExtractedAttrStyle
59
-
60
- export type ExtractTagProps = {
61
- parserProps: TamaguiOptionsWithFileInfo
62
- attrs: ExtractedAttr[]
63
- node: t.JSXOpeningElement
64
- attemptEval: (exprNode: t.Node, evalFn?: ((node: t.Node) => any) | undefined) => any
65
- flatNodeName?: string
66
- jsxPath: NodePath<t.JSXElement>
67
- programPath: NodePath<t.Program>
68
- originalNodeName: string
69
- lineNumbers: string
70
- filePath: string
71
- completeProps: Record<string, any>
72
- staticConfig: StaticConfig
73
- config: TamaguiConfig
74
- }
75
-
76
- export type TamaguiOptionsWithFileInfo = TamaguiOptions & {
77
- sourcePath?: string
78
- allLoadedComponents: LoadedComponents[]
79
- }
80
-
81
- export type ExtractorParseProps = Omit<
82
- TamaguiOptionsWithFileInfo,
83
- 'allLoadedComponents'
84
- > & {
85
- platform: TamaguiPlatform
86
- shouldPrintDebug?: boolean | 'verbose'
87
- onExtractTag: (props: ExtractTagProps) => void
88
- getFlattenedNode?: (props: { isTextView: boolean; tag: string }) => string
89
- extractStyledDefinitions?: boolean
90
- // identifer, rule
91
- onStyledDefinitionRule?: (identifier: string, rules: string[]) => void
92
- }
93
-
94
- export interface Ternary {
95
- test: t.Expression
96
- remove: Function
97
- consequent: object | null
98
- alternate: object | null
99
- fontFamily?: string
100
- inlineMediaQuery?: string
101
- }
102
-
103
- export type ClassNameToStyleObj = {
104
- [key: string]: StyleObject
105
- }
106
-
107
- export interface PluginContext {
108
- write: (path: string, rules: { [key: string]: string }) => any
109
- }
4
+ export type TamaguiPlatform = 'native' | 'web'