@tamagui/compiler-core 0.0.0-bootstrap.0 → 3.0.0-beta.1093.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 (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -1
  3. package/dist/cjs/ast.cjs +108 -0
  4. package/dist/cjs/contracts.cjs +61 -0
  5. package/dist/cjs/diagnostics.cjs +68 -0
  6. package/dist/cjs/evaluate.cjs +602 -0
  7. package/dist/cjs/graph.cjs +335 -0
  8. package/dist/cjs/hash.cjs +48 -0
  9. package/dist/cjs/index.cjs +43 -0
  10. package/dist/cjs/ir.cjs +32 -0
  11. package/dist/cjs/lower.cjs +232 -0
  12. package/dist/cjs/materialize.cjs +222 -0
  13. package/dist/cjs/normalize.cjs +628 -0
  14. package/dist/cjs/output.cjs +148 -0
  15. package/dist/cjs/planCache.cjs +262 -0
  16. package/dist/cjs/session.cjs +127 -0
  17. package/dist/cjs/yuku.cjs +166 -0
  18. package/dist/cjs/zero.cjs +389 -0
  19. package/dist/esm/ast.mjs +79 -0
  20. package/dist/esm/ast.mjs.map +1 -0
  21. package/dist/esm/contracts.mjs +34 -0
  22. package/dist/esm/contracts.mjs.map +1 -0
  23. package/dist/esm/diagnostics.mjs +44 -0
  24. package/dist/esm/diagnostics.mjs.map +1 -0
  25. package/dist/esm/evaluate.mjs +576 -0
  26. package/dist/esm/evaluate.mjs.map +1 -0
  27. package/dist/esm/graph.mjs +313 -0
  28. package/dist/esm/graph.mjs.map +1 -0
  29. package/dist/esm/hash.mjs +26 -0
  30. package/dist/esm/hash.mjs.map +1 -0
  31. package/dist/esm/index.mjs +30 -0
  32. package/dist/esm/ir.mjs +12 -0
  33. package/dist/esm/ir.mjs.map +1 -0
  34. package/dist/esm/lower.mjs +210 -0
  35. package/dist/esm/lower.mjs.map +1 -0
  36. package/dist/esm/materialize.mjs +203 -0
  37. package/dist/esm/materialize.mjs.map +1 -0
  38. package/dist/esm/normalize.mjs +604 -0
  39. package/dist/esm/normalize.mjs.map +1 -0
  40. package/dist/esm/output.mjs +119 -0
  41. package/dist/esm/output.mjs.map +1 -0
  42. package/dist/esm/planCache.mjs +232 -0
  43. package/dist/esm/planCache.mjs.map +1 -0
  44. package/dist/esm/session.mjs +108 -0
  45. package/dist/esm/session.mjs.map +1 -0
  46. package/dist/esm/yuku.mjs +144 -0
  47. package/dist/esm/yuku.mjs.map +1 -0
  48. package/dist/esm/zero.mjs +354 -0
  49. package/dist/esm/zero.mjs.map +1 -0
  50. package/package.json +42 -4
  51. package/src/ast.ts +106 -0
  52. package/src/contracts.ts +150 -0
  53. package/src/diagnostics.ts +96 -0
  54. package/src/evaluate.ts +875 -0
  55. package/src/graph.ts +425 -0
  56. package/src/hash.ts +36 -0
  57. package/src/index.ts +15 -0
  58. package/src/ir.ts +156 -0
  59. package/src/lower.ts +435 -0
  60. package/src/materialize.ts +383 -0
  61. package/src/normalize.ts +834 -0
  62. package/src/output.ts +175 -0
  63. package/src/planCache.ts +362 -0
  64. package/src/session.ts +192 -0
  65. package/src/yuku.ts +197 -0
  66. package/src/zero.ts +609 -0
  67. package/types/ast.d.ts +11 -0
  68. package/types/ast.d.ts.map +1 -0
  69. package/types/contracts.d.ts +99 -0
  70. package/types/contracts.d.ts.map +1 -0
  71. package/types/diagnostics.d.ts +31 -0
  72. package/types/diagnostics.d.ts.map +1 -0
  73. package/types/evaluate.d.ts +48 -0
  74. package/types/evaluate.d.ts.map +1 -0
  75. package/types/graph.d.ts +51 -0
  76. package/types/graph.d.ts.map +1 -0
  77. package/types/hash.d.ts +8 -0
  78. package/types/hash.d.ts.map +1 -0
  79. package/types/index.d.ts +16 -0
  80. package/types/index.d.ts.map +1 -0
  81. package/types/ir.d.ts +120 -0
  82. package/types/ir.d.ts.map +1 -0
  83. package/types/lower.d.ts +99 -0
  84. package/types/lower.d.ts.map +1 -0
  85. package/types/materialize.d.ts +121 -0
  86. package/types/materialize.d.ts.map +1 -0
  87. package/types/normalize.d.ts +7 -0
  88. package/types/normalize.d.ts.map +1 -0
  89. package/types/output.d.ts +32 -0
  90. package/types/output.d.ts.map +1 -0
  91. package/types/planCache.d.ts +123 -0
  92. package/types/planCache.d.ts.map +1 -0
  93. package/types/session.d.ts +52 -0
  94. package/types/session.d.ts.map +1 -0
  95. package/types/yuku.d.ts +4 -0
  96. package/types/yuku.d.ts.map +1 -0
  97. package/types/zero.d.ts +99 -0
  98. package/types/zero.d.ts.map +1 -0
@@ -0,0 +1,144 @@
1
+ import { Analyzer } from "yuku-analyzer";
2
+ import { resolveFromHost, resolvedModuleId } from "./contracts.mjs";
3
+ import { childNode, walkAst } from "./ast.mjs";
4
+ import { asAstNode, definitionFromDeclaration, nodeAtSpan } from "./normalize.mjs";
5
+
6
+ var YukuCandidate = class {
7
+ constructor(project) {
8
+ this.project = project;
9
+ this.#analyzer = new Analyzer({ resolve: (specifier, importer) => resolveFromHost(this.project.resolutions, specifier, importer) });
10
+ for (const [id, source] of project.files) this.addFile(id, source);
11
+ }
12
+ project;
13
+ name = "yuku";
14
+ #analyzer;
15
+ #parseCounts = /* @__PURE__ */ new Map();
16
+ addFile(id, source) {
17
+ this.#analyzer.addFile(id, source, {
18
+ preserveParens: true,
19
+ sourceType: "module"
20
+ });
21
+ this.#parseCounts.set(id, (this.#parseCounts.get(id) ?? 0) + 1);
22
+ }
23
+ removeFile(id) {
24
+ return this.#analyzer.removeFile(id);
25
+ }
26
+ link() {
27
+ this.#analyzer.link();
28
+ }
29
+ #module(id) {
30
+ const module = this.#analyzer.module(id);
31
+ if (!module) throw new Error(`yuku: unknown module ${id}`);
32
+ return module;
33
+ }
34
+ #canonicalSymbol(id, localName) {
35
+ const symbol = this.#module(id).resolve(localName);
36
+ return symbol ? this.#analyzer.definitionOf(symbol)?.symbol ?? null : null;
37
+ }
38
+ #definitionSite(symbol) {
39
+ const declaration = symbol.declarations[0];
40
+ if (!declaration) return null;
41
+ return definitionFromDeclaration(symbol.module.path, symbol.name, asAstNode(declaration, `${symbol.name} declaration`), (node) => symbol.module.parentOf(node));
42
+ }
43
+ definitionOf(id, localName) {
44
+ const symbol = this.#canonicalSymbol(id, localName);
45
+ return symbol ? this.#definitionSite(symbol) : null;
46
+ }
47
+ definitionAt(id, start, end) {
48
+ const module = this.#module(id);
49
+ const node = nodeAtSpan(asAstNode(module.ast, `${module.path} program`), start, end);
50
+ if (!node) return null;
51
+ const symbol = module.symbolOf(node);
52
+ const definition = symbol && this.#analyzer.definitionOf(symbol)?.symbol;
53
+ return definition ? this.#definitionSite(definition) : null;
54
+ }
55
+ referencesOf(definition) {
56
+ const symbol = this.#canonicalSymbol(definition.id, definition.name);
57
+ if (!symbol) return [];
58
+ return this.#analyzer.referencesOf(symbol).map(({ module, reference }) => ({
59
+ id: resolvedModuleId(module.path),
60
+ name: reference.name,
61
+ start: reference.node.start,
62
+ end: reference.node.end
63
+ }));
64
+ }
65
+ dependenciesOf(id) {
66
+ return this.#module(id).dependencies.map((module) => module.path).sort();
67
+ }
68
+ dependentsOf(id) {
69
+ return this.#module(id).dependents.map((module) => module.path).sort();
70
+ }
71
+ affectedBy(id) {
72
+ const affected = /* @__PURE__ */ new Set([id]);
73
+ const queue = [id];
74
+ while (queue.length) {
75
+ const current = queue.shift();
76
+ for (const dependent of this.dependentsOf(current)) {
77
+ if (!affected.has(dependent)) {
78
+ affected.add(dependent);
79
+ queue.push(dependent);
80
+ }
81
+ }
82
+ }
83
+ return [...affected].sort();
84
+ }
85
+ programOf(id) {
86
+ return asAstNode(this.#module(id).ast, `${id} program`);
87
+ }
88
+ sourceOf(id) {
89
+ return this.#module(id).source;
90
+ }
91
+ parseCount(id) {
92
+ return this.#parseCounts.get(id) ?? 0;
93
+ }
94
+ diagnostics() {
95
+ const parseDiagnostics = [...this.#analyzer.modules.values()].flatMap((module) => module.diagnostics.map((diagnostic) => ({
96
+ kind: "parse",
97
+ id: resolvedModuleId(module.path),
98
+ message: diagnostic.message
99
+ })));
100
+ return [...parseDiagnostics, ...this.#analyzer.diagnostics.map((diagnostic) => ({
101
+ kind: "link",
102
+ id: resolvedModuleId(diagnostic.module),
103
+ message: diagnostic.message
104
+ }))];
105
+ }
106
+ };
107
+ const yukuFactory = {
108
+ name: "yuku",
109
+ create: (project) => new YukuCandidate(project),
110
+ scanImports(id, source) {
111
+ const candidate = new YukuCandidate({
112
+ files: /* @__PURE__ */ new Map([[id, source]]),
113
+ resolutions: /* @__PURE__ */ new Map()
114
+ });
115
+ const found = [];
116
+ walkAst(candidate.programOf(id), (node) => {
117
+ if (node.type !== "ImportDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "ExportAllDeclaration" && node.type !== "ImportExpression") {
118
+ return;
119
+ }
120
+ const sourceNode = childNode(node, "source");
121
+ if (sourceNode && typeof sourceNode.value === "string") {
122
+ found.push({
123
+ start: node.start,
124
+ specifier: sourceNode.value
125
+ });
126
+ }
127
+ });
128
+ return [...new Set(found.sort((left, right) => left.start - right.start).map(({ specifier }) => specifier))];
129
+ }
130
+ };
131
+ function parseModuleAst(source, id = "/tamagui/compiler-module.tsx") {
132
+ const candidate = yukuFactory.create({
133
+ files: /* @__PURE__ */ new Map([[id, source]]),
134
+ resolutions: /* @__PURE__ */ new Map()
135
+ });
136
+ const diagnostics = candidate.diagnostics().filter((diagnostic) => diagnostic.kind === "parse");
137
+ if (diagnostics.length) {
138
+ throw new Error(`Unable to parse ${id}: ${diagnostics.map(({ message }) => message).join("; ")}`);
139
+ }
140
+ return candidate.programOf(id);
141
+ }
142
+
143
+ export { parseModuleAst, yukuFactory };
144
+ //# sourceMappingURL=yuku.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yuku.js","names":["#analyzer","#parseCounts","#module","#canonicalSymbol","#definitionSite"],"sources":["esm/yuku.js"],"sourcesContent":["import { Analyzer } from \"yuku-analyzer\";\nimport { resolveFromHost, resolvedModuleId } from \"./contracts\";\nimport { childNode, walkAst } from \"./ast\";\nimport { asAstNode, definitionFromDeclaration, nodeAtSpan } from \"./normalize\";\nclass YukuCandidate {\n constructor(project) {\n this.project = project;\n this.#analyzer = new Analyzer({\n resolve: (specifier, importer) => resolveFromHost(this.project.resolutions, specifier, importer)\n });\n for (const [id, source] of project.files) this.addFile(id, source);\n }\n project;\n name = \"yuku\";\n #analyzer;\n #parseCounts = /* @__PURE__ */ new Map();\n addFile(id, source) {\n this.#analyzer.addFile(id, source, { preserveParens: true, sourceType: \"module\" });\n this.#parseCounts.set(id, (this.#parseCounts.get(id) ?? 0) + 1);\n }\n removeFile(id) {\n return this.#analyzer.removeFile(id);\n }\n link() {\n this.#analyzer.link();\n }\n #module(id) {\n const module = this.#analyzer.module(id);\n if (!module) throw new Error(`yuku: unknown module ${id}`);\n return module;\n }\n #canonicalSymbol(id, localName) {\n const symbol = this.#module(id).resolve(localName);\n return symbol ? this.#analyzer.definitionOf(symbol)?.symbol ?? null : null;\n }\n #definitionSite(symbol) {\n const declaration = symbol.declarations[0];\n if (!declaration) return null;\n return definitionFromDeclaration(\n symbol.module.path,\n symbol.name,\n asAstNode(declaration, `${symbol.name} declaration`),\n (node) => symbol.module.parentOf(node)\n );\n }\n definitionOf(id, localName) {\n const symbol = this.#canonicalSymbol(id, localName);\n return symbol ? this.#definitionSite(symbol) : null;\n }\n definitionAt(id, start, end) {\n const module = this.#module(id);\n const node = nodeAtSpan(asAstNode(module.ast, `${module.path} program`), start, end);\n if (!node) return null;\n const symbol = module.symbolOf(node);\n const definition = symbol && this.#analyzer.definitionOf(symbol)?.symbol;\n return definition ? this.#definitionSite(definition) : null;\n }\n referencesOf(definition) {\n const symbol = this.#canonicalSymbol(definition.id, definition.name);\n if (!symbol) return [];\n return this.#analyzer.referencesOf(symbol).map(({ module, reference }) => ({\n id: resolvedModuleId(module.path),\n name: reference.name,\n start: reference.node.start,\n end: reference.node.end\n }));\n }\n dependenciesOf(id) {\n return this.#module(id).dependencies.map((module) => module.path).sort();\n }\n dependentsOf(id) {\n return this.#module(id).dependents.map((module) => module.path).sort();\n }\n affectedBy(id) {\n const affected = /* @__PURE__ */ new Set([id]);\n const queue = [id];\n while (queue.length) {\n const current = queue.shift();\n for (const dependent of this.dependentsOf(current)) {\n if (!affected.has(dependent)) {\n affected.add(dependent);\n queue.push(dependent);\n }\n }\n }\n return [...affected].sort();\n }\n programOf(id) {\n return asAstNode(this.#module(id).ast, `${id} program`);\n }\n sourceOf(id) {\n return this.#module(id).source;\n }\n parseCount(id) {\n return this.#parseCounts.get(id) ?? 0;\n }\n diagnostics() {\n const parseDiagnostics = [...this.#analyzer.modules.values()].flatMap(\n (module) => module.diagnostics.map((diagnostic) => ({\n kind: \"parse\",\n id: resolvedModuleId(module.path),\n message: diagnostic.message\n }))\n );\n return [\n ...parseDiagnostics,\n ...this.#analyzer.diagnostics.map((diagnostic) => ({\n kind: \"link\",\n id: resolvedModuleId(diagnostic.module),\n message: diagnostic.message\n }))\n ];\n }\n}\nconst yukuFactory = {\n name: \"yuku\",\n create: (project) => new YukuCandidate(project),\n scanImports(id, source) {\n const candidate = new YukuCandidate({\n files: /* @__PURE__ */ new Map([[id, source]]),\n resolutions: /* @__PURE__ */ new Map()\n });\n const found = [];\n walkAst(candidate.programOf(id), (node) => {\n if (node.type !== \"ImportDeclaration\" && node.type !== \"ExportNamedDeclaration\" && node.type !== \"ExportAllDeclaration\" && node.type !== \"ImportExpression\") {\n return;\n }\n const sourceNode = childNode(node, \"source\");\n if (sourceNode && typeof sourceNode.value === \"string\") {\n found.push({ start: node.start, specifier: sourceNode.value });\n }\n });\n return [\n ...new Set(\n found.sort((left, right) => left.start - right.start).map(({ specifier }) => specifier)\n )\n ];\n }\n};\nfunction parseModuleAst(source, id = \"/tamagui/compiler-module.tsx\") {\n const candidate = yukuFactory.create({\n files: /* @__PURE__ */ new Map([[id, source]]),\n resolutions: /* @__PURE__ */ new Map()\n });\n const diagnostics = candidate.diagnostics().filter((diagnostic) => diagnostic.kind === \"parse\");\n if (diagnostics.length) {\n throw new Error(\n `Unable to parse ${id}: ${diagnostics.map(({ message }) => message).join(\"; \")}`\n );\n }\n return candidate.programOf(id);\n}\nexport {\n parseModuleAst,\n yukuFactory\n};\n//# sourceMappingURL=yuku.js.map\n"],"mappings":";;;;;;AAIA,IAAM,gBAAN,MAAoB;CAClB,YAAY,SAAS;EACnB,KAAK,UAAU;EACf,KAAKA,YAAY,IAAI,SAAS,EAC5B,UAAU,WAAW,aAAa,gBAAgB,KAAK,QAAQ,aAAa,WAAW,QAAQ,EACjG,CAAC;EACD,KAAK,MAAM,CAAC,IAAI,WAAW,QAAQ,OAAO,KAAK,QAAQ,IAAI,MAAM;CACnE;CACA;CACA,OAAO;CACP;CACA,+BAA+B,IAAI,IAAI;CACvC,QAAQ,IAAI,QAAQ;EAClB,KAAKA,UAAU,QAAQ,IAAI,QAAQ;GAAE,gBAAgB;GAAM,YAAY;EAAS,CAAC;EACjF,KAAKC,aAAa,IAAI,KAAK,KAAKA,aAAa,IAAI,EAAE,KAAK,KAAK,CAAC;CAChE;CACA,WAAW,IAAI;EACb,OAAO,KAAKD,UAAU,WAAW,EAAE;CACrC;CACA,OAAO;EACL,KAAKA,UAAU,KAAK;CACtB;CACA,QAAQ,IAAI;EACV,MAAM,SAAS,KAAKA,UAAU,OAAO,EAAE;EACvC,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,wBAAwB,IAAI;EACzD,OAAO;CACT;CACA,iBAAiB,IAAI,WAAW;EAC9B,MAAM,SAAS,KAAKE,QAAQ,EAAE,CAAC,CAAC,QAAQ,SAAS;EACjD,OAAO,SAAS,KAAKF,UAAU,aAAa,MAAM,CAAC,EAAE,UAAU,OAAO;CACxE;CACA,gBAAgB,QAAQ;EACtB,MAAM,cAAc,OAAO,aAAa;EACxC,IAAI,CAAC,aAAa,OAAO;EACzB,OAAO,0BACL,OAAO,OAAO,MACd,OAAO,MACP,UAAU,aAAa,GAAG,OAAO,KAAK,aAAa,IAClD,SAAS,OAAO,OAAO,SAAS,IAAI,CACvC;CACF;CACA,aAAa,IAAI,WAA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AAC;GAC/D;EACF,CAAC;EACD,OAAO,CACL,GAAG,IAAI,IACL,MAAM,MAAM,MAAM,UAAU,KAAK,QAAQ,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,gBAAgB,SAAS,CACxF,CACF;CACF;AACF;AACA,SAAS,eAAe,QAAQ,KAAK,gCAAgC;CACnE,MAAM,YAAY,YAAY,OAAO;EACnC,uBAAuB,IAAI,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC;EAC7C,6BAA6B,IAAI,IAAI;CACvC,CAAC;CACD,MAAM,cAAc,UAAU,YAAY,CAAC,CAAC,QAAQ,eAAe,WAAW,SAAS,OAAO;CAC9F,IAAI,YAAY,QAAQ;EACtB,MAAM,IAAI,MACR,mBAAmB,GAAG,IAAI,YAAY,KAAK,EAAE,cAAc,OAAO,CAAC,CAAC,KAAK,IAAI,GAC/E;CACF;CACA,OAAO,UAAU,UAAU,EAAE;AAC/B"}
@@ -0,0 +1,354 @@
1
+ import { childNode, childNodes, walkAst } from "./ast.mjs";
2
+ import { zeroRuleForBailout } from "./diagnostics.mjs";
3
+ import { parseModuleAst } from "./yuku.mjs";
4
+
5
+ const ZERO_FAILURE_FOOTER = "Fix every site or move the owning module to a declared full-runtime island. Zero-runtime never retains one component as a fallback.";
6
+ const ZERO_DESIGN_STATE_APIS = /* @__PURE__ */ new Set([
7
+ "useMedia",
8
+ "useTheme",
9
+ "useThemeName",
10
+ "splitStyleProps",
11
+ "getConfig",
12
+ "getTokens",
13
+ "useTokens",
14
+ "getVariableValue",
15
+ "getToken",
16
+ "getTokenValue",
17
+ "useConfiguration",
18
+ "useAnimationDriver",
19
+ "updateTheme",
20
+ "addTheme",
21
+ "replaceTheme",
22
+ "forceUpdateThemes"
23
+ ]);
24
+ const ZERO_PROVIDER_EXPORTS = /* @__PURE__ */ new Set([
25
+ "TamaguiProvider",
26
+ "ThemeProvider",
27
+ "TamaguiRoot"
28
+ ]);
29
+ const ZERO_ANIMATED_NUMBER_HOOKS = /* @__PURE__ */ new Set([
30
+ "useAnimatedNumber",
31
+ "useAnimatedNumberStyle",
32
+ "useAnimatedNumbersStyle",
33
+ "useAnimatedNumberReaction"
34
+ ]);
35
+ const ZERO_ANIMATED_NUMBER_MODULE = "@tamagui/animations-css/animated-number";
36
+ function zeroRuleMessage(rule, params) {
37
+ const component = params.component ?? "this component";
38
+ switch (rule) {
39
+ case 1: return `Zero-runtime rule 1: ${component} cannot receive a prop spread because the compiler cannot prove it is style-free. Pass non-style props explicitly or move this module to a full-runtime island.`;
40
+ case 2: return `Zero-runtime rule 2: component expression ${params.expression ?? component} does not resolve to one literal lowerable host component. Use a literal Tamagui or html.* component, or move this module to a full-runtime island.`;
41
+ case 3: return `Zero-runtime rule 3: value for ${params.prop ?? "a style prop"} on ${component} cannot be lowered: ${params.detail ?? "the compiler could not evaluate it"}. Use a supported build-time value or move this module to a full-runtime island.`;
42
+ case 4: return `Zero-runtime rule 4: ${params.detail ?? component} requires runtime theme or config state. Theme names and modifier targets must be statically enumerable, Theme value props and config must be build-time data, and runtime mutation belongs in a full-runtime island.`;
43
+ case 5: return `Zero-runtime rule 5: ${params.detail ?? component} requires a component animation runtime. Use a static CSS transition or move this module to a full-runtime island.`;
44
+ case 6: return `Zero-runtime rule 6: ${component} does not lower to one host element with className and is island-only. Move this module to a declared full-runtime island.`;
45
+ case 7: return `Zero-runtime rule 7: ${params.api ?? component} reads Tamagui design state in JavaScript. Express the condition in CSS or move this module to a full-runtime island.`;
46
+ case 8: return `Zero-runtime rule 8: ${params.detail ?? "a module-level import"} defeats the zero-runtime graph. ${params.remediation ?? ""}`.trimEnd();
47
+ }
48
+ }
49
+ function zeroSideEffectImportMessage(specifier) {
50
+ return zeroRuleMessage(8, {
51
+ detail: `the bare side-effect import of "${specifier}", whose effects zero-runtime cannot prove or erase,`,
52
+ remediation: `Remove it, or import the values this module uses so the compiler can lower and erase them.`
53
+ });
54
+ }
55
+ function zeroStaticIslandImportMessage(specifier, islandId) {
56
+ return zeroRuleMessage(8, {
57
+ detail: `the static import of "${specifier}", which is declared as full-runtime island "${islandId}",`,
58
+ remediation: `Import the generated island loader instead; the island is a separately built entry and the zero graph never contains it.`
59
+ });
60
+ }
61
+ const ZERO_PROVIDER_MESSAGE = "[tamagui zero-runtime] Rule 4: TamaguiProvider is not used by a zero-runtime root. The bundler loads generated CSS and the compiler lowers static Theme nodes. Remove this provider or make this entry full-runtime.";
62
+ function zeroThemeBoundaryMessage(component, prop) {
63
+ return `[tamagui zero-runtime] Rule 4: ${component} uses ${prop}, which creates a runtime component theme boundary. Replace it with a static <Theme name="..."> wrapper (use name="inverse" for themeInverse) or move this module to a full-runtime island.`;
64
+ }
65
+ function zeroConfigDriverMessage(name, outputStyle) {
66
+ return `[tamagui zero-runtime] Rule 5: createTamagui animations must resolve to the CSS driver. Driver ${name} has outputStyle=${String(outputStyle)}. Remove it from the zero entry or move its consumers to a full-runtime island.`;
67
+ }
68
+ function zeroIslandThemeMessage(entry) {
69
+ return `[tamagui zero-runtime] Rule 4: island ${entry} has no statically resolved theme context at this mount. Place the island boundary under a compiler-visible static <Theme> or make this entry full-runtime.`;
70
+ }
71
+ function zeroViolationsFromPlan(plan) {
72
+ const violations = [];
73
+ for (const diagnostic of plan.diagnostics) {
74
+ if (!diagnostic.blocking) continue;
75
+ const rule = zeroRuleForBailout(diagnostic);
76
+ violations.push({
77
+ rule,
78
+ code: diagnostic.code,
79
+ span: diagnostic.span,
80
+ component: diagnostic.component,
81
+ message: diagnostic.zeroMessage ?? zeroRuleMessage(rule, {
82
+ component: diagnostic.component,
83
+ prop: diagnostic.prop,
84
+ detail: diagnostic.message
85
+ })
86
+ });
87
+ }
88
+ return violations;
89
+ }
90
+ function isTamaguiSpecifier(specifier) {
91
+ return specifier === "tamagui" || specifier.startsWith("tamagui/") || specifier.startsWith("@tamagui/");
92
+ }
93
+ function collectNameOccurrences(program) {
94
+ const occurrences = /* @__PURE__ */ new Map();
95
+ walkAst(program, (node, parent, key) => {
96
+ if (node.type !== "Identifier" && node.type !== "JSXIdentifier") return;
97
+ const name = typeof node.name === "string" ? node.name : null;
98
+ if (!name) return;
99
+ if (parent) {
100
+ if (parent.type === "ImportSpecifier" || parent.type === "ImportDefaultSpecifier" || parent.type === "ImportNamespaceSpecifier" || parent.type === "ExportSpecifier") {
101
+ return;
102
+ }
103
+ if ((parent.type === "MemberExpression" || parent.type === "JSXMemberExpression" || parent.type === "OptionalMemberExpression") && key === "property" && !parent.computed) {
104
+ return;
105
+ }
106
+ if ((parent.type === "Property" || parent.type === "PropertyDefinition") && key === "key" && !parent.computed) {
107
+ return;
108
+ }
109
+ if (parent.type === "JSXAttribute" && key === "name") return;
110
+ if ((parent.type === "VariableDeclarator" || parent.type === "FunctionDeclaration" || parent.type === "ClassDeclaration") && key === "id") {
111
+ return;
112
+ }
113
+ }
114
+ const entry = {
115
+ start: node.start,
116
+ end: node.end,
117
+ parent: parent ?? null
118
+ };
119
+ const list = occurrences.get(name);
120
+ if (list) list.push(entry);
121
+ else occurrences.set(name, [entry]);
122
+ });
123
+ return occurrences;
124
+ }
125
+ function coversRange(outer, inner) {
126
+ return outer.start <= inner.start && outer.end >= inner.end;
127
+ }
128
+ function stringValueOf(node) {
129
+ return node && typeof node.value === "string" ? node.value : null;
130
+ }
131
+ function identifierNameOf(node) {
132
+ return node && node.type === "Identifier" && typeof node.name === "string" ? node.name : null;
133
+ }
134
+ function referenceExpression(source, reference) {
135
+ const parent = reference.parent;
136
+ const node = parent && (parent.type === "ConditionalExpression" || parent.type === "LogicalExpression" || parent.type === "CallExpression" || parent.type === "MemberExpression" || parent.type === "ArrayExpression") ? parent : reference;
137
+ const text = source.slice(node.start, node.end).replace(/\s+/g, " ").trim();
138
+ return text.length > 80 ? `${text.slice(0, 77)}...` : text;
139
+ }
140
+ function collectStyledDeclarators(program, styledLocals) {
141
+ const found = [];
142
+ for (const statement of childNodes(program, "body")) {
143
+ const exported = statement.type === "ExportNamedDeclaration";
144
+ const declaration = exported ? childNode(statement, "declaration") : statement;
145
+ if (!declaration || declaration.type !== "VariableDeclaration") continue;
146
+ const declarators = childNodes(declaration, "declarations");
147
+ if (declarators.length !== 1) continue;
148
+ const declarator = declarators[0];
149
+ const name = identifierNameOf(childNode(declarator, "id"));
150
+ const init = childNode(declarator, "init");
151
+ if (!name || !init || init.type !== "CallExpression") continue;
152
+ const callee = identifierNameOf(childNode(init, "callee"));
153
+ if (!callee || !styledLocals.has(callee)) continue;
154
+ found.push({
155
+ name,
156
+ declarator,
157
+ declaration: exported ? statement : declaration,
158
+ exported
159
+ });
160
+ }
161
+ return found;
162
+ }
163
+ function planZeroErasure(input) {
164
+ const { id, source, loweredEdits } = input;
165
+ const program = parseModuleAst(source, id);
166
+ const violations = [];
167
+ const span = (node) => ({
168
+ id,
169
+ start: node.start,
170
+ end: node.end
171
+ });
172
+ const bindings = [];
173
+ const tamaguiDeclarations = [];
174
+ for (const statement of childNodes(program, "body")) {
175
+ if (statement.type !== "ImportDeclaration") continue;
176
+ if (statement.importKind === "type") continue;
177
+ const moduleSpecifier = stringValueOf(childNode(statement, "source"));
178
+ if (!moduleSpecifier) continue;
179
+ const islandId = input.islandIdFor(moduleSpecifier);
180
+ if (islandId) {
181
+ violations.push({
182
+ rule: 8,
183
+ code: "zero/static-island-import",
184
+ span: span(statement),
185
+ message: zeroStaticIslandImportMessage(moduleSpecifier, islandId)
186
+ });
187
+ continue;
188
+ }
189
+ if (!input.isTamaguiSpecifier(moduleSpecifier)) continue;
190
+ tamaguiDeclarations.push(statement);
191
+ const specifiers = childNodes(statement, "specifiers");
192
+ if (specifiers.length === 0) {
193
+ violations.push({
194
+ rule: 8,
195
+ code: "zero/side-effect-import",
196
+ span: span(statement),
197
+ message: zeroSideEffectImportMessage(moduleSpecifier)
198
+ });
199
+ continue;
200
+ }
201
+ for (const specifier of specifiers) {
202
+ if (specifier.importKind === "type") continue;
203
+ const local = identifierNameOf(childNode(specifier, "local"));
204
+ if (!local) continue;
205
+ bindings.push({
206
+ local,
207
+ imported: identifierNameOf(childNode(specifier, "imported")) ?? local,
208
+ specifierNode: specifier,
209
+ declaration: statement,
210
+ moduleSpecifier
211
+ });
212
+ }
213
+ }
214
+ if (bindings.length === 0) {
215
+ return {
216
+ edits: [],
217
+ removedModules: [],
218
+ removedBindings: [],
219
+ erasedStyledDefinitions: [],
220
+ erasedExports: [],
221
+ rewrittenAnimatedNumberHooks: [],
222
+ liveBindings: [],
223
+ violations
224
+ };
225
+ }
226
+ const consumed = loweredEdits.filter((edit) => edit.end > edit.start).map((edit) => ({
227
+ start: edit.start,
228
+ end: edit.end
229
+ }));
230
+ const occurrences = collectNameOccurrences(program);
231
+ const referencesOf = (local) => occurrences.get(local) ?? [];
232
+ const isConsumed = (reference) => consumed.some((range) => coversRange(range, reference));
233
+ const styledLocals = new Set(bindings.filter((binding) => binding.imported === "styled").map((b) => b.local));
234
+ const erasedStyledDefinitions = [];
235
+ const erasedExports = [];
236
+ const styledEdits = [];
237
+ for (const definition of collectStyledDeclarators(program, styledLocals)) {
238
+ const references = referencesOf(definition.name);
239
+ if (references.length === 0) continue;
240
+ if (!references.every(isConsumed)) continue;
241
+ styledEdits.push({
242
+ start: definition.declaration.start,
243
+ end: definition.declaration.end,
244
+ content: "",
245
+ origin: span(definition.declaration)
246
+ });
247
+ consumed.push({
248
+ start: definition.declaration.start,
249
+ end: definition.declaration.end
250
+ });
251
+ erasedStyledDefinitions.push(definition.name);
252
+ if (definition.exported) erasedExports.push(definition.name);
253
+ }
254
+ const animatedNumberBindings = bindings.filter((binding) => ZERO_ANIMATED_NUMBER_HOOKS.has(binding.imported) && referencesOf(binding.local).some((reference) => !isConsumed(reference)));
255
+ const rewrittenAnimatedNumberHooks = animatedNumberBindings.map((binding) => binding.imported);
256
+ const animatedNumberSpecifiers = new Set(animatedNumberBindings.map((binding) => binding.specifierNode));
257
+ const leafImportEdits = [];
258
+ for (const declaration of tamaguiDeclarations) {
259
+ const rewritten = animatedNumberBindings.filter((binding) => binding.declaration === declaration);
260
+ if (rewritten.length === 0) continue;
261
+ leafImportEdits.push({
262
+ start: declaration.start,
263
+ end: declaration.start,
264
+ content: `import { ${rewritten.map((binding) => binding.imported === binding.local ? binding.imported : `${binding.imported} as ${binding.local}`).join(", ")} } from ${JSON.stringify(ZERO_ANIMATED_NUMBER_MODULE)};
265
+ `,
266
+ origin: span(declaration)
267
+ });
268
+ }
269
+ const deadBindings = new Set(animatedNumberSpecifiers);
270
+ const removedBindings = [];
271
+ const liveBindings = [];
272
+ for (const binding of bindings) {
273
+ if (animatedNumberSpecifiers.has(binding.specifierNode)) continue;
274
+ const references = referencesOf(binding.local);
275
+ if (references.length > 0 && !references.every(isConsumed)) {
276
+ liveBindings.push(binding);
277
+ continue;
278
+ }
279
+ deadBindings.add(binding.specifierNode);
280
+ removedBindings.push(binding.local);
281
+ }
282
+ const edits = [...styledEdits, ...leafImportEdits];
283
+ const removedModules = [];
284
+ for (const declaration of tamaguiDeclarations) {
285
+ const specifiers = childNodes(declaration, "specifiers").filter((specifier) => specifier.importKind !== "type");
286
+ if (specifiers.length === 0) continue;
287
+ const dead = specifiers.filter((specifier) => deadBindings.has(specifier));
288
+ if (dead.length === 0) continue;
289
+ if (dead.length === specifiers.length) {
290
+ edits.push({
291
+ start: declaration.start,
292
+ end: declaration.end,
293
+ content: "",
294
+ origin: span(declaration)
295
+ });
296
+ removedModules.push(stringValueOf(childNode(declaration, "source")));
297
+ continue;
298
+ }
299
+ const survivors = specifiers.filter((specifier) => !deadBindings.has(specifier));
300
+ const braceStart = specifiers[0].start;
301
+ const braceEnd = specifiers[specifiers.length - 1].end;
302
+ edits.push({
303
+ start: braceStart,
304
+ end: braceEnd,
305
+ content: survivors.map((specifier) => source.slice(specifier.start, specifier.end)).join(", "),
306
+ origin: span({
307
+ start: braceStart,
308
+ end: braceEnd
309
+ })
310
+ });
311
+ }
312
+ for (const binding of liveBindings) {
313
+ const live = referencesOf(binding.local).filter((reference) => !isConsumed(reference))[0];
314
+ if (ZERO_DESIGN_STATE_APIS.has(binding.imported)) {
315
+ violations.push({
316
+ rule: 7,
317
+ code: "zero/design-state-read",
318
+ span: span(live),
319
+ message: zeroRuleMessage(7, { api: binding.imported })
320
+ });
321
+ continue;
322
+ }
323
+ if (ZERO_PROVIDER_EXPORTS.has(binding.imported)) {
324
+ violations.push({
325
+ rule: 4,
326
+ code: "zero/runtime-provider",
327
+ span: span(live),
328
+ component: binding.imported,
329
+ message: ZERO_PROVIDER_MESSAGE
330
+ });
331
+ continue;
332
+ }
333
+ violations.push({
334
+ rule: 2,
335
+ code: "zero/live-tamagui-reference",
336
+ span: span(live),
337
+ component: binding.local,
338
+ message: zeroRuleMessage(2, { expression: referenceExpression(source, live) })
339
+ });
340
+ }
341
+ return {
342
+ edits,
343
+ removedModules,
344
+ removedBindings,
345
+ erasedStyledDefinitions,
346
+ erasedExports,
347
+ rewrittenAnimatedNumberHooks,
348
+ liveBindings: liveBindings.map((binding) => binding.local),
349
+ violations
350
+ };
351
+ }
352
+
353
+ export { ZERO_ANIMATED_NUMBER_HOOKS, ZERO_ANIMATED_NUMBER_MODULE, ZERO_DESIGN_STATE_APIS, ZERO_FAILURE_FOOTER, ZERO_PROVIDER_EXPORTS, ZERO_PROVIDER_MESSAGE, isTamaguiSpecifier, planZeroErasure, zeroConfigDriverMessage, zeroIslandThemeMessage, zeroRuleMessage, zeroSideEffectImportMessage, zeroStaticIslandImportMessage, zeroThemeBoundaryMessage, zeroViolationsFromPlan };
354
+ //# sourceMappingURL=zero.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zero.js","names":[],"sources":["esm/zero.js"],"sourcesContent":["import { childNode, childNodes, walkAst } from \"./ast\";\nimport { zeroRuleForBailout } from \"./diagnostics\";\nimport { parseModuleAst } from \"./yuku\";\nconst ZERO_FAILURE_FOOTER = \"Fix every site or move the owning module to a declared full-runtime island. Zero-runtime never retains one component as a fallback.\";\nconst ZERO_DESIGN_STATE_APIS = /* @__PURE__ */ new Set([\n \"useMedia\",\n \"useTheme\",\n \"useThemeName\",\n \"splitStyleProps\",\n \"getConfig\",\n \"getTokens\",\n \"useTokens\",\n \"getVariableValue\",\n \"getToken\",\n \"getTokenValue\",\n \"useConfiguration\",\n \"useAnimationDriver\",\n \"updateTheme\",\n \"addTheme\",\n \"replaceTheme\",\n \"forceUpdateThemes\"\n]);\nconst ZERO_PROVIDER_EXPORTS = /* @__PURE__ */ new Set([\n \"TamaguiProvider\",\n \"ThemeProvider\",\n \"TamaguiRoot\"\n]);\nconst ZERO_ANIMATED_NUMBER_HOOKS = /* @__PURE__ */ new Set([\n \"useAnimatedNumber\",\n \"useAnimatedNumberStyle\",\n \"useAnimatedNumbersStyle\",\n \"useAnimatedNumberReaction\"\n]);\nconst ZERO_ANIMATED_NUMBER_MODULE = \"@tamagui/animations-css/animated-number\";\nfunction zeroRuleMessage(rule, params) {\n const component = params.component ?? \"this component\";\n switch (rule) {\n case 1:\n return `Zero-runtime rule 1: ${component} cannot receive a prop spread because the compiler cannot prove it is style-free. Pass non-style props explicitly or move this module to a full-runtime island.`;\n case 2:\n return `Zero-runtime rule 2: component expression ${params.expression ?? component} does not resolve to one literal lowerable host component. Use a literal Tamagui or html.* component, or move this module to a full-runtime island.`;\n case 3:\n return `Zero-runtime rule 3: value for ${params.prop ?? \"a style prop\"} on ${component} cannot be lowered: ${params.detail ?? \"the compiler could not evaluate it\"}. Use a supported build-time value or move this module to a full-runtime island.`;\n case 4:\n return `Zero-runtime rule 4: ${params.detail ?? component} requires runtime theme or config state. Theme names and modifier targets must be statically enumerable, Theme value props and config must be build-time data, and runtime mutation belongs in a full-runtime island.`;\n case 5:\n return `Zero-runtime rule 5: ${params.detail ?? component} requires a component animation runtime. Use a static CSS transition or move this module to a full-runtime island.`;\n case 6:\n return `Zero-runtime rule 6: ${component} does not lower to one host element with className and is island-only. Move this module to a declared full-runtime island.`;\n case 7:\n return `Zero-runtime rule 7: ${params.api ?? component} reads Tamagui design state in JavaScript. Express the condition in CSS or move this module to a full-runtime island.`;\n case 8:\n return `Zero-runtime rule 8: ${params.detail ?? \"a module-level import\"} defeats the zero-runtime graph. ${params.remediation ?? \"\"}`.trimEnd();\n }\n}\nfunction zeroSideEffectImportMessage(specifier) {\n return zeroRuleMessage(8, {\n detail: `the bare side-effect import of \"${specifier}\", whose effects zero-runtime cannot prove or erase,`,\n remediation: `Remove it, or import the values this module uses so the compiler can lower and erase them.`\n });\n}\nfunction zeroStaticIslandImportMessage(specifier, islandId) {\n return zeroRuleMessage(8, {\n detail: `the static import of \"${specifier}\", which is declared as full-runtime island \"${islandId}\",`,\n remediation: `Import the generated island loader instead; the island is a separately built entry and the zero graph never contains it.`\n });\n}\nconst ZERO_PROVIDER_MESSAGE = \"[tamagui zero-runtime] Rule 4: TamaguiProvider is not used by a zero-runtime root. The bundler loads generated CSS and the compiler lowers static Theme nodes. Remove this provider or make this entry full-runtime.\";\nfunction zeroThemeBoundaryMessage(component, prop) {\n return `[tamagui zero-runtime] Rule 4: ${component} uses ${prop}, which creates a runtime component theme boundary. Replace it with a static <Theme name=\"...\"> wrapper (use name=\"inverse\" for themeInverse) or move this module to a full-runtime island.`;\n}\nfunction zeroConfigDriverMessage(name, outputStyle) {\n return `[tamagui zero-runtime] Rule 5: createTamagui animations must resolve to the CSS driver. Driver ${name} has outputStyle=${String(outputStyle)}. Remove it from the zero entry or move its consumers to a full-runtime island.`;\n}\nfunction zeroIslandThemeMessage(entry) {\n return `[tamagui zero-runtime] Rule 4: island ${entry} has no statically resolved theme context at this mount. Place the island boundary under a compiler-visible static <Theme> or make this entry full-runtime.`;\n}\nfunction zeroViolationsFromPlan(plan) {\n const violations = [];\n for (const diagnostic of plan.diagnostics) {\n if (!diagnostic.blocking) continue;\n const rule = zeroRuleForBailout(diagnostic);\n violations.push({\n rule,\n code: diagnostic.code,\n span: diagnostic.span,\n component: diagnostic.component,\n message: diagnostic.zeroMessage ?? zeroRuleMessage(rule, {\n component: diagnostic.component,\n prop: diagnostic.prop,\n detail: diagnostic.message\n })\n });\n }\n return violations;\n}\nfunction isTamaguiSpecifier(specifier) {\n return specifier === \"tamagui\" || specifier.startsWith(\"tamagui/\") || specifier.startsWith(\"@tamagui/\");\n}\nfunction collectNameOccurrences(program) {\n const occurrences = /* @__PURE__ */ new Map();\n walkAst(program, (node, parent, key) => {\n if (node.type !== \"Identifier\" && node.type !== \"JSXIdentifier\") return;\n const name = typeof node.name === \"string\" ? node.name : null;\n if (!name) return;\n if (parent) {\n if (parent.type === \"ImportSpecifier\" || parent.type === \"ImportDefaultSpecifier\" || parent.type === \"ImportNamespaceSpecifier\" || parent.type === \"ExportSpecifier\") {\n return;\n }\n if ((parent.type === \"MemberExpression\" || parent.type === \"JSXMemberExpression\" || parent.type === \"OptionalMemberExpression\") && key === \"property\" && !parent.computed) {\n return;\n }\n if ((parent.type === \"Property\" || parent.type === \"PropertyDefinition\") && key === \"key\" && !parent.computed) {\n return;\n }\n if (parent.type === \"JSXAttribute\" && key === \"name\") return;\n if ((parent.type === \"VariableDeclarator\" || parent.type === \"FunctionDeclaration\" || parent.type === \"ClassDeclaration\") && key === \"id\") {\n return;\n }\n }\n const entry = { start: node.start, end: node.end, parent: parent ?? null };\n const list = occurrences.get(name);\n if (list) list.push(entry);\n else occurrences.set(name, [entry]);\n });\n return occurrences;\n}\nfunction coversRange(outer, inner) {\n return outer.start <= inner.start && outer.end >= inner.end;\n}\nfunction stringValueOf(node) {\n return node && typeof node.value === \"string\" ? node.value : null;\n}\nfunction identifierNameOf(node) {\n return node && node.type === \"Identifier\" && typeof node.name === \"string\" ? node.name : null;\n}\nfunction referenceExpression(source, reference) {\n const parent = reference.parent;\n const node = parent && (parent.type === \"ConditionalExpression\" || parent.type === \"LogicalExpression\" || parent.type === \"CallExpression\" || parent.type === \"MemberExpression\" || parent.type === \"ArrayExpression\") ? parent : reference;\n const text = source.slice(node.start, node.end).replace(/\\s+/g, \" \").trim();\n return text.length > 80 ? `${text.slice(0, 77)}...` : text;\n}\nfunction collectStyledDeclarators(program, styledLocals) {\n const found = [];\n for (const statement of childNodes(program, \"body\")) {\n const exported = statement.type === \"ExportNamedDeclaration\";\n const declaration = exported ? childNode(statement, \"declaration\") : statement;\n if (!declaration || declaration.type !== \"VariableDeclaration\") continue;\n const declarators = childNodes(declaration, \"declarations\");\n if (declarators.length !== 1) continue;\n const declarator = declarators[0];\n const name = identifierNameOf(childNode(declarator, \"id\"));\n const init = childNode(declarator, \"init\");\n if (!name || !init || init.type !== \"CallExpression\") continue;\n const callee = identifierNameOf(childNode(init, \"callee\"));\n if (!callee || !styledLocals.has(callee)) continue;\n found.push({\n name,\n declarator,\n declaration: exported ? statement : declaration,\n exported\n });\n }\n return found;\n}\nfunction planZeroErasure(input) {\n const { id, source, loweredEdits } = input;\n const program = parseModuleAst(source, id);\n const violations = [];\n const span = (node) => ({ id, start: node.start, end: node.end });\n const bindings = [];\n const tamaguiDeclarations = [];\n for (const statement of childNodes(program, \"body\")) {\n if (statement.type !== \"ImportDeclaration\") continue;\n if (statement.importKind === \"type\") continue;\n const moduleSpecifier = stringValueOf(childNode(statement, \"source\"));\n if (!moduleSpecifier) continue;\n const islandId = input.islandIdFor(moduleSpecifier);\n if (islandId) {\n violations.push({\n rule: 8,\n code: \"zero/static-island-import\",\n span: span(statement),\n message: zeroStaticIslandImportMessage(moduleSpecifier, islandId)\n });\n continue;\n }\n if (!input.isTamaguiSpecifier(moduleSpecifier)) continue;\n tamaguiDeclarations.push(statement);\n const specifiers = childNodes(statement, \"specifiers\");\n if (specifiers.length === 0) {\n violations.push({\n rule: 8,\n code: \"zero/side-effect-import\",\n span: span(statement),\n message: zeroSideEffectImportMessage(moduleSpecifier)\n });\n continue;\n }\n for (const specifier of specifiers) {\n if (specifier.importKind === \"type\") continue;\n const local = identifierNameOf(childNode(specifier, \"local\"));\n if (!local) continue;\n bindings.push({\n local,\n imported: identifierNameOf(childNode(specifier, \"imported\")) ?? local,\n specifierNode: specifier,\n declaration: statement,\n moduleSpecifier\n });\n }\n }\n if (bindings.length === 0) {\n return {\n edits: [],\n removedModules: [],\n removedBindings: [],\n erasedStyledDefinitions: [],\n erasedExports: [],\n rewrittenAnimatedNumberHooks: [],\n liveBindings: [],\n violations\n };\n }\n const consumed = loweredEdits.filter((edit) => edit.end > edit.start).map((edit) => ({ start: edit.start, end: edit.end }));\n const occurrences = collectNameOccurrences(program);\n const referencesOf = (local) => occurrences.get(local) ?? [];\n const isConsumed = (reference) => consumed.some((range) => coversRange(range, reference));\n const styledLocals = new Set(\n bindings.filter((binding) => binding.imported === \"styled\").map((b) => b.local)\n );\n const erasedStyledDefinitions = [];\n const erasedExports = [];\n const styledEdits = [];\n for (const definition of collectStyledDeclarators(program, styledLocals)) {\n const references = referencesOf(definition.name);\n if (references.length === 0) continue;\n if (!references.every(isConsumed)) continue;\n styledEdits.push({\n start: definition.declaration.start,\n end: definition.declaration.end,\n content: \"\",\n origin: span(definition.declaration)\n });\n consumed.push({\n start: definition.declaration.start,\n end: definition.declaration.end\n });\n erasedStyledDefinitions.push(definition.name);\n if (definition.exported) erasedExports.push(definition.name);\n }\n const animatedNumberBindings = bindings.filter(\n (binding) => ZERO_ANIMATED_NUMBER_HOOKS.has(binding.imported) && referencesOf(binding.local).some((reference) => !isConsumed(reference))\n );\n const rewrittenAnimatedNumberHooks = animatedNumberBindings.map(\n (binding) => binding.imported\n );\n const animatedNumberSpecifiers = new Set(\n animatedNumberBindings.map((binding) => binding.specifierNode)\n );\n const leafImportEdits = [];\n for (const declaration of tamaguiDeclarations) {\n const rewritten = animatedNumberBindings.filter(\n (binding) => binding.declaration === declaration\n );\n if (rewritten.length === 0) continue;\n leafImportEdits.push({\n start: declaration.start,\n end: declaration.start,\n content: `import { ${rewritten.map(\n (binding) => binding.imported === binding.local ? binding.imported : `${binding.imported} as ${binding.local}`\n ).join(\", \")} } from ${JSON.stringify(ZERO_ANIMATED_NUMBER_MODULE)};\n`,\n origin: span(declaration)\n });\n }\n const deadBindings = new Set(animatedNumberSpecifiers);\n const removedBindings = [];\n const liveBindings = [];\n for (const binding of bindings) {\n if (animatedNumberSpecifiers.has(binding.specifierNode)) continue;\n const references = referencesOf(binding.local);\n if (references.length > 0 && !references.every(isConsumed)) {\n liveBindings.push(binding);\n continue;\n }\n deadBindings.add(binding.specifierNode);\n removedBindings.push(binding.local);\n }\n const edits = [...styledEdits, ...leafImportEdits];\n const removedModules = [];\n for (const declaration of tamaguiDeclarations) {\n const specifiers = childNodes(declaration, \"specifiers\").filter(\n (specifier) => specifier.importKind !== \"type\"\n );\n if (specifiers.length === 0) continue;\n const dead = specifiers.filter((specifier) => deadBindings.has(specifier));\n if (dead.length === 0) continue;\n if (dead.length === specifiers.length) {\n edits.push({\n start: declaration.start,\n end: declaration.end,\n content: \"\",\n origin: span(declaration)\n });\n removedModules.push(stringValueOf(childNode(declaration, \"source\")));\n continue;\n }\n const survivors = specifiers.filter((specifier) => !deadBindings.has(specifier));\n const braceStart = specifiers[0].start;\n const braceEnd = specifiers[specifiers.length - 1].end;\n edits.push({\n start: braceStart,\n end: braceEnd,\n content: survivors.map((specifier) => source.slice(specifier.start, specifier.end)).join(\", \"),\n origin: span({ start: braceStart, end: braceEnd })\n });\n }\n for (const binding of liveBindings) {\n const live = referencesOf(binding.local).filter(\n (reference) => !isConsumed(reference)\n )[0];\n if (ZERO_DESIGN_STATE_APIS.has(binding.imported)) {\n violations.push({\n rule: 7,\n code: \"zero/design-state-read\",\n span: span(live),\n message: zeroRuleMessage(7, { api: binding.imported })\n });\n continue;\n }\n if (ZERO_PROVIDER_EXPORTS.has(binding.imported)) {\n violations.push({\n rule: 4,\n code: \"zero/runtime-provider\",\n span: span(live),\n component: binding.imported,\n message: ZERO_PROVIDER_MESSAGE\n });\n continue;\n }\n violations.push({\n rule: 2,\n code: \"zero/live-tamagui-reference\",\n span: span(live),\n component: binding.local,\n message: zeroRuleMessage(2, { expression: referenceExpression(source, live) })\n });\n }\n return {\n edits,\n removedModules,\n removedBindings,\n erasedStyledDefinitions,\n erasedExports,\n rewrittenAnimatedNumberHooks,\n liveBindings: liveBindings.map((binding) => binding.local),\n violations\n };\n}\nexport {\n ZERO_ANIMATED_NUMBER_HOOKS,\n ZERO_ANIMATED_NUMBER_MODULE,\n ZERO_DESIGN_STATE_APIS,\n ZERO_FAILURE_FOOTER,\n ZERO_PROVIDER_EXPORTS,\n ZERO_PROVIDER_MESSAGE,\n isTamaguiSpecifier,\n planZeroErasure,\n zeroConfigDriverMessage,\n zeroIslandThemeMessage,\n zeroRuleMessage,\n zeroSideEffectImportMessage,\n zeroStaticIslandImportMessage,\n zeroThemeBoundaryMessage,\n zeroViolationsFromPlan\n};\n//# sourceMappingURL=zero.js.map\n"],"mappings":";;;;;AAGA,MAAM,sBAAsB;AAC5B,MAAM,yCAAyC,IAAI,IAAI;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,wCAAwC,IAAI,IAAI;CACpD;CACA;CACA;AACF,CAAC;AACD,MAAM,6CAA6C,IAAI,IAAI;CACzD;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,8BAA8B;AACpC,SAAS,gBAAgB,MAAM,QAAQ;CACrC,MAAM,YAAY,OAAO,aAAa;CACtC,QAAQ,MAAR;EACE,KAAK,GACH,OAAO,wBAAwB,UAAU;EAC3C,KAAK,GACH,OAAO,6CAA6C,OAAO,cAAc,UAAU;EACrF,KAAK,GACH,OAAO,kCAAkC,OAAO,QAAQ,eAAe,MAAM,UAAU,sBAAsB,OAAO,UAAU,qCAAqC;EACrK,KAAK,GACH,OAAO,wBAAwB,OAAO,UAAU,UAAU;EAC5D,KAAK,GACH,OAAO,wBAAwB,OAAO,UAAU,UAAU;EAC5D,KAAK,GACH,OAAO,wBAAwB,UAAU;EAC3C,KAAK,GACH,OAAO,wBAAwB,OAAO,OAAO,UAAU;EACzD,KAAK,GACH,OAAO,wBAAwB,OAAO,UAAU,wBAAwB,mCAAmC,OAAO,eAAe,KAAK,QAAQ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C;CACH;CACA,KAAK,MAAM,WAAW,cAAc;EAClC,MAAM,OAAO,aAAa,QAAQ,KAAK,CAAC,CAAC,QACtC,cAAc,CAAC,WAAW,SAAS,CACtC,CAAC,CAAC;EACF,IAAI,uBAAuB,IAAI,QAAQ,QAAQ,GAAG;GAChD,WAAW,KAAK;IACd,MAAM;IACN,MAAM;IACN,MAAM,KAAK,IAAI;IACf,SAAS,gBAAgB,GAAG,EAAE,KAAK,QAAQ,SAAS,CAAC;GACvD,CAAC;GACD;EACF;EACA,IAAI,sBAAsB,IAAI,QAAQ,QAAQ,GAAG;GAC/C,WAAW,KAAK;IACd,MAAM;IACN,MAAM;IACN,MAAM,KAAK,IAAI;IACf,WAAW,QAAQ;IACnB,SAAS;GACX,CAAC;GACD;EACF;EACA,WAAW,KAAK;GACd,MAAM;GACN,MAAM;GACN,MAAM,KAAK,IAAI;GACf,WAAW,QAAQ;GACnB,SAAS,gBAAgB,GAAG,EAAE,YAAY,oBAAoB,QAAQ,IAAI,EAAE,CAAC;EAC/E,CAAC;CACH;CACA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA,cAAc,aAAa,KAAK,YAAY,QAAQ,KAAK;EACzD;CACF;AACF"}
package/package.json CHANGED
@@ -1,13 +1,51 @@
1
1
  {
2
2
  "name": "@tamagui/compiler-core",
3
- "version": "0.0.0-bootstrap.0",
4
- "description": "Tamagui v3 package bootstrap",
5
- "repository": "https://github.com/tamagui/tamagui",
3
+ "version": "3.0.0-beta.1093.1",
4
+ "description": "Shared parser-independent Tamagui compiler graph and element IR",
6
5
  "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "source": "src/index.ts",
7
9
  "files": [
8
- "README.md"
10
+ "src",
11
+ "types",
12
+ "dist"
9
13
  ],
14
+ "main": "dist/cjs/index.cjs",
15
+ "module": "dist/esm/index.mjs",
16
+ "types": "types/index.d.ts",
17
+ "exports": {
18
+ "./package.json": "./package.json",
19
+ ".": {
20
+ "types": "./types/index.d.ts",
21
+ "browser": "./dist/esm/index.mjs",
22
+ "module": "./dist/esm/index.mjs",
23
+ "import": "./dist/esm/index.mjs",
24
+ "require": "./dist/cjs/index.cjs",
25
+ "default": "./dist/esm/index.mjs"
26
+ }
27
+ },
10
28
  "publishConfig": {
11
29
  "access": "public"
30
+ },
31
+ "scripts": {
32
+ "build": "tamagui-build --skip-native",
33
+ "watch": "tamagui-build --skip-native --watch",
34
+ "clean": "tamagui-build clean",
35
+ "clean:build": "tamagui-build clean:build"
36
+ },
37
+ "dependencies": {
38
+ "@jridgewell/gen-mapping": "0.3.13",
39
+ "magic-string": "0.30.21",
40
+ "yuku-analyzer": "0.6.1"
41
+ },
42
+ "devDependencies": {
43
+ "@tamagui/build": "3.0.0-beta.1093.1",
44
+ "typescript": "~6.0.3"
45
+ },
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/tamagui/tamagui.git",
49
+ "directory": "code/compiler/compiler-core"
12
50
  }
13
51
  }