@tamagui/static 3.0.0-beta.831.1 → 3.0.0-beta.889.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 (41) hide show
  1. package/dist/cjs/compiler.cjs +17 -5
  2. package/dist/cjs/compilerHost.cjs +148 -39
  3. package/dist/cjs/componentDiscovery.cjs +94 -0
  4. package/dist/cjs/domStructuralPass.cjs +12 -2
  5. package/dist/cjs/exports.cjs +4 -1
  6. package/dist/cjs/extractor/bundleConfig.cjs +23 -0
  7. package/dist/cjs/zero/theme.cjs +5 -20
  8. package/dist/esm/compiler.mjs +18 -6
  9. package/dist/esm/compiler.mjs.map +1 -1
  10. package/dist/esm/compilerHost.mjs +146 -40
  11. package/dist/esm/compilerHost.mjs.map +1 -1
  12. package/dist/esm/componentDiscovery.mjs +69 -0
  13. package/dist/esm/componentDiscovery.mjs.map +1 -0
  14. package/dist/esm/domStructuralPass.mjs +12 -2
  15. package/dist/esm/domStructuralPass.mjs.map +1 -1
  16. package/dist/esm/exports.mjs +4 -1
  17. package/dist/esm/extractor/bundleConfig.mjs +23 -1
  18. package/dist/esm/extractor/bundleConfig.mjs.map +1 -1
  19. package/dist/esm/zero/theme.mjs +5 -20
  20. package/dist/esm/zero/theme.mjs.map +1 -1
  21. package/package.json +17 -17
  22. package/src/compiler.ts +27 -5
  23. package/src/compilerHost.ts +262 -74
  24. package/src/componentDiscovery.ts +105 -0
  25. package/src/domStructuralPass.ts +22 -2
  26. package/src/exports.ts +2 -0
  27. package/src/extractor/bundleConfig.ts +34 -0
  28. package/src/zero/theme.ts +12 -21
  29. package/types/compiler.d.ts +13 -0
  30. package/types/compiler.d.ts.map +1 -1
  31. package/types/compilerHost.d.ts +13 -0
  32. package/types/compilerHost.d.ts.map +1 -1
  33. package/types/componentDiscovery.d.ts +27 -0
  34. package/types/componentDiscovery.d.ts.map +1 -0
  35. package/types/domStructuralPass.d.ts.map +1 -1
  36. package/types/exports.d.ts +2 -0
  37. package/types/exports.d.ts.map +1 -1
  38. package/types/extractor/bundleConfig.d.ts +7 -0
  39. package/types/extractor/bundleConfig.d.ts.map +1 -1
  40. package/types/zero/theme.d.ts +0 -1
  41. package/types/zero/theme.d.ts.map +1 -1
@@ -0,0 +1,69 @@
1
+ import path from "node:path";
2
+ import { getComponentStaticConfigByName } from "./extractor/bundleConfig.mjs";
3
+
4
+ const packageSpecifier = /^(?:@[^/@\s]+\/)?[^./~@\s][^/\s]*(?:\/|$)/;
5
+ function isPackageSpecifier(specifier) {
6
+ return packageSpecifier.test(specifier);
7
+ }
8
+ var ComponentDiscovery = class {
9
+ /** null records a module that had no components or could not evaluate */
10
+ #discovered = /* @__PURE__ */ new Map();
11
+ clear() {
12
+ this.#discovered.clear();
13
+ }
14
+ /** host-resolved ids of every module discovery found components in */
15
+ ids() {
16
+ return [...this.#discovered].filter(([, loaded]) => loaded !== null).map(([id]) => id).sort();
17
+ }
18
+ /** re-register everything found so far into a freshly built registry */
19
+ seed(registry) {
20
+ for (const [id, loaded] of this.#discovered) {
21
+ if (!loaded) continue;
22
+ registry.modulesById.set(id, id);
23
+ registry.componentsByModule.set(id, loaded);
24
+ }
25
+ }
26
+ async prepare(module, registry, evaluate) {
27
+ if (!evaluate) return;
28
+ const seen = /* @__PURE__ */ new Set();
29
+ const provenances = [...module.elements.map((element) => element.component.provenance), ...module.styledDefinitions.map((definition) => definition.base.provenance)];
30
+ for (const provenance of provenances) {
31
+ if (!provenance || !isPackageSpecifier(provenance.specifier)) continue;
32
+ const id = provenance.resolvedId.split(/[?#]/, 1)[0];
33
+ if (seen.has(id) || registry.modulesById.has(id) || this.#discovered.has(id)) {
34
+ continue;
35
+ }
36
+ seen.add(id);
37
+ if (!path.isAbsolute(id)) {
38
+ this.#discovered.set(id, null);
39
+ continue;
40
+ }
41
+ let loaded = null;
42
+ try {
43
+ const exports = await evaluate({
44
+ id,
45
+ specifier: provenance.specifier
46
+ });
47
+ if (exports) {
48
+ const nameToInfo = getComponentStaticConfigByName(id, exports.default ?? exports);
49
+ if (Object.keys(nameToInfo).length) loaded = {
50
+ moduleName: id,
51
+ nameToInfo
52
+ };
53
+ }
54
+ } catch (error) {
55
+ if (process.env.DEBUG === "tamagui") {
56
+ console.info(`[tamagui] component discovery skipped ${id}:`, error);
57
+ }
58
+ }
59
+ this.#discovered.set(id, loaded);
60
+ if (loaded) {
61
+ registry.modulesById.set(id, id);
62
+ registry.componentsByModule.set(id, loaded);
63
+ }
64
+ }
65
+ }
66
+ };
67
+
68
+ export { ComponentDiscovery };
69
+ //# sourceMappingURL=componentDiscovery.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentDiscovery.js","names":["#discovered"],"sources":["esm/componentDiscovery.js"],"sourcesContent":["import path from \"node:path\";\nimport {\n getComponentStaticConfigByName\n} from \"./extractor/bundleConfig\";\nconst packageSpecifier = /^(?:@[^/@\\s]+\\/)?[^./~@\\s][^/\\s]*(?:\\/|$)/;\nfunction isPackageSpecifier(specifier) {\n return packageSpecifier.test(specifier);\n}\nclass ComponentDiscovery {\n /** null records a module that had no components or could not evaluate */\n #discovered = /* @__PURE__ */ new Map();\n clear() {\n this.#discovered.clear();\n }\n /** host-resolved ids of every module discovery found components in */\n ids() {\n return [...this.#discovered].filter(([, loaded]) => loaded !== null).map(([id]) => id).sort();\n }\n /** re-register everything found so far into a freshly built registry */\n seed(registry) {\n for (const [id, loaded] of this.#discovered) {\n if (!loaded) continue;\n registry.modulesById.set(id, id);\n registry.componentsByModule.set(id, loaded);\n }\n }\n async prepare(module, registry, evaluate) {\n if (!evaluate) return;\n const seen = /* @__PURE__ */ new Set();\n const provenances = [\n ...module.elements.map((element) => element.component.provenance),\n ...module.styledDefinitions.map((definition) => definition.base.provenance)\n ];\n for (const provenance of provenances) {\n if (!provenance || !isPackageSpecifier(provenance.specifier)) continue;\n const id = provenance.resolvedId.split(/[?#]/, 1)[0];\n if (seen.has(id) || registry.modulesById.has(id) || this.#discovered.has(id)) {\n continue;\n }\n seen.add(id);\n if (!path.isAbsolute(id)) {\n this.#discovered.set(id, null);\n continue;\n }\n let loaded = null;\n try {\n const exports = await evaluate({ id, specifier: provenance.specifier });\n if (exports) {\n const nameToInfo = getComponentStaticConfigByName(\n id,\n exports.default ?? exports\n );\n if (Object.keys(nameToInfo).length) loaded = { moduleName: id, nameToInfo };\n }\n } catch (error) {\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`[tamagui] component discovery skipped ${id}:`, error);\n }\n }\n this.#discovered.set(id, loaded);\n if (loaded) {\n registry.modulesById.set(id, id);\n registry.componentsByModule.set(id, loaded);\n }\n }\n }\n}\nexport {\n ComponentDiscovery\n};\n//# sourceMappingURL=componentDiscovery.js.map\n"],"mappings":";;;;AAIA,MAAM,mBAAmB;AACzB,SAAS,mBAAmB,WAAW;CACrC,OAAO,iBAAiB,KAAK,SAAS;AACxC;AACA,IAAM,qBAAN,MAAyB;;CAEvB,8BAA8B,IAAI,IAAI;CACtC,QAAQ;EACN,KAAKA,YAAY,MAAM;CACzB;;CAEA,MAAM;EACJ,OAAO,CAAC,GAAG,KAAKA,WAAW,CAAC,CAAC,QAAQ,GAAG,YAAY,WAAW,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK;CAC9F;;CAEA,KAAK,UAAU;EACb,KAAK,MAAM,CAAC,IAAI,WAAW,KAAKA,aAAa;GAC3C,IAAI,CAAC,QAAQ;GACb,SAAS,YAAY,IAAI,IAAI,EAAE;GAC/B,SAAS,mBAAmB,IAAI,IAAI,MAAM;EAC5C;CACF;CACA,MAAM,QAAQ,QAAQ,UAAU,UAAU;EACxC,IAAI,CAAC,UAAU;EACf,MAAM,uBAAuB,IAAI,IAAI;EACrC,MAAM,cAAc,CAClB,GAAG,OAAO,SAAS,KAAK,YAAY,QAAQ,UAAU,UAAU,GAChE,GAAG,OAAO,kBAAkB,KAAK,eAAe,WAAW,KAAK,UAAU,CAC5E;EACA,KAAK,MAAM,cAAc,aAAa;GACpC,IAAI,CAAC,cAAc,CAAC,mBAAmB,WAAW,SAAS,GAAG;GAC9D,MAAM,KAAK,WAAW,WAAW,MAAM,QAAQ,CAAC,CAAC,CAAC;GAClD,IAAI,KAAK,IAAI,EAAE,KAAK,SAAS,YAAY,IAAI,EAAE,KAAK,KAAKA,YAAY,IAAI,EAAE,GAAG;IAC5E;GACF;GACA,KAAK,IAAI,EAAE;GACX,IAAI,CAAC,KAAK,WAAW,EAAE,GAAG;IACxB,KAAKA,YAAY,IAAI,IAAI,IAAI;IAC7B;GACF;GACA,IAAI,SAAS;GACb,IAAI;IACF,MAAM,UAAU,MAAM,SAAS;KAAE;KAAI,WAAW,WAAW;IAAU,CAAC;IACtE,IAAI,SAAS;KACX,MAAM,aAAa,+BACjB,IACA,QAAQ,WAAW,OACrB;KACA,IAAI,OAAO,KAAK,UAAU,CAAC,CAAC,QAAQ,SAAS;MAAE,YAAY;MAAI;KAAW;IAC5E;GACF,SAAS,OAAO;IACd,IAAI,QAAQ,IAAI,UAAU,WAAW;KACnC,QAAQ,KAAK,yCAAyC,GAAG,IAAI,KAAK;IACpE;GACF;GACA,KAAKA,YAAY,IAAI,IAAI,MAAM;GAC/B,IAAI,QAAQ;IACV,SAAS,YAAY,IAAI,IAAI,EAAE;IAC/B,SAAS,mBAAmB,IAAI,IAAI,MAAM;GAC5C;EACF;CACF;AACF"}
@@ -9,6 +9,11 @@ const DOM_FRONTENDS = /* @__PURE__ */ new Set([
9
9
  "@tamagui/core/dom",
10
10
  "@tamagui/tailwind"
11
11
  ]);
12
+ const RUNTIME_STYLE_FRONTENDS = /* @__PURE__ */ new Set([
13
+ "tamagui",
14
+ "@tamagui/core",
15
+ "@tamagui/web"
16
+ ]);
12
17
  const acceptsTag = (accepted, tag) => accepted === "*" || accepted.includes(tag);
13
18
  function isDOMElement(element) {
14
19
  const provenance = element.component.provenance;
@@ -21,7 +26,7 @@ const versionHash = createHash("sha256").update(JSON.stringify({
21
26
  TAGS
22
27
  })).digest("hex");
23
28
  const domStructuralPass = {
24
- versionHash: `dom-structural-v3-${versionHash}`,
29
+ versionHash: `dom-structural-v4-${versionHash}`,
25
30
  transform({ module, source, target }) {
26
31
  const edits = [];
27
32
  const diagnostics = [];
@@ -70,10 +75,15 @@ const domStructuralPass = {
70
75
  diagnostics.push(localBailout("local/dynamic-style-value", definition.value.span, `style() definition ${definition.name} must be statically evaluable`));
71
76
  continue;
72
77
  }
78
+ const isRuntimeStyle = RUNTIME_STYLE_FRONTENDS.has(definition.factory.specifier);
79
+ if (isRuntimeStyle && (!definition.value.value || typeof definition.value.value !== "object" || Array.isArray(definition.value.value))) {
80
+ diagnostics.push(localBailout("local/dynamic-style-value", definition.value.span, `style() definition ${definition.name} must be an object literal`));
81
+ continue;
82
+ }
73
83
  edits.push({
74
84
  start: definition.span.start,
75
85
  end: definition.span.end,
76
- content: "undefined",
86
+ content: isRuntimeStyle ? `({ className: "", [Symbol.for("tamagui.stylePiece")]: { byKey: {}, styleObject: ${JSON.stringify(definition.value.value)} } })` : "undefined",
77
87
  origin: definition.span
78
88
  });
79
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"domStructuralPass.js","names":[],"sources":["esm/domStructuralPass.js"],"sourcesContent":["import {\n ATTRIBUTES,\n EVENTS,\n NATIVE_BACKING,\n TAGS\n} from \"@tamagui/dom\";\nimport {\n localBailout\n} from \"@tamagui/compiler-core\";\nimport { createHash } from \"node:crypto\";\nconst DOM_FRONTENDS = /* @__PURE__ */ new Set([\n \"tamagui\",\n \"tamagui/dom\",\n \"@tamagui/core\",\n \"@tamagui/core/dom\",\n \"@tamagui/tailwind\"\n]);\nconst acceptsTag = (accepted, tag) => accepted === \"*\" || accepted.includes(tag);\nfunction isDOMElement(element) {\n const provenance = element.component.provenance;\n return provenance?.importedName === \"html\" && DOM_FRONTENDS.has(provenance.specifier);\n}\nconst versionHash = createHash(\"sha256\").update(\n JSON.stringify({\n ATTRIBUTES,\n EVENTS,\n NATIVE_BACKING,\n TAGS\n })\n).digest(\"hex\");\nconst domStructuralPass = {\n versionHash: `dom-structural-v3-${versionHash}`,\n transform({ module, source, target }) {\n const edits = [];\n const diagnostics = [];\n const domElements = module.elements.filter(isDOMElement);\n const supportedDOMElements = domElements.filter(\n (element) => element.component.name in TAGS\n );\n const domBySpan = new Map(\n supportedDOMElements.map((element) => [\n `${element.span.start}:${element.span.end}`,\n element\n ])\n );\n for (const element of domElements) {\n const tagName = element.component.name;\n if (!(tagName in TAGS)) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-target\",\n element.component.span,\n `html.${element.component.name} is not part of the Tamagui DOM contract`\n )\n );\n continue;\n }\n const tag = TAGS[tagName];\n if (target === \"native\" && tag.native === \"none\") {\n diagnostics.push(\n localBailout(\n \"local/unsupported-target\",\n element.component.span,\n `html.${tagName} is not supported on native: ${tag.note ?? \"no native backing\"}`\n )\n );\n continue;\n }\n for (const entry of element.entries) {\n if (entry.kind !== \"prop\") continue;\n const attribute = (entry.name in ATTRIBUTES ? ATTRIBUTES[entry.name] : void 0) ?? (entry.name.startsWith(\"data-\") ? ATTRIBUTES[\"data-*\"] : void 0);\n const event = entry.name in EVENTS ? EVENTS[entry.name] : void 0;\n const row = attribute ?? event;\n if (!row) continue;\n if (!acceptsTag(row.tags, tagName)) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-prop-key\",\n entry.span,\n `${entry.name} is not supported on html.${tagName}`\n )\n );\n continue;\n }\n if (target === \"native\" && row.native === \"none\") {\n if (event) continue;\n diagnostics.push(\n localBailout(\n \"local/unsupported-prop-key\",\n entry.span,\n `${entry.name} is not supported on native html.${tagName}: ${row.note ?? \"no native equivalent\"}`\n )\n );\n }\n }\n for (const entry of element.entries) {\n if (entry.kind !== \"child\" || entry.value.kind !== \"element\") continue;\n const child = domBySpan.get(`${entry.value.span.start}:${entry.value.span.end}`);\n if (!child) continue;\n const childTag = child.component.name;\n const invalid = tag.content === \"void\" || tag.content === \"text\" || tag.content === \"phrasing\" && TAGS[childTag].display === \"block\" || tag.content === \"tags\" && !tag.childTags?.includes(childTag);\n if (invalid) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-child\",\n child.component.span,\n `html.${childTag} cannot be nested directly inside html.${tagName}`\n )\n );\n }\n }\n }\n for (const definition of module.domStyleDefinitions) {\n if (definition.value.kind !== \"static\") {\n diagnostics.push(\n localBailout(\n \"local/dynamic-style-value\",\n definition.value.span,\n `style() definition ${definition.name} must be statically evaluable`\n )\n );\n continue;\n }\n edits.push({\n start: definition.span.start,\n end: definition.span.end,\n content: \"undefined\",\n origin: definition.span\n });\n }\n const nextModule = module;\n return {\n module: nextModule,\n edits,\n imports: [],\n diagnostics,\n dependencies: []\n };\n }\n};\nexport {\n domStructuralPass\n};\n//# sourceMappingURL=domStructuralPass.js.map\n"],"mappings":";;;;;AAUA,MAAM,gCAAgC,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,cAAc,UAAU,QAAQ,aAAa,OAAO,SAAS,SAAS,GAAG;AAC/E,SAAS,aAAa,SAAS;CAC7B,MAAM,aAAa,QAAQ,UAAU;CACrC,OAAO,YAAY,iBAAiB,UAAU,cAAc,IAAI,WAAW,SAAS;AACtF;AACA,MAAM,cAAc,WAAW,QAAQ,CAAC,CAAC,OACvC,KAAK,UAAU;CACb;CACA;CACA;CACA;AACF,CAAC,CACH,CAAC,CAAC,OAAO,KAAK;AACd,MAAM,oBAAoB;CACxB,aAAa,qBAAqB;CAClC,UAAU,EAAE,QAAQ,QAAQ,UAAU;EACpC,MAAM,QAAQ,CAAC;EACf,MAAM,cAAc,CAAC;EACrB,MAAM,cAAc,OAAO,SAAS,OAAO,YAAY;EACvD,MAAM,uBAAuB,YAAY,QACtC,YAAY,QAAQ,UAAU,QAAQ,IACzC;EACA,MAAM,YAAY,IAAI,IACpB,qBAAqB,KAAK,YAAY,CACpC,GAAG,QAAQ,KAAK,MAAM,GAAG,QAAQ,KAAK,OACtC,OACF,CAAC,CACH;EACA,KAAK,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,YAAY,UAAU,IAAI,YAAY,cAAc,KAAK,SAAS,CAAC,YAAY,WAAW,IAAI,YAAY,UAAU,CAAC,IAAI,WAAW,SAAS,QAAQ;IACnM,IAAI,SAAS;KACX,YAAY,KACV,aACE,2BACA,MAAM,UAAU,MAChB,QAAQ,SAAS,yCAAyC,SAC5D,CACF;IACF;GACF;EACF;EACA,KAAK,MAAM,cAAc,OAAO,qBAAqB;GACnD,IAAI,WAAW,MAAM,SAAS,UAAU;IACtC,YAAY,KACV,aACE,6BACA,WAAW,MAAM,MACjB,sBAAsB,WAAW,KAAK,8BACxC,CACF;IACA;GACF;GACA,MAAM,KAAK;IACT,OAAO,WAAW,KAAK;IACvB,KAAK,WAAW,KAAK;IACrB,SAAS;IACT,QAAQ,WAAW;GACrB,CAAC;EACH;EACA,MAAM,aAAa;EACnB,OAAO;GACL,QAAQ;GACR;GACA,SAAS,CAAC;GACV;GACA,cAAc,CAAC;EACjB;CACF;AACF"}
1
+ {"version":3,"file":"domStructuralPass.js","names":[],"sources":["esm/domStructuralPass.js"],"sourcesContent":["import {\n ATTRIBUTES,\n EVENTS,\n NATIVE_BACKING,\n TAGS\n} from \"@tamagui/dom\";\nimport {\n localBailout\n} from \"@tamagui/compiler-core\";\nimport { createHash } from \"node:crypto\";\nconst DOM_FRONTENDS = /* @__PURE__ */ new Set([\n \"tamagui\",\n \"tamagui/dom\",\n \"@tamagui/core\",\n \"@tamagui/core/dom\",\n \"@tamagui/tailwind\"\n]);\nconst RUNTIME_STYLE_FRONTENDS = /* @__PURE__ */ new Set([\"tamagui\", \"@tamagui/core\", \"@tamagui/web\"]);\nconst acceptsTag = (accepted, tag) => accepted === \"*\" || accepted.includes(tag);\nfunction isDOMElement(element) {\n const provenance = element.component.provenance;\n return provenance?.importedName === \"html\" && DOM_FRONTENDS.has(provenance.specifier);\n}\nconst versionHash = createHash(\"sha256\").update(\n JSON.stringify({\n ATTRIBUTES,\n EVENTS,\n NATIVE_BACKING,\n TAGS\n })\n).digest(\"hex\");\nconst domStructuralPass = {\n versionHash: `dom-structural-v4-${versionHash}`,\n transform({ module, source, target }) {\n const edits = [];\n const diagnostics = [];\n const domElements = module.elements.filter(isDOMElement);\n const supportedDOMElements = domElements.filter(\n (element) => element.component.name in TAGS\n );\n const domBySpan = new Map(\n supportedDOMElements.map((element) => [\n `${element.span.start}:${element.span.end}`,\n element\n ])\n );\n for (const element of domElements) {\n const tagName = element.component.name;\n if (!(tagName in TAGS)) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-target\",\n element.component.span,\n `html.${element.component.name} is not part of the Tamagui DOM contract`\n )\n );\n continue;\n }\n const tag = TAGS[tagName];\n if (target === \"native\" && tag.native === \"none\") {\n diagnostics.push(\n localBailout(\n \"local/unsupported-target\",\n element.component.span,\n `html.${tagName} is not supported on native: ${tag.note ?? \"no native backing\"}`\n )\n );\n continue;\n }\n for (const entry of element.entries) {\n if (entry.kind !== \"prop\") continue;\n const attribute = (entry.name in ATTRIBUTES ? ATTRIBUTES[entry.name] : void 0) ?? (entry.name.startsWith(\"data-\") ? ATTRIBUTES[\"data-*\"] : void 0);\n const event = entry.name in EVENTS ? EVENTS[entry.name] : void 0;\n const row = attribute ?? event;\n if (!row) continue;\n if (!acceptsTag(row.tags, tagName)) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-prop-key\",\n entry.span,\n `${entry.name} is not supported on html.${tagName}`\n )\n );\n continue;\n }\n if (target === \"native\" && row.native === \"none\") {\n if (event) continue;\n diagnostics.push(\n localBailout(\n \"local/unsupported-prop-key\",\n entry.span,\n `${entry.name} is not supported on native html.${tagName}: ${row.note ?? \"no native equivalent\"}`\n )\n );\n }\n }\n for (const entry of element.entries) {\n if (entry.kind !== \"child\" || entry.value.kind !== \"element\") continue;\n const child = domBySpan.get(`${entry.value.span.start}:${entry.value.span.end}`);\n if (!child) continue;\n const childTag = child.component.name;\n const invalid = tag.content === \"void\" || tag.content === \"text\" || tag.content === \"phrasing\" && TAGS[childTag].display === \"block\" || tag.content === \"tags\" && !tag.childTags?.includes(childTag);\n if (invalid) {\n diagnostics.push(\n localBailout(\n \"local/unsupported-child\",\n child.component.span,\n `html.${childTag} cannot be nested directly inside html.${tagName}`\n )\n );\n }\n }\n }\n for (const definition of module.domStyleDefinitions) {\n if (definition.value.kind !== \"static\") {\n diagnostics.push(\n localBailout(\n \"local/dynamic-style-value\",\n definition.value.span,\n `style() definition ${definition.name} must be statically evaluable`\n )\n );\n continue;\n }\n const isRuntimeStyle = RUNTIME_STYLE_FRONTENDS.has(definition.factory.specifier);\n if (isRuntimeStyle && (!definition.value.value || typeof definition.value.value !== \"object\" || Array.isArray(definition.value.value))) {\n diagnostics.push(\n localBailout(\n \"local/dynamic-style-value\",\n definition.value.span,\n `style() definition ${definition.name} must be an object literal`\n )\n );\n continue;\n }\n edits.push({\n start: definition.span.start,\n end: definition.span.end,\n content: isRuntimeStyle ? `({ className: \"\", [Symbol.for(\"tamagui.stylePiece\")]: { byKey: {}, styleObject: ${JSON.stringify(definition.value.value)} } })` : \"undefined\",\n origin: definition.span\n });\n }\n const nextModule = module;\n return {\n module: nextModule,\n edits,\n imports: [],\n diagnostics,\n dependencies: []\n };\n }\n};\nexport {\n domStructuralPass\n};\n//# sourceMappingURL=domStructuralPass.js.map\n"],"mappings":";;;;;AAUA,MAAM,gCAAgC,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,0CAA0C,IAAI,IAAI;CAAC;CAAW;CAAiB;AAAc,CAAC;AACpG,MAAM,cAAc,UAAU,QAAQ,aAAa,OAAO,SAAS,SAAS,GAAG;AAC/E,SAAS,aAAa,SAAS;CAC7B,MAAM,aAAa,QAAQ,UAAU;CACrC,OAAO,YAAY,iBAAiB,UAAU,cAAc,IAAI,WAAW,SAAS;AACtF;AACA,MAAM,cAAc,WAAW,QAAQ,CAAC,CAAC,OACvC,KAAK,UAAU;CACb;CACA;CACA;CACA;AACF,CAAC,CACH,CAAC,CAAC,OAAO,KAAK;AAC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C;GACV;GACA,cAAc,CAAC;EACjB;CACF;AACF"}
@@ -1,3 +1,4 @@
1
+ import { evaluateComponentModule } from "./extractor/bundleConfig.mjs";
1
2
  import { clearFormatCache, detectModuleFormat } from "./extractor/detectModuleFormat.mjs";
2
3
  import { esbundleTamaguiConfig } from "./extractor/bundle.mjs";
3
4
 
@@ -15,6 +16,8 @@ export * from "./extractor/concatClassName.mjs"
15
16
 
16
17
  export * from "./extractor/loadTamagui.mjs"
17
18
 
19
+ export * from "./componentDiscovery.mjs"
20
+
18
21
  export * from "./extractor/watchTamaguiConfig.mjs"
19
22
 
20
23
  export * from "./registerRequire.mjs"
@@ -23,4 +26,4 @@ export * from "./getPragmaOptions.mjs"
23
26
 
24
27
  export * from "./zero/index.mjs"
25
28
 
26
- export { clearFormatCache, detectModuleFormat, esbundleTamaguiConfig };
29
+ export { clearFormatCache, detectModuleFormat, esbundleTamaguiConfig, evaluateComponentModule };
@@ -440,6 +440,28 @@ async function loadComponents(props, forceExports = false) {
440
440
  const otherComponents = await loadComponentsInner(props, forceExports);
441
441
  return [...coreComponents, ...otherComponents];
442
442
  }
443
+ async function evaluateComponentModule(props, id) {
444
+ const previousIsStatic = process.env.IS_STATIC;
445
+ const previousIsServer = process.env.TAMAGUI_IS_SERVER;
446
+ process.env.IS_STATIC = "is_static";
447
+ process.env.TAMAGUI_IS_SERVER = "true";
448
+ const { unregister } = registerRequire(props.platform || "web", { ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules });
449
+ try {
450
+ try {
451
+ return nodeRequire(id);
452
+ } catch (error) {
453
+ const code = error?.code;
454
+ if (code !== "ERR_REQUIRE_ESM" && code !== "ERR_REQUIRE_ASYNC_MODULE") throw error;
455
+ }
456
+ } finally {
457
+ unregister();
458
+ if (previousIsStatic === void 0) delete process.env.IS_STATIC;
459
+ else process.env.IS_STATIC = previousIsStatic;
460
+ if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;
461
+ else process.env.TAMAGUI_IS_SERVER = previousIsServer;
462
+ }
463
+ return import(`${pathToFileURL(id).href}?v=${FS.statSync(id).mtimeMs}`);
464
+ }
443
465
  function loadComponentsSync(props, forceExports = false) {
444
466
  const coreComponents = getCoreComponentsSync(props);
445
467
  const otherComponents = loadComponentsInnerSync(props, forceExports);
@@ -702,5 +724,5 @@ function interopDefaultExport(mod) {
702
724
  }
703
725
  const cacheComponents = {};
704
726
 
705
- export { bundleConfig, esbuildOptions, esbuildOptionsWithPlugins, getBundledConfig, getComponentStaticConfigByName, getLoadedConfig, hasBundledConfigChanged, loadComponents, loadComponentsInner, loadComponentsInnerSync, loadComponentsSync, setLoadedConfig, writeTamaguiCSS };
727
+ export { bundleConfig, esbuildOptions, esbuildOptionsWithPlugins, evaluateComponentModule, getBundledConfig, getComponentStaticConfigByName, getLoadedConfig, hasBundledConfigChanged, loadComponents, loadComponentsInner, loadComponentsInnerSync, loadComponentsSync, setLoadedConfig, writeTamaguiCSS };
706
728
  //# sourceMappingURL=bundleConfig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundleConfig.js","names":[],"sources":["esm/extractor/bundleConfig.js"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, unlinkSync } from \"node:fs\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep\n} from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { readFile } from \"node:fs/promises\";\nimport { registerRequire, setRequireResult } from \"../registerRequire\";\nimport { addLocalExports } from \"./addLocalExports\";\nimport { esbuildLoaderConfig, esbundleTamaguiConfig } from \"./bundle\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst componentDisplayName = /* @__PURE__ */ Symbol.for(\"tamagui.componentDisplayName\");\nconst activeTempFiles = /* @__PURE__ */ new Set();\nfunction getDynamicEvalOutfile(name, format, contents) {\n const ext = format === \"esm\" ? \"mjs\" : \"cjs\";\n const hash = createHash(\"sha1\").update(name).update(\"\\0\").update(format).update(\"\\0\").update(contents).digest(\"hex\").slice(0, 10);\n return join(process.cwd(), \".tamagui\", `dynamic-eval-${hash}-${basename(name)}.${ext}`);\n}\nfunction getEsbuildStdinLoader(filePath) {\n if (filePath.endsWith(\".tsx\")) return \"tsx\";\n if (filePath.endsWith(\".ts\")) return \"ts\";\n if (filePath.endsWith(\".jsx\")) return \"jsx\";\n return \"js\";\n}\nfunction resolvePackageEntry(packageName, format) {\n if (format === \"cjs\") {\n return nodeRequire.resolve(packageName);\n }\n const packageJsonPath = nodeRequire.resolve(`${packageName}/package.json`);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n const packageRoot = dirname(packageJsonPath);\n const exportEntry = packageJson.exports?.[\".\"];\n const esmEntry = exportEntry?.import || exportEntry?.module || exportEntry?.browser || packageJson.module;\n if (typeof esmEntry === \"string\") {\n return join(packageRoot, esmEntry);\n }\n return nodeRequire.resolve(packageName);\n}\nfunction cleanupTempFiles() {\n for (const f of activeTempFiles) {\n try {\n unlinkSync(f);\n } catch {\n }\n }\n activeTempFiles.clear();\n}\nprocess.on(\"exit\", cleanupTempFiles);\nprocess.on(\"SIGINT\", () => {\n cleanupTempFiles();\n process.exit();\n});\nprocess.on(\"SIGTERM\", () => {\n cleanupTempFiles();\n process.exit();\n});\nconst external = [\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"react\",\n \"react-dom\",\n \"react-native-svg\"\n];\nconst esbuildExtraOptions = {\n define: {\n __DEV__: `${process.env.NODE_ENV === \"development\"}`\n }\n};\nconst handleEsmFeaturesPlugin = {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n};\nconst esbuildTransformOptions = {\n target: \"es2022\",\n format: \"cjs\",\n jsx: \"automatic\",\n platform: \"node\",\n ...esbuildExtraOptions\n};\nconst esbuildOptions = {\n ...esbuildTransformOptions\n};\nconst esbuildOptionsWithPlugins = {\n ...esbuildTransformOptions,\n plugins: [handleEsmFeaturesPlugin]\n};\nlet currentBundle = null;\nlet currentBundleKey = \"\";\nlet isBundling = false;\nlet lastBundle = null;\nconst waitForBundle = /* @__PURE__ */ new Set();\nfunction hasBundledConfigChanged() {\n if (lastBundle === currentBundle) {\n return false;\n }\n lastBundle = currentBundle;\n return true;\n}\nlet loadedConfig = null;\nconst getLoadedConfig = () => loadedConfig;\nconst setLoadedConfig = (config) => {\n loadedConfig = config;\n};\nfunction getBundleKey(props) {\n return JSON.stringify({\n root: props.root,\n components: props.components,\n config: props.config,\n platform: props.platform,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n}\nfunction getPackageNameFromPath(modulePath) {\n const normalized = modulePath.split(sep).join(\"/\");\n const nodeModulesIndex = normalized.lastIndexOf(\"/node_modules/\");\n if (nodeModulesIndex === -1) {\n return normalized.startsWith(\".\") || isAbsolute(normalized) ? void 0 : normalized;\n }\n const packagePath = normalized.slice(nodeModulesIndex + \"/node_modules/\".length);\n const parts = packagePath.split(\"/\");\n return parts[0]?.startsWith(\"@\") ? parts.slice(0, 2).join(\"/\") : parts[0];\n}\nfunction findStaticEvaluationError(error) {\n let current = error;\n while (current instanceof Error) {\n if (\"code\" in current && current.code === \"TAMAGUI_STATIC_EVALUATION_ERROR\" && \"moduleName\" in current && \"importer\" in current && \"failedModule\" in current && \"reason\" in current) {\n return current;\n }\n current = current.cause;\n }\n}\nasync function getBundledConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n if (isBundling) {\n await new Promise((res) => {\n waitForBundle.add(res);\n });\n }\n if (!currentBundle || currentBundleKey !== bundleKey || rebuild) {\n return await bundleConfig(props, rebuild);\n }\n return currentBundle;\n}\nglobal.tamaguiLastLoaded ||= 0;\nfunction updateLastLoaded(config, bundleKey) {\n global.tamaguiLastLoaded = Date.now();\n global.tamaguiLastBundledConfig = config;\n global.tamaguiLastBundledConfigKey = bundleKey;\n}\nlet hasBundledOnce = false;\nlet hasLoggedBuild = false;\nconst packageNameByDirectory = /* @__PURE__ */ new Map();\nfunction owningPackageName(file) {\n let directory = dirname(file);\n const walked = [];\n while (true) {\n const known = packageNameByDirectory.get(directory);\n if (known !== void 0) {\n for (const step of walked) packageNameByDirectory.set(step, known);\n return known;\n }\n walked.push(directory);\n const manifest = join(directory, \"package.json\");\n if (existsSync(manifest)) {\n let name = null;\n try {\n name = JSON.parse(readFileSync(manifest, \"utf-8\")).name ?? null;\n } catch {\n name = null;\n }\n for (const step of walked) packageNameByDirectory.set(step, name);\n return name;\n }\n const parent = dirname(directory);\n if (parent === directory) {\n for (const step of walked) packageNameByDirectory.set(step, null);\n return null;\n }\n directory = parent;\n }\n}\nfunction requiredTamaguiPackageFiles() {\n const found = [];\n for (const file of Object.keys(nodeRequire.cache)) {\n if (!file.includes(\".\")) continue;\n const name = owningPackageName(file);\n if (name === \"tamagui\" || name?.startsWith(\"@tamagui/\")) found.push(file);\n }\n return found;\n}\nasync function bundleConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n const root = props.root || process.cwd();\n const configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config, root) : \"\";\n const baseComponents = (props.components || []).filter((x) => x !== \"@tamagui/core\");\n let componentOutPaths = [];\n let componentImports = [];\n if (!rebuild && global.tamaguiLastBundledConfig && global.tamaguiLastBundledConfigKey === bundleKey && Date.now() - global.tamaguiLastLoaded < 3e3) {\n return global.tamaguiLastBundledConfig;\n }\n try {\n isBundling = true;\n const rootRequire = createRequire(join(root, \"package.json\"));\n const tmpDir = join(root, \".tamagui\");\n const platformSuffix = (props.platform || \"web\") === \"native\" ? \".native\" : \".web\";\n const configFormat = configEntry ? detectModuleFormat(configEntry) : \"cjs\";\n const configExt = configFormat === \"esm\" ? \".mjs\" : \".cjs\";\n const configOutPath = join(tmpDir, `tamagui.config${platformSuffix}${configExt}`);\n const componentFormats = baseComponents.map((mod) => {\n try {\n let packageRoot = dirname(rootRequire.resolve(mod));\n while (!existsSync(join(packageRoot, \"package.json\"))) {\n const parent = dirname(packageRoot);\n if (parent === packageRoot) {\n return \"cjs\";\n }\n packageRoot = parent;\n }\n const pkg = JSON.parse(readFileSync(join(packageRoot, \"package.json\"), \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n });\n componentOutPaths = baseComponents.map((componentModule, i) => {\n const ext = componentFormats[i] === \"esm\" ? \".mjs\" : \".cjs\";\n return join(\n tmpDir,\n `${componentModule.split(sep).join(\"-\").replace(/[^a-z0-9]+/gi, \"\")}-components.config${platformSuffix}${ext}`\n );\n });\n let compilerDependencies = currentBundle?.dependencies ?? [];\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building config entry`, configEntry);\n }\n let shouldBuild = rebuild || !props.disableInitialBuild;\n if (shouldBuild && props.config && !rebuild) {\n const allOutFiles = [configOutPath, ...componentOutPaths];\n try {\n const stats = await Promise.all(\n allOutFiles.map((f) => FS.stat(f).catch(() => null))\n );\n const allExistAndRecent = stats.every(\n (s) => s !== null && Date.now() - s.mtimeMs < 3e3\n );\n if (allExistAndRecent) {\n shouldBuild = false;\n }\n } catch {\n }\n }\n if (shouldBuild) {\n try {\n await FS.ensureDir(tmpDir);\n } catch {\n }\n const start = Date.now();\n const buildResults = await Promise.all([\n props.config ? esbundleTamaguiConfig(\n {\n entryPoints: [configEntry],\n external,\n outfile: configOutPath,\n target: \"node24\",\n format: configFormat,\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n ) : null,\n ...baseComponents.map((componentModule, i) => {\n return esbundleTamaguiConfig(\n {\n entryPoints: [componentModule],\n // bare packages must stay bare so esbuild can select their\n // react-native conditional export; local files still use siblings\n resolvePlatformSpecificEntries: props.platform !== \"native\" || componentModule.startsWith(\".\") || isAbsolute(componentModule),\n conditions: props.platform === \"native\" ? [\"react-native\"] : void 0,\n external,\n outfile: componentOutPaths[i],\n target: \"node24\",\n format: componentFormats[i],\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n );\n })\n ]);\n compilerDependencies = buildResults.flatMap(\n (result) => result?.metafile ? Object.keys(result.metafile.inputs).map((input) => resolve(root, input)) : []\n );\n componentImports = buildResults.slice(1).map((result) => {\n if (!result?.metafile) {\n return [];\n }\n const entryPoint = Object.values(result.metafile.outputs).find(\n (output) => output.entryPoint\n )?.entryPoint;\n if (!entryPoint) {\n return [];\n }\n return [\n ...new Set(\n result.metafile.inputs[entryPoint]?.imports.map((item) => getPackageNameFromPath(item.path)).filter((moduleName) => Boolean(moduleName)) || []\n )\n ];\n });\n if (!hasLoggedBuild && !props[\"_skipBuildLog\"]) {\n hasLoggedBuild = true;\n colorLog(\n Color.FgYellow,\n `\n \\u27A1 [tamagui] built config, components, prompt (${Date.now() - start}ms)`\n );\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n colorLog(\n Color.Dim,\n `\n Config .${sep}${relative(root, configOutPath)}\n Components ${componentOutPaths.map((p) => `.${sep}${relative(root, p)}`).join(\"\\n \")}\n `\n );\n }\n }\n }\n if (hasBundledOnce) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(configOutPath)];\n } catch {\n }\n for (const p of componentOutPaths) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(p)];\n } catch {\n }\n }\n } else {\n hasBundledOnce = true;\n }\n let out;\n if (configFormat === \"esm\") {\n out = await import(`${pathToFileURL(configOutPath).href}?v=${FS.statSync(configOutPath).mtimeMs}`);\n } else {\n out = nodeRequire(configOutPath);\n }\n let config = out.default || out || out.config;\n if (config && config.config && !config.tokens) {\n config = config.config;\n }\n if (!config) {\n throw new Error(`No config: ${config}`);\n }\n loadedConfig = config;\n if (!config.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n config = createTamagui(config);\n } else {\n const { installTamaguiConfig } = requireTamaguiCore(props.platform || \"web\");\n installTamaguiConfig(config);\n }\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, config);\n }\n if (rebuild) {\n delete cacheComponents[componentOutPaths.join(\"\\0\")];\n }\n let components = await loadComponents({\n ...props,\n components: componentOutPaths\n });\n if (!components) {\n throw new Error(`No components found: ${componentOutPaths.join(\", \")}`);\n }\n for (const component of components) {\n component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName;\n if (!component.moduleName) {\n if (process.env.DEBUG?.includes(\"tamagui\") || process.env.IS_TAMAGUI_DEV) {\n console.warn(\n `\\u26A0\\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(\n baseComponents\n )} in ${JSON.stringify(componentOutPaths)}`\n );\n }\n }\n }\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(\"Loaded components\", components);\n }\n const res = {\n components,\n nameToPaths: {},\n tamaguiConfig: config,\n dependencies: compilerDependencies,\n // the generated bundles inline every source they were built from,\n // including the component packages resolved out of node_modules, so their\n // bytes are a complete description of what the compiler host will read\n stampSources: [\n ...configEntry ? [configOutPath] : [],\n ...componentOutPaths,\n // The generated bundles inline the user's config and components, but\n // `external` keeps @tamagui/core and @tamagui/web out of them, and\n // everything reached only through those two is left out with them.\n // Those packages hold the staticConfig and style engine every lowering\n // is computed against, so without their bytes an in-place engine edit at\n // the same version - exactly what `bun run watch` and\n // `bun release --into` produce - would serve plans built by the\n // previous engine.\n ...requiredTamaguiPackageFiles()\n ]\n };\n currentBundle = res;\n currentBundleKey = bundleKey;\n updateLastLoaded(res, bundleKey);\n return res;\n } catch (err) {\n const failure = findStaticEvaluationError(err);\n const componentIndex = failure ? componentOutPaths.findIndex(\n (outputPath) => outputPath === failure.moduleName || outputPath === failure.importer\n ) : -1;\n const configuredComponent = baseComponents[componentIndex];\n if (failure && configuredComponent) {\n const configuredImport = configuredComponent.startsWith(\".\") || isAbsolute(configuredComponent) ? componentImports[componentIndex]?.[0] || configuredComponent : configuredComponent;\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured component \"${configuredComponent}\".\nThe import \"${configuredImport}\" reached module \"${failure.failedModule}\", which failed during Node evaluation.\nReason: ${failure.reason}\nFix the failing module so it can run in Node during the build. If \"${configuredImport}\" is runtime-only and none of its exports create your Tamagui config or components, add \"${configuredImport}\" to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n }\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured Tamagui config \"${configEntry || \"<default config>\"}\".\nReason: ${err instanceof Error ? err.message : String(err)}\nFix the failing import so it can run in Node during the build. If it is runtime-only and none of its exports create your Tamagui config or components, add its exact module name to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n } finally {\n isBundling = false;\n waitForBundle.forEach((cb) => cb());\n waitForBundle.clear();\n }\n}\nasync function writeTamaguiCSS(outputCSS, config) {\n const flush = async () => {\n colorLog(Color.FgYellow, ` \\u27A1 [tamagui] output css: ${outputCSS}`);\n await FS.mkdirp(dirname(outputCSS));\n await FS.writeFile(outputCSS, css);\n };\n const css = config.getCSS();\n if (typeof css !== \"string\") {\n throw new Error(`Invalid CSS: ${typeof css} ${css}`);\n }\n try {\n if (existsSync(outputCSS) && await readFile(outputCSS, \"utf8\") === css) {\n } else {\n await flush();\n }\n } catch (err) {\n console.info(\"Error writing themes\", err);\n }\n}\nasync function loadComponents(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = await loadComponentsInner(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nfunction loadComponentsSync(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = loadComponentsInnerSync(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nfunction getCoreComponentsSync(props) {\n const loaded = loadComponentsInnerSync({\n ...props,\n components: [\"@tamagui/core\"]\n });\n if (!loaded[0]) {\n throw new Error(`Core should always load`);\n }\n return [\n {\n ...loaded[0],\n moduleName: \"@tamagui/core\"\n }\n ];\n}\nasync function loadComponentsInner(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const results = [];\n for (const name of componentsModules) {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const format = isLocal ? detectModuleFormat(name) : \"cjs\";\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n const attemptLoad = async ({ forceExports: forceExports2 = false } = {}) => {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, format, writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n await esbuild.build({\n ...esbuildOptionsWithPlugins,\n plugins: [\n ...esbuildOptionsWithPlugins.plugins || [],\n staticEvaluationIgnorePlugin(\n props.dangerouslyIgnoreStaticEvaluationModules\n )\n ],\n format,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n format\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, format);\n }\n let moduleResult;\n if (format === \"esm\") {\n moduleResult = await import(`${pathToFileURL(loadModule).href}?v=${FS.statSync(loadModule).mtimeMs}`);\n } else {\n moduleResult = nodeRequire(loadModule);\n }\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n };\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n let loaded;\n try {\n loaded = await attemptLoad({ forceExports: isDynamic });\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n try {\n loaded = await attemptLoad({ forceExports: false });\n } catch (err2) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err2 instanceof Error ? err2.message : String(err2)}`,\n { cause: err2 }\n );\n }\n } finally {\n dispose();\n }\n if (Array.isArray(loaded)) {\n results.push(...loaded);\n } else if (loaded) {\n results.push(loaded);\n }\n }\n cacheComponents[key] = results;\n return results;\n } finally {\n unregister();\n }\n}\nfunction loadComponentsInnerSync(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const info = componentsModules.flatMap((name) => {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n function attemptLoad({ forceExports: forceExports2 = false } = {}) {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, \"cjs\", writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n esbuild.buildSync({\n ...esbuildOptions,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n \"esm\"\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, nodeRequire.resolve(loadModule));\n }\n const moduleResult = nodeRequire(loadModule);\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n }\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n try {\n const res = attemptLoad({ forceExports: isDynamic });\n return res;\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n } finally {\n dispose();\n }\n try {\n return attemptLoad({ forceExports: false });\n } catch (err) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n } finally {\n dispose();\n }\n });\n cacheComponents[key] = info;\n return info;\n } finally {\n unregister();\n }\n}\nconst esbuildit = (src, target) => {\n return esbuild.transformSync(src, {\n ...esbuildTransformOptions,\n ...target === \"modern\" && {\n target: \"es2022\",\n jsx: \"automatic\",\n loader: \"tsx\",\n platform: \"neutral\",\n format: \"esm\"\n }\n }).code;\n};\nfunction getComponentStaticConfigByName(name, exported) {\n const components = {};\n if (!exported || typeof exported !== \"object\" || Array.isArray(exported)) {\n throw new Error(`Invalid export from package ${name}: ${typeof exported}`);\n }\n for (const key in exported) {\n const found = getTamaguiComponent(key, exported[key]);\n if (found) {\n const { Component, ...sc } = found.staticConfig;\n components[key] = {\n staticConfig: sc,\n ...found.displayName && { displayName: found.displayName }\n };\n }\n }\n return components;\n}\nfunction getTamaguiComponent(name, Component) {\n if (name[0].toUpperCase() !== name[0]) {\n return;\n }\n const staticConfig = Component?.staticConfig;\n if (staticConfig) {\n return {\n staticConfig,\n displayName: Component[componentDisplayName]\n };\n }\n}\nfunction interopDefaultExport(mod) {\n return mod?.default ?? mod;\n}\nconst cacheComponents = {};\nexport {\n bundleConfig,\n esbuildOptions,\n esbuildOptionsWithPlugins,\n getBundledConfig,\n getComponentStaticConfigByName,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponents,\n loadComponentsInner,\n loadComponentsInnerSync,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n};\n//# sourceMappingURL=bundleConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,uBAAuC,uBAAO,IAAI,8BAA8B;AACtF,MAAM,kCAAkC,IAAI,IAAI;AAChD,SAAS,sBAAsB,MAAM,QAAQ,UAAU;CACrD,MAAM,MAAM,WAAW,QAAQ,QAAQ;CACvC,MAAM,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;CAChI,OAAO,KAAK,QAAQ,IAAI,GAAG,YAAY,gBAAgB,KAAK,GAAG,SAAS,IAAI,EAAE,GAAG,KAAK;AACxF;AACA,SAAS,sBAAsB,UAAU;C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R,QAAQ;GACV;EACF,CAAC;EACD,gBAAgB,OAAO;EACvB,OAAO;CACT,UAAU;EACR,WAAW;CACb;AACF;AACA,MAAM,aAAa,KAAK,WAAW;CACjC,OAAO,QAAQ,cAAc,KAAK;EAChC,GAAG;EACH,GAAG,WAAW,YAAY;GACxB,QAAQ;GACR,KAAK;GACL,QAAQ;GACR,UAAU;GACV,QAAQ;EACV;CACF,CAAC,CAAC,CAAC;AACL;AACA,SAAS,+BAA+B,MAAM,UAAU;CACtD,MAAM,aAAa,CAAC;CACpB,IAAI,CAAC,YAAY,OAAO,aAAa,YAAY,MAAM,QAAQ,QAAQ,GAAG;EACxE,MAAM,IAAI,MAAM,+BAA+B,KAAK,IAAI,OAAO,UAAU;CAC3E;CACA,KAAK,MAAM,OAAO,UAAU;EAC1B,MAAM,QAAQ,oBAAoB,KAAK,SAAS,IAAI;EACpD,IAAI,OAAO;GACT,MAAM,EAAE,WAAW,GAAG,OAAO,MAAM;GACnC,WAAW,OAAO;IAChB,cAAc;IACd,GAAG,MAAM,eAAe,EAAE,aAAa,MAAM,YAAY;GAC3D;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,oBAAoB,MAAM,WAAW;CAC5C,IAAI,KAAK,EAAE,CAAC,YAAY,MAAM,KAAK,IAAI;EACrC;CACF;CACA,MAAM,eAAe,WAAW;CAChC,IAAI,cAAc;EAChB,OAAO;GACL;GACA,aAAa,UAAU;EACzB;CACF;AACF;AACA,SAAS,qBAAqB,KAAK;CACjC,OAAO,KAAK,WAAW;AACzB;AACA,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"bundleConfig.js","names":[],"sources":["esm/extractor/bundleConfig.js"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, unlinkSync } from \"node:fs\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep\n} from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { readFile } from \"node:fs/promises\";\nimport { registerRequire, setRequireResult } from \"../registerRequire\";\nimport { addLocalExports } from \"./addLocalExports\";\nimport { esbuildLoaderConfig, esbundleTamaguiConfig } from \"./bundle\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst componentDisplayName = /* @__PURE__ */ Symbol.for(\"tamagui.componentDisplayName\");\nconst activeTempFiles = /* @__PURE__ */ new Set();\nfunction getDynamicEvalOutfile(name, format, contents) {\n const ext = format === \"esm\" ? \"mjs\" : \"cjs\";\n const hash = createHash(\"sha1\").update(name).update(\"\\0\").update(format).update(\"\\0\").update(contents).digest(\"hex\").slice(0, 10);\n return join(process.cwd(), \".tamagui\", `dynamic-eval-${hash}-${basename(name)}.${ext}`);\n}\nfunction getEsbuildStdinLoader(filePath) {\n if (filePath.endsWith(\".tsx\")) return \"tsx\";\n if (filePath.endsWith(\".ts\")) return \"ts\";\n if (filePath.endsWith(\".jsx\")) return \"jsx\";\n return \"js\";\n}\nfunction resolvePackageEntry(packageName, format) {\n if (format === \"cjs\") {\n return nodeRequire.resolve(packageName);\n }\n const packageJsonPath = nodeRequire.resolve(`${packageName}/package.json`);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n const packageRoot = dirname(packageJsonPath);\n const exportEntry = packageJson.exports?.[\".\"];\n const esmEntry = exportEntry?.import || exportEntry?.module || exportEntry?.browser || packageJson.module;\n if (typeof esmEntry === \"string\") {\n return join(packageRoot, esmEntry);\n }\n return nodeRequire.resolve(packageName);\n}\nfunction cleanupTempFiles() {\n for (const f of activeTempFiles) {\n try {\n unlinkSync(f);\n } catch {\n }\n }\n activeTempFiles.clear();\n}\nprocess.on(\"exit\", cleanupTempFiles);\nprocess.on(\"SIGINT\", () => {\n cleanupTempFiles();\n process.exit();\n});\nprocess.on(\"SIGTERM\", () => {\n cleanupTempFiles();\n process.exit();\n});\nconst external = [\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"react\",\n \"react-dom\",\n \"react-native-svg\"\n];\nconst esbuildExtraOptions = {\n define: {\n __DEV__: `${process.env.NODE_ENV === \"development\"}`\n }\n};\nconst handleEsmFeaturesPlugin = {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n};\nconst esbuildTransformOptions = {\n target: \"es2022\",\n format: \"cjs\",\n jsx: \"automatic\",\n platform: \"node\",\n ...esbuildExtraOptions\n};\nconst esbuildOptions = {\n ...esbuildTransformOptions\n};\nconst esbuildOptionsWithPlugins = {\n ...esbuildTransformOptions,\n plugins: [handleEsmFeaturesPlugin]\n};\nlet currentBundle = null;\nlet currentBundleKey = \"\";\nlet isBundling = false;\nlet lastBundle = null;\nconst waitForBundle = /* @__PURE__ */ new Set();\nfunction hasBundledConfigChanged() {\n if (lastBundle === currentBundle) {\n return false;\n }\n lastBundle = currentBundle;\n return true;\n}\nlet loadedConfig = null;\nconst getLoadedConfig = () => loadedConfig;\nconst setLoadedConfig = (config) => {\n loadedConfig = config;\n};\nfunction getBundleKey(props) {\n return JSON.stringify({\n root: props.root,\n components: props.components,\n config: props.config,\n platform: props.platform,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n}\nfunction getPackageNameFromPath(modulePath) {\n const normalized = modulePath.split(sep).join(\"/\");\n const nodeModulesIndex = normalized.lastIndexOf(\"/node_modules/\");\n if (nodeModulesIndex === -1) {\n return normalized.startsWith(\".\") || isAbsolute(normalized) ? void 0 : normalized;\n }\n const packagePath = normalized.slice(nodeModulesIndex + \"/node_modules/\".length);\n const parts = packagePath.split(\"/\");\n return parts[0]?.startsWith(\"@\") ? parts.slice(0, 2).join(\"/\") : parts[0];\n}\nfunction findStaticEvaluationError(error) {\n let current = error;\n while (current instanceof Error) {\n if (\"code\" in current && current.code === \"TAMAGUI_STATIC_EVALUATION_ERROR\" && \"moduleName\" in current && \"importer\" in current && \"failedModule\" in current && \"reason\" in current) {\n return current;\n }\n current = current.cause;\n }\n}\nasync function getBundledConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n if (isBundling) {\n await new Promise((res) => {\n waitForBundle.add(res);\n });\n }\n if (!currentBundle || currentBundleKey !== bundleKey || rebuild) {\n return await bundleConfig(props, rebuild);\n }\n return currentBundle;\n}\nglobal.tamaguiLastLoaded ||= 0;\nfunction updateLastLoaded(config, bundleKey) {\n global.tamaguiLastLoaded = Date.now();\n global.tamaguiLastBundledConfig = config;\n global.tamaguiLastBundledConfigKey = bundleKey;\n}\nlet hasBundledOnce = false;\nlet hasLoggedBuild = false;\nconst packageNameByDirectory = /* @__PURE__ */ new Map();\nfunction owningPackageName(file) {\n let directory = dirname(file);\n const walked = [];\n while (true) {\n const known = packageNameByDirectory.get(directory);\n if (known !== void 0) {\n for (const step of walked) packageNameByDirectory.set(step, known);\n return known;\n }\n walked.push(directory);\n const manifest = join(directory, \"package.json\");\n if (existsSync(manifest)) {\n let name = null;\n try {\n name = JSON.parse(readFileSync(manifest, \"utf-8\")).name ?? null;\n } catch {\n name = null;\n }\n for (const step of walked) packageNameByDirectory.set(step, name);\n return name;\n }\n const parent = dirname(directory);\n if (parent === directory) {\n for (const step of walked) packageNameByDirectory.set(step, null);\n return null;\n }\n directory = parent;\n }\n}\nfunction requiredTamaguiPackageFiles() {\n const found = [];\n for (const file of Object.keys(nodeRequire.cache)) {\n if (!file.includes(\".\")) continue;\n const name = owningPackageName(file);\n if (name === \"tamagui\" || name?.startsWith(\"@tamagui/\")) found.push(file);\n }\n return found;\n}\nasync function bundleConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n const root = props.root || process.cwd();\n const configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config, root) : \"\";\n const baseComponents = (props.components || []).filter((x) => x !== \"@tamagui/core\");\n let componentOutPaths = [];\n let componentImports = [];\n if (!rebuild && global.tamaguiLastBundledConfig && global.tamaguiLastBundledConfigKey === bundleKey && Date.now() - global.tamaguiLastLoaded < 3e3) {\n return global.tamaguiLastBundledConfig;\n }\n try {\n isBundling = true;\n const rootRequire = createRequire(join(root, \"package.json\"));\n const tmpDir = join(root, \".tamagui\");\n const platformSuffix = (props.platform || \"web\") === \"native\" ? \".native\" : \".web\";\n const configFormat = configEntry ? detectModuleFormat(configEntry) : \"cjs\";\n const configExt = configFormat === \"esm\" ? \".mjs\" : \".cjs\";\n const configOutPath = join(tmpDir, `tamagui.config${platformSuffix}${configExt}`);\n const componentFormats = baseComponents.map((mod) => {\n try {\n let packageRoot = dirname(rootRequire.resolve(mod));\n while (!existsSync(join(packageRoot, \"package.json\"))) {\n const parent = dirname(packageRoot);\n if (parent === packageRoot) {\n return \"cjs\";\n }\n packageRoot = parent;\n }\n const pkg = JSON.parse(readFileSync(join(packageRoot, \"package.json\"), \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n });\n componentOutPaths = baseComponents.map((componentModule, i) => {\n const ext = componentFormats[i] === \"esm\" ? \".mjs\" : \".cjs\";\n return join(\n tmpDir,\n `${componentModule.split(sep).join(\"-\").replace(/[^a-z0-9]+/gi, \"\")}-components.config${platformSuffix}${ext}`\n );\n });\n let compilerDependencies = currentBundle?.dependencies ?? [];\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building config entry`, configEntry);\n }\n let shouldBuild = rebuild || !props.disableInitialBuild;\n if (shouldBuild && props.config && !rebuild) {\n const allOutFiles = [configOutPath, ...componentOutPaths];\n try {\n const stats = await Promise.all(\n allOutFiles.map((f) => FS.stat(f).catch(() => null))\n );\n const allExistAndRecent = stats.every(\n (s) => s !== null && Date.now() - s.mtimeMs < 3e3\n );\n if (allExistAndRecent) {\n shouldBuild = false;\n }\n } catch {\n }\n }\n if (shouldBuild) {\n try {\n await FS.ensureDir(tmpDir);\n } catch {\n }\n const start = Date.now();\n const buildResults = await Promise.all([\n props.config ? esbundleTamaguiConfig(\n {\n entryPoints: [configEntry],\n external,\n outfile: configOutPath,\n target: \"node24\",\n format: configFormat,\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n ) : null,\n ...baseComponents.map((componentModule, i) => {\n return esbundleTamaguiConfig(\n {\n entryPoints: [componentModule],\n // bare packages must stay bare so esbuild can select their\n // react-native conditional export; local files still use siblings\n resolvePlatformSpecificEntries: props.platform !== \"native\" || componentModule.startsWith(\".\") || isAbsolute(componentModule),\n conditions: props.platform === \"native\" ? [\"react-native\"] : void 0,\n external,\n outfile: componentOutPaths[i],\n target: \"node24\",\n format: componentFormats[i],\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n );\n })\n ]);\n compilerDependencies = buildResults.flatMap(\n (result) => result?.metafile ? Object.keys(result.metafile.inputs).map((input) => resolve(root, input)) : []\n );\n componentImports = buildResults.slice(1).map((result) => {\n if (!result?.metafile) {\n return [];\n }\n const entryPoint = Object.values(result.metafile.outputs).find(\n (output) => output.entryPoint\n )?.entryPoint;\n if (!entryPoint) {\n return [];\n }\n return [\n ...new Set(\n result.metafile.inputs[entryPoint]?.imports.map((item) => getPackageNameFromPath(item.path)).filter((moduleName) => Boolean(moduleName)) || []\n )\n ];\n });\n if (!hasLoggedBuild && !props[\"_skipBuildLog\"]) {\n hasLoggedBuild = true;\n colorLog(\n Color.FgYellow,\n `\n \\u27A1 [tamagui] built config, components, prompt (${Date.now() - start}ms)`\n );\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n colorLog(\n Color.Dim,\n `\n Config .${sep}${relative(root, configOutPath)}\n Components ${componentOutPaths.map((p) => `.${sep}${relative(root, p)}`).join(\"\\n \")}\n `\n );\n }\n }\n }\n if (hasBundledOnce) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(configOutPath)];\n } catch {\n }\n for (const p of componentOutPaths) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(p)];\n } catch {\n }\n }\n } else {\n hasBundledOnce = true;\n }\n let out;\n if (configFormat === \"esm\") {\n out = await import(`${pathToFileURL(configOutPath).href}?v=${FS.statSync(configOutPath).mtimeMs}`);\n } else {\n out = nodeRequire(configOutPath);\n }\n let config = out.default || out || out.config;\n if (config && config.config && !config.tokens) {\n config = config.config;\n }\n if (!config) {\n throw new Error(`No config: ${config}`);\n }\n loadedConfig = config;\n if (!config.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n config = createTamagui(config);\n } else {\n const { installTamaguiConfig } = requireTamaguiCore(props.platform || \"web\");\n installTamaguiConfig(config);\n }\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, config);\n }\n if (rebuild) {\n delete cacheComponents[componentOutPaths.join(\"\\0\")];\n }\n let components = await loadComponents({\n ...props,\n components: componentOutPaths\n });\n if (!components) {\n throw new Error(`No components found: ${componentOutPaths.join(\", \")}`);\n }\n for (const component of components) {\n component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName;\n if (!component.moduleName) {\n if (process.env.DEBUG?.includes(\"tamagui\") || process.env.IS_TAMAGUI_DEV) {\n console.warn(\n `\\u26A0\\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(\n baseComponents\n )} in ${JSON.stringify(componentOutPaths)}`\n );\n }\n }\n }\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(\"Loaded components\", components);\n }\n const res = {\n components,\n nameToPaths: {},\n tamaguiConfig: config,\n dependencies: compilerDependencies,\n // the generated bundles inline every source they were built from,\n // including the component packages resolved out of node_modules, so their\n // bytes are a complete description of what the compiler host will read\n stampSources: [\n ...configEntry ? [configOutPath] : [],\n ...componentOutPaths,\n // The generated bundles inline the user's config and components, but\n // `external` keeps @tamagui/core and @tamagui/web out of them, and\n // everything reached only through those two is left out with them.\n // Those packages hold the staticConfig and style engine every lowering\n // is computed against, so without their bytes an in-place engine edit at\n // the same version - exactly what `bun run watch` and\n // `bun release --into` produce - would serve plans built by the\n // previous engine.\n ...requiredTamaguiPackageFiles()\n ]\n };\n currentBundle = res;\n currentBundleKey = bundleKey;\n updateLastLoaded(res, bundleKey);\n return res;\n } catch (err) {\n const failure = findStaticEvaluationError(err);\n const componentIndex = failure ? componentOutPaths.findIndex(\n (outputPath) => outputPath === failure.moduleName || outputPath === failure.importer\n ) : -1;\n const configuredComponent = baseComponents[componentIndex];\n if (failure && configuredComponent) {\n const configuredImport = configuredComponent.startsWith(\".\") || isAbsolute(configuredComponent) ? componentImports[componentIndex]?.[0] || configuredComponent : configuredComponent;\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured component \"${configuredComponent}\".\nThe import \"${configuredImport}\" reached module \"${failure.failedModule}\", which failed during Node evaluation.\nReason: ${failure.reason}\nFix the failing module so it can run in Node during the build. If \"${configuredImport}\" is runtime-only and none of its exports create your Tamagui config or components, add \"${configuredImport}\" to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n }\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured Tamagui config \"${configEntry || \"<default config>\"}\".\nReason: ${err instanceof Error ? err.message : String(err)}\nFix the failing import so it can run in Node during the build. If it is runtime-only and none of its exports create your Tamagui config or components, add its exact module name to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n } finally {\n isBundling = false;\n waitForBundle.forEach((cb) => cb());\n waitForBundle.clear();\n }\n}\nasync function writeTamaguiCSS(outputCSS, config) {\n const flush = async () => {\n colorLog(Color.FgYellow, ` \\u27A1 [tamagui] output css: ${outputCSS}`);\n await FS.mkdirp(dirname(outputCSS));\n await FS.writeFile(outputCSS, css);\n };\n const css = config.getCSS();\n if (typeof css !== \"string\") {\n throw new Error(`Invalid CSS: ${typeof css} ${css}`);\n }\n try {\n if (existsSync(outputCSS) && await readFile(outputCSS, \"utf8\") === css) {\n } else {\n await flush();\n }\n } catch (err) {\n console.info(\"Error writing themes\", err);\n }\n}\nasync function loadComponents(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = await loadComponentsInner(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nasync function evaluateComponentModule(props, id) {\n const previousIsStatic = process.env.IS_STATIC;\n const previousIsServer = process.env.TAMAGUI_IS_SERVER;\n process.env.IS_STATIC = \"is_static\";\n process.env.TAMAGUI_IS_SERVER = \"true\";\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n try {\n return nodeRequire(id);\n } catch (error) {\n const code = error?.code;\n if (code !== \"ERR_REQUIRE_ESM\" && code !== \"ERR_REQUIRE_ASYNC_MODULE\") throw error;\n }\n } finally {\n unregister();\n if (previousIsStatic === void 0) delete process.env.IS_STATIC;\n else process.env.IS_STATIC = previousIsStatic;\n if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;\n else process.env.TAMAGUI_IS_SERVER = previousIsServer;\n }\n return import(`${pathToFileURL(id).href}?v=${FS.statSync(id).mtimeMs}`);\n}\nfunction loadComponentsSync(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = loadComponentsInnerSync(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nfunction getCoreComponentsSync(props) {\n const loaded = loadComponentsInnerSync({\n ...props,\n components: [\"@tamagui/core\"]\n });\n if (!loaded[0]) {\n throw new Error(`Core should always load`);\n }\n return [\n {\n ...loaded[0],\n moduleName: \"@tamagui/core\"\n }\n ];\n}\nasync function loadComponentsInner(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const results = [];\n for (const name of componentsModules) {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const format = isLocal ? detectModuleFormat(name) : \"cjs\";\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n const attemptLoad = async ({ forceExports: forceExports2 = false } = {}) => {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, format, writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n await esbuild.build({\n ...esbuildOptionsWithPlugins,\n plugins: [\n ...esbuildOptionsWithPlugins.plugins || [],\n staticEvaluationIgnorePlugin(\n props.dangerouslyIgnoreStaticEvaluationModules\n )\n ],\n format,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n format\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, format);\n }\n let moduleResult;\n if (format === \"esm\") {\n moduleResult = await import(`${pathToFileURL(loadModule).href}?v=${FS.statSync(loadModule).mtimeMs}`);\n } else {\n moduleResult = nodeRequire(loadModule);\n }\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n };\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n let loaded;\n try {\n loaded = await attemptLoad({ forceExports: isDynamic });\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n try {\n loaded = await attemptLoad({ forceExports: false });\n } catch (err2) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err2 instanceof Error ? err2.message : String(err2)}`,\n { cause: err2 }\n );\n }\n } finally {\n dispose();\n }\n if (Array.isArray(loaded)) {\n results.push(...loaded);\n } else if (loaded) {\n results.push(loaded);\n }\n }\n cacheComponents[key] = results;\n return results;\n } finally {\n unregister();\n }\n}\nfunction loadComponentsInnerSync(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const info = componentsModules.flatMap((name) => {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n function attemptLoad({ forceExports: forceExports2 = false } = {}) {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, \"cjs\", writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n esbuild.buildSync({\n ...esbuildOptions,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n \"esm\"\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, nodeRequire.resolve(loadModule));\n }\n const moduleResult = nodeRequire(loadModule);\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n }\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n try {\n const res = attemptLoad({ forceExports: isDynamic });\n return res;\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n } finally {\n dispose();\n }\n try {\n return attemptLoad({ forceExports: false });\n } catch (err) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n } finally {\n dispose();\n }\n });\n cacheComponents[key] = info;\n return info;\n } finally {\n unregister();\n }\n}\nconst esbuildit = (src, target) => {\n return esbuild.transformSync(src, {\n ...esbuildTransformOptions,\n ...target === \"modern\" && {\n target: \"es2022\",\n jsx: \"automatic\",\n loader: \"tsx\",\n platform: \"neutral\",\n format: \"esm\"\n }\n }).code;\n};\nfunction getComponentStaticConfigByName(name, exported) {\n const components = {};\n if (!exported || typeof exported !== \"object\" || Array.isArray(exported)) {\n throw new Error(`Invalid export from package ${name}: ${typeof exported}`);\n }\n for (const key in exported) {\n const found = getTamaguiComponent(key, exported[key]);\n if (found) {\n const { Component, ...sc } = found.staticConfig;\n components[key] = {\n staticConfig: sc,\n ...found.displayName && { displayName: found.displayName }\n };\n }\n }\n return components;\n}\nfunction getTamaguiComponent(name, Component) {\n if (name[0].toUpperCase() !== name[0]) {\n return;\n }\n const staticConfig = Component?.staticConfig;\n if (staticConfig) {\n return {\n staticConfig,\n displayName: Component[componentDisplayName]\n };\n }\n}\nfunction interopDefaultExport(mod) {\n return mod?.default ?? mod;\n}\nconst cacheComponents = {};\nexport {\n bundleConfig,\n esbuildOptions,\n esbuildOptionsWithPlugins,\n evaluateComponentModule,\n getBundledConfig,\n getComponentStaticConfigByName,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponents,\n loadComponentsInner,\n loadComponentsInnerSync,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n};\n//# sourceMappingURL=bundleConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,uBAAuC,uBAAO,IAAI,8BAA8B;AACtF,MAAM,kCAAkC,IAAI,IAAI;AAChD,SAAS,sBAAsB,MAAM,QAAQ,UAAU;CACrD,MAAM,MAAM,WAAW,QAAQ,QAAQ;CACvC,MAAM,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;CAChI,OAAO,KAAK,QAAQ,IAAI,GAAG,YAAY,gBAAgB,KAAK,GAAG,SAAS,IAAI,EAAE,GAAG,KAAK;AACxF;AACA,SAAS,sBAAsB,UAAU;CACvC,IAAI,SAAS,SAAS,MAAM,GAAG,OAAO;CACtC,IAAI,SAAS,SAAS,KAAK,GAAG,OAAO;CACrC,IAAI,SAAS,SAAS,MAAM,GAAG,OAAO;CACtC,OAAO;AACT;AACA,SAAS,oBAAoB,aAAa,QAAQ;CAChD,IAAI,WAAW,OAAO;EACpB,OAAO,YAAY,QAAQ,WAAW;CACxC;CACA,MAAM,kBAAkB,YAAY,QAAQ,GAAG,YAAY,cAAc;CACzE,MAAM,cAAc,KAAK,MAAM,aA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F;AACA,SAAS,qBAAqB,KAAK;CACjC,OAAO,KAAK,WAAW;AACzB;AACA,MAAM,kBAAkB,CAAC"}
@@ -4,11 +4,7 @@ import { resolveThemeName, variableToString } from "@tamagui/web";
4
4
  import { getInlineValuesFromProps, getVariablesCSSRules } from "@tamagui/web/theme-update";
5
5
 
6
6
  const MAX_THEME_BRANCHES = 8;
7
- const LOWERABLE_RESERVED_PROPS = /* @__PURE__ */ new Set([
8
- "name",
9
- "reset",
10
- "contain"
11
- ]);
7
+ const LOWERABLE_RESERVED_PROPS = /* @__PURE__ */ new Set(["name", "contain"]);
12
8
  function jsxAttributeName(attribute) {
13
9
  const name = childNode(attribute, "name");
14
10
  return name && typeof name.name === "string" ? name.name : null;
@@ -71,7 +67,7 @@ function resolveThemeChain(chain, rootThemeName, config) {
71
67
  const next = [];
72
68
  for (const parent of branches) {
73
69
  for (const option of node.options) {
74
- const resolved = resolveThemeName(parent.name, option.name, node.reset, config.themes);
70
+ const resolved = resolveThemeName(parent.name, option.name, config.themes);
75
71
  const tests = [parent.test, option.test].filter(Boolean);
76
72
  next.push({
77
73
  test: tests.length ? tests.join(" && ") : null,
@@ -99,7 +95,6 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
99
95
  test: null,
100
96
  name: void 0
101
97
  }];
102
- let reset = false;
103
98
  let contain = false;
104
99
  const themeKeyProps = {};
105
100
  for (const attribute of childNodes(opening, "attributes")) {
@@ -164,7 +159,6 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
164
159
  });
165
160
  continue;
166
161
  }
167
- if (key === "reset") reset = literal2;
168
162
  if (key === "contain") contain = literal2;
169
163
  continue;
170
164
  }
@@ -195,15 +189,6 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
195
189
  }
196
190
  themeKeyProps[key] = literal;
197
191
  }
198
- if (kind === "Theme" && reset && options.some((option) => option.name !== void 0)) {
199
- violations.push({
200
- rule: 4,
201
- code: "local/unsupported-target",
202
- span: span(opening),
203
- component: "Theme",
204
- message: zeroRuleMessage(4, { detail: "a <Theme> with both name and reset, which cannot mean one theme," })
205
- });
206
- }
207
192
  if (!closing) {
208
193
  violations.push({
209
194
  rule: 4,
@@ -214,7 +199,8 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
214
199
  });
215
200
  }
216
201
  const issues = [];
217
- const inlineValues = kind === "ThemeUpdate" && Object.keys(themeKeyProps).length ? getInlineValuesFromProps(themeKeyProps, config, (issue) => issues.push(issue)) : null;
202
+ const themeUpdateConfig = config;
203
+ const inlineValues = kind === "ThemeUpdate" && Object.keys(themeKeyProps).length ? getInlineValuesFromProps(themeKeyProps, themeUpdateConfig, (issue) => issues.push(issue)) : null;
218
204
  for (const issue of issues) {
219
205
  violations.push({
220
206
  rule: 3,
@@ -228,7 +214,7 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
228
214
  })
229
215
  });
230
216
  }
231
- const inlineCSS = inlineValues ? getVariablesCSSRules(inlineValues, config) : null;
217
+ const inlineCSS = inlineValues ? getVariablesCSSRules(inlineValues, themeUpdateConfig) : null;
232
218
  if (inlineCSS) css.set(inlineCSS.identifier, inlineCSS.rules.join(""));
233
219
  if (violations.length) return {
234
220
  node: null,
@@ -242,7 +228,6 @@ function readStaticTheme(element, id, source, config, kind = "Theme") {
242
228
  opening,
243
229
  closing,
244
230
  options,
245
- reset,
246
231
  contain,
247
232
  layer: inlineValues && inlineCSS ? {
248
233
  inlineValues,
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","names":[],"sources":["esm/zero/theme.js"],"sourcesContent":["import {\n childNode,\n childNodes,\n resolvedModuleId,\n walkAst,\n zeroRuleMessage\n} from \"@tamagui/compiler-core\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport {\n resolveThemeName,\n variableToString\n} from \"@tamagui/web\";\nimport {\n getInlineValuesFromProps,\n getVariablesCSSRules\n} from \"@tamagui/web/theme-update\";\nconst MAX_THEME_BRANCHES = 8;\nconst LOWERABLE_RESERVED_PROPS = /* @__PURE__ */ new Set([\"name\", \"reset\", \"contain\"]);\nfunction jsxAttributeName(attribute) {\n const name = childNode(attribute, \"name\");\n return name && typeof name.name === \"string\" ? name.name : null;\n}\nfunction literalOf(node) {\n if (!node) return void 0;\n if (node.type === \"Literal\" && typeof node.value !== \"object\") {\n return node.value;\n }\n return void 0;\n}\nfunction hasSideEffects(node) {\n let found = false;\n walkAst(node, (child) => {\n if (child.type === \"CallExpression\" || child.type === \"OptionalCallExpression\" || child.type === \"NewExpression\" || child.type === \"AwaitExpression\" || child.type === \"YieldExpression\" || child.type === \"AssignmentExpression\" || child.type === \"UpdateExpression\" || child.type === \"TaggedTemplateExpression\") {\n found = true;\n }\n });\n return found;\n}\nfunction readNameOptions(value, source, guards) {\n const literal = literalOf(value);\n if (typeof literal === \"string\") {\n return [{ test: guards.length ? guards.join(\" && \") : null, name: literal }];\n }\n if (value.type === \"ConditionalExpression\") {\n const test = childNode(value, \"test\");\n const consequent = childNode(value, \"consequent\");\n const alternate = childNode(value, \"alternate\");\n if (!test || !consequent || !alternate) return null;\n if (hasSideEffects(test)) return null;\n const testText = source.slice(test.start, test.end).replace(/\\s+/g, \" \").trim();\n const left = readNameOptions(consequent, source, [...guards, `(${testText})`]);\n const right = readNameOptions(alternate, source, [...guards, `!(${testText})`]);\n if (!left || !right) return null;\n return [...left, ...right];\n }\n return null;\n}\nfunction foldBranches(branches) {\n const last = branches[branches.length - 1];\n if (new Set(branches.map((branch) => branch.value)).size === 1) return last.value;\n let expression = last.value;\n for (let index = branches.length - 2; index >= 0; index--) {\n const branch = branches[index];\n expression = branch.test === null ? branch.value : `${branch.test} ? ${branch.value} : ${expression}`;\n }\n return expression;\n}\nfunction resolveThemeChain(chain, rootThemeName, config) {\n let branches = [{ test: null, name: rootThemeName, isNew: false }];\n for (const node of chain) {\n const next = [];\n for (const parent of branches) {\n for (const option of node.options) {\n const resolved = resolveThemeName(\n parent.name,\n option.name,\n node.reset,\n config.themes\n );\n const tests = [parent.test, option.test].filter(Boolean);\n next.push({\n test: tests.length ? tests.join(\" && \") : null,\n name: resolved ?? parent.name,\n isNew: resolved !== null\n });\n }\n }\n branches = next;\n }\n return branches;\n}\nfunction readStaticTheme(element, id, source, config, kind = \"Theme\") {\n const moduleId = resolvedModuleId(id);\n const violations = [];\n const css = /* @__PURE__ */ new Map();\n const opening = childNode(element, \"openingElement\");\n const closing = childNode(element, \"closingElement\");\n const span = (node) => ({ id: moduleId, start: node.start, end: node.end });\n let options = [{ test: null, name: void 0 }];\n let reset = false;\n let contain = false;\n const themeKeyProps = {};\n for (const attribute of childNodes(opening, \"attributes\")) {\n if (attribute.type !== \"JSXAttribute\") {\n violations.push({\n rule: 1,\n code: \"local/unsafe-style-spread\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(1, { component: kind })\n });\n continue;\n }\n const key = jsxAttributeName(attribute);\n if (!key) continue;\n const rawValue = childNode(attribute, \"value\");\n const value = rawValue && rawValue.type === \"JSXExpressionContainer\" ? childNode(rawValue, \"expression\") : rawValue;\n if (kind === \"ThemeUpdate\" && reservedThemeProps[key]) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(4, {\n detail: `the <ThemeUpdate ${key}> prop, which belongs on <Theme>,`\n })\n });\n continue;\n }\n if (kind === \"Theme\" && key === \"name\") {\n const read = value ? readNameOptions(value, source, []) : null;\n if (!read) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the <Theme name> value ${source.slice(attribute.start, attribute.end).replace(/\\s+/g, \" \").trim()}, which is not a literal theme name or a conditional over literal theme names,`\n })\n });\n continue;\n }\n options = read;\n continue;\n }\n if (kind === \"Theme\" && reservedThemeProps[key]) {\n if (!LOWERABLE_RESERVED_PROPS.has(key)) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the <Theme ${key}> prop, which has no compiled form,`\n })\n });\n continue;\n }\n const literal2 = value ? literalOf(value) : true;\n if (typeof literal2 !== \"boolean\") {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a non-literal <Theme ${key}> value,`\n })\n });\n continue;\n }\n if (key === \"reset\") reset = literal2;\n if (key === \"contain\") contain = literal2;\n continue;\n }\n if (kind === \"Theme\") {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the removed <Theme ${key}> inline-value spelling. Use <ThemeUpdate ${key}> around the subtree instead,`\n })\n });\n continue;\n }\n const literal = value ? literalOf(value) : void 0;\n if (typeof literal !== \"string\" && typeof literal !== \"number\") {\n violations.push({\n rule: 3,\n code: \"local/dynamic-style-value\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(3, {\n prop: key,\n component: kind,\n detail: value ? \"a theme value must be a string or number literal at build time\" : \"a theme key needs a value\"\n })\n });\n continue;\n }\n themeKeyProps[key] = literal;\n }\n if (kind === \"Theme\" && reset && options.some((option) => option.name !== void 0)) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(opening),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: \"a <Theme> with both name and reset, which cannot mean one theme,\"\n })\n });\n }\n if (!closing) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(element),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a self-closing <${kind}>, which has no subtree to theme,`\n })\n });\n }\n const issues = [];\n const inlineValues = kind === \"ThemeUpdate\" && Object.keys(themeKeyProps).length ? getInlineValuesFromProps(themeKeyProps, config, (issue) => issues.push(issue)) : null;\n for (const issue of issues) {\n violations.push({\n rule: 3,\n code: \"local/dynamic-style-value\",\n span: span(opening),\n component: kind,\n message: zeroRuleMessage(3, {\n prop: issue.key,\n component: kind,\n detail: issue.message\n })\n });\n }\n const inlineCSS = inlineValues ? getVariablesCSSRules(inlineValues, config) : null;\n if (inlineCSS) css.set(inlineCSS.identifier, inlineCSS.rules.join(\"\"));\n if (violations.length) return { node: null, violations, css };\n return {\n node: {\n kind,\n element,\n opening,\n closing,\n options,\n reset,\n contain,\n layer: inlineValues && inlineCSS ? {\n inlineValues,\n inlineClassName: inlineCSS.identifier\n } : null\n },\n violations,\n css\n };\n}\nfunction lowerStaticTheme(node, chain, rootThemeName, config, id) {\n const moduleId = resolvedModuleId(id);\n const branches = resolveThemeChain(chain, rootThemeName, config);\n if (branches.length > MAX_THEME_BRANCHES) {\n return {\n edits: [],\n violations: [\n {\n rule: 4,\n code: \"local/unsupported-target\",\n span: { id: moduleId, start: node.element.start, end: node.element.end },\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a <Theme> chain that enumerates ${branches.length} theme names, past the ${MAX_THEME_BRANCHES} this lowers,`\n })\n }\n ]\n };\n }\n const inlineClass = node.layer?.inlineClassName ?? \"\";\n const classBranches = branches.map((branch) => ({\n test: branch.test,\n value: JSON.stringify(\n [branch.isNew ? getThemeClassNames(branch.name) : \"\", \"is_Theme\", inlineClass].filter(Boolean).join(\" \").replace(/\\s+/g, \" \").trim()\n )\n }));\n const baseStyle = node.contain ? `display:\"contents\",contain:\"strict\"` : `display:\"contents\"`;\n const styleBranches = branches.map((branch) => {\n const theme = config.themes[branch.name];\n const color = branch.isNew && theme ? variableToString(theme.color) : \"\";\n return {\n test: branch.test,\n value: color ? `{color:${JSON.stringify(color)},${baseStyle}}` : `{${baseStyle}}`\n };\n });\n const className = foldBranches(classBranches);\n const style = foldBranches(styleBranches);\n const classAttribute = className.startsWith('\"') ? `className=${className}` : `className={${className}}`;\n const edits = [\n {\n start: node.opening.start,\n end: node.opening.end,\n content: `<span ${classAttribute} style={${style}}>`,\n origin: { id: moduleId, start: node.opening.start, end: node.opening.end }\n }\n ];\n if (node.closing) {\n edits.push({\n start: node.closing.start,\n end: node.closing.end,\n content: `</span>`,\n origin: { id: moduleId, start: node.closing.start, end: node.closing.end }\n });\n }\n return { edits, violations: [] };\n}\nexport {\n foldBranches,\n lowerStaticTheme,\n readStaticTheme,\n resolveThemeChain\n};\n//# sourceMappingURL=theme.js.map\n"],"mappings":";;;;;;AAgBA,MAAM,qBAAqB;AAC3B,MAAM,2CAA2C,IAAI,IAAI;CAAC;CAAQ;CAAS;AAAS,CAAC;AACrF,SAAS,iBAAiB,WAAW;CACnC,MAAM,OAAO,UAAU,WAAW,MAAM;CACxC,OAAO,QAAQ,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AAC7D;AACA,SAAS,UAAU,MAAM;CACvB,IAAI,CAAC,MAAM,OAAO,KAAK;CACvB,IAAI,KAAK,SAAS,aAAa,OAAO,KAAK,UAAU,UAAU;EAC7D,OAAO,KAAK;CACd;CACA,OAAO,KAAK;AACd;AACA,SAAS,eAAe,MAAM;CAC5B,IAAI,QAAQ;CACZ,QAAQ,OAAO,UAAU;EACvB,IAAI,MAAM,SAAS,oBAAoB,MAAM,SAAS,4BAA4B,MAAM,SAAS,mBAAmB,MAAM,SAAS,qBAAqB,MAAM,SAAS,qBAAqB,MAAM,SAAS,0BAA0B,MAAM,SAAS,sBAAsB,MAAM,SAAS,4BAA4B;GACnT,QAAQ;EACV;CACF,CAAC;CACD,OAAO;AACT;AACA,SAAS,gBAAgB,OAAO,QAAQ,QAAQ;CAC9C,MAAM,UAAU,UAAU,KAAK;CAC/B,IAAI,OAAO,YAAY,UAAU;EAC/B,OAAO,CAAC;GAAE,MAAM,OAAO,SAAS,OAAO,KAAK,MAAM,IAAI;GAAM,MAAM;EAAQ,CAAC;CAC7E;CACA,IAAI,MAAM,SAAS,yBAAyB;EAC1C,MAAM,OAAO,UAAU,OAAO,MAAM;EACpC,MAAM,aAAa,UAAU,OAAO,YAAY;EAChD,MAAM,YAAY,UAAU,OAAO,WAAW;EAC9C,IAAI,CAAC,QAA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Q;EAClB,SAAS,SAAS,eAAe,UAAU,MAAM;EACjD,QAAQ;GAAE,IAAI;GAAU,OAAO,KAAK,QAAQ;GAAO,KAAK,KAAK,QAAQ;EAAI;CAC3E,CACF;CACA,IAAI,KAAK,SAAS;EAChB,MAAM,KAAK;GACT,OAAO,KAAK,QAAQ;GACpB,KAAK,KAAK,QAAQ;GAClB,SAAS;GACT,QAAQ;IAAE,IAAI;IAAU,OAAO,KAAK,QAAQ;IAAO,KAAK,KAAK,QAAQ;GAAI;EAC3E,CAAC;CACH;CACA,OAAO;EAAE;EAAO,YAAY,CAAC;CAAE;AACjC"}
1
+ {"version":3,"file":"theme.js","names":[],"sources":["esm/zero/theme.js"],"sourcesContent":["import {\n childNode,\n childNodes,\n resolvedModuleId,\n walkAst,\n zeroRuleMessage\n} from \"@tamagui/compiler-core\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport {\n resolveThemeName,\n variableToString\n} from \"@tamagui/web\";\nimport {\n getInlineValuesFromProps,\n getVariablesCSSRules\n} from \"@tamagui/web/theme-update\";\nconst MAX_THEME_BRANCHES = 8;\nconst LOWERABLE_RESERVED_PROPS = /* @__PURE__ */ new Set([\"name\", \"contain\"]);\nfunction jsxAttributeName(attribute) {\n const name = childNode(attribute, \"name\");\n return name && typeof name.name === \"string\" ? name.name : null;\n}\nfunction literalOf(node) {\n if (!node) return void 0;\n if (node.type === \"Literal\" && typeof node.value !== \"object\") {\n return node.value;\n }\n return void 0;\n}\nfunction hasSideEffects(node) {\n let found = false;\n walkAst(node, (child) => {\n if (child.type === \"CallExpression\" || child.type === \"OptionalCallExpression\" || child.type === \"NewExpression\" || child.type === \"AwaitExpression\" || child.type === \"YieldExpression\" || child.type === \"AssignmentExpression\" || child.type === \"UpdateExpression\" || child.type === \"TaggedTemplateExpression\") {\n found = true;\n }\n });\n return found;\n}\nfunction readNameOptions(value, source, guards) {\n const literal = literalOf(value);\n if (typeof literal === \"string\") {\n return [{ test: guards.length ? guards.join(\" && \") : null, name: literal }];\n }\n if (value.type === \"ConditionalExpression\") {\n const test = childNode(value, \"test\");\n const consequent = childNode(value, \"consequent\");\n const alternate = childNode(value, \"alternate\");\n if (!test || !consequent || !alternate) return null;\n if (hasSideEffects(test)) return null;\n const testText = source.slice(test.start, test.end).replace(/\\s+/g, \" \").trim();\n const left = readNameOptions(consequent, source, [...guards, `(${testText})`]);\n const right = readNameOptions(alternate, source, [...guards, `!(${testText})`]);\n if (!left || !right) return null;\n return [...left, ...right];\n }\n return null;\n}\nfunction foldBranches(branches) {\n const last = branches[branches.length - 1];\n if (new Set(branches.map((branch) => branch.value)).size === 1) return last.value;\n let expression = last.value;\n for (let index = branches.length - 2; index >= 0; index--) {\n const branch = branches[index];\n expression = branch.test === null ? branch.value : `${branch.test} ? ${branch.value} : ${expression}`;\n }\n return expression;\n}\nfunction resolveThemeChain(chain, rootThemeName, config) {\n let branches = [{ test: null, name: rootThemeName, isNew: false }];\n for (const node of chain) {\n const next = [];\n for (const parent of branches) {\n for (const option of node.options) {\n const resolved = resolveThemeName(\n parent.name,\n option.name,\n config.themes\n );\n const tests = [parent.test, option.test].filter(Boolean);\n next.push({\n test: tests.length ? tests.join(\" && \") : null,\n name: resolved ?? parent.name,\n isNew: resolved !== null\n });\n }\n }\n branches = next;\n }\n return branches;\n}\nfunction readStaticTheme(element, id, source, config, kind = \"Theme\") {\n const moduleId = resolvedModuleId(id);\n const violations = [];\n const css = /* @__PURE__ */ new Map();\n const opening = childNode(element, \"openingElement\");\n const closing = childNode(element, \"closingElement\");\n const span = (node) => ({ id: moduleId, start: node.start, end: node.end });\n let options = [{ test: null, name: void 0 }];\n let contain = false;\n const themeKeyProps = {};\n for (const attribute of childNodes(opening, \"attributes\")) {\n if (attribute.type !== \"JSXAttribute\") {\n violations.push({\n rule: 1,\n code: \"local/unsafe-style-spread\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(1, { component: kind })\n });\n continue;\n }\n const key = jsxAttributeName(attribute);\n if (!key) continue;\n const rawValue = childNode(attribute, \"value\");\n const value = rawValue && rawValue.type === \"JSXExpressionContainer\" ? childNode(rawValue, \"expression\") : rawValue;\n if (kind === \"ThemeUpdate\" && reservedThemeProps[key]) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(4, {\n detail: `the <ThemeUpdate ${key}> prop, which belongs on <Theme>,`\n })\n });\n continue;\n }\n if (kind === \"Theme\" && key === \"name\") {\n const read = value ? readNameOptions(value, source, []) : null;\n if (!read) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the <Theme name> value ${source.slice(attribute.start, attribute.end).replace(/\\s+/g, \" \").trim()}, which is not a literal theme name or a conditional over literal theme names,`\n })\n });\n continue;\n }\n options = read;\n continue;\n }\n if (kind === \"Theme\" && reservedThemeProps[key]) {\n if (!LOWERABLE_RESERVED_PROPS.has(key)) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the <Theme ${key}> prop, which has no compiled form,`\n })\n });\n continue;\n }\n const literal2 = value ? literalOf(value) : true;\n if (typeof literal2 !== \"boolean\") {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a non-literal <Theme ${key}> value,`\n })\n });\n continue;\n }\n if (key === \"contain\") contain = literal2;\n continue;\n }\n if (kind === \"Theme\") {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(attribute),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `the removed <Theme ${key}> inline-value spelling. Use <ThemeUpdate ${key}> around the subtree instead,`\n })\n });\n continue;\n }\n const literal = value ? literalOf(value) : void 0;\n if (typeof literal !== \"string\" && typeof literal !== \"number\") {\n violations.push({\n rule: 3,\n code: \"local/dynamic-style-value\",\n span: span(attribute),\n component: kind,\n message: zeroRuleMessage(3, {\n prop: key,\n component: kind,\n detail: value ? \"a theme value must be a string or number literal at build time\" : \"a theme key needs a value\"\n })\n });\n continue;\n }\n themeKeyProps[key] = literal;\n }\n if (!closing) {\n violations.push({\n rule: 4,\n code: \"local/unsupported-target\",\n span: span(element),\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a self-closing <${kind}>, which has no subtree to theme,`\n })\n });\n }\n const issues = [];\n const themeUpdateConfig = config;\n const inlineValues = kind === \"ThemeUpdate\" && Object.keys(themeKeyProps).length ? getInlineValuesFromProps(\n themeKeyProps,\n themeUpdateConfig,\n (issue) => issues.push(issue)\n ) : null;\n for (const issue of issues) {\n violations.push({\n rule: 3,\n code: \"local/dynamic-style-value\",\n span: span(opening),\n component: kind,\n message: zeroRuleMessage(3, {\n prop: issue.key,\n component: kind,\n detail: issue.message\n })\n });\n }\n const inlineCSS = inlineValues ? getVariablesCSSRules(inlineValues, themeUpdateConfig) : null;\n if (inlineCSS) css.set(inlineCSS.identifier, inlineCSS.rules.join(\"\"));\n if (violations.length) return { node: null, violations, css };\n return {\n node: {\n kind,\n element,\n opening,\n closing,\n options,\n contain,\n layer: inlineValues && inlineCSS ? {\n inlineValues,\n inlineClassName: inlineCSS.identifier\n } : null\n },\n violations,\n css\n };\n}\nfunction lowerStaticTheme(node, chain, rootThemeName, config, id) {\n const moduleId = resolvedModuleId(id);\n const branches = resolveThemeChain(chain, rootThemeName, config);\n if (branches.length > MAX_THEME_BRANCHES) {\n return {\n edits: [],\n violations: [\n {\n rule: 4,\n code: \"local/unsupported-target\",\n span: { id: moduleId, start: node.element.start, end: node.element.end },\n component: \"Theme\",\n message: zeroRuleMessage(4, {\n detail: `a <Theme> chain that enumerates ${branches.length} theme names, past the ${MAX_THEME_BRANCHES} this lowers,`\n })\n }\n ]\n };\n }\n const inlineClass = node.layer?.inlineClassName ?? \"\";\n const classBranches = branches.map((branch) => ({\n test: branch.test,\n value: JSON.stringify(\n [branch.isNew ? getThemeClassNames(branch.name) : \"\", \"is_Theme\", inlineClass].filter(Boolean).join(\" \").replace(/\\s+/g, \" \").trim()\n )\n }));\n const baseStyle = node.contain ? `display:\"contents\",contain:\"strict\"` : `display:\"contents\"`;\n const styleBranches = branches.map((branch) => {\n const theme = config.themes[branch.name];\n const color = branch.isNew && theme ? variableToString(theme.color) : \"\";\n return {\n test: branch.test,\n value: color ? `{color:${JSON.stringify(color)},${baseStyle}}` : `{${baseStyle}}`\n };\n });\n const className = foldBranches(classBranches);\n const style = foldBranches(styleBranches);\n const classAttribute = className.startsWith('\"') ? `className=${className}` : `className={${className}}`;\n const edits = [\n {\n start: node.opening.start,\n end: node.opening.end,\n content: `<span ${classAttribute} style={${style}}>`,\n origin: { id: moduleId, start: node.opening.start, end: node.opening.end }\n }\n ];\n if (node.closing) {\n edits.push({\n start: node.closing.start,\n end: node.closing.end,\n content: `</span>`,\n origin: { id: moduleId, start: node.closing.start, end: node.closing.end }\n });\n }\n return { edits, violations: [] };\n}\nexport {\n foldBranches,\n lowerStaticTheme,\n readStaticTheme,\n resolveThemeChain\n};\n//# sourceMappingURL=theme.js.map\n"],"mappings":";;;;;;AAgBA,MAAM,qBAAqB;AAC3B,MAAM,2CAA2C,IAAI,IAAI,CAAC,QAAQ,SAAS,CAAC;AAC5E,SAAS,iBAAiB,WAAW;CACnC,MAAM,OAAO,UAAU,WAAW,MAAM;CACxC,OAAO,QAAQ,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO;AAC7D;AACA,SAAS,UAAU,MAAM;CACvB,IAAI,CAAC,MAAM,OAAO,KAAK;CACvB,IAAI,KAAK,SAAS,aAAa,OAAO,KAAK,UAAU,UAAU;EAC7D,OAAO,KAAK;CACd;CACA,OAAO,KAAK;AACd;AACA,SAAS,eAAe,MAAM;CAC5B,IAAI,QAAQ;CACZ,QAAQ,OAAO,UAAU;EACvB,IAAI,MAAM,SAAS,oBAAoB,MAAM,SAAS,4BAA4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