@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
@@ -0,0 +1,139 @@
1
+ import { type ZeroRule } from '@tamagui/compiler-core';
2
+ /**
3
+ * The zero-runtime bundle gate.
4
+ *
5
+ * Reference erasure is what removes the modules; this is what proves it. A green
6
+ * build is not evidence, so every integration hands its own resolved module ids
7
+ * and importer chains to this one check and writes a machine-readable receipt.
8
+ */
9
+ export interface ZeroGraphModule {
10
+ id: string;
11
+ /** Direct importers of this module inside the same graph. */
12
+ importers?: readonly string[];
13
+ }
14
+ export interface ZeroForbiddenModule {
15
+ id: string;
16
+ /** Shortest importer chain from an entry to the forbidden module. */
17
+ chain: string[];
18
+ /** The package that owns the module, which is what the gate matched on. */
19
+ owner: string;
20
+ }
21
+ export interface ZeroGraphReceipt {
22
+ integration: string;
23
+ graph: 'zero' | 'island' | 'negative-control';
24
+ entries: string[];
25
+ moduleCount: number;
26
+ tamaguiModules: string[];
27
+ forbidden: ZeroForbiddenModule[];
28
+ cssArtifact: {
29
+ path: string;
30
+ hash: string;
31
+ } | null;
32
+ identity: string;
33
+ gzip?: Record<string, number>;
34
+ /**
35
+ * Whether this build restored its artifact from a persisted plan cache
36
+ * instead of rescanning. Only integrations that cache plans set it.
37
+ */
38
+ plansRestoredFromCache?: boolean;
39
+ }
40
+ /** A module's owning package: the nearest package.json and the name in it. */
41
+ export interface OwningPackage {
42
+ name: string | null;
43
+ manifest: string;
44
+ }
45
+ /**
46
+ * The package that owns a module, read from the nearest package.json.
47
+ *
48
+ * Path matching is not enough: in this monorepo `@tamagui/web` resolves to
49
+ * `code/core/web/dist/...`, which contains no `@tamagui` path segment at all. A
50
+ * gate that greps ids would report a clean graph on a bundle that ships the
51
+ * whole runtime.
52
+ */
53
+ export declare function owningPackageOf(id: string): OwningPackage | null;
54
+ /** The same walk from a directory, for the project root itself. */
55
+ export declare function owningPackageOfDir(from: string): OwningPackage | null;
56
+ /**
57
+ * `ownManifest` is the building project's own package.json.
58
+ *
59
+ * A project may legitimately name itself `tamagui` or `@tamagui/something` —
60
+ * this repo's own site and examples do — and then every one of its modules
61
+ * answers this question the same way Tamagui's do. The distinction that
62
+ * actually holds is ownership, not spelling: Tamagui reaches a build as a
63
+ * resolved dependency, so its modules are owned by a different package.json
64
+ * than the one being built. Excluding the project's own manifest keeps the gate
65
+ * a name-free rule rather than a list of names to carve out.
66
+ */
67
+ export declare function isTamaguiModuleId(id: string, ownManifest?: string | null): boolean;
68
+ export declare function isForbiddenZeroModuleId(id: string, ownManifest?: string | null): boolean;
69
+ export declare function checkZeroGraph(input: {
70
+ entries: readonly string[];
71
+ /** The modules that actually shipped in the emitted chunks. */
72
+ modules: readonly ZeroGraphModule[];
73
+ /**
74
+ * Importer edges for the whole resolved graph. A forbidden module's chain
75
+ * usually runs through modules that were merged into another chunk, so the
76
+ * shipped set alone cannot reconstruct it.
77
+ */
78
+ importerEdges?: ReadonlyMap<string, readonly string[]>;
79
+ /**
80
+ * The project being built. Its own package.json is what
81
+ * `isTamaguiModuleId` excludes, so a project named `@tamagui/something` does
82
+ * not report every one of its own modules as a forbidden Tamagui module.
83
+ *
84
+ * It cannot be derived from the entries: webpack's entry for a Next app is
85
+ * `node_modules/next/dist/client/next.js`, which belongs to `next`.
86
+ */
87
+ root: string;
88
+ }): {
89
+ tamaguiModules: string[];
90
+ forbidden: ZeroForbiddenModule[];
91
+ };
92
+ export declare function formatZeroGraphFailure(receipt: ZeroGraphReceipt): string;
93
+ export declare function writeZeroGraphReceipt(outDir: string, name: string, receipt: ZeroGraphReceipt): string;
94
+ export interface ZeroViolationSite {
95
+ file: string;
96
+ line: number;
97
+ column: number;
98
+ rule: ZeroRule;
99
+ code: string;
100
+ component?: string;
101
+ message: string;
102
+ }
103
+ /**
104
+ * One deterministic order for every integration: normalized file path, source
105
+ * offset, rule, then message. A build that reports its violations in a
106
+ * different order on a different machine is not a receipt anyone can diff.
107
+ */
108
+ export declare function sortZeroViolations(sites: readonly ZeroViolationSite[]): ZeroViolationSite[];
109
+ /** The compiler collects every violation before failing. */
110
+ export declare function formatZeroViolations(sites: readonly ZeroViolationSite[]): string;
111
+ /**
112
+ * The machine-readable half of the same list. `report` mode writes it and exits
113
+ * successfully; `enforce` writes it and then fails, so the two are comparable.
114
+ */
115
+ export declare function writeZeroViolationReport(outDir: string, name: string, report: {
116
+ integration: string;
117
+ mode: 'report' | 'enforce';
118
+ violations: readonly ZeroViolationSite[];
119
+ }): string;
120
+ /**
121
+ * An exported `styled()` declarator is only erasable because every importer in
122
+ * this entry graph was itself transformed, and therefore lowered its uses. That
123
+ * is a build-wide fact, so it is checked once here rather than guessed per
124
+ * module.
125
+ */
126
+ export declare function erasedExportEscape(input: {
127
+ integration: string;
128
+ /** Module ids the zero transform actually ran on. */
129
+ transformed: ReadonlySet<string>;
130
+ /** Erased exported binding names, by the module that declared them. */
131
+ erasedExports: ReadonlyMap<string, readonly string[]>;
132
+ importersOf: ReadonlyMap<string, readonly string[]>;
133
+ }): string | null;
134
+ /** UTF-16 offset to 1-based line/column, for diagnostic sites. */
135
+ export declare function offsetToLineColumn(source: string, offset: number): {
136
+ line: number;
137
+ column: number;
138
+ };
139
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/zero/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAI3E;;;;;;GAMG;AAEH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,6DAA6D;IAC7D,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,qEAAqE;IACrE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAA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S,MAAM,EAAE,CAAC,CAAA;IACrD,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAA;CACpD,GAAG,MAAM,GAAG,IAAI,CAsBhB;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAUlC"}
@@ -0,0 +1,33 @@
1
+ import type { TamaguiRuntimeLiteral } from './options';
2
+ /**
3
+ * Bumped whenever the zero transform's emitted output changes shape. It rides
4
+ * the lowering plan version so a compiler change also invalidates zero caches.
5
+ */
6
+ export declare const ZERO_COMPILER_VERSION = "zero-1/plan-2";
7
+ /**
8
+ * Every integration records this tuple in its cache and build identity. The CSS
9
+ * path alone is insufficient because the artifact's content can change in place.
10
+ */
11
+ export interface ZeroArtifactIdentity {
12
+ runtimeLiteral: TamaguiRuntimeLiteral;
13
+ target: 'web' | 'native';
14
+ configGeneration: string;
15
+ cssHash: string;
16
+ compilerVersion: string;
17
+ islandEntries: string[];
18
+ bridgeManifestHash: string;
19
+ islandOutputHashes: Record<string, string>;
20
+ }
21
+ export declare function hashZeroIdentity(identity: ZeroArtifactIdentity): string;
22
+ /**
23
+ * A key-sorted deep copy.
24
+ *
25
+ * The bridge manifest is compared and hashed across processes and across a
26
+ * persisted cache, and a round trip through JSON reorders object keys. Hashing
27
+ * insertion order makes the same manifest produce two identities depending on
28
+ * whether the build scanned or restored, which is a cache miss that looks like
29
+ * a real change.
30
+ */
31
+ export declare function canonicalizeBridgeManifest<T>(manifest: T): T;
32
+ export declare function hashBridgeManifest(manifest: unknown): string;
33
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/zero/identity.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,kBAA+C,CAAA;AAEjF;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,qBAAqB,CAAA;IACrC,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC3C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,CAgBvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAY5D;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAK5D"}
@@ -0,0 +1,9 @@
1
+ export * from './artifact';
2
+ export * from './graph';
3
+ export * from './identity';
4
+ export * from './islands';
5
+ export * from './options';
6
+ export * from './ownership';
7
+ export * from './theme';
8
+ export * from './transform';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
@@ -0,0 +1,56 @@
1
+ import type { ZeroIsland } from './options';
2
+ /**
3
+ * Island generation.
4
+ *
5
+ * An island is a full-runtime entry graph built in a separate bundler
6
+ * invocation. The zero graph never imports it; it imports a generated loader
7
+ * that owns the deterministic server placeholder, the shared React handoff, and
8
+ * the async fetch of the separately built island bundle.
9
+ */
10
+ export declare const ISLAND_RUNTIME_KEY = "__tamagui_island_runtime__";
11
+ export declare const ISLAND_REGISTRY_KEY = "__tamagui_islands__";
12
+ /** Block 3's normalized internal representation, produced at compile time. */
13
+ export interface IslandThemeBridgeLayer {
14
+ inlineValues: {
15
+ values: Record<string, string | number>;
16
+ themes?: Record<string, Record<string, string | number>>;
17
+ };
18
+ inlineClassName: string;
19
+ }
20
+ export interface IslandThemeBridge {
21
+ id: string;
22
+ name: string;
23
+ layers: IslandThemeBridgeLayer[];
24
+ }
25
+ export interface IslandGenerationInput {
26
+ island: ZeroIsland;
27
+ /** Names the integration in the loader's recovery diagnostic. */
28
+ integration: string;
29
+ /** Absolute path of the app's tamagui config module. */
30
+ configPath: string;
31
+ /** URL the loader fetches the built island bundle from. */
32
+ scriptUrl: string;
33
+ /** URL of the one generated CSS artifact both entries load. */
34
+ cssHref: string;
35
+ }
36
+ export declare function generateIslandLoaderSource(input: IslandGenerationInput): string;
37
+ export declare function generateIslandEntrySource(input: IslandGenerationInput): string;
38
+ export declare function writeIslandModules(input: IslandGenerationInput): void;
39
+ /**
40
+ * The island child build externalizes React to the handoff the generated loader
41
+ * publishes, so one React instance serves both graphs.
42
+ *
43
+ * Property paths are the source of truth: webpack needs the segments (a dotted
44
+ * string becomes one literal property name), rollup needs the joined expression.
45
+ */
46
+ export declare const ISLAND_EXTERNAL_GLOBAL_PATHS: Record<string, string[]>;
47
+ export declare const ISLAND_EXTERNAL_GLOBALS: Record<string, string>;
48
+ /**
49
+ * Merges one module's bridge descriptors into the build-wide manifest.
50
+ *
51
+ * A module is transformed once per compilation (webpack builds a server and a
52
+ * client pass over the same source), so a bridge id must replace its previous
53
+ * record rather than append a duplicate.
54
+ */
55
+ export declare function mergeIslandBridges(target: Map<string, IslandThemeBridge[]>, incoming: Map<string, IslandThemeBridge[]>): void;
56
+ //# sourceMappingURL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,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK1D,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,EACxC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,GACzC,IAAI,CAWN"}
@@ -0,0 +1,58 @@
1
+ import type { TamaguiInternalConfig } from '@tamagui/web';
2
+ import type { TamaguiOptions } from '../types';
3
+ /**
4
+ * `TAMAGUI_RUNTIME` has exactly two integration-owned literal values. The public
5
+ * `experimental.zeroRuntime` option is the author input; this literal is
6
+ * generated output, so an ambient shell value never reaches a build.
7
+ */
8
+ export type TamaguiRuntimeLiteral = 'full' | 'zero';
9
+ export type ZeroRuntimeMode = 'off' | 'report' | 'enforce';
10
+ export interface ZeroIsland {
11
+ /** Stable, deterministic id derived from the island module's root-relative path. */
12
+ id: string;
13
+ /** Absolute path of the island root module. */
14
+ module: string;
15
+ /** Absolute path of the generated loader the zero graph imports. */
16
+ loader: string;
17
+ /** Absolute path of the generated full-runtime entry. */
18
+ entry: string;
19
+ }
20
+ export interface ZeroRuntimeResolved {
21
+ mode: ZeroRuntimeMode;
22
+ /** The project being built. The graph gate excludes its own package. */
23
+ root: string;
24
+ islandGlobs: string[];
25
+ islands: ZeroIsland[];
26
+ /** Absolute directory holding generated loaders, entries, and receipts. */
27
+ outDir: string;
28
+ /** Absolute path of the single generated CSS artifact. */
29
+ cssPath: string;
30
+ }
31
+ export declare const ZERO_OUT_DIRNAME = ".tamagui/zero";
32
+ /**
33
+ * Island id is the module's basename, which is also the generated loader's
34
+ * filename. Two declared islands may not share a basename.
35
+ */
36
+ export declare function islandIdFor(moduleId: string): string;
37
+ type ZeroRuntimeInput = Pick<TamaguiOptions, 'experimental' | 'outputCSS' | 'platform'>;
38
+ export declare function resolveZeroRuntime(options: ZeroRuntimeInput, root: string): Promise<ZeroRuntimeResolved>;
39
+ /** The webpack adapter configures itself synchronously, before any hook runs. */
40
+ export declare function resolveZeroRuntimeSync(options: ZeroRuntimeInput, root: string): ZeroRuntimeResolved;
41
+ /**
42
+ * Rule 5 at config level. A non-CSS driver in the zero entry's own config means
43
+ * every animated component in that graph needs a component animation runtime,
44
+ * which is exactly what the mode removes.
45
+ */
46
+ export declare function assertZeroConfigDrivers(config: TamaguiInternalConfig): void;
47
+ export type ZeroIntegration = 'vite' | 'next-webpack' | 'metro-web';
48
+ /**
49
+ * Base and island support are enabled per integration after that integration
50
+ * passes its own receipts. One lagging integration never blocks another.
51
+ */
52
+ export declare const ZERO_INTEGRATION_SUPPORT: Record<ZeroIntegration, {
53
+ base: boolean;
54
+ islands: boolean;
55
+ }>;
56
+ export declare function assertZeroIntegrationSupport(integration: ZeroIntegration, resolved: ZeroRuntimeResolved): void;
57
+ export {};
58
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/zero/options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAIzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AAEnD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE1D,MAAM,WAAW,UAAU;IACzB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAA;IACV,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAA;IACd,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAA;IACrB,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAA;CAChB;AAID,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,KAAK,gBAAgB,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC,CAAA;AAEvF,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,CAW9B;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,MAAM,GACX,mBAAmB,CAWrB;AAuGD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAa3E;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAA;AAEnE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,eAAe,EACf;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAKpC,CAAA;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,eAAe,EAC5B,QAAQ,EAAE,mBAAmB,GAC5B,IAAI,CAaN"}
@@ -0,0 +1,51 @@
1
+ import type { TamaguiOptions } from '../types';
2
+ /**
3
+ * Artifact ownership, shared by every integration and by both CSS tiers.
4
+ *
5
+ * A build may claim `TAMAGUI_DID_OUTPUT_CSS='1'` only after the artifact that
6
+ * replaces the stripped JavaScript rules is proven to exist, to match the CSS
7
+ * this build's config generates, and to be loaded by the entry graph. Those are
8
+ * three separate failures with three separate causes, so they are three
9
+ * separate diagnostics.
10
+ */
11
+ export type GlobalCSSFailureKind = 'missing' | 'stale' | 'unimported';
12
+ export interface GlobalCSSFailure {
13
+ kind: GlobalCSSFailureKind;
14
+ cssPath: string;
15
+ message: string;
16
+ }
17
+ export declare const hashCSS: (css: string) => string;
18
+ /**
19
+ * `TAMAGUI_DOES_SSR_CSS='mutates-themes'` declares that themes are mutated at
20
+ * runtime, which is the one declaration that keeps the runtime theme generator
21
+ * alive. It therefore blocks the compiled-global-CSS claim outright.
22
+ */
23
+ export declare const declaresRuntimeThemeMutation: () => boolean;
24
+ export interface GlobalCSSOwnership {
25
+ /** Absolute path of the artifact this build owns. */
26
+ cssPath: string;
27
+ }
28
+ /**
29
+ * The compiled-global-CSS tier for one web build, or null when the build is not
30
+ * in that tier.
31
+ *
32
+ * Zero mode owns its own combined artifact and derives the flag through
33
+ * `ZeroCSSArtifact`, so it is deliberately excluded here: one tier, one owner.
34
+ */
35
+ export declare function resolveGlobalCSSOwnership(options: Pick<TamaguiOptions, 'experimental' | 'outputCSS' | 'platform' | 'disable'>, root: string): GlobalCSSOwnership | null;
36
+ /**
37
+ * The three ways the stripping fact and its replacement asset can diverge.
38
+ *
39
+ * `loadedModuleIds` is the set of module ids the entry graph actually shipped.
40
+ * An integration that publishes the artifact as a static file rather than as a
41
+ * graph module passes the published copy's path instead, which is the same
42
+ * question asked of a different transport.
43
+ */
44
+ export declare function checkGlobalCSSArtifact(input: {
45
+ cssPath: string;
46
+ expectedCSS: string;
47
+ loadedModuleIds: Iterable<string>;
48
+ /** How the entry is expected to reach the artifact, printed on failure. */
49
+ importHint: string;
50
+ }): GlobalCSSFailure | null;
51
+ //# sourceMappingURL=ownership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/zero/ownership.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C;;;;;;;;GAQG;AAEH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,CAAA;AAErE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,eAAO,MAAM,OAAO,QAAS,MAAM,WAC0B,CAAA;AAI7D;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,eACc,CAAA;AAEvD,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC,EACpF,IAAI,EAAE,MAAM,GACX,kBAAkB,GAAG,IAAI,CAW3B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IACjC,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,gBAAgB,GAAG,IAAI,CAgC1B"}
@@ -0,0 +1,83 @@
1
+ import { type AstNode, type SourceEdit, type ZeroViolation } from '@tamagui/compiler-core';
2
+ import { type TamaguiInternalConfig } from '@tamagui/web';
3
+ import type { IslandThemeBridgeLayer } from './islands';
4
+ /**
5
+ * Static `<Theme>` lowering.
6
+ *
7
+ * A `<Theme>` node is markup plus classes and nothing else once its name and its
8
+ * direct theme-key values are known at build time. This resolves the name the
9
+ * way the runtime resolves it, emits the same span the runtime emits, and turns
10
+ * every value the parser cannot use into a violation rather than the warn-and-
11
+ * drop the render path does.
12
+ */
13
+ /**
14
+ * One branch of a `<Theme name>`. `test` is the source text of the condition
15
+ * that selects it, or null for the unconditional branch. A literal name is one
16
+ * option with a null test.
17
+ */
18
+ export interface ThemeNameOption {
19
+ test: string | null;
20
+ name: string | undefined;
21
+ }
22
+ export interface StaticThemeNode {
23
+ element: AstNode;
24
+ opening: AstNode;
25
+ closing: AstNode | null;
26
+ options: ThemeNameOption[];
27
+ reset: boolean;
28
+ contain: boolean;
29
+ /** The compiled inline-value layer, when the node carries theme-key props. */
30
+ layer: IslandThemeBridgeLayer | null;
31
+ }
32
+ /**
33
+ * Folds one value per branch into a single expression. The branches are the
34
+ * product in authored order and the last one is exhaustive, so it is the
35
+ * ternary's else. Branches that agree collapse to a literal, which is what makes
36
+ * an ordinary literal `<Theme name="dark">` emit a plain string.
37
+ */
38
+ export declare function foldBranches(branches: {
39
+ test: string | null;
40
+ value: string;
41
+ }[]): string;
42
+ /** One resolved theme name, with the guard that selects it. */
43
+ export interface ThemeBranch {
44
+ test: string | null;
45
+ name: string;
46
+ isNew: boolean;
47
+ }
48
+ /**
49
+ * Every theme name an element's `<Theme>` ancestry can resolve to.
50
+ *
51
+ * The chain is root-most first and includes the element's own node when it has
52
+ * one. Each node contributes its branches; the result is their product, walked
53
+ * in authored order so a nested `<Theme name="blue">` resolves against whatever
54
+ * its parent resolved to, exactly as `resolveThemeName` does at runtime.
55
+ */
56
+ export declare function resolveThemeChain(chain: readonly StaticThemeNode[], rootThemeName: string, config: TamaguiInternalConfig): ThemeBranch[];
57
+ export interface StaticThemeReadResult {
58
+ node: StaticThemeNode | null;
59
+ violations: ZeroViolation[];
60
+ /** The CSS rules the node's inline values need, keyed by their class name. */
61
+ css: Map<string, string>;
62
+ }
63
+ /**
64
+ * Reads one `<Theme>` element into its static description.
65
+ *
66
+ * Prop classification is `reservedThemeProps`, the same table the runtime reads,
67
+ * so a name that becomes reserved later cannot mean a theme key here and a
68
+ * reserved prop there.
69
+ */
70
+ export declare function readStaticTheme(element: AstNode, id: string, source: string, config: TamaguiInternalConfig): StaticThemeReadResult;
71
+ /**
72
+ * The span a static `<Theme>` lowers to.
73
+ *
74
+ * Same classes and same inline style the runtime span carries, because both are
75
+ * read by the same CSS: the theme classes select the named theme's variables,
76
+ * the inline-value class carries the direct props at the anchored specificity
77
+ * that lets it beat them, and `display: contents` keeps the span out of layout.
78
+ */
79
+ export declare function lowerStaticTheme(node: StaticThemeNode, chain: readonly StaticThemeNode[], rootThemeName: string, config: TamaguiInternalConfig, id: string): {
80
+ edits: SourceEdit[];
81
+ violations: ZeroViolation[];
82
+ };
83
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/zero/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAEvD;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,OAAO,CAAA;IAChB,8EAA8E;IAC9E,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAA;CACrC;AAoFD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,CAYvF;AAED,+DAA+D;AAC/D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,qBAAqB,GAC5B,WAAW,EAAE,CAuBf;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,8EAA8E;IAC9E,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,qBAAqB,GAC5B,qBAAqB,CAgLvB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,qBAAqB,EAC7B,EAAE,EAAE,MAAM,GACT;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,UAAU,EAAE,aAAa,EAAE,CAAA;CAAE,CAmEtD"}
@@ -0,0 +1,53 @@
1
+ import { type AppliedLoweredModule, type LoweredModulePlan, type SourceEdit, type ZeroViolation } from '@tamagui/compiler-core';
2
+ import { type TamaguiInternalConfig } from '@tamagui/web';
3
+ import type { IslandThemeBridge } from './islands';
4
+ /**
5
+ * The zero-mode source transform.
6
+ *
7
+ * It runs after lowering has committed its edits and before the bundler records
8
+ * this module's dependencies. It lowers static `<Theme>` into host markup plus
9
+ * classes, assigns each island mount its theme bridge, and erases the Tamagui
10
+ * references lowering consumed.
11
+ */
12
+ export interface ZeroModuleTransformInput {
13
+ /**
14
+ * `report` runs every analysis and returns the source unchanged, so a project
15
+ * can see its violations without moving off the full runtime.
16
+ */
17
+ mode: 'report' | 'enforce';
18
+ id: string;
19
+ /** Project root, so bridge ids are stable and unique across modules. */
20
+ root: string;
21
+ source: string;
22
+ /** The module's lowering plan. Erasure only runs on a plan with no violations. */
23
+ plan: LoweredModulePlan;
24
+ config: TamaguiInternalConfig;
25
+ /** Specifier prefixes that name the Tamagui surface, e.g. `tamagui`. */
26
+ isTamaguiSpecifier(specifier: string): boolean;
27
+ /** Island id when a specifier resolves to a generated island loader. */
28
+ resolveIslandLoader(specifier: string): {
29
+ islandId: string;
30
+ } | null;
31
+ /** Island id when a specifier resolves to a declared island root module. */
32
+ resolveIslandModule(specifier: string): string | null;
33
+ }
34
+ export interface ZeroModuleTransformResult {
35
+ output: AppliedLoweredModule;
36
+ edits: SourceEdit[];
37
+ /** Deterministic bridge descriptors this module produced, by island id. */
38
+ bridges: Map<string, IslandThemeBridge[]>;
39
+ /** Inline-value CSS rules keyed by their generated class name. */
40
+ bridgeCSS: Map<string, string>;
41
+ violations: ZeroViolation[];
42
+ erased: {
43
+ modules: string[];
44
+ bindings: string[];
45
+ styledDefinitions: string[];
46
+ /** Erased declarators this module also exported. */
47
+ exports: string[];
48
+ };
49
+ /** Animated-number hooks rewritten from the public barrel to the leaf. */
50
+ rewrittenAnimatedNumberHooks: string[];
51
+ }
52
+ export declare function transformZeroModule(input: ZeroModuleTransformInput): ZeroModuleTransformResult;
53
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/zero/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,oBAAoB,EAEzB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAKzD,OAAO,KAAK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