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