@tamagui/static 1.115.1 → 1.115.3

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 (123) hide show
  1. package/dist/check-dep-versions.js +389 -0
  2. package/dist/checkDeps.js +26 -0
  3. package/dist/{constants.cjs → constants.js} +14 -29
  4. package/dist/exports.js +33 -0
  5. package/dist/extractor/accessSafe.js +47 -0
  6. package/dist/extractor/babelParse.js +59 -0
  7. package/dist/extractor/buildClassName.js +72 -0
  8. package/dist/extractor/bundle.js +133 -0
  9. package/dist/extractor/bundleConfig.js +350 -0
  10. package/dist/extractor/{createEvaluator.cjs → createEvaluator.js} +21 -37
  11. package/dist/extractor/createExtractor.js +1217 -0
  12. package/dist/extractor/createLogger.js +32 -0
  13. package/dist/extractor/ensureImportingConcat.js +50 -0
  14. package/dist/extractor/esbuildAliasPlugin.js +36 -0
  15. package/dist/extractor/evaluateAstNode.js +99 -0
  16. package/dist/extractor/extractHelpers.js +109 -0
  17. package/dist/extractor/extractMediaStyle.js +123 -0
  18. package/dist/extractor/extractToClassNames.js +291 -0
  19. package/dist/extractor/extractToNative.js +319 -0
  20. package/dist/extractor/findTopmostFunction.js +32 -0
  21. package/dist/extractor/generatedUid.js +42 -0
  22. package/dist/extractor/getPrefixLogs.js +23 -0
  23. package/dist/extractor/getPropValueFromAttributes.js +65 -0
  24. package/dist/extractor/getSourceModule.js +66 -0
  25. package/dist/extractor/{getStaticBindingsForScope.cjs → getStaticBindingsForScope.js} +61 -66
  26. package/dist/extractor/{getTamaguiConfigPathFromOptionsConfig.cjs → getTamaguiConfigPathFromOptionsConfig.js} +11 -16
  27. package/dist/extractor/{hoistClassNames.cjs → hoistClassNames.js} +32 -31
  28. package/dist/extractor/{literalToAst.cjs → literalToAst.js} +44 -38
  29. package/dist/extractor/{loadFile.cjs → loadFile.js} +6 -3
  30. package/dist/extractor/{loadTamagui.cjs → loadTamagui.js} +78 -99
  31. package/dist/extractor/logLines.js +30 -0
  32. package/dist/extractor/{normalizeTernaries.cjs → normalizeTernaries.js} +29 -38
  33. package/dist/extractor/{propsToFontFamilyCache.cjs → propsToFontFamilyCache.js} +14 -18
  34. package/dist/extractor/regenerateConfig.js +111 -0
  35. package/dist/extractor/{removeUnusedHooks.cjs → removeUnusedHooks.js} +27 -31
  36. package/dist/extractor/{timer.cjs → timer.js} +11 -16
  37. package/dist/extractor/{validHTMLAttributes.cjs → validHTMLAttributes.js} +11 -16
  38. package/dist/extractor/{watchTamaguiConfig.cjs → watchTamaguiConfig.js} +29 -30
  39. package/dist/{getPragmaOptions.cjs → getPragmaOptions.js} +17 -22
  40. package/dist/helpers/memoize.js +33 -0
  41. package/dist/helpers/requireTamaguiCore.js +30 -0
  42. package/dist/index.js +30 -0
  43. package/dist/registerRequire.js +96 -0
  44. package/dist/{server.cjs → server.js} +21 -38
  45. package/dist/setup.js +1 -0
  46. package/dist/types.js +14 -0
  47. package/package.json +16 -16
  48. package/dist/check-dep-versions.cjs +0 -267
  49. package/dist/checkDeps.cjs +0 -32
  50. package/dist/exports.cjs +0 -40
  51. package/dist/extractor/accessSafe.cjs +0 -46
  52. package/dist/extractor/babelParse.cjs +0 -54
  53. package/dist/extractor/buildClassName.cjs +0 -62
  54. package/dist/extractor/bundle.cjs +0 -146
  55. package/dist/extractor/bundleConfig.cjs +0 -322
  56. package/dist/extractor/createExtractor.cjs +0 -1008
  57. package/dist/extractor/createLogger.cjs +0 -45
  58. package/dist/extractor/ensureImportingConcat.cjs +0 -48
  59. package/dist/extractor/esbuildAliasPlugin.cjs +0 -44
  60. package/dist/extractor/evaluateAstNode.cjs +0 -83
  61. package/dist/extractor/extractHelpers.cjs +0 -120
  62. package/dist/extractor/extractMediaStyle.cjs +0 -129
  63. package/dist/extractor/extractToClassNames.cjs +0 -254
  64. package/dist/extractor/extractToNative.cjs +0 -274
  65. package/dist/extractor/findTopmostFunction.cjs +0 -34
  66. package/dist/extractor/generatedUid.cjs +0 -47
  67. package/dist/extractor/getPrefixLogs.cjs +0 -28
  68. package/dist/extractor/getPropValueFromAttributes.cjs +0 -67
  69. package/dist/extractor/getSourceModule.cjs +0 -68
  70. package/dist/extractor/logLines.cjs +0 -35
  71. package/dist/extractor/regenerateConfig.cjs +0 -144
  72. package/dist/helpers/memoize.cjs +0 -37
  73. package/dist/helpers/requireTamaguiCore.cjs +0 -33
  74. package/dist/index.cjs +0 -40
  75. package/dist/registerRequire.cjs +0 -102
  76. package/dist/setup.cjs +0 -0
  77. package/dist/types.cjs +0 -16
  78. /package/dist/{check-dep-versions.cjs.map → check-dep-versions.js.map} +0 -0
  79. /package/dist/{checkDeps.cjs.map → checkDeps.js.map} +0 -0
  80. /package/dist/{constants.cjs.map → constants.js.map} +0 -0
  81. /package/dist/{exports.cjs.map → exports.js.map} +0 -0
  82. /package/dist/extractor/{accessSafe.cjs.map → accessSafe.js.map} +0 -0
  83. /package/dist/extractor/{babelParse.cjs.map → babelParse.js.map} +0 -0
  84. /package/dist/extractor/{buildClassName.cjs.map → buildClassName.js.map} +0 -0
  85. /package/dist/extractor/{bundle.cjs.map → bundle.js.map} +0 -0
  86. /package/dist/extractor/{bundleConfig.cjs.map → bundleConfig.js.map} +0 -0
  87. /package/dist/extractor/{createEvaluator.cjs.map → createEvaluator.js.map} +0 -0
  88. /package/dist/extractor/{createExtractor.cjs.map → createExtractor.js.map} +0 -0
  89. /package/dist/extractor/{createLogger.cjs.map → createLogger.js.map} +0 -0
  90. /package/dist/extractor/{ensureImportingConcat.cjs.map → ensureImportingConcat.js.map} +0 -0
  91. /package/dist/extractor/{esbuildAliasPlugin.cjs.map → esbuildAliasPlugin.js.map} +0 -0
  92. /package/dist/extractor/{evaluateAstNode.cjs.map → evaluateAstNode.js.map} +0 -0
  93. /package/dist/extractor/{extractHelpers.cjs.map → extractHelpers.js.map} +0 -0
  94. /package/dist/extractor/{extractMediaStyle.cjs.map → extractMediaStyle.js.map} +0 -0
  95. /package/dist/extractor/{extractToClassNames.cjs.map → extractToClassNames.js.map} +0 -0
  96. /package/dist/extractor/{extractToNative.cjs.map → extractToNative.js.map} +0 -0
  97. /package/dist/extractor/{findTopmostFunction.cjs.map → findTopmostFunction.js.map} +0 -0
  98. /package/dist/extractor/{generatedUid.cjs.map → generatedUid.js.map} +0 -0
  99. /package/dist/extractor/{getPrefixLogs.cjs.map → getPrefixLogs.js.map} +0 -0
  100. /package/dist/extractor/{getPropValueFromAttributes.cjs.map → getPropValueFromAttributes.js.map} +0 -0
  101. /package/dist/extractor/{getSourceModule.cjs.map → getSourceModule.js.map} +0 -0
  102. /package/dist/extractor/{getStaticBindingsForScope.cjs.map → getStaticBindingsForScope.js.map} +0 -0
  103. /package/dist/extractor/{getTamaguiConfigPathFromOptionsConfig.cjs.map → getTamaguiConfigPathFromOptionsConfig.js.map} +0 -0
  104. /package/dist/extractor/{hoistClassNames.cjs.map → hoistClassNames.js.map} +0 -0
  105. /package/dist/extractor/{literalToAst.cjs.map → literalToAst.js.map} +0 -0
  106. /package/dist/extractor/{loadFile.cjs.map → loadFile.js.map} +0 -0
  107. /package/dist/extractor/{loadTamagui.cjs.map → loadTamagui.js.map} +0 -0
  108. /package/dist/extractor/{logLines.cjs.map → logLines.js.map} +0 -0
  109. /package/dist/extractor/{normalizeTernaries.cjs.map → normalizeTernaries.js.map} +0 -0
  110. /package/dist/extractor/{propsToFontFamilyCache.cjs.map → propsToFontFamilyCache.js.map} +0 -0
  111. /package/dist/extractor/{regenerateConfig.cjs.map → regenerateConfig.js.map} +0 -0
  112. /package/dist/extractor/{removeUnusedHooks.cjs.map → removeUnusedHooks.js.map} +0 -0
  113. /package/dist/extractor/{timer.cjs.map → timer.js.map} +0 -0
  114. /package/dist/extractor/{validHTMLAttributes.cjs.map → validHTMLAttributes.js.map} +0 -0
  115. /package/dist/extractor/{watchTamaguiConfig.cjs.map → watchTamaguiConfig.js.map} +0 -0
  116. /package/dist/{getPragmaOptions.cjs.map → getPragmaOptions.js.map} +0 -0
  117. /package/dist/helpers/{memoize.cjs.map → memoize.js.map} +0 -0
  118. /package/dist/helpers/{requireTamaguiCore.cjs.map → requireTamaguiCore.js.map} +0 -0
  119. /package/dist/{index.cjs.map → index.js.map} +0 -0
  120. /package/dist/{registerRequire.cjs.map → registerRequire.js.map} +0 -0
  121. /package/dist/{server.cjs.map → server.js.map} +0 -0
  122. /package/dist/{setup.cjs.map → setup.js.map} +0 -0
  123. /package/dist/{types.cjs.map → types.js.map} +0 -0
@@ -0,0 +1,42 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var generatedUid_exports = {};
24
+ __export(generatedUid_exports, {
25
+ generateUid: () => generateUid
26
+ });
27
+ module.exports = __toCommonJS(generatedUid_exports);
28
+ var t = __toESM(require("@babel/types"));
29
+ function generateUid(scope, name) {
30
+ if (typeof scope != "object")
31
+ throw "generateUid expects a scope object as its first parameter";
32
+ if (!(typeof name == "string" && name !== ""))
33
+ throw "generateUid expects a valid name as its second parameter";
34
+ name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
35
+ let uid, i = 0;
36
+ do
37
+ i > 1 ? uid = name + i : uid = name, i++;
38
+ while (scope.hasLabel(uid) || scope.hasBinding(uid) || scope.hasGlobal(uid) || scope.hasReference(uid));
39
+ const program = scope.getProgramParent();
40
+ return program.references[uid] = !0, program.uids[uid] = !0, uid;
41
+ }
42
+ //# sourceMappingURL=generatedUid.js.map
@@ -0,0 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var getPrefixLogs_exports = {};
16
+ __export(getPrefixLogs_exports, {
17
+ getPrefixLogs: () => getPrefixLogs
18
+ });
19
+ module.exports = __toCommonJS(getPrefixLogs_exports);
20
+ function getPrefixLogs(options) {
21
+ return options?.prefixLogs ?? ` ${options?.platform || "web"} | `;
22
+ }
23
+ //# sourceMappingURL=getPrefixLogs.js.map
@@ -0,0 +1,65 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var getPropValueFromAttributes_exports = {};
24
+ __export(getPropValueFromAttributes_exports, {
25
+ getPropValueFromAttributes: () => getPropValueFromAttributes
26
+ });
27
+ module.exports = __toCommonJS(getPropValueFromAttributes_exports);
28
+ var import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_accessSafe = require("./accessSafe");
29
+ function getPropValueFromAttributes(propName, attrs) {
30
+ let propIndex = -1, jsxAttr = null;
31
+ for (let idx = -1, len = attrs.length; ++idx < len; ) {
32
+ const attr = attrs[idx];
33
+ if (t.isJSXAttribute(attr) && attr.name && attr.name.name === propName) {
34
+ propIndex = idx, jsxAttr = attr;
35
+ break;
36
+ }
37
+ }
38
+ if (!jsxAttr || jsxAttr.value == null)
39
+ return null;
40
+ let propValue = jsxAttr.value;
41
+ if (t.isJSXExpressionContainer(propValue) && (propValue = propValue.expression), t.isJSXEmptyExpression(propValue))
42
+ return console.error("encountered JSXEmptyExpression"), null;
43
+ const applicableSpreads = attrs.filter(
44
+ // 1. idx is greater than propValue prop index
45
+ // 2. attr is a spread operator
46
+ (attr, idx) => {
47
+ if (t.isJSXSpreadAttribute(attr)) {
48
+ if (t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument))
49
+ return idx > propIndex;
50
+ if (t.isLogicalExpression(attr.argument))
51
+ return !1;
52
+ throw new Error(
53
+ `unsupported spread of type "${attr.argument.type}": ${// @ts-ignore
54
+ (0, import_generator.default)(attr).code}`
55
+ );
56
+ }
57
+ return !1;
58
+ }
59
+ ).map((attr) => attr.argument);
60
+ return applicableSpreads.length > 0 && (propValue = applicableSpreads.reduce(
61
+ (acc, val) => t.logicalExpression("||", (0, import_accessSafe.accessSafe)(val, propName), acc),
62
+ propValue
63
+ )), propValue;
64
+ }
65
+ //# sourceMappingURL=getPropValueFromAttributes.js.map
@@ -0,0 +1,66 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
23
+ var getSourceModule_exports = {};
24
+ __export(getSourceModule_exports, {
25
+ getSourceModule: () => getSourceModule
26
+ });
27
+ module.exports = __toCommonJS(getSourceModule_exports);
28
+ var t = __toESM(require("@babel/types"));
29
+ function getSourceModule(itemName, itemBinding) {
30
+ if (!itemBinding.constant)
31
+ return null;
32
+ let sourceModule, imported, local, destructured, usesImportSyntax = !1;
33
+ const itemNode = itemBinding.path.node;
34
+ if (
35
+ // import x from 'y';
36
+ t.isImportDefaultSpecifier(itemNode) || // import {x} from 'y';
37
+ t.isImportSpecifier(itemNode)
38
+ )
39
+ t.isImportDeclaration(itemBinding.path.parent) && (sourceModule = itemBinding.path.parent.source.value, local = itemNode.local.name, usesImportSyntax = !0, t.isImportSpecifier(itemNode) ? (imported = itemNode.imported.name, destructured = !0) : (imported = itemNode.local.name, destructured = !1));
40
+ else if (t.isVariableDeclarator(itemNode) && itemNode.init != null && t.isCallExpression(itemNode.init) && t.isIdentifier(itemNode.init.callee) && itemNode.init.callee.name === "require" && itemNode.init.arguments.length === 1) {
41
+ const firstArg = itemNode.init.arguments[0];
42
+ if (!t.isStringLiteral(firstArg))
43
+ return null;
44
+ if (sourceModule = firstArg.value, t.isIdentifier(itemNode.id))
45
+ local = itemNode.id.name, imported = itemNode.id.name, destructured = !1;
46
+ else if (t.isObjectPattern(itemNode.id)) {
47
+ for (const objProp of itemNode.id.properties)
48
+ if (t.isObjectProperty(objProp) && t.isIdentifier(objProp.value) && objProp.value.name === itemName) {
49
+ local = objProp.value.name, imported = objProp.key.name, destructured = !0;
50
+ break;
51
+ }
52
+ if (!local || !imported)
53
+ return console.error("could not find prop with value `%s`", itemName), null;
54
+ } else
55
+ return console.error("Unhandled id type: %s", itemNode.id.type), null;
56
+ } else
57
+ return null;
58
+ return {
59
+ destructured,
60
+ imported,
61
+ local,
62
+ sourceModule,
63
+ usesImportSyntax
64
+ };
65
+ }
66
+ //# sourceMappingURL=getSourceModule.js.map
@@ -2,54 +2,38 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
6
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
20
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
16
  // If the importer is in node compatibility mode or this is not an ESM
22
17
  // file that has been converted to a CommonJS file using a Babel-
23
18
  // compatible transform (i.e. "__esModule" has not been set), then set
24
19
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
32
23
  var getStaticBindingsForScope_exports = {};
33
24
  __export(getStaticBindingsForScope_exports, {
34
25
  cleanupBeforeExit: () => cleanupBeforeExit,
35
26
  getStaticBindingsForScope: () => getStaticBindingsForScope
36
27
  });
37
28
  module.exports = __toCommonJS(getStaticBindingsForScope_exports);
38
- var import_node_child_process = require("node:child_process"),
39
- import_node_path = require("node:path"),
40
- t = __toESM(require("@babel/types")),
41
- import_evaluateAstNode = require("./evaluateAstNode.cjs"),
42
- import_getSourceModule = require("./getSourceModule.cjs");
43
- const isLocalImport = path => path.startsWith(".") || path.startsWith("/");
29
+ var import_node_child_process = require("node:child_process"), import_node_path = require("node:path"), t = __toESM(require("@babel/types")), import_evaluateAstNode = require("./evaluateAstNode"), import_getSourceModule = require("./getSourceModule");
30
+ const isLocalImport = (path) => path.startsWith(".") || path.startsWith("/");
44
31
  function resolveImportPath(sourcePath, path) {
45
32
  const sourceDir = (0, import_node_path.dirname)(sourcePath);
46
33
  return isLocalImport(path) ? ((0, import_node_path.extname)(path) === "" && (path += ""), (0, import_node_path.resolve)(sourceDir, path)) : path;
47
34
  }
48
- const cache = /* @__PURE__ */new Map(),
49
- pending = /* @__PURE__ */new Map(),
50
- loadCmd = `${(0, import_node_path.join)(__dirname, "loadFile.js")}`;
51
- let exited = !1,
52
- child = null;
35
+ const cache = /* @__PURE__ */ new Map(), pending = /* @__PURE__ */ new Map(), loadCmd = `${(0, import_node_path.join)(__dirname, "loadFile.js")}`;
36
+ let exited = !1, child = null;
53
37
  function forkChild() {
54
38
  child = (0, import_node_child_process.fork)(loadCmd, [], {
55
39
  execArgv: ["-r", "esbuild-register"],
@@ -64,11 +48,13 @@ process.once("SIGTERM", cleanupBeforeExit);
64
48
  process.once("SIGINT", cleanupBeforeExit);
65
49
  process.once("beforeExit", cleanupBeforeExit);
66
50
  function importModule(path) {
67
- if (child || forkChild(), pending.has(path)) return pending.get(path);
51
+ if (child || forkChild(), pending.has(path))
52
+ return pending.get(path);
68
53
  const promise = new Promise((res, rej) => {
69
54
  if (!child) return;
70
- if (cache.size > 2e3 && cache.clear(), cache.has(path)) return cache.get(path);
71
- const listener = msg => {
55
+ if (cache.size > 2e3 && cache.clear(), cache.has(path))
56
+ return cache.get(path);
57
+ const listener = (msg) => {
72
58
  if (!child || !msg || typeof msg != "string") return;
73
59
  if (msg[0] === "-") {
74
60
  rej(new Error(msg.slice(1)));
@@ -83,45 +69,52 @@ function importModule(path) {
83
69
  return pending.set(path, promise), promise;
84
70
  }
85
71
  async function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bindingCache, shouldPrintDebug) {
86
- const bindings = scope.getAllBindings(),
87
- ret = {},
88
- program = scope.getProgramParent().block;
89
- for (const node of program.body) if (t.isImportDeclaration(node)) {
90
- const importPath = node.source.value;
91
- if (!node.specifiers.length || !isLocalImport(importPath)) continue;
92
- const moduleName = resolveImportPath(sourcePath, importPath);
93
- if (!whitelist.some(test => moduleName.endsWith(test))) continue;
94
- try {
95
- const src = await importModule(moduleName);
96
- if (!src) continue;
97
- for (const specifier of node.specifiers) if (t.isImportSpecifier(specifier) && t.isIdentifier(specifier.imported) && typeof src[specifier.imported.name] < "u") {
98
- const val = src[specifier.local.name];
99
- ret[specifier.local.name] = val;
72
+ const bindings = scope.getAllBindings(), ret = {}, program = scope.getProgramParent().block;
73
+ for (const node of program.body)
74
+ if (t.isImportDeclaration(node)) {
75
+ const importPath = node.source.value;
76
+ if (!node.specifiers.length || !isLocalImport(importPath))
77
+ continue;
78
+ const moduleName = resolveImportPath(sourcePath, importPath);
79
+ if (!whitelist.some((test) => moduleName.endsWith(test))) continue;
80
+ try {
81
+ const src = await importModule(moduleName);
82
+ if (!src) continue;
83
+ for (const specifier of node.specifiers)
84
+ if (t.isImportSpecifier(specifier) && t.isIdentifier(specifier.imported) && typeof src[specifier.imported.name] < "u") {
85
+ const val = src[specifier.local.name];
86
+ ret[specifier.local.name] = val;
87
+ }
88
+ } catch (err) {
89
+ shouldPrintDebug ? console.warn(
90
+ ` | Skipping partial evaluation of constant file: ${moduleName} (DEBUG=tamagui for more)`
91
+ ) : process.env.DEBUG?.startsWith("tamagui") && console.info("Error in partial evaluation", err.message, err.stack);
100
92
  }
101
- } catch (err) {
102
- shouldPrintDebug ? console.warn(` | Skipping partial evaluation of constant file: ${moduleName} (DEBUG=tamagui for more)`) : process.env.DEBUG?.startsWith("tamagui") && console.info("Error in partial evaluation", err.message, err.stack);
103
93
  }
104
- }
105
- if (!bindingCache) throw new Error("BindingCache is a required param");
94
+ if (!bindingCache)
95
+ throw new Error("BindingCache is a required param");
106
96
  for (const k in bindings) {
107
- const binding = bindings[k],
108
- sourceModule = (0, import_getSourceModule.getSourceModule)(k, binding);
97
+ const binding = bindings[k], sourceModule = (0, import_getSourceModule.getSourceModule)(k, binding);
109
98
  if (sourceModule) {
110
- if (!sourceModule.sourceModule) continue;
99
+ if (!sourceModule.sourceModule)
100
+ continue;
111
101
  const moduleName = resolveImportPath(sourcePath, sourceModule.sourceModule);
112
- if (whitelist.some(test => moduleName.endsWith(test))) {
102
+ if (whitelist.some((test) => moduleName.endsWith(test))) {
113
103
  const src = importModule(moduleName);
114
- if (!src) return console.info(` | \u26A0\uFE0F Missing file ${moduleName} via ${sourcePath} import ${sourceModule.sourceModule}?`), {};
104
+ if (!src)
105
+ return console.info(
106
+ ` | \u26A0\uFE0F Missing file ${moduleName} via ${sourcePath} import ${sourceModule.sourceModule}?`
107
+ ), {};
115
108
  sourceModule.destructured ? sourceModule.imported && (ret[k] = src[sourceModule.imported]) : ret[k] = src;
116
109
  }
117
110
  continue;
118
111
  }
119
- const {
120
- parent
121
- } = binding.path;
122
- if (!t.isVariableDeclaration(parent) || parent.kind !== "const") continue;
123
- const dec = parent.declarations.find(d => t.isIdentifier(d.id) && d.id.name === k);
124
- if (!dec || !dec.init) continue;
112
+ const { parent } = binding.path;
113
+ if (!t.isVariableDeclaration(parent) || parent.kind !== "const")
114
+ continue;
115
+ const dec = parent.declarations.find((d) => t.isIdentifier(d.id) && d.id.name === k);
116
+ if (!dec || !dec.init)
117
+ continue;
125
118
  if (typeof dec.id.start != "number" || typeof dec.id.end != "number") {
126
119
  console.error("dec.id.start/end is not a number");
127
120
  continue;
@@ -142,7 +135,9 @@ async function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bind
142
135
  try {
143
136
  ret[k] = (0, import_evaluateAstNode.evaluateAstNode)(dec.init, void 0, shouldPrintDebug), bindingCache[cacheKey] = ret[k];
144
137
  continue;
145
- } catch {}
138
+ } catch {
139
+ }
146
140
  }
147
141
  return ret;
148
- }
142
+ }
143
+ //# sourceMappingURL=getStaticBindingsForScope.js.map
@@ -3,21 +3,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: !0
9
- });
10
- },
11
- __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- return to;
17
- };
18
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
- value: !0
20
- }), mod);
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: !0 });
8
+ }, __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from == "object" || typeof from == "function")
10
+ for (let key of __getOwnPropNames(from))
11
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
21
15
  var getTamaguiConfigPathFromOptionsConfig_exports = {};
22
16
  __export(getTamaguiConfigPathFromOptionsConfig_exports, {
23
17
  getTamaguiConfigPathFromOptionsConfig: () => getTamaguiConfigPathFromOptionsConfig
@@ -26,4 +20,5 @@ module.exports = __toCommonJS(getTamaguiConfigPathFromOptionsConfig_exports);
26
20
  var import_node_path = require("node:path");
27
21
  function getTamaguiConfigPathFromOptionsConfig(config) {
28
22
  return (0, import_node_path.isAbsolute)(config) ? config : (0, import_node_path.join)(process.cwd(), config);
29
- }
23
+ }
24
+ //# sourceMappingURL=getTamaguiConfigPathFromOptionsConfig.js.map
@@ -2,33 +2,24 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
6
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
20
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
16
  // If the importer is in node compatibility mode or this is not an ESM
22
17
  // file that has been converted to a CommonJS file using a Babel-
23
18
  // compatible transform (i.e. "__esModule" has not been set), then set
24
19
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
32
23
  var hoistClassNames_exports = {};
33
24
  __export(hoistClassNames_exports, {
34
25
  hoistClassNames: () => hoistClassNames
@@ -38,25 +29,35 @@ var t = __toESM(require("@babel/types"));
38
29
  function hoistClassNames(path, existing, expr) {
39
30
  const hoist = hoistClassNames.bind(null, path, existing);
40
31
  if (t.isStringLiteral(expr)) {
41
- if (expr.value.trim() === "") return expr;
42
- if (existing[expr.value]) return existing[expr.value];
32
+ if (expr.value.trim() === "")
33
+ return expr;
34
+ if (existing[expr.value])
35
+ return existing[expr.value];
43
36
  const identifier = replaceStringWithVariable(expr);
44
37
  return existing[expr.value] = identifier, identifier;
45
38
  }
46
39
  if (t.isBinaryExpression(expr)) {
47
- if (t.isPrivateName(expr.left)) throw new Error("no private name");
40
+ if (t.isPrivateName(expr.left))
41
+ throw new Error("no private name");
48
42
  return t.binaryExpression(expr.operator, hoist(expr.left), hoist(expr.right));
49
43
  }
50
- if (t.isLogicalExpression(expr)) return t.logicalExpression(expr.operator, hoist(expr.left), hoist(expr.right));
51
- if (t.isConditionalExpression(expr)) return t.conditionalExpression(expr.test, hoist(expr.consequent), hoist(expr.alternate));
44
+ if (t.isLogicalExpression(expr))
45
+ return t.logicalExpression(expr.operator, hoist(expr.left), hoist(expr.right));
46
+ if (t.isConditionalExpression(expr))
47
+ return t.conditionalExpression(
48
+ expr.test,
49
+ hoist(expr.consequent),
50
+ hoist(expr.alternate)
51
+ );
52
52
  return expr;
53
53
  function replaceStringWithVariable(str) {
54
- const uid = path.scope.generateUidIdentifier("cn"),
55
- parent = path.findParent(path2 => path2.isProgram());
54
+ const uid = path.scope.generateUidIdentifier("cn"), parent = path.findParent((path2) => path2.isProgram());
56
55
  if (!parent) throw new Error("no program?");
57
56
  const variable = t.variableDeclaration("const", [
58
- // adding a space for extra safety
59
- t.variableDeclarator(uid, t.stringLiteral(` ${str.value}`))]);
57
+ // adding a space for extra safety
58
+ t.variableDeclarator(uid, t.stringLiteral(` ${str.value}`))
59
+ ]);
60
60
  return parent.unshiftContainer("body", variable), uid;
61
61
  }
62
- }
62
+ }
63
+ //# sourceMappingURL=hoistClassNames.js.map
@@ -2,33 +2,24 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
6
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
- get: () => from[key],
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- return to;
19
- };
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
20
15
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
16
  // If the importer is in node compatibility mode or this is not an ESM
22
17
  // file that has been converted to a CommonJS file using a Babel-
23
18
  // compatible transform (i.e. "__esModule" has not been set), then set
24
19
  // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
32
23
  var literalToAst_exports = {};
33
24
  __export(literalToAst_exports, {
34
25
  astToLiteral: () => astToLiteral,
@@ -37,7 +28,8 @@ __export(literalToAst_exports, {
37
28
  module.exports = __toCommonJS(literalToAst_exports);
38
29
  var t = __toESM(require("@babel/types"));
39
30
  function literalToAst(literal) {
40
- if (literal === null) return t.nullLiteral();
31
+ if (literal === null)
32
+ return t.nullLiteral();
41
33
  switch (typeof literal) {
42
34
  case "function":
43
35
  throw new Error("Unsupported");
@@ -50,35 +42,49 @@ function literalToAst(literal) {
50
42
  case "undefined":
51
43
  return t.unaryExpression("void", t.numericLiteral(0), !0);
52
44
  default:
53
- return Array.isArray(literal) ? t.arrayExpression(literal.map(literalToAst)) : t.objectExpression(Object.keys(literal).filter(k => typeof literal[k] < "u").map(k => t.objectProperty(t.stringLiteral(k), literalToAst(literal[k]))));
45
+ return Array.isArray(literal) ? t.arrayExpression(literal.map(literalToAst)) : t.objectExpression(
46
+ Object.keys(literal).filter((k) => typeof literal[k] < "u").map((k) => t.objectProperty(t.stringLiteral(k), literalToAst(literal[k])))
47
+ );
54
48
  }
55
49
  }
56
50
  const easyPeasies = ["BooleanLiteral", "StringLiteral", "NumericLiteral"];
57
51
  function astToLiteral(node) {
58
52
  if (node) {
59
- if (easyPeasies.includes(node.type)) return node.value;
53
+ if (easyPeasies.includes(node.type))
54
+ return node.value;
60
55
  if (!(node.name === "undefined" && !node.value)) {
61
- if (t.isNullLiteral(node)) return null;
62
- if (t.isObjectExpression(node)) return computeProps(node.properties);
63
- if (t.isArrayExpression(node)) return node.elements.reduce(
64
- // @ts-ignore
65
- (acc, element) => [...acc, ...(element?.type === "SpreadElement" ? astToLiteral(element.argument) : [astToLiteral(element)])], []);
56
+ if (t.isNullLiteral(node))
57
+ return null;
58
+ if (t.isObjectExpression(node))
59
+ return computeProps(node.properties);
60
+ if (t.isArrayExpression(node))
61
+ return node.elements.reduce(
62
+ // @ts-ignore
63
+ (acc, element) => [
64
+ ...acc,
65
+ ...element?.type === "SpreadElement" ? astToLiteral(element.argument) : [astToLiteral(element)]
66
+ ],
67
+ []
68
+ );
66
69
  }
67
70
  }
68
71
  }
69
72
  function computeProps(props) {
70
73
  return props.reduce((acc, prop) => {
71
- if (prop.type === "SpreadElement") return {
72
- ...acc,
73
- ...astToLiteral(prop.argument)
74
- };
75
- if (prop.type !== "ObjectMethod") {
76
- const val = astToLiteral(prop.value);
77
- if (val !== void 0) return {
74
+ if (prop.type === "SpreadElement")
75
+ return {
78
76
  ...acc,
79
- [prop.key.name]: val
77
+ ...astToLiteral(prop.argument)
80
78
  };
79
+ if (prop.type !== "ObjectMethod") {
80
+ const val = astToLiteral(prop.value);
81
+ if (val !== void 0)
82
+ return {
83
+ ...acc,
84
+ [prop.key.name]: val
85
+ };
81
86
  }
82
87
  return acc;
83
88
  }, {});
84
- }
89
+ }
90
+ //# sourceMappingURL=literalToAst.js.map