@tamagui/static 1.89.26 → 1.89.27-1708113113238

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/cjs/constants.native.js +4 -4
  2. package/dist/cjs/constants.native.js.map +3 -3
  3. package/dist/cjs/extractor/accessSafe.native.js +1 -5
  4. package/dist/cjs/extractor/accessSafe.native.js.map +3 -3
  5. package/dist/cjs/extractor/babelParse.native.js +5 -8
  6. package/dist/cjs/extractor/babelParse.native.js.map +3 -3
  7. package/dist/cjs/extractor/buildClassName.native.js +31 -42
  8. package/dist/cjs/extractor/buildClassName.native.js.map +3 -3
  9. package/dist/cjs/extractor/bundle.js +6 -4
  10. package/dist/cjs/extractor/bundle.js.map +1 -1
  11. package/dist/cjs/extractor/bundle.native.js +321 -56
  12. package/dist/cjs/extractor/bundle.native.js.map +3 -3
  13. package/dist/cjs/extractor/bundleConfig.native.js +499 -187
  14. package/dist/cjs/extractor/bundleConfig.native.js.map +3 -3
  15. package/dist/cjs/extractor/createEvaluator.native.js +9 -11
  16. package/dist/cjs/extractor/createEvaluator.native.js.map +3 -3
  17. package/dist/cjs/extractor/createExtractor.native.js +1240 -906
  18. package/dist/cjs/extractor/createExtractor.native.js.map +3 -3
  19. package/dist/cjs/extractor/ensureImportingConcat.native.js +11 -17
  20. package/dist/cjs/extractor/ensureImportingConcat.native.js.map +3 -3
  21. package/dist/cjs/extractor/esbuildAliasPlugin.native.js +22 -11
  22. package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +3 -3
  23. package/dist/cjs/extractor/evaluateAstNode.native.js +15 -21
  24. package/dist/cjs/extractor/evaluateAstNode.native.js.map +3 -3
  25. package/dist/cjs/extractor/extractHelpers.native.js +146 -38
  26. package/dist/cjs/extractor/extractHelpers.native.js.map +3 -3
  27. package/dist/cjs/extractor/extractMediaStyle.native.js +127 -54
  28. package/dist/cjs/extractor/extractMediaStyle.native.js.map +3 -3
  29. package/dist/cjs/extractor/extractToClassNames.native.js +449 -252
  30. package/dist/cjs/extractor/extractToClassNames.native.js.map +3 -3
  31. package/dist/cjs/extractor/findTopmostFunction.native.js +4 -4
  32. package/dist/cjs/extractor/findTopmostFunction.native.js.map +3 -3
  33. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +415 -54
  34. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  35. package/dist/cjs/extractor/generatedUid.native.js +2 -2
  36. package/dist/cjs/extractor/generatedUid.native.js.map +3 -3
  37. package/dist/cjs/extractor/getPrefixLogs.native.js +2 -1
  38. package/dist/cjs/extractor/getPrefixLogs.native.js.map +3 -3
  39. package/dist/cjs/extractor/getPropValueFromAttributes.native.js +16 -19
  40. package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +3 -3
  41. package/dist/cjs/extractor/getSourceModule.native.js +20 -7
  42. package/dist/cjs/extractor/getSourceModule.native.js.map +3 -3
  43. package/dist/cjs/extractor/getStaticBindingsForScope.native.js +336 -94
  44. package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +3 -3
  45. package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  46. package/dist/cjs/extractor/hoistClassNames.native.js +8 -10
  47. package/dist/cjs/extractor/hoistClassNames.native.js.map +3 -3
  48. package/dist/cjs/extractor/literalToAst.native.js +89 -19
  49. package/dist/cjs/extractor/literalToAst.native.js.map +3 -3
  50. package/dist/cjs/extractor/loadFile.native.js +16 -8
  51. package/dist/cjs/extractor/loadFile.native.js.map +3 -3
  52. package/dist/cjs/extractor/loadTamagui.js +3 -3
  53. package/dist/cjs/extractor/loadTamagui.js.map +1 -1
  54. package/dist/cjs/extractor/loadTamagui.native.js +667 -192
  55. package/dist/cjs/extractor/loadTamagui.native.js.map +3 -3
  56. package/dist/cjs/extractor/logLines.native.js +24 -6
  57. package/dist/cjs/extractor/logLines.native.js.map +3 -3
  58. package/dist/cjs/extractor/normalizeTernaries.native.js +71 -20
  59. package/dist/cjs/extractor/normalizeTernaries.native.js.map +3 -3
  60. package/dist/cjs/extractor/propsToFontFamilyCache.native.js +3 -3
  61. package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +3 -3
  62. package/dist/cjs/extractor/removeUnusedHooks.native.js +69 -36
  63. package/dist/cjs/extractor/removeUnusedHooks.native.js.map +3 -3
  64. package/dist/cjs/extractor/timer.native.js +10 -9
  65. package/dist/cjs/extractor/timer.native.js.map +3 -3
  66. package/dist/cjs/extractor/validHTMLAttributes.native.js +1 -1
  67. package/dist/cjs/extractor/validHTMLAttributes.native.js.map +3 -3
  68. package/dist/cjs/getPragmaOptions.native.js +4 -9
  69. package/dist/cjs/getPragmaOptions.native.js.map +3 -3
  70. package/dist/cjs/helpers/memoize.native.js +5 -3
  71. package/dist/cjs/helpers/memoize.native.js.map +3 -3
  72. package/dist/cjs/helpers/requireTamaguiCore.native.js +2 -1
  73. package/dist/cjs/helpers/requireTamaguiCore.native.js.map +3 -3
  74. package/dist/cjs/index.native.js.map +2 -2
  75. package/dist/cjs/minifyCSS.native.js.map +3 -3
  76. package/dist/cjs/registerRequire.native.js +56 -28
  77. package/dist/cjs/registerRequire.native.js.map +3 -3
  78. package/dist/cjs/server.native.js +175 -21
  79. package/dist/cjs/server.native.js.map +3 -3
  80. package/dist/cjs/setup.native.js.map +3 -3
  81. package/dist/cjs/static.native.js.map +2 -2
  82. package/dist/cjs/types.native.js.map +2 -2
  83. package/dist/cjs/webpackPlugin.native.js +26 -5
  84. package/dist/cjs/webpackPlugin.native.js.map +3 -3
  85. package/dist/esm/constants.native.js +4 -3
  86. package/dist/esm/constants.native.js.map +3 -3
  87. package/dist/esm/extractor/accessSafe.native.js +1 -5
  88. package/dist/esm/extractor/accessSafe.native.js.map +3 -3
  89. package/dist/esm/extractor/babelParse.native.js +5 -7
  90. package/dist/esm/extractor/babelParse.native.js.map +3 -3
  91. package/dist/esm/extractor/buildClassName.native.js +31 -41
  92. package/dist/esm/extractor/buildClassName.native.js.map +3 -3
  93. package/dist/esm/extractor/bundle.js +6 -4
  94. package/dist/esm/extractor/bundle.js.map +1 -1
  95. package/dist/esm/extractor/bundle.mjs +7 -5
  96. package/dist/esm/extractor/bundle.native.js +321 -56
  97. package/dist/esm/extractor/bundle.native.js.map +3 -3
  98. package/dist/esm/extractor/bundleConfig.native.js +499 -187
  99. package/dist/esm/extractor/bundleConfig.native.js.map +3 -3
  100. package/dist/esm/extractor/createEvaluator.native.js +9 -11
  101. package/dist/esm/extractor/createEvaluator.native.js.map +3 -3
  102. package/dist/esm/extractor/createExtractor.native.js +1241 -916
  103. package/dist/esm/extractor/createExtractor.native.js.map +3 -3
  104. package/dist/esm/extractor/ensureImportingConcat.native.js +11 -16
  105. package/dist/esm/extractor/ensureImportingConcat.native.js.map +3 -3
  106. package/dist/esm/extractor/esbuildAliasPlugin.native.js +22 -11
  107. package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +3 -3
  108. package/dist/esm/extractor/evaluateAstNode.native.js +15 -21
  109. package/dist/esm/extractor/evaluateAstNode.native.js.map +3 -3
  110. package/dist/esm/extractor/extractHelpers.native.js +146 -38
  111. package/dist/esm/extractor/extractHelpers.native.js.map +3 -3
  112. package/dist/esm/extractor/extractMediaStyle.native.js +127 -54
  113. package/dist/esm/extractor/extractMediaStyle.native.js.map +3 -3
  114. package/dist/esm/extractor/extractToClassNames.native.js +449 -252
  115. package/dist/esm/extractor/extractToClassNames.native.js.map +3 -3
  116. package/dist/esm/extractor/findTopmostFunction.native.js +4 -4
  117. package/dist/esm/extractor/findTopmostFunction.native.js.map +3 -3
  118. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +415 -54
  119. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
  120. package/dist/esm/extractor/generatedUid.native.js +2 -2
  121. package/dist/esm/extractor/generatedUid.native.js.map +3 -3
  122. package/dist/esm/extractor/getPrefixLogs.native.js +2 -1
  123. package/dist/esm/extractor/getPrefixLogs.native.js.map +3 -3
  124. package/dist/esm/extractor/getPropValueFromAttributes.native.js +16 -19
  125. package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +3 -3
  126. package/dist/esm/extractor/getSourceModule.native.js +20 -7
  127. package/dist/esm/extractor/getSourceModule.native.js.map +3 -3
  128. package/dist/esm/extractor/getStaticBindingsForScope.native.js +336 -94
  129. package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +3 -3
  130. package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
  131. package/dist/esm/extractor/hoistClassNames.native.js +8 -10
  132. package/dist/esm/extractor/hoistClassNames.native.js.map +3 -3
  133. package/dist/esm/extractor/literalToAst.native.js +89 -19
  134. package/dist/esm/extractor/literalToAst.native.js.map +3 -3
  135. package/dist/esm/extractor/loadFile.native.js +16 -8
  136. package/dist/esm/extractor/loadFile.native.js.map +3 -3
  137. package/dist/esm/extractor/loadTamagui.js +1 -2
  138. package/dist/esm/extractor/loadTamagui.js.map +1 -1
  139. package/dist/esm/extractor/loadTamagui.mjs +5 -3
  140. package/dist/esm/extractor/loadTamagui.native.js +668 -203
  141. package/dist/esm/extractor/loadTamagui.native.js.map +3 -3
  142. package/dist/esm/extractor/logLines.native.js +24 -6
  143. package/dist/esm/extractor/logLines.native.js.map +3 -3
  144. package/dist/esm/extractor/normalizeTernaries.native.js +71 -20
  145. package/dist/esm/extractor/normalizeTernaries.native.js.map +3 -3
  146. package/dist/esm/extractor/propsToFontFamilyCache.native.js +3 -3
  147. package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +3 -3
  148. package/dist/esm/extractor/removeUnusedHooks.native.js +69 -35
  149. package/dist/esm/extractor/removeUnusedHooks.native.js.map +3 -3
  150. package/dist/esm/extractor/timer.native.js +10 -9
  151. package/dist/esm/extractor/timer.native.js.map +3 -3
  152. package/dist/esm/extractor/validHTMLAttributes.native.js +1 -1
  153. package/dist/esm/extractor/validHTMLAttributes.native.js.map +3 -3
  154. package/dist/esm/getPragmaOptions.native.js +4 -9
  155. package/dist/esm/getPragmaOptions.native.js.map +3 -3
  156. package/dist/esm/helpers/memoize.native.js +5 -3
  157. package/dist/esm/helpers/memoize.native.js.map +3 -3
  158. package/dist/esm/helpers/requireTamaguiCore.native.js +2 -1
  159. package/dist/esm/helpers/requireTamaguiCore.native.js.map +3 -3
  160. package/dist/esm/index.native.js.map +1 -1
  161. package/dist/esm/minifyCSS.native.js.map +3 -3
  162. package/dist/esm/registerRequire.native.js +56 -28
  163. package/dist/esm/registerRequire.native.js.map +3 -3
  164. package/dist/esm/server.native.js +175 -21
  165. package/dist/esm/server.native.js.map +3 -3
  166. package/dist/esm/setup.native.js.map +3 -3
  167. package/dist/esm/static.native.js.map +3 -3
  168. package/dist/esm/webpackPlugin.native.js +26 -5
  169. package/dist/esm/webpackPlugin.native.js.map +3 -3
  170. package/package.json +14 -15
  171. package/src/extractor/bundle.ts +5 -2
  172. package/src/extractor/loadTamagui.ts +3 -2
  173. package/types/extractor/bundle.d.ts.map +1 -1
  174. package/types/extractor/loadTamagui.d.ts.map +1 -1
  175. package/tamagui.tsconfig.json +0 -5
@@ -32,129 +32,457 @@ __export(loadTamagui_exports, {
32
32
  watchTamaguiConfig: () => watchTamaguiConfig
33
33
  });
34
34
  module.exports = __toCommonJS(loadTamagui_exports);
35
- var import_fs = require("fs"), import_path = require("path"), import_cli_color = require("@tamagui/cli-color"), import_config_default = require("@tamagui/config-default"), import_esbuild = __toESM(require("esbuild")), import_fs_extra = require("fs-extra"), import_constants = require("../constants"), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_minifyCSS = require("../minifyCSS"), import_registerRequire = require("../registerRequire"), import_bundleConfig = require("./bundleConfig"), import_generateTamaguiStudioConfig = require("./generateTamaguiStudioConfig"), import_getTamaguiConfigPathFromOptionsConfig = require("./getTamaguiConfigPathFromOptionsConfig"), import_promises = require("fs/promises");
36
- const getFilledOptions = (propsIn) => ({
37
- // defaults
38
- platform: "native",
39
- config: "tamagui.config.ts",
40
- components: ["tamagui"],
41
- ...propsIn
42
- });
43
- async function loadTamagui(propsIn) {
44
- const props = getFilledOptions(propsIn), bundleInfo = await (0, import_bundleConfig.getBundledConfig)(props);
45
- if (!bundleInfo)
46
- return console.warn(
47
- "No bundled config generated, maybe an error in bundling. Set DEBUG=tamagui and re-run to get logs."
48
- ), null;
49
- if (await generateThemesAndLog(props, !0), !(0, import_bundleConfig.hasBundledConfigChanged)())
50
- return bundleInfo;
51
- if (bundleInfo) {
52
- const { createTamagui } = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform), config = createTamagui(bundleInfo.tamaguiConfig), { outputCSS } = props;
53
- if (outputCSS && props.platform === "web") {
54
- const flush = async () => {
55
- (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [tamagui] output css: ${outputCSS}
56
- `), await (0, import_fs_extra.writeFile)(outputCSS, css);
57
- }, cssOut = config.getCSS(), css = props.disableMinifyCSS === !1 ? (0, import_minifyCSS.minifyCSS)(cssOut).code : cssOut;
35
+ var import_fs = require("fs"), import_path = require("path"), import_cli_color = require("@tamagui/cli-color"), import_esbuild = __toESM(require("esbuild")), import_fs_extra = require("fs-extra"), import_constants = require("../constants"), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_minifyCSS = require("../minifyCSS"), import_registerRequire = require("../registerRequire"), import_bundleConfig = require("./bundleConfig"), import_generateTamaguiStudioConfig = require("./generateTamaguiStudioConfig"), import_getTamaguiConfigPathFromOptionsConfig = require("./getTamaguiConfigPathFromOptionsConfig"), import_promises = require("fs/promises");
36
+ function _array_like_to_array(arr, len) {
37
+ (len == null || len > arr.length) && (len = arr.length);
38
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
39
+ arr2[i] = arr[i];
40
+ return arr2;
41
+ }
42
+ function _array_without_holes(arr) {
43
+ if (Array.isArray(arr))
44
+ return _array_like_to_array(arr);
45
+ }
46
+ function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
47
+ try {
48
+ var info = gen[key](arg), value = info.value;
49
+ } catch (error) {
50
+ reject(error);
51
+ return;
52
+ }
53
+ info.done ? resolve2(value) : Promise.resolve(value).then(_next, _throw);
54
+ }
55
+ function _async_to_generator(fn) {
56
+ return function() {
57
+ var self = this, args = arguments;
58
+ return new Promise(function(resolve2, reject) {
59
+ var gen = fn.apply(self, args);
60
+ function _next(value) {
61
+ asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
62
+ }
63
+ function _throw(err) {
64
+ asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
65
+ }
66
+ _next(void 0);
67
+ });
68
+ };
69
+ }
70
+ function _define_property(obj, key, value) {
71
+ return key in obj ? Object.defineProperty(obj, key, {
72
+ value,
73
+ enumerable: !0,
74
+ configurable: !0,
75
+ writable: !0
76
+ }) : obj[key] = value, obj;
77
+ }
78
+ function _instanceof(left, right) {
79
+ return right != null && typeof Symbol < "u" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;
80
+ }
81
+ function _iterable_to_array(iter) {
82
+ if (typeof Symbol < "u" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
83
+ return Array.from(iter);
84
+ }
85
+ function _non_iterable_spread() {
86
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
87
+ }
88
+ function _object_spread(target) {
89
+ for (var i = 1; i < arguments.length; i++) {
90
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
91
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
92
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
93
+ }))), ownKeys2.forEach(function(key) {
94
+ _define_property(target, key, source[key]);
95
+ });
96
+ }
97
+ return target;
98
+ }
99
+ function ownKeys(object, enumerableOnly) {
100
+ var keys = Object.keys(object);
101
+ if (Object.getOwnPropertySymbols) {
102
+ var symbols = Object.getOwnPropertySymbols(object);
103
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
104
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
105
+ })), keys.push.apply(keys, symbols);
106
+ }
107
+ return keys;
108
+ }
109
+ function _object_spread_props(target, source) {
110
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
111
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
112
+ }), target;
113
+ }
114
+ function _object_without_properties(source, excluded) {
115
+ if (source == null)
116
+ return {};
117
+ var target = _object_without_properties_loose(source, excluded), key, i;
118
+ if (Object.getOwnPropertySymbols) {
119
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
120
+ for (i = 0; i < sourceSymbolKeys.length; i++)
121
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
122
+ }
123
+ return target;
124
+ }
125
+ function _object_without_properties_loose(source, excluded) {
126
+ if (source == null)
127
+ return {};
128
+ var target = {}, sourceKeys = Object.keys(source), key, i;
129
+ for (i = 0; i < sourceKeys.length; i++)
130
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
131
+ return target;
132
+ }
133
+ function _to_consumable_array(arr) {
134
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
135
+ }
136
+ function _unsupported_iterable_to_array(o, minLen) {
137
+ if (o) {
138
+ if (typeof o == "string")
139
+ return _array_like_to_array(o, minLen);
140
+ var n = Object.prototype.toString.call(o).slice(8, -1);
141
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
142
+ return Array.from(n);
143
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
144
+ return _array_like_to_array(o, minLen);
145
+ }
146
+ }
147
+ function _ts_generator(thisArg, body) {
148
+ var f, y, t, g, _ = {
149
+ label: 0,
150
+ sent: function() {
151
+ if (t[0] & 1)
152
+ throw t[1];
153
+ return t[1];
154
+ },
155
+ trys: [],
156
+ ops: []
157
+ };
158
+ return g = {
159
+ next: verb(0),
160
+ throw: verb(1),
161
+ return: verb(2)
162
+ }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
163
+ return this;
164
+ }), g;
165
+ function verb(n) {
166
+ return function(v) {
167
+ return step([
168
+ n,
169
+ v
170
+ ]);
171
+ };
172
+ }
173
+ function step(op) {
174
+ if (f)
175
+ throw new TypeError("Generator is already executing.");
176
+ for (; _; )
58
177
  try {
59
- await (0, import_promises.readFile)(outputCSS, "utf8") === css || await flush();
60
- } catch {
61
- await flush();
178
+ if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
179
+ return t;
180
+ switch (y = 0, t && (op = [
181
+ op[0] & 2,
182
+ t.value
183
+ ]), op[0]) {
184
+ case 0:
185
+ case 1:
186
+ t = op;
187
+ break;
188
+ case 4:
189
+ return _.label++, {
190
+ value: op[1],
191
+ done: !1
192
+ };
193
+ case 5:
194
+ _.label++, y = op[1], op = [
195
+ 0
196
+ ];
197
+ continue;
198
+ case 7:
199
+ op = _.ops.pop(), _.trys.pop();
200
+ continue;
201
+ default:
202
+ if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
203
+ _ = 0;
204
+ continue;
205
+ }
206
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
207
+ _.label = op[1];
208
+ break;
209
+ }
210
+ if (op[0] === 6 && _.label < t[1]) {
211
+ _.label = t[1], t = op;
212
+ break;
213
+ }
214
+ if (t && _.label < t[2]) {
215
+ _.label = t[2], _.ops.push(op);
216
+ break;
217
+ }
218
+ t[2] && _.ops.pop(), _.trys.pop();
219
+ continue;
220
+ }
221
+ op = body.call(thisArg, _);
222
+ } catch (e) {
223
+ op = [
224
+ 6,
225
+ e
226
+ ], y = 0;
227
+ } finally {
228
+ f = t = 0;
62
229
  }
63
- }
230
+ if (op[0] & 5)
231
+ throw op[1];
232
+ return {
233
+ value: op[0] ? op[1] : void 0,
234
+ done: !0
235
+ };
64
236
  }
65
- return process.env.NODE_ENV === "development" && await (0, import_generateTamaguiStudioConfig.generateTamaguiStudioConfig)(props, bundleInfo), bundleInfo;
66
237
  }
67
- let waiting = !1, hasLoggedOnce = !1;
68
- const generateThemesAndLog = async (options, force = !1) => {
69
- if (!waiting && options.themeBuilder)
70
- try {
71
- waiting = !0, await new Promise((res) => setTimeout(res, 30));
72
- const didGenerate = await (0, import_generateTamaguiStudioConfig.generateTamaguiThemes)(options, force);
73
- !hasLoggedOnce && didGenerate && (hasLoggedOnce = !0, (0, import_cli_color.colorLog)(
74
- import_cli_color.Color.FgYellow,
75
- `
76
- \u27A1 [tamagui] generated themes: ${(0, import_path.relative)(
77
- process.cwd(),
78
- options.themeBuilder.output
79
- )}`
80
- ));
81
- } finally {
82
- waiting = !1;
83
- }
84
- }, last = {}, lastVersion = {};
238
+ var getFilledOptions = function(propsIn) {
239
+ return _object_spread({
240
+ // defaults
241
+ platform: "native",
242
+ config: "tamagui.config.ts",
243
+ components: [
244
+ "tamagui"
245
+ ]
246
+ }, propsIn);
247
+ };
248
+ function loadTamagui(propsIn) {
249
+ return _loadTamagui.apply(this, arguments);
250
+ }
251
+ function _loadTamagui() {
252
+ return _loadTamagui = _async_to_generator(function(propsIn) {
253
+ var props, bundleInfo, createTamagui, config, outputCSS, flush, cssOut, css, e;
254
+ return _ts_generator(this, function(_state) {
255
+ switch (_state.label) {
256
+ case 0:
257
+ return props = getFilledOptions(propsIn), [
258
+ 4,
259
+ (0, import_bundleConfig.getBundledConfig)(props)
260
+ ];
261
+ case 1:
262
+ return bundleInfo = _state.sent(), bundleInfo ? [
263
+ 4,
264
+ generateThemesAndLog(props, !0)
265
+ ] : (console.warn("No bundled config generated, maybe an error in bundling. Set DEBUG=tamagui and re-run to get logs."), [
266
+ 2,
267
+ null
268
+ ]);
269
+ case 2:
270
+ if (_state.sent(), !(0, import_bundleConfig.hasBundledConfigChanged)())
271
+ return [
272
+ 2,
273
+ bundleInfo
274
+ ];
275
+ if (!bundleInfo)
276
+ return [
277
+ 3,
278
+ 10
279
+ ];
280
+ if (createTamagui = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform).createTamagui, config = createTamagui(bundleInfo.tamaguiConfig), outputCSS = props.outputCSS, !(outputCSS && props.platform === "web"))
281
+ return [
282
+ 3,
283
+ 10
284
+ ];
285
+ flush = function() {
286
+ var _ref = _async_to_generator(function() {
287
+ return _ts_generator(this, function(_state2) {
288
+ switch (_state2.label) {
289
+ case 0:
290
+ return (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, " \u27A1 [tamagui] output css: ".concat(outputCSS, `
291
+ `)), [
292
+ 4,
293
+ (0, import_fs_extra.writeFile)(outputCSS, css)
294
+ ];
295
+ case 1:
296
+ return _state2.sent(), [
297
+ 2
298
+ ];
299
+ }
300
+ });
301
+ });
302
+ return function() {
303
+ return _ref.apply(this, arguments);
304
+ };
305
+ }(), cssOut = config.getCSS(), css = props.disableMinifyCSS === !1 ? (0, import_minifyCSS.minifyCSS)(cssOut).code : cssOut, _state.label = 3;
306
+ case 3:
307
+ return _state.trys.push([
308
+ 3,
309
+ 8,
310
+ ,
311
+ 10
312
+ ]), [
313
+ 4,
314
+ (0, import_promises.readFile)(outputCSS, "utf8")
315
+ ];
316
+ case 4:
317
+ return _state.sent() !== css ? [
318
+ 3,
319
+ 5
320
+ ] : [
321
+ 3,
322
+ 7
323
+ ];
324
+ case 5:
325
+ return [
326
+ 4,
327
+ flush()
328
+ ];
329
+ case 6:
330
+ _state.sent(), _state.label = 7;
331
+ case 7:
332
+ return [
333
+ 3,
334
+ 10
335
+ ];
336
+ case 8:
337
+ return e = _state.sent(), [
338
+ 4,
339
+ flush()
340
+ ];
341
+ case 9:
342
+ return _state.sent(), [
343
+ 3,
344
+ 10
345
+ ];
346
+ case 10:
347
+ return process.env.NODE_ENV !== "development" ? [
348
+ 3,
349
+ 12
350
+ ] : [
351
+ 4,
352
+ (0, import_generateTamaguiStudioConfig.generateTamaguiStudioConfig)(props, bundleInfo)
353
+ ];
354
+ case 11:
355
+ _state.sent(), _state.label = 12;
356
+ case 12:
357
+ return [
358
+ 2,
359
+ bundleInfo
360
+ ];
361
+ }
362
+ });
363
+ }), _loadTamagui.apply(this, arguments);
364
+ }
365
+ var waiting = !1, hasLoggedOnce = !1, generateThemesAndLog = function() {
366
+ var _ref = _async_to_generator(function(options) {
367
+ var force, didGenerate, whitespaceBefore, _arguments = arguments;
368
+ return _ts_generator(this, function(_state) {
369
+ switch (_state.label) {
370
+ case 0:
371
+ if (force = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : !1, waiting)
372
+ return [
373
+ 2
374
+ ];
375
+ if (!options.themeBuilder)
376
+ return [
377
+ 2
378
+ ];
379
+ _state.label = 1;
380
+ case 1:
381
+ return _state.trys.push([
382
+ 1,
383
+ ,
384
+ 4,
385
+ 5
386
+ ]), waiting = !0, [
387
+ 4,
388
+ new Promise(function(res) {
389
+ return setTimeout(res, 30);
390
+ })
391
+ ];
392
+ case 2:
393
+ return _state.sent(), [
394
+ 4,
395
+ (0, import_generateTamaguiStudioConfig.generateTamaguiThemes)(options, force)
396
+ ];
397
+ case 3:
398
+ return didGenerate = _state.sent(), !hasLoggedOnce && didGenerate && (hasLoggedOnce = !0, whitespaceBefore = " ", (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, `
399
+ `.concat(whitespaceBefore, "\u27A1 [tamagui] generated themes: ").concat((0, import_path.relative)(process.cwd(), options.themeBuilder.output)))), [
400
+ 3,
401
+ 5
402
+ ];
403
+ case 4:
404
+ return waiting = !1, [
405
+ 7
406
+ ];
407
+ case 5:
408
+ return [
409
+ 2
410
+ ];
411
+ }
412
+ });
413
+ });
414
+ return function(options) {
415
+ return _ref.apply(this, arguments);
416
+ };
417
+ }(), last = {}, lastVersion = {};
85
418
  function loadTamaguiBuildConfigSync(tamaguiOptions) {
86
- const buildFilePath = (tamaguiOptions == null ? void 0 : tamaguiOptions.buildFile) ?? "tamagui.build.ts";
419
+ var _tamaguiOptions_buildFile, buildFilePath = (_tamaguiOptions_buildFile = tamaguiOptions == null ? void 0 : tamaguiOptions.buildFile) !== null && _tamaguiOptions_buildFile !== void 0 ? _tamaguiOptions_buildFile : "tamagui.build.ts";
87
420
  if ((0, import_fs_extra.existsSync)(buildFilePath)) {
88
- const registered = (0, import_registerRequire.registerRequire)("web");
421
+ var registered = (0, import_registerRequire.registerRequire)("web");
89
422
  try {
90
- const out = require(buildFilePath).default;
423
+ var out = require(buildFilePath).default;
91
424
  if (!out)
92
- throw new Error(`No default export found in ${buildFilePath}: ${out}`);
93
- tamaguiOptions = {
94
- ...tamaguiOptions,
95
- ...out
96
- };
425
+ throw new Error("No default export found in ".concat(buildFilePath, ": ").concat(out));
426
+ tamaguiOptions = _object_spread({}, tamaguiOptions, out);
97
427
  } finally {
98
428
  registered.unregister();
99
429
  }
100
430
  }
101
431
  if (!tamaguiOptions)
102
- throw new Error(
103
- "No tamagui build options found either via input props or at tamagui.build.ts"
104
- );
105
- return {
432
+ throw new Error("No tamagui build options found either via input props or at tamagui.build.ts");
433
+ return _object_spread({
106
434
  config: "tamagui.config.ts",
107
- components: ["@tamagui/core"],
108
- ...tamaguiOptions
109
- };
435
+ components: [
436
+ "@tamagui/core"
437
+ ]
438
+ }, tamaguiOptions);
110
439
  }
111
- function loadTamaguiSync({
112
- forceExports,
113
- cacheKey,
114
- ...propsIn
115
- }) {
116
- const key = JSON.stringify(propsIn);
440
+ function loadTamaguiSync(_param) {
441
+ var forceExports = _param.forceExports, cacheKey = _param.cacheKey, propsIn = _object_without_properties(_param, [
442
+ "forceExports",
443
+ "cacheKey"
444
+ ]), key = JSON.stringify(propsIn);
117
445
  if (last[key] && !(0, import_bundleConfig.hasBundledConfigChanged)() && (!lastVersion[key] || lastVersion[key] === cacheKey))
118
446
  return last[key];
119
447
  lastVersion[key] = cacheKey || "";
120
- const props = getFilledOptions(propsIn);
448
+ var props = getFilledOptions(propsIn);
121
449
  process.env.IS_STATIC = "is_static", process.env.TAMAGUI_IS_SERVER = "true";
122
- const { unregister } = (0, import_registerRequire.registerRequire)(props.platform, {
450
+ var unregister = (0, import_registerRequire.registerRequire)(props.platform, {
123
451
  proxyWormImports: !!forceExports
124
- });
452
+ }).unregister;
125
453
  try {
126
- const devValueOG = globalThis.__DEV__;
454
+ var devValueOG = globalThis.__DEV__;
127
455
  globalThis.__DEV__ = process.env.NODE_ENV === "development";
128
456
  try {
129
- let tamaguiConfig = null;
457
+ var tamaguiConfig = null;
130
458
  if (propsIn.config) {
131
- const configPath = (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(propsIn.config), exp = require(configPath);
459
+ var configPath = (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(propsIn.config), exp = require(configPath);
132
460
  if (tamaguiConfig = exp.default || exp.config || exp, !tamaguiConfig || !tamaguiConfig.parsed) {
133
- const confPath = require.resolve(configPath);
134
- throw new Error(`Can't find valid config in ${confPath}:
461
+ var confPath = require.resolve(configPath);
462
+ throw new Error("Can't find valid config in ".concat(confPath, `:
135
463
 
136
- Be sure you "export default" or "export const config" the config.`);
464
+ Be sure you "export default" or "export const config" the config.`));
137
465
  }
138
466
  if (tamaguiConfig) {
139
- const { createTamagui } = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform);
467
+ var createTamagui = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform).createTamagui;
140
468
  createTamagui(tamaguiConfig);
141
469
  }
142
470
  }
143
- const components = (0, import_bundleConfig.loadComponents)(props, forceExports);
471
+ var components = (0, import_bundleConfig.loadComponents)(props, forceExports);
144
472
  if (!components)
145
473
  throw new Error("No components loaded");
146
474
  process.env.DEBUG === "tamagui" && console.info("components", components), process.env.IS_STATIC = void 0, globalThis.__DEV__ = devValueOG;
147
- const info = {
475
+ var info = {
148
476
  components,
149
477
  tamaguiConfig,
150
478
  nameToPaths: (0, import_registerRequire.getNameToPaths)()
151
479
  };
152
480
  if (tamaguiConfig) {
153
- const { outputCSS } = props;
481
+ var outputCSS = props.outputCSS;
154
482
  if (outputCSS) {
155
- const flush = () => {
156
- (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [tamagui] output css: ${outputCSS}
157
- `), (0, import_fs.writeFileSync)(outputCSS, css);
483
+ var flush = function() {
484
+ (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, " \u27A1 [tamagui] output css: ".concat(outputCSS, `
485
+ `)), (0, import_fs.writeFileSync)(outputCSS, css);
158
486
  }, css = props.disableMinifyCSS === !1 ? (0, import_minifyCSS.minifyCSS)(tamaguiConfig.getCSS()).code : tamaguiConfig.getCSS();
159
487
  try {
160
488
  (0, import_fs.readFileSync)(outputCSS, "utf-8") === css || flush();
@@ -164,22 +492,19 @@ function loadTamaguiSync({
164
492
  }
165
493
  (0, import_generateTamaguiStudioConfig.generateTamaguiStudioConfigSync)(props, info);
166
494
  }
167
- return last[key] = {
168
- ...info,
495
+ return last[key] = _object_spread_props(_object_spread({}, info), {
169
496
  cached: !0
170
- }, info;
497
+ }), info;
171
498
  } catch (err) {
172
- err instanceof Error ? !import_constants.SHOULD_DEBUG && !forceExports ? (console.warn(
173
- "Error loading tamagui.config.ts (set DEBUG=tamagui to see full stack), running tamagui without custom config"
174
- ), console.info(`
499
+ _instanceof(err, Error) ? !import_constants.SHOULD_DEBUG && !forceExports ? (console.warn("Error loading tamagui.config.ts (set DEBUG=tamagui to see full stack), running tamagui without custom config"), console.info(`
175
500
 
176
- ${err.message}
501
+ `.concat(err.message, `
177
502
 
178
- `)) : import_constants.SHOULD_DEBUG && console.error(err) : console.error("Error loading tamagui.config.ts", err);
179
- const { createTamagui } = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform);
503
+ `))) : import_constants.SHOULD_DEBUG && console.error(err) : console.error("Error loading tamagui.config.ts", err);
504
+ var createTamagui1 = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform).createTamagui, getDefaultTamaguiConfig = require("@tamagui/config-default").getDefaultTamaguiConfig;
180
505
  return {
181
506
  components: [],
182
- tamaguiConfig: createTamagui((0, import_config_default.getDefaultTamaguiConfig)()),
507
+ tamaguiConfig: createTamagui1(getDefaultTamaguiConfig()),
183
508
  nameToPaths: {}
184
509
  };
185
510
  }
@@ -187,114 +512,264 @@ function loadTamaguiSync({
187
512
  unregister();
188
513
  }
189
514
  }
190
- async function getOptions({
191
- root = process.cwd(),
192
- tsconfigPath = "tsconfig.json",
193
- tamaguiOptions,
194
- host,
195
- debug
196
- } = {}) {
197
- const dotDir = (0, import_path.join)(root, ".tamagui");
198
- let pkgJson = {};
199
- try {
200
- pkgJson = await (0, import_fs_extra.readJSON)((0, import_path.join)(root, "package.json"));
201
- } catch {
202
- }
203
- return {
204
- mode: process.env.NODE_ENV === "production" ? "production" : "development",
205
- root,
206
- host: host || "127.0.0.1",
207
- pkgJson,
208
- debug,
209
- tsconfigPath,
210
- tamaguiOptions: {
211
- platform: "native",
212
- components: ["tamagui"],
213
- ...tamaguiOptions,
214
- config: await getDefaultTamaguiConfigPath(root, tamaguiOptions == null ? void 0 : tamaguiOptions.config)
215
- },
216
- paths: {
217
- dotDir,
218
- conf: (0, import_path.join)(dotDir, "tamagui.config.json"),
219
- types: (0, import_path.join)(dotDir, "types.json")
220
- }
221
- };
515
+ function getOptions() {
516
+ return _getOptions.apply(this, arguments);
517
+ }
518
+ function _getOptions() {
519
+ return _getOptions = _async_to_generator(function() {
520
+ var _ref, _ref_root, root, _ref_tsconfigPath, tsconfigPath, tamaguiOptions, host, debug, dotDir, pkgJson, err, _tmp, _tmp1, _tmp2, _arguments = arguments;
521
+ return _ts_generator(this, function(_state) {
522
+ switch (_state.label) {
523
+ case 0:
524
+ _ref = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, _ref_root = _ref.root, root = _ref_root === void 0 ? process.cwd() : _ref_root, _ref_tsconfigPath = _ref.tsconfigPath, tsconfigPath = _ref_tsconfigPath === void 0 ? "tsconfig.json" : _ref_tsconfigPath, tamaguiOptions = _ref.tamaguiOptions, host = _ref.host, debug = _ref.debug, dotDir = (0, import_path.join)(root, ".tamagui"), pkgJson = {}, _state.label = 1;
525
+ case 1:
526
+ return _state.trys.push([
527
+ 1,
528
+ 3,
529
+ ,
530
+ 4
531
+ ]), [
532
+ 4,
533
+ (0, import_fs_extra.readJSON)((0, import_path.join)(root, "package.json"))
534
+ ];
535
+ case 2:
536
+ return pkgJson = _state.sent(), [
537
+ 3,
538
+ 4
539
+ ];
540
+ case 3:
541
+ return err = _state.sent(), [
542
+ 3,
543
+ 4
544
+ ];
545
+ case 4:
546
+ return _tmp = {
547
+ mode: process.env.NODE_ENV === "production" ? "production" : "development",
548
+ root,
549
+ host: host || "127.0.0.1",
550
+ pkgJson,
551
+ debug,
552
+ tsconfigPath
553
+ }, _tmp1 = [
554
+ _object_spread({
555
+ platform: "native",
556
+ components: [
557
+ "tamagui"
558
+ ]
559
+ }, tamaguiOptions)
560
+ ], _tmp2 = {}, [
561
+ 4,
562
+ getDefaultTamaguiConfigPath(root, tamaguiOptions == null ? void 0 : tamaguiOptions.config)
563
+ ];
564
+ case 5:
565
+ return [
566
+ 2,
567
+ (_tmp.tamaguiOptions = _object_spread_props.apply(void 0, _tmp1.concat([
568
+ (_tmp2.config = _state.sent(), _tmp2)
569
+ ])), _tmp.paths = {
570
+ dotDir,
571
+ conf: (0, import_path.join)(dotDir, "tamagui.config.json"),
572
+ types: (0, import_path.join)(dotDir, "types.json")
573
+ }, _tmp)
574
+ ];
575
+ }
576
+ });
577
+ }), _getOptions.apply(this, arguments);
222
578
  }
223
579
  function resolveWebOrNativeSpecificEntry(entry) {
224
- const workspaceRoot = (0, import_path.resolve)(), resolved = require.resolve(entry, { paths: [workspaceRoot] }), ext = (0, import_path.extname)(resolved), fileName = (0, import_path.basename)(resolved).replace(ext, ""), specificFile = (0, import_path.join)((0, import_path.dirname)(resolved), fileName + "." + "native" + ext);
580
+ var workspaceRoot = (0, import_path.resolve)(), resolved = require.resolve(entry, {
581
+ paths: [
582
+ workspaceRoot
583
+ ]
584
+ }), ext = (0, import_path.extname)(resolved), fileName = (0, import_path.basename)(resolved).replace(ext, ""), specificExt = "native", specificFile = (0, import_path.join)((0, import_path.dirname)(resolved), fileName + "." + specificExt + ext);
225
585
  return (0, import_fs_extra.existsSync)(specificFile) ? specificFile : entry;
226
586
  }
227
- const defaultPaths = ["tamagui.config.ts", (0, import_path.join)("src", "tamagui.config.ts")];
228
- let hasWarnedOnce = !1;
229
- async function getDefaultTamaguiConfigPath(root, configPath) {
230
- const searchPaths = [
231
- ...new Set(
232
- [configPath, ...defaultPaths].filter(Boolean).map((p) => (0, import_path.join)(root, p))
233
- )
234
- ];
235
- for (const path of searchPaths)
236
- if (await (0, import_fs_extra.pathExists)(path))
237
- return path;
238
- hasWarnedOnce || (hasWarnedOnce = !0, console.warn(`Warning: couldn't find tamagui.config.ts in the following paths given configuration "${configPath}":
239
- ${searchPaths.join(`
240
- `)}
241
- `));
587
+ var defaultPaths = [
588
+ "tamagui.config.ts",
589
+ (0, import_path.join)("src", "tamagui.config.ts")
590
+ ], hasWarnedOnce = !1;
591
+ function getDefaultTamaguiConfigPath(root, configPath) {
592
+ return _getDefaultTamaguiConfigPath.apply(this, arguments);
242
593
  }
243
- async function watchTamaguiConfig(tamaguiOptions) {
244
- var _a;
245
- const options = await getOptions({ tamaguiOptions });
246
- if (!options.tamaguiOptions.config)
247
- throw new Error("No config");
248
- if (process.env.NODE_ENV === "production")
249
- return {
250
- dispose() {
594
+ function _getDefaultTamaguiConfigPath() {
595
+ return _getDefaultTamaguiConfigPath = _async_to_generator(function(root, configPath) {
596
+ var searchPaths, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, path, err;
597
+ return _ts_generator(this, function(_state) {
598
+ switch (_state.label) {
599
+ case 0:
600
+ searchPaths = _to_consumable_array(new Set([
601
+ configPath
602
+ ].concat(_to_consumable_array(defaultPaths)).filter(Boolean).map(function(p) {
603
+ return (0, import_path.join)(root, p);
604
+ }))), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0, _state.label = 1;
605
+ case 1:
606
+ _state.trys.push([
607
+ 1,
608
+ 6,
609
+ 7,
610
+ 8
611
+ ]), _iterator = searchPaths[Symbol.iterator](), _state.label = 2;
612
+ case 2:
613
+ return (_iteratorNormalCompletion = (_step = _iterator.next()).done) ? [
614
+ 3,
615
+ 5
616
+ ] : (path = _step.value, [
617
+ 4,
618
+ (0, import_fs_extra.pathExists)(path)
619
+ ]);
620
+ case 3:
621
+ if (_state.sent())
622
+ return [
623
+ 2,
624
+ path
625
+ ];
626
+ _state.label = 4;
627
+ case 4:
628
+ return _iteratorNormalCompletion = !0, [
629
+ 3,
630
+ 2
631
+ ];
632
+ case 5:
633
+ return [
634
+ 3,
635
+ 8
636
+ ];
637
+ case 6:
638
+ return err = _state.sent(), _didIteratorError = !0, _iteratorError = err, [
639
+ 3,
640
+ 8
641
+ ];
642
+ case 7:
643
+ try {
644
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
645
+ } finally {
646
+ if (_didIteratorError)
647
+ throw _iteratorError;
648
+ }
649
+ return [
650
+ 7
651
+ ];
652
+ case 8:
653
+ return hasWarnedOnce || (hasWarnedOnce = !0, console.warn(`Warning: couldn't find tamagui.config.ts in the following paths given configuration "`.concat(configPath, `":
654
+ `).concat(searchPaths.join(`
655
+ `), `
656
+ `))), [
657
+ 2
658
+ ];
251
659
  }
252
- };
253
- const disposeConfigWatcher = await esbuildWatchFiles(
254
- options.tamaguiOptions.config,
255
- () => {
256
- (0, import_generateTamaguiStudioConfig.generateTamaguiStudioConfig)(options.tamaguiOptions, null, !0);
257
- }
258
- ), themeBuilderInput = (_a = options.tamaguiOptions.themeBuilder) == null ? void 0 : _a.input;
259
- let disposeThemesWatcher;
260
- if (themeBuilderInput) {
261
- let inputPath = themeBuilderInput;
262
- try {
263
- inputPath = require.resolve(themeBuilderInput);
264
- } catch {
265
- }
266
- disposeThemesWatcher = await esbuildWatchFiles(inputPath, () => {
267
- generateThemesAndLog(options.tamaguiOptions);
268
660
  });
269
- }
270
- return {
271
- dispose() {
272
- disposeConfigWatcher(), disposeThemesWatcher == null || disposeThemesWatcher();
273
- }
274
- };
661
+ }), _getDefaultTamaguiConfigPath.apply(this, arguments);
275
662
  }
276
- async function esbuildWatchFiles(entry, onChanged) {
277
- let hasRunOnce = !1;
278
- const context = await import_esbuild.default.context({
279
- bundle: !0,
280
- entryPoints: [entry],
281
- resolveExtensions: [".ts", ".tsx", ".js", ".jsx", ".mjs"],
282
- logLevel: "silent",
283
- write: !1,
284
- plugins: [
285
- {
286
- name: "on-rebuild",
287
- setup({ onEnd }) {
288
- onEnd(() => {
289
- hasRunOnce ? onChanged() : hasRunOnce = !0;
290
- });
291
- }
663
+ function watchTamaguiConfig(tamaguiOptions) {
664
+ return _watchTamaguiConfig.apply(this, arguments);
665
+ }
666
+ function _watchTamaguiConfig() {
667
+ return _watchTamaguiConfig = _async_to_generator(function(tamaguiOptions) {
668
+ var _options_tamaguiOptions_themeBuilder, options, disposeConfigWatcher, themeBuilderInput, disposeThemesWatcher, inputPath;
669
+ return _ts_generator(this, function(_state) {
670
+ switch (_state.label) {
671
+ case 0:
672
+ return [
673
+ 4,
674
+ getOptions({
675
+ tamaguiOptions
676
+ })
677
+ ];
678
+ case 1:
679
+ if (options = _state.sent(), !options.tamaguiOptions.config)
680
+ throw new Error("No config");
681
+ return process.env.NODE_ENV === "production" ? [
682
+ 2,
683
+ {
684
+ dispose: function() {
685
+ }
686
+ }
687
+ ] : [
688
+ 4,
689
+ esbuildWatchFiles(options.tamaguiOptions.config, function() {
690
+ (0, import_generateTamaguiStudioConfig.generateTamaguiStudioConfig)(options.tamaguiOptions, null, !0);
691
+ })
692
+ ];
693
+ case 2:
694
+ if (disposeConfigWatcher = _state.sent(), themeBuilderInput = (_options_tamaguiOptions_themeBuilder = options.tamaguiOptions.themeBuilder) === null || _options_tamaguiOptions_themeBuilder === void 0 ? void 0 : _options_tamaguiOptions_themeBuilder.input, !themeBuilderInput)
695
+ return [
696
+ 3,
697
+ 4
698
+ ];
699
+ inputPath = themeBuilderInput;
700
+ try {
701
+ inputPath = require.resolve(themeBuilderInput);
702
+ } catch {
703
+ }
704
+ return [
705
+ 4,
706
+ esbuildWatchFiles(inputPath, function() {
707
+ generateThemesAndLog(options.tamaguiOptions);
708
+ })
709
+ ];
710
+ case 3:
711
+ disposeThemesWatcher = _state.sent(), _state.label = 4;
712
+ case 4:
713
+ return [
714
+ 2,
715
+ {
716
+ dispose: function() {
717
+ disposeConfigWatcher(), disposeThemesWatcher == null || disposeThemesWatcher();
718
+ }
719
+ }
720
+ ];
292
721
  }
293
- ]
294
- });
295
- return context.watch(), () => {
296
- context.dispose();
297
- };
722
+ });
723
+ }), _watchTamaguiConfig.apply(this, arguments);
724
+ }
725
+ function esbuildWatchFiles(entry, onChanged) {
726
+ return _esbuildWatchFiles.apply(this, arguments);
727
+ }
728
+ function _esbuildWatchFiles() {
729
+ return _esbuildWatchFiles = _async_to_generator(function(entry, onChanged) {
730
+ var hasRunOnce, context;
731
+ return _ts_generator(this, function(_state) {
732
+ switch (_state.label) {
733
+ case 0:
734
+ return hasRunOnce = !1, [
735
+ 4,
736
+ import_esbuild.default.context({
737
+ bundle: !0,
738
+ entryPoints: [
739
+ entry
740
+ ],
741
+ resolveExtensions: [
742
+ ".ts",
743
+ ".tsx",
744
+ ".js",
745
+ ".jsx",
746
+ ".mjs"
747
+ ],
748
+ logLevel: "silent",
749
+ write: !1,
750
+ plugins: [
751
+ {
752
+ name: "on-rebuild",
753
+ setup: function(param) {
754
+ var onEnd = param.onEnd;
755
+ onEnd(function() {
756
+ hasRunOnce ? onChanged() : hasRunOnce = !0;
757
+ });
758
+ }
759
+ }
760
+ ]
761
+ })
762
+ ];
763
+ case 1:
764
+ return context = _state.sent(), context.watch(), [
765
+ 2,
766
+ function() {
767
+ context.dispose();
768
+ }
769
+ ];
770
+ }
771
+ });
772
+ }), _esbuildWatchFiles.apply(this, arguments);
298
773
  }
299
774
  // Annotate the CommonJS export names for ESM import in node:
300
775
  0 && (module.exports = {