@tamagui/static 1.110.4 → 1.111.0

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