@tamagui/static 1.89.26 → 1.89.27-1708113113238

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 (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,7 +32,240 @@ __export(bundleConfig_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(bundleConfig_exports);
34
34
  var import_fs = require("fs"), import_path = require("path"), import_generator = __toESM(require("@babel/generator")), import_traverse = __toESM(require("@babel/traverse")), t = __toESM(require("@babel/types")), import_cli_color = require("@tamagui/cli-color"), import_esbuild = __toESM(require("esbuild")), import_fs_extra = require("fs-extra"), import_registerRequire = require("../registerRequire"), import_babelParse = require("./babelParse"), import_bundle = require("./bundle"), import_getTamaguiConfigPathFromOptionsConfig = require("./getTamaguiConfigPathFromOptionsConfig");
35
- const external = [
35
+ function _array_like_to_array(arr, len) {
36
+ (len == null || len > arr.length) && (len = arr.length);
37
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
38
+ arr2[i] = arr[i];
39
+ return arr2;
40
+ }
41
+ function _array_with_holes(arr) {
42
+ if (Array.isArray(arr))
43
+ return arr;
44
+ }
45
+ function _array_without_holes(arr) {
46
+ if (Array.isArray(arr))
47
+ return _array_like_to_array(arr);
48
+ }
49
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
50
+ try {
51
+ var info = gen[key](arg), value = info.value;
52
+ } catch (error) {
53
+ reject(error);
54
+ return;
55
+ }
56
+ info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
57
+ }
58
+ function _async_to_generator(fn) {
59
+ return function() {
60
+ var self = this, args = arguments;
61
+ return new Promise(function(resolve, reject) {
62
+ var gen = fn.apply(self, args);
63
+ function _next(value) {
64
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
65
+ }
66
+ function _throw(err) {
67
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
68
+ }
69
+ _next(void 0);
70
+ });
71
+ };
72
+ }
73
+ function _define_property(obj, key, value) {
74
+ return key in obj ? Object.defineProperty(obj, key, {
75
+ value,
76
+ enumerable: !0,
77
+ configurable: !0,
78
+ writable: !0
79
+ }) : obj[key] = value, obj;
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 _iterable_to_array_limit(arr, i) {
86
+ var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
87
+ if (_i != null) {
88
+ var _arr = [], _n = !0, _d = !1, _s, _e;
89
+ try {
90
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
91
+ ;
92
+ } catch (err) {
93
+ _d = !0, _e = err;
94
+ } finally {
95
+ try {
96
+ !_n && _i.return != null && _i.return();
97
+ } finally {
98
+ if (_d)
99
+ throw _e;
100
+ }
101
+ }
102
+ return _arr;
103
+ }
104
+ }
105
+ function _non_iterable_rest() {
106
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
107
+ }
108
+ function _non_iterable_spread() {
109
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
110
+ }
111
+ function _object_spread(target) {
112
+ for (var i = 1; i < arguments.length; i++) {
113
+ var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
114
+ typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
115
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
116
+ }))), ownKeys2.forEach(function(key) {
117
+ _define_property(target, key, source[key]);
118
+ });
119
+ }
120
+ return target;
121
+ }
122
+ function ownKeys(object, enumerableOnly) {
123
+ var keys = Object.keys(object);
124
+ if (Object.getOwnPropertySymbols) {
125
+ var symbols = Object.getOwnPropertySymbols(object);
126
+ enumerableOnly && (symbols = symbols.filter(function(sym) {
127
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
128
+ })), keys.push.apply(keys, symbols);
129
+ }
130
+ return keys;
131
+ }
132
+ function _object_spread_props(target, source) {
133
+ return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
134
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
135
+ }), target;
136
+ }
137
+ function _object_without_properties(source, excluded) {
138
+ if (source == null)
139
+ return {};
140
+ var target = _object_without_properties_loose(source, excluded), key, i;
141
+ if (Object.getOwnPropertySymbols) {
142
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
143
+ for (i = 0; i < sourceSymbolKeys.length; i++)
144
+ key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
145
+ }
146
+ return target;
147
+ }
148
+ function _object_without_properties_loose(source, excluded) {
149
+ if (source == null)
150
+ return {};
151
+ var target = {}, sourceKeys = Object.keys(source), key, i;
152
+ for (i = 0; i < sourceKeys.length; i++)
153
+ key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
154
+ return target;
155
+ }
156
+ function _sliced_to_array(arr, i) {
157
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
158
+ }
159
+ function _to_consumable_array(arr) {
160
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
161
+ }
162
+ function _type_of(obj) {
163
+ "@swc/helpers - typeof";
164
+ return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
165
+ }
166
+ function _unsupported_iterable_to_array(o, minLen) {
167
+ if (o) {
168
+ if (typeof o == "string")
169
+ return _array_like_to_array(o, minLen);
170
+ var n = Object.prototype.toString.call(o).slice(8, -1);
171
+ if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
172
+ return Array.from(n);
173
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
174
+ return _array_like_to_array(o, minLen);
175
+ }
176
+ }
177
+ function _ts_generator(thisArg, body) {
178
+ var f, y, t2, g, _ = {
179
+ label: 0,
180
+ sent: function() {
181
+ if (t2[0] & 1)
182
+ throw t2[1];
183
+ return t2[1];
184
+ },
185
+ trys: [],
186
+ ops: []
187
+ };
188
+ return g = {
189
+ next: verb(0),
190
+ throw: verb(1),
191
+ return: verb(2)
192
+ }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
193
+ return this;
194
+ }), g;
195
+ function verb(n) {
196
+ return function(v) {
197
+ return step([
198
+ n,
199
+ v
200
+ ]);
201
+ };
202
+ }
203
+ function step(op) {
204
+ if (f)
205
+ throw new TypeError("Generator is already executing.");
206
+ for (; _; )
207
+ try {
208
+ if (f = 1, y && (t2 = op[0] & 2 ? y.return : op[0] ? y.throw || ((t2 = y.return) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done)
209
+ return t2;
210
+ switch (y = 0, t2 && (op = [
211
+ op[0] & 2,
212
+ t2.value
213
+ ]), op[0]) {
214
+ case 0:
215
+ case 1:
216
+ t2 = op;
217
+ break;
218
+ case 4:
219
+ return _.label++, {
220
+ value: op[1],
221
+ done: !1
222
+ };
223
+ case 5:
224
+ _.label++, y = op[1], op = [
225
+ 0
226
+ ];
227
+ continue;
228
+ case 7:
229
+ op = _.ops.pop(), _.trys.pop();
230
+ continue;
231
+ default:
232
+ if (t2 = _.trys, !(t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
233
+ _ = 0;
234
+ continue;
235
+ }
236
+ if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
237
+ _.label = op[1];
238
+ break;
239
+ }
240
+ if (op[0] === 6 && _.label < t2[1]) {
241
+ _.label = t2[1], t2 = op;
242
+ break;
243
+ }
244
+ if (t2 && _.label < t2[2]) {
245
+ _.label = t2[2], _.ops.push(op);
246
+ break;
247
+ }
248
+ t2[2] && _.ops.pop(), _.trys.pop();
249
+ continue;
250
+ }
251
+ op = body.call(thisArg, _);
252
+ } catch (e) {
253
+ op = [
254
+ 6,
255
+ e
256
+ ], y = 0;
257
+ } finally {
258
+ f = t2 = 0;
259
+ }
260
+ if (op[0] & 5)
261
+ throw op[1];
262
+ return {
263
+ value: op[0] ? op[1] : void 0,
264
+ done: !0
265
+ };
266
+ }
267
+ }
268
+ var external = [
36
269
  "@tamagui/core",
37
270
  "@tamagui/web",
38
271
  "react",
@@ -40,155 +273,228 @@ const external = [
40
273
  "react-native-svg"
41
274
  ], esbuildExtraOptions = {
42
275
  define: {
43
- __DEV__: `${process.env.NODE_ENV === "development"}`
276
+ __DEV__: "".concat(process.env.NODE_ENV === "development")
44
277
  }
45
- }, esbuildOptions = {
278
+ }, esbuildOptions = _object_spread({
46
279
  target: "es2018",
47
280
  format: "cjs",
48
281
  jsx: "automatic",
49
- platform: "node",
50
- ...esbuildExtraOptions
51
- };
52
- let currentBundle = null, isBundling = !1, lastBundle = null;
53
- const waitForBundle = /* @__PURE__ */ new Set();
282
+ platform: "node"
283
+ }, esbuildExtraOptions), currentBundle = null, isBundling = !1, lastBundle = null, waitForBundle = /* @__PURE__ */ new Set();
54
284
  function hasBundledConfigChanged() {
55
285
  return lastBundle === currentBundle ? !1 : (lastBundle = currentBundle, !0);
56
286
  }
57
- async function getBundledConfig(props, rebuild = !1) {
58
- if (isBundling)
59
- await new Promise((res) => {
60
- waitForBundle.add(res);
287
+ function getBundledConfig(props) {
288
+ return _getBundledConfig.apply(this, arguments);
289
+ }
290
+ function _getBundledConfig() {
291
+ return _getBundledConfig = _async_to_generator(function(props) {
292
+ var rebuild, _arguments = arguments;
293
+ return _ts_generator(this, function(_state) {
294
+ switch (_state.label) {
295
+ case 0:
296
+ return rebuild = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : !1, isBundling ? [
297
+ 4,
298
+ new Promise(function(res) {
299
+ waitForBundle.add(res);
300
+ })
301
+ ] : [
302
+ 3,
303
+ 2
304
+ ];
305
+ case 1:
306
+ return _state.sent(), [
307
+ 3,
308
+ 4
309
+ ];
310
+ case 2:
311
+ return !currentBundle || rebuild ? [
312
+ 4,
313
+ bundleConfig(props)
314
+ ] : [
315
+ 3,
316
+ 4
317
+ ];
318
+ case 3:
319
+ return [
320
+ 2,
321
+ _state.sent()
322
+ ];
323
+ case 4:
324
+ return [
325
+ 2,
326
+ currentBundle
327
+ ];
328
+ }
61
329
  });
62
- else if (!currentBundle || rebuild)
63
- return await bundleConfig(props);
64
- return currentBundle;
330
+ }), _getBundledConfig.apply(this, arguments);
65
331
  }
66
- async function bundleConfig(props) {
67
- var _a, _b, _c, _d;
68
- try {
69
- isBundling = !0;
70
- const configEntry = props.config ? (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(props.config) : "", tmpDir = (0, import_path.join)(process.cwd(), ".tamagui"), configOutPath = (0, import_path.join)(tmpDir, "tamagui.config.cjs"), baseComponents = props.components.filter((x) => x !== "@tamagui/core"), componentOutPaths = baseComponents.map(
71
- (componentModule) => (0, import_path.join)(
72
- tmpDir,
73
- `${componentModule.split(import_path.sep).join("-").replace(/[^a-z0-9]+/gi, "")}-components.config.cjs`
74
- )
75
- );
76
- if (process.env.NODE_ENV === "development" && ((_a = process.env.DEBUG) != null && _a.startsWith("tamagui")) && console.info("Building config entry", configEntry), !props.disableInitialBuild) {
77
- try {
78
- await (0, import_fs_extra.ensureDir)(tmpDir);
79
- } catch {
332
+ function bundleConfig(props) {
333
+ return _bundleConfig.apply(this, arguments);
334
+ }
335
+ function _bundleConfig() {
336
+ return _bundleConfig = _async_to_generator(function(props) {
337
+ var _process_env_DEBUG, _process_env_DEBUG1, configEntry, tmpDir, configOutPath, baseComponents, componentOutPaths, e, start, out, unregister, config, components, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, component, _process_env_DEBUG2, res, err, _process_env_DEBUG3;
338
+ return _ts_generator(this, function(_state) {
339
+ switch (_state.label) {
340
+ case 0:
341
+ if (_state.trys.push([
342
+ 0,
343
+ 7,
344
+ 8,
345
+ 9
346
+ ]), isBundling = !0, configEntry = props.config ? (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(props.config) : "", tmpDir = (0, import_path.join)(process.cwd(), ".tamagui"), configOutPath = (0, import_path.join)(tmpDir, "tamagui.config.cjs"), baseComponents = props.components.filter(function(x) {
347
+ return x !== "@tamagui/core";
348
+ }), componentOutPaths = baseComponents.map(function(componentModule) {
349
+ return (0, import_path.join)(tmpDir, "".concat(componentModule.split(import_path.sep).join("-").replace(/[^a-z0-9]+/gi, ""), "-components.config.cjs"));
350
+ }), process.env.NODE_ENV === "development" && (!((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui")) && console.info("Building config entry", configEntry), props.disableInitialBuild)
351
+ return [
352
+ 3,
353
+ 6
354
+ ];
355
+ _state.label = 1;
356
+ case 1:
357
+ return _state.trys.push([
358
+ 1,
359
+ 3,
360
+ ,
361
+ 4
362
+ ]), [
363
+ 4,
364
+ (0, import_fs_extra.ensureDir)(tmpDir)
365
+ ];
366
+ case 2:
367
+ return _state.sent(), [
368
+ 3,
369
+ 4
370
+ ];
371
+ case 3:
372
+ return e = _state.sent(), [
373
+ 3,
374
+ 4
375
+ ];
376
+ case 4:
377
+ return start = Date.now(), [
378
+ 4,
379
+ Promise.all([
380
+ props.config ? (0, import_bundle.bundle)(_object_spread({
381
+ entryPoints: [
382
+ configEntry
383
+ ],
384
+ external,
385
+ outfile: configOutPath,
386
+ target: "node16"
387
+ }, esbuildExtraOptions), props.platform) : null
388
+ ].concat(_to_consumable_array(baseComponents.map(function(componentModule, i) {
389
+ return (0, import_bundle.bundle)(_object_spread({
390
+ entryPoints: [
391
+ componentModule
392
+ ],
393
+ resolvePlatformSpecificEntries: !0,
394
+ external,
395
+ outfile: componentOutPaths[i],
396
+ target: "node16"
397
+ }, esbuildExtraOptions), props.platform);
398
+ }))))
399
+ ];
400
+ case 5:
401
+ _state.sent(), (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, `
402
+ \u27A1 [tamagui] built config and components (`.concat(Date.now() - start, "ms):")), (0, import_cli_color.colorLog)(import_cli_color.Color.Dim, `
403
+ Config .`.concat(import_path.sep).concat((0, import_path.relative)(process.cwd(), configOutPath), `
404
+ Components `).concat(_to_consumable_array(componentOutPaths.map(function(p) {
405
+ return ".".concat(import_path.sep).concat((0, import_path.relative)(process.cwd(), p));
406
+ })).join(`
407
+ `), `
408
+ `)), _state.label = 6;
409
+ case 6:
410
+ unregister = (0, import_registerRequire.registerRequire)(props.platform).unregister;
411
+ try {
412
+ out = require(configOutPath);
413
+ } catch (err2) {
414
+ throw err2;
415
+ } finally {
416
+ unregister();
417
+ }
418
+ if (config = out.default || out || out.config, config && config.config && !config.tokens && (config = config.config), !config)
419
+ throw new Error("No config: ".concat(config));
420
+ if (components = loadComponents(_object_spread_props(_object_spread({}, props), {
421
+ components: componentOutPaths
422
+ })), !components)
423
+ throw new Error("No components found: ".concat(componentOutPaths.join(", ")));
424
+ _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
425
+ try {
426
+ for (_iterator = components[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0)
427
+ component = _step.value, component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, component.moduleName || (!((_process_env_DEBUG2 = process.env.DEBUG) === null || _process_env_DEBUG2 === void 0) && _process_env_DEBUG2.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("\u26A0\uFE0F no module name found: ".concat(component.moduleName, " ").concat(JSON.stringify(baseComponents), " in ").concat(JSON.stringify(componentOutPaths)));
428
+ } catch (err2) {
429
+ _didIteratorError = !0, _iteratorError = err2;
430
+ } finally {
431
+ try {
432
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
433
+ } finally {
434
+ if (_didIteratorError)
435
+ throw _iteratorError;
436
+ }
437
+ }
438
+ return process.env.NODE_ENV === "development" && (!((_process_env_DEBUG1 = process.env.DEBUG) === null || _process_env_DEBUG1 === void 0) && _process_env_DEBUG1.startsWith("tamagui")) && console.info("Loaded components", components), res = {
439
+ components,
440
+ nameToPaths: {},
441
+ tamaguiConfig: config
442
+ }, currentBundle = res, [
443
+ 2,
444
+ res
445
+ ];
446
+ case 7:
447
+ return err = _state.sent(), console.error("Error bundling tamagui config: ".concat(err == null ? void 0 : err.message, " (run with DEBUG=tamagui to see stack)")), !((_process_env_DEBUG3 = process.env.DEBUG) === null || _process_env_DEBUG3 === void 0) && _process_env_DEBUG3.includes("tamagui") && console.error(err.stack), [
448
+ 3,
449
+ 9
450
+ ];
451
+ case 8:
452
+ return isBundling = !1, waitForBundle.forEach(function(cb) {
453
+ return cb();
454
+ }), waitForBundle.clear(), [
455
+ 7
456
+ ];
457
+ case 9:
458
+ return [
459
+ 2
460
+ ];
80
461
  }
81
- const start = Date.now();
82
- await Promise.all([
83
- props.config ? (0, import_bundle.bundle)(
84
- {
85
- entryPoints: [configEntry],
86
- external,
87
- outfile: configOutPath,
88
- target: "node16",
89
- ...esbuildExtraOptions
90
- },
91
- props.platform
92
- ) : null,
93
- ...baseComponents.map((componentModule, i) => (0, import_bundle.bundle)(
94
- {
95
- entryPoints: [componentModule],
96
- resolvePlatformSpecificEntries: !0,
97
- external,
98
- outfile: componentOutPaths[i],
99
- target: "node16",
100
- ...esbuildExtraOptions
101
- },
102
- props.platform
103
- ))
104
- ]), (0, import_cli_color.colorLog)(
105
- import_cli_color.Color.FgYellow,
106
- `
107
- \u27A1 [tamagui] built config and components (${Date.now() - start}ms):`
108
- ), (0, import_cli_color.colorLog)(
109
- import_cli_color.Color.Dim,
110
- `
111
- Config .${import_path.sep}${(0, import_path.relative)(process.cwd(), configOutPath)}
112
- Components ${[
113
- ...componentOutPaths.map((p) => `.${import_path.sep}${(0, import_path.relative)(process.cwd(), p)}`)
114
- ].join(`
115
- `)}
116
- `
117
- );
118
- }
119
- let out;
120
- const { unregister } = (0, import_registerRequire.registerRequire)(props.platform);
121
- try {
122
- out = require(configOutPath);
123
- } catch (err) {
124
- throw err;
125
- } finally {
126
- unregister();
127
- }
128
- let config = out.default || out || out.config;
129
- if (config && config.config && !config.tokens && (config = config.config), !config)
130
- throw new Error(`No config: ${config}`);
131
- let components = loadComponents({
132
- ...props,
133
- components: componentOutPaths
134
462
  });
135
- if (!components)
136
- throw new Error(`No components found: ${componentOutPaths.join(", ")}`);
137
- for (const component of components)
138
- component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, component.moduleName || ((_b = process.env.DEBUG) != null && _b.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn(
139
- `\u26A0\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(
140
- baseComponents
141
- )} in ${JSON.stringify(componentOutPaths)}`
142
- );
143
- process.env.NODE_ENV === "development" && ((_c = process.env.DEBUG) != null && _c.startsWith("tamagui")) && console.info("Loaded components", components);
144
- const res = {
145
- components,
146
- nameToPaths: {},
147
- tamaguiConfig: config
148
- };
149
- return currentBundle = res, res;
150
- } catch (err) {
151
- console.error(
152
- `Error bundling tamagui config: ${err == null ? void 0 : err.message} (run with DEBUG=tamagui to see stack)`
153
- ), (_d = process.env.DEBUG) != null && _d.includes("tamagui") && console.error(err.stack);
154
- } finally {
155
- isBundling = !1, waitForBundle.forEach((cb) => cb()), waitForBundle.clear();
156
- }
463
+ }), _bundleConfig.apply(this, arguments);
157
464
  }
158
- function loadComponents(props, forceExports = !1) {
159
- const coreComponents = getCoreComponents(props), otherComponents = loadComponentsInner(props, forceExports);
160
- return [...coreComponents, ...otherComponents || []];
465
+ function loadComponents(props) {
466
+ var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, coreComponents = getCoreComponents(props), otherComponents = loadComponentsInner(props, forceExports);
467
+ return _to_consumable_array(coreComponents).concat(_to_consumable_array(otherComponents || []));
161
468
  }
162
469
  function getCoreComponents(props) {
163
- const loaded = loadComponentsInner({
164
- ...props,
165
- components: ["@tamagui/core"]
166
- });
470
+ var loaded = loadComponentsInner(_object_spread_props(_object_spread({}, props), {
471
+ components: [
472
+ "@tamagui/core"
473
+ ]
474
+ }));
167
475
  if (!loaded)
168
476
  throw new Error("Core should always load");
169
477
  return [
170
- {
171
- ...loaded[0],
478
+ _object_spread_props(_object_spread({}, loaded[0]), {
172
479
  moduleName: "@tamagui/core"
173
- }
480
+ })
174
481
  ];
175
482
  }
176
- function loadComponentsInner(props, forceExports = !1) {
177
- const componentsModules = props.components, key = componentsModules.join("");
483
+ function loadComponentsInner(props) {
484
+ var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, componentsModules = props.components, key = componentsModules.join("");
178
485
  if (!forceExports && cacheComponents[key])
179
486
  return cacheComponents[key];
180
- const { unregister } = (0, import_registerRequire.registerRequire)(props.platform, {
487
+ var unregister = (0, import_registerRequire.registerRequire)(props.platform, {
181
488
  proxyWormImports: forceExports
182
- });
489
+ }).unregister;
183
490
  try {
184
- const info = componentsModules.flatMap((name) => {
185
- var _a;
186
- const isDynamic = !!(0, import_path.extname)(name) && forceExports, fileContents = isDynamic ? (0, import_fs.readFileSync)(name, "utf-8") : "", loadModule = isDynamic ? (0, import_path.join)((0, import_path.dirname)(name), `.tamagui-dynamic-eval-${(0, import_path.basename)(name)}.tsx`) : name;
187
- let writtenContents = fileContents, didBabel = !1;
188
- function attemptLoad({ forceExports: forceExports2 = !1 } = {}) {
189
- isDynamic && (writtenContents = forceExports2 ? transformAddExports((0, import_babelParse.babelParse)(esbuildit(fileContents, "modern"), name)) : fileContents, (0, import_fs_extra.writeFileSync)(loadModule, writtenContents), import_esbuild.default.buildSync({
190
- ...esbuildOptions,
191
- entryPoints: [loadModule],
491
+ var info = componentsModules.flatMap(function(name) {
492
+ var attemptLoad = function() {
493
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_forceExports = _ref.forceExports, forceExports2 = _ref_forceExports === void 0 ? !1 : _ref_forceExports;
494
+ isDynamic && (writtenContents = forceExports2 ? transformAddExports((0, import_babelParse.babelParse)(esbuildit(fileContents, "modern"), name)) : fileContents, (0, import_fs_extra.writeFileSync)(loadModule, writtenContents), import_esbuild.default.buildSync(_object_spread_props(_object_spread({}, esbuildOptions), {
495
+ entryPoints: [
496
+ loadModule
497
+ ],
192
498
  outfile: loadModule,
193
499
  alias: {
194
500
  "react-native": require.resolve("react-native-web-lite")
@@ -199,28 +505,25 @@ function loadComponentsInner(props, forceExports = !1) {
199
505
  // logLevel: 'silent',
200
506
  sourcemap: !1,
201
507
  loader: import_bundle.esbuildLoaderConfig
202
- })), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
203
- const moduleResult = require(loadModule);
508
+ }))), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
509
+ var moduleResult = require(loadModule);
204
510
  forceExports2 || (0, import_registerRequire.setRequireResult)(name, moduleResult);
205
- const nameToInfo = getComponentStaticConfigByName(
206
- name,
207
- interopDefaultExport(moduleResult)
208
- );
511
+ var nameToInfo = getComponentStaticConfigByName(name, interopDefaultExport(moduleResult));
209
512
  return {
210
513
  moduleName: name,
211
514
  nameToInfo
212
515
  };
213
- }
214
- const dispose = () => {
516
+ }, extension = (0, import_path.extname)(name), isLocal = !!extension, isDynamic = isLocal && forceExports, fileContents = isDynamic ? (0, import_fs.readFileSync)(name, "utf-8") : "", loadModule = isDynamic ? (0, import_path.join)((0, import_path.dirname)(name), ".tamagui-dynamic-eval-".concat((0, import_path.basename)(name), ".tsx")) : name, writtenContents = fileContents, didBabel = !1, dispose = function() {
215
517
  isDynamic && (0, import_fs_extra.removeSync)(loadModule);
216
518
  };
217
519
  try {
218
- const res = attemptLoad({
520
+ var res = attemptLoad({
219
521
  forceExports: !0
220
522
  });
221
523
  return didBabel = !0, res;
222
524
  } catch (err) {
223
- console.info("babel err", err, writtenContents), writtenContents = fileContents, (_a = process.env.DEBUG) != null && _a.startsWith("tamagui") && console.info("Error parsing babel likely", err);
525
+ var _process_env_DEBUG;
526
+ console.info("babel err", err, writtenContents), writtenContents = fileContents, !((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.info("Error parsing babel likely", err);
224
527
  } finally {
225
528
  dispose();
226
529
  }
@@ -232,18 +535,11 @@ function loadComponentsInner(props, forceExports = !1) {
232
535
  return process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.info(`
233
536
 
234
537
  Tamagui attempted but failed to dynamically optimize components in:
235
- ${name}
236
- `), console.info(err), console.info(
237
- `At: ${loadModule}`,
238
- `
239
- didBabel: ${didBabel}`,
240
- `
241
- In:`,
242
- writtenContents,
243
- `
244
- isDynamic: `,
245
- isDynamic
246
- )), [];
538
+ `.concat(name, `
539
+ `)), console.info(err), console.info("At: ".concat(loadModule), `
540
+ didBabel: `.concat(didBabel), `
541
+ In:`, writtenContents, `
542
+ isDynamic: `, isDynamic)), [];
247
543
  } finally {
248
544
  dispose();
249
545
  }
@@ -255,68 +551,84 @@ isDynamic: `,
255
551
  unregister();
256
552
  }
257
553
  }
258
- const esbuildit = (src, target) => import_esbuild.default.transformSync(src, {
259
- ...esbuildOptions,
260
- ...target === "modern" && {
554
+ var esbuildit = function(src, target) {
555
+ return import_esbuild.default.transformSync(src, _object_spread({}, esbuildOptions, target === "modern" && {
261
556
  target: "es2022",
262
557
  jsx: "automatic",
263
558
  loader: "tsx",
264
559
  platform: "neutral",
265
560
  format: "esm"
266
- }
267
- }).code;
561
+ })).code;
562
+ };
268
563
  function getComponentStaticConfigByName(name, exported) {
269
- const components = {};
564
+ var components = {};
270
565
  try {
271
566
  if (!exported || typeof exported != "object" || Array.isArray(exported))
272
- throw new Error(`Invalid export from package ${name}: ${typeof exported}`);
273
- for (const key in exported) {
274
- const found = getTamaguiComponent(key, exported[key]);
567
+ throw new Error("Invalid export from package ".concat(name, ": ").concat(typeof exported > "u" ? "undefined" : _type_of(exported)));
568
+ for (var _ref in exported) {
569
+ var key = _ref, found = getTamaguiComponent(key, exported[key]);
275
570
  if (found) {
276
- const { Component, ...sc } = found.staticConfig;
277
- components[key] = { staticConfig: sc };
571
+ var _found_staticConfig = found.staticConfig, Component = _found_staticConfig.Component, sc = _object_without_properties(_found_staticConfig, [
572
+ "Component"
573
+ ]);
574
+ components[key] = {
575
+ staticConfig: sc
576
+ };
278
577
  }
279
578
  }
280
579
  } catch (err) {
281
- process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error(
282
- `Tamagui failed getting components from ${name} (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)`
283
- ), console.error(err));
580
+ process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error("Tamagui failed getting components from ".concat(name, " (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)")), console.error(err));
284
581
  }
285
582
  return components;
286
583
  }
287
584
  function getTamaguiComponent(name, Component) {
288
- if (name[0].toUpperCase() !== name[0])
289
- return;
290
- if (Component == null ? void 0 : Component.staticConfig)
291
- return Component;
585
+ if (name[0].toUpperCase() === name[0]) {
586
+ var staticConfig = Component == null ? void 0 : Component.staticConfig;
587
+ if (staticConfig)
588
+ return Component;
589
+ }
292
590
  }
293
591
  function interopDefaultExport(mod) {
294
- return (mod == null ? void 0 : mod.default) ?? mod;
592
+ var _mod_default;
593
+ return (_mod_default = mod == null ? void 0 : mod.default) !== null && _mod_default !== void 0 ? _mod_default : mod;
295
594
  }
296
- const cacheComponents = {};
595
+ var cacheComponents = {};
297
596
  function transformAddExports(ast) {
298
- const usedNames = /* @__PURE__ */ new Set();
597
+ var usedNames = /* @__PURE__ */ new Set();
299
598
  return (0, import_traverse.default)(ast, {
300
- ExportNamedDeclaration(nodePath) {
301
- if (nodePath.node.specifiers)
302
- for (const spec of nodePath.node.specifiers)
303
- usedNames.add(
304
- t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value
305
- );
599
+ ExportNamedDeclaration: function(nodePath) {
600
+ if (nodePath.node.specifiers) {
601
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
602
+ try {
603
+ for (var _iterator = nodePath.node.specifiers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
604
+ var spec = _step.value;
605
+ usedNames.add(t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value);
606
+ }
607
+ } catch (err) {
608
+ _didIteratorError = !0, _iteratorError = err;
609
+ } finally {
610
+ try {
611
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
612
+ } finally {
613
+ if (_didIteratorError)
614
+ throw _iteratorError;
615
+ }
616
+ }
617
+ }
306
618
  }
307
619
  }), (0, import_traverse.default)(ast, {
308
- VariableDeclaration(nodePath) {
309
- if (!t.isProgram(nodePath.parent))
310
- return;
311
- const decs = nodePath.node.declarations;
312
- if (decs.length > 1)
313
- return;
314
- const [dec] = decs;
315
- t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(
316
- t.exportNamedDeclaration(t.variableDeclaration("let", [dec]), [
317
- t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))
318
- ])
319
- )));
620
+ VariableDeclaration: function(nodePath) {
621
+ if (t.isProgram(nodePath.parent)) {
622
+ var decs = nodePath.node.declarations;
623
+ if (!(decs.length > 1)) {
624
+ var _decs = _sliced_to_array(decs, 1), dec = _decs[0];
625
+ t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(t.exportNamedDeclaration(t.variableDeclaration("let", [
626
+ dec
627
+ ]), [
628
+ t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))
629
+ ]))));
630
+ }
631
+ }
320
632
  }
321
633
  }), (0, import_generator.default)(ast, {
322
634
  concise: !1,