@tamagui/static 1.92.1 → 1.93.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. package/dist/cjs/extractor/bundle.js +4 -4
  2. package/dist/cjs/extractor/bundle.js.map +1 -1
  3. package/dist/cjs/extractor/bundle.native.js +4 -4
  4. package/dist/cjs/extractor/bundle.native.js.map +2 -2
  5. package/dist/cjs/extractor/bundleConfig.js +10 -10
  6. package/dist/cjs/extractor/bundleConfig.js.map +1 -1
  7. package/dist/cjs/extractor/bundleConfig.native.js +10 -10
  8. package/dist/cjs/extractor/bundleConfig.native.js.map +2 -2
  9. package/dist/cjs/extractor/createExtractor.js +10 -4
  10. package/dist/cjs/extractor/createExtractor.js.map +1 -1
  11. package/dist/cjs/extractor/createExtractor.native.js +3 -3
  12. package/dist/cjs/extractor/createExtractor.native.js.map +2 -2
  13. package/dist/cjs/extractor/extractHelpers.js +1 -1
  14. package/dist/cjs/extractor/extractHelpers.js.map +1 -1
  15. package/dist/cjs/extractor/extractHelpers.native.js +1 -1
  16. package/dist/cjs/extractor/extractHelpers.native.js.map +1 -1
  17. package/dist/cjs/extractor/extractMediaStyle.js +8 -2
  18. package/dist/cjs/extractor/extractMediaStyle.js.map +1 -1
  19. package/dist/cjs/extractor/extractMediaStyle.native.js +2 -2
  20. package/dist/cjs/extractor/extractMediaStyle.native.js.map +2 -2
  21. package/dist/cjs/extractor/extractToClassNames.js +3 -2
  22. package/dist/cjs/extractor/extractToClassNames.js.map +1 -1
  23. package/dist/cjs/extractor/extractToClassNames.native.js +3 -2
  24. package/dist/cjs/extractor/extractToClassNames.native.js.map +2 -2
  25. package/dist/cjs/extractor/generateTamaguiStudioConfig.js +12 -8
  26. package/dist/cjs/extractor/generateTamaguiStudioConfig.js.map +2 -2
  27. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +7 -7
  28. package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
  29. package/dist/cjs/extractor/generatedUid.js.map +1 -1
  30. package/dist/cjs/extractor/generatedUid.native.js.map +1 -1
  31. package/dist/cjs/extractor/getStaticBindingsForScope.js +1 -1
  32. package/dist/cjs/extractor/getStaticBindingsForScope.js.map +1 -1
  33. package/dist/cjs/extractor/getStaticBindingsForScope.native.js +1 -1
  34. package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +1 -1
  35. package/dist/cjs/extractor/loadTamagui.js +13 -45
  36. package/dist/cjs/extractor/loadTamagui.js.map +1 -1
  37. package/dist/cjs/extractor/loadTamagui.native.js +16 -78
  38. package/dist/cjs/extractor/loadTamagui.native.js.map +2 -2
  39. package/dist/cjs/extractor/watchTamaguiConfig.js +53 -0
  40. package/dist/cjs/extractor/watchTamaguiConfig.js.map +6 -0
  41. package/dist/cjs/extractor/watchTamaguiConfig.native.js +203 -0
  42. package/dist/cjs/extractor/watchTamaguiConfig.native.js.map +6 -0
  43. package/dist/cjs/index.js +18 -2
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/index.native.js +30 -4
  46. package/dist/cjs/index.native.js.map +1 -1
  47. package/dist/cjs/registerRequire.js +2 -2
  48. package/dist/cjs/registerRequire.js.map +1 -1
  49. package/dist/cjs/registerRequire.native.js +3 -3
  50. package/dist/cjs/registerRequire.native.js.map +2 -2
  51. package/dist/esm/extractor/bundle.js +4 -4
  52. package/dist/esm/extractor/bundle.js.map +1 -1
  53. package/dist/esm/extractor/bundle.mjs +4 -4
  54. package/dist/esm/extractor/bundle.native.js +4 -4
  55. package/dist/esm/extractor/bundle.native.js.map +2 -2
  56. package/dist/esm/extractor/bundleConfig.js +10 -10
  57. package/dist/esm/extractor/bundleConfig.js.map +1 -1
  58. package/dist/esm/extractor/bundleConfig.mjs +10 -10
  59. package/dist/esm/extractor/bundleConfig.native.js +10 -10
  60. package/dist/esm/extractor/bundleConfig.native.js.map +2 -2
  61. package/dist/esm/extractor/createExtractor.js +10 -4
  62. package/dist/esm/extractor/createExtractor.js.map +1 -1
  63. package/dist/esm/extractor/createExtractor.mjs +4 -4
  64. package/dist/esm/extractor/createExtractor.native.js +3 -3
  65. package/dist/esm/extractor/createExtractor.native.js.map +2 -2
  66. package/dist/esm/extractor/extractHelpers.js +1 -1
  67. package/dist/esm/extractor/extractHelpers.js.map +1 -1
  68. package/dist/esm/extractor/extractHelpers.mjs +1 -1
  69. package/dist/esm/extractor/extractHelpers.native.js +1 -1
  70. package/dist/esm/extractor/extractHelpers.native.js.map +1 -1
  71. package/dist/esm/extractor/extractMediaStyle.js +8 -2
  72. package/dist/esm/extractor/extractMediaStyle.js.map +1 -1
  73. package/dist/esm/extractor/extractMediaStyle.mjs +2 -2
  74. package/dist/esm/extractor/extractMediaStyle.native.js +2 -2
  75. package/dist/esm/extractor/extractMediaStyle.native.js.map +2 -2
  76. package/dist/esm/extractor/extractToClassNames.js +3 -2
  77. package/dist/esm/extractor/extractToClassNames.js.map +1 -1
  78. package/dist/esm/extractor/extractToClassNames.mjs +3 -2
  79. package/dist/esm/extractor/extractToClassNames.native.js +3 -2
  80. package/dist/esm/extractor/extractToClassNames.native.js.map +2 -2
  81. package/dist/esm/extractor/generateTamaguiStudioConfig.js +12 -8
  82. package/dist/esm/extractor/generateTamaguiStudioConfig.js.map +1 -1
  83. package/dist/esm/extractor/generateTamaguiStudioConfig.mjs +6 -6
  84. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +7 -7
  85. package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
  86. package/dist/esm/extractor/generatedUid.js.map +1 -1
  87. package/dist/esm/extractor/generatedUid.native.js.map +1 -1
  88. package/dist/esm/extractor/getStaticBindingsForScope.js +1 -1
  89. package/dist/esm/extractor/getStaticBindingsForScope.js.map +1 -1
  90. package/dist/esm/extractor/getStaticBindingsForScope.mjs +1 -1
  91. package/dist/esm/extractor/getStaticBindingsForScope.native.js +1 -1
  92. package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +1 -1
  93. package/dist/esm/extractor/loadTamagui.js +14 -47
  94. package/dist/esm/extractor/loadTamagui.js.map +1 -1
  95. package/dist/esm/extractor/loadTamagui.mjs +13 -41
  96. package/dist/esm/extractor/loadTamagui.native.js +15 -77
  97. package/dist/esm/extractor/loadTamagui.native.js.map +2 -2
  98. package/dist/esm/extractor/watchTamaguiConfig.js +38 -0
  99. package/dist/esm/extractor/watchTamaguiConfig.js.map +6 -0
  100. package/dist/esm/extractor/watchTamaguiConfig.mjs +31 -0
  101. package/dist/esm/extractor/watchTamaguiConfig.native.js +183 -0
  102. package/dist/esm/extractor/watchTamaguiConfig.native.js.map +6 -0
  103. package/dist/esm/index.js +15 -1
  104. package/dist/esm/index.js.map +1 -1
  105. package/dist/esm/index.mjs +13 -2
  106. package/dist/esm/index.native.js +15 -1
  107. package/dist/esm/index.native.js.map +2 -2
  108. package/dist/esm/registerRequire.js +2 -2
  109. package/dist/esm/registerRequire.js.map +1 -1
  110. package/dist/esm/registerRequire.mjs +3 -3
  111. package/dist/esm/registerRequire.native.js +3 -3
  112. package/dist/esm/registerRequire.native.js.map +2 -2
  113. package/package.json +25 -19
  114. package/src/extractor/bundle.ts +4 -4
  115. package/src/extractor/bundleConfig.ts +10 -10
  116. package/src/extractor/createExtractor.ts +10 -4
  117. package/src/extractor/extractHelpers.ts +1 -1
  118. package/src/extractor/extractMediaStyle.ts +8 -2
  119. package/src/extractor/extractToClassNames.ts +3 -2
  120. package/src/extractor/generateTamaguiStudioConfig.ts +14 -10
  121. package/src/extractor/generatedUid.ts +0 -1
  122. package/src/extractor/getStaticBindingsForScope.ts +5 -1
  123. package/src/extractor/loadTamagui.ts +14 -57
  124. package/src/extractor/watchTamaguiConfig.ts +46 -0
  125. package/src/index.ts +11 -1
  126. package/src/registerRequire.ts +2 -3
  127. package/types/extractor/createExtractor.d.ts.map +1 -1
  128. package/types/extractor/extractMediaStyle.d.ts +3 -2
  129. package/types/extractor/extractMediaStyle.d.ts.map +1 -1
  130. package/types/extractor/extractToClassNames.d.ts.map +1 -1
  131. package/types/extractor/generateTamaguiStudioConfig.d.ts.map +1 -1
  132. package/types/extractor/generatedUid.d.ts.map +1 -1
  133. package/types/extractor/getStaticBindingsForScope.d.ts.map +1 -1
  134. package/types/extractor/loadTamagui.d.ts +3 -4
  135. package/types/extractor/loadTamagui.d.ts.map +1 -1
  136. package/types/extractor/watchTamaguiConfig.d.ts +5 -0
  137. package/types/extractor/watchTamaguiConfig.d.ts.map +1 -0
  138. package/types/index.d.ts +11 -1
  139. package/types/index.d.ts.map +1 -1
  140. package/types/registerRequire.d.ts.map +1 -1
  141. package/src/static.ts +0 -10
@@ -2,15 +2,15 @@ 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
4
  import esbuild from "esbuild";
5
- import { existsSync, pathExists, readJSON, writeFile } from "fs-extra";
5
+ import * as fsExtra from "fs-extra";
6
+ import { readFile } from "fs/promises";
6
7
  import { SHOULD_DEBUG } from "../constants.mjs";
7
8
  import { requireTamaguiCore } from "../helpers/requireTamaguiCore.mjs";
8
9
  import { minifyCSS } from "../minifyCSS.mjs";
9
10
  import { getNameToPaths, registerRequire } from "../registerRequire.mjs";
10
- import { TamaguiProjectInfo, getBundledConfig, hasBundledConfigChanged, loadComponents } from "./bundleConfig.mjs";
11
+ import { getBundledConfig, hasBundledConfigChanged, loadComponents } from "./bundleConfig.mjs";
11
12
  import { generateTamaguiStudioConfig, generateTamaguiStudioConfigSync, generateTamaguiThemes } from "./generateTamaguiStudioConfig.mjs";
12
13
  import { getTamaguiConfigPathFromOptionsConfig } from "./getTamaguiConfigPathFromOptionsConfig.mjs";
13
- import { readFile } from "fs/promises";
14
14
  const getFilledOptions = propsIn => ({
15
15
  // defaults
16
16
  platform: "web",
@@ -26,7 +26,7 @@ async function loadTamagui(propsIn) {
26
26
  if (bundleInfo) {
27
27
  const {
28
28
  createTamagui
29
- } = requireTamaguiCore(props.platform),
29
+ } = requireTamaguiCore(props.platform || "web"),
30
30
  config = createTamagui(bundleInfo.tamaguiConfig),
31
31
  {
32
32
  outputCSS
@@ -34,7 +34,7 @@ async function loadTamagui(propsIn) {
34
34
  if (outputCSS && props.platform === "web") {
35
35
  const flush = async () => {
36
36
  colorLog(Color.FgYellow, ` \u27A1 [tamagui] output css: ${outputCSS}
37
- `), await writeFile(outputCSS, css);
37
+ `), await fsExtra.writeFile(outputCSS, css);
38
38
  },
39
39
  cssOut = config.getCSS(),
40
40
  css = props.disableMinifyCSS === !1 ? minifyCSS(cssOut).code : cssOut;
@@ -63,7 +63,7 @@ const generateThemesAndLog = async (options, force = !1) => {
63
63
  lastVersion = {};
64
64
  function loadTamaguiBuildConfigSync(tamaguiOptions) {
65
65
  const buildFilePath = tamaguiOptions?.buildFile ?? "tamagui.build.ts";
66
- if (existsSync(buildFilePath)) {
66
+ if (fsExtra.existsSync(buildFilePath)) {
67
67
  const registered = registerRequire("web");
68
68
  try {
69
69
  const out = require(buildFilePath).default;
@@ -95,7 +95,7 @@ function loadTamaguiSync({
95
95
  process.env.IS_STATIC = "is_static", process.env.TAMAGUI_IS_SERVER = "true";
96
96
  const {
97
97
  unregister
98
- } = registerRequire(props.platform, {
98
+ } = registerRequire(props.platform || "web", {
99
99
  proxyWormImports: !!forceExports
100
100
  });
101
101
  try {
@@ -115,7 +115,7 @@ function loadTamaguiSync({
115
115
  if (tamaguiConfig) {
116
116
  const {
117
117
  createTamagui
118
- } = requireTamaguiCore(props.platform);
118
+ } = requireTamaguiCore(props.platform || "web");
119
119
  createTamagui(tamaguiConfig);
120
120
  }
121
121
  }
@@ -157,7 +157,7 @@ function loadTamaguiSync({
157
157
  `)) : SHOULD_DEBUG && console.error(err) : console.error("Error loading tamagui.config.ts", err);
158
158
  const {
159
159
  createTamagui
160
- } = requireTamaguiCore(props.platform),
160
+ } = requireTamaguiCore(props.platform || "web"),
161
161
  {
162
162
  getDefaultTamaguiConfig
163
163
  } = require("@tamagui/config-default");
@@ -181,7 +181,7 @@ async function getOptions({
181
181
  const dotDir = join(root, ".tamagui");
182
182
  let pkgJson = {};
183
183
  try {
184
- pkgJson = await readJSON(join(root, "package.json"));
184
+ pkgJson = await fsExtra.readJSON(join(root, "package.json"));
185
185
  } catch {}
186
186
  return {
187
187
  mode: process.env.NODE_ENV === "production" ? "production" : "development",
@@ -212,46 +212,18 @@ function resolveWebOrNativeSpecificEntry(entry) {
212
212
  ext = extname(resolved),
213
213
  fileName = basename(resolved).replace(ext, ""),
214
214
  specificFile = join(dirname(resolved), fileName + "." + "web" + ext);
215
- return existsSync(specificFile) ? specificFile : entry;
215
+ return fsExtra.existsSync(specificFile) ? specificFile : entry;
216
216
  }
217
217
  const defaultPaths = ["tamagui.config.ts", join("src", "tamagui.config.ts")];
218
218
  let hasWarnedOnce = !1;
219
219
  async function getDefaultTamaguiConfigPath(root, configPath) {
220
220
  const searchPaths = [...new Set([configPath, ...defaultPaths].filter(Boolean).map(p => join(root, p)))];
221
- for (const path of searchPaths) if (await pathExists(path)) return path;
221
+ for (const path of searchPaths) if (await fsExtra.pathExists(path)) return path;
222
222
  hasWarnedOnce || (hasWarnedOnce = !0, console.warn(`Warning: couldn't find tamagui.config.ts in the following paths given configuration "${configPath}":
223
223
  ${searchPaths.join(`
224
224
  `)}
225
225
  `));
226
226
  }
227
- async function watchTamaguiConfig(tamaguiOptions) {
228
- const options = await getOptions({
229
- tamaguiOptions
230
- });
231
- if (!options.tamaguiOptions.config) throw new Error("No config");
232
- if (process.env.NODE_ENV === "production") return {
233
- dispose() {}
234
- };
235
- const disposeConfigWatcher = await esbuildWatchFiles(options.tamaguiOptions.config, () => {
236
- generateTamaguiStudioConfig(options.tamaguiOptions, null, !0);
237
- }),
238
- themeBuilderInput = options.tamaguiOptions.themeBuilder?.input;
239
- let disposeThemesWatcher;
240
- if (themeBuilderInput) {
241
- let inputPath = themeBuilderInput;
242
- try {
243
- inputPath = require.resolve(themeBuilderInput);
244
- } catch {}
245
- disposeThemesWatcher = await esbuildWatchFiles(inputPath, () => {
246
- generateThemesAndLog(options.tamaguiOptions);
247
- });
248
- }
249
- return {
250
- dispose() {
251
- disposeConfigWatcher(), disposeThemesWatcher?.();
252
- }
253
- };
254
- }
255
227
  async function esbuildWatchFiles(entry, onChanged) {
256
228
  let hasRunOnce = !1;
257
229
  const context = await esbuild.context({
@@ -275,4 +247,4 @@ async function esbuildWatchFiles(entry, onChanged) {
275
247
  context.dispose();
276
248
  };
277
249
  }
278
- export { TamaguiProjectInfo, getOptions, loadTamagui, loadTamaguiBuildConfigSync, loadTamaguiSync, resolveWebOrNativeSpecificEntry, watchTamaguiConfig };
250
+ export { esbuildWatchFiles, generateThemesAndLog, getOptions, loadTamagui, loadTamaguiBuildConfigSync, loadTamaguiSync, resolveWebOrNativeSpecificEntry };
@@ -2,15 +2,15 @@ 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
4
  import esbuild from "esbuild";
5
- import { existsSync, pathExists, readJSON, writeFile } from "fs-extra";
5
+ import * as fsExtra from "fs-extra";
6
+ import { readFile } from "fs/promises";
6
7
  import { SHOULD_DEBUG } from "../constants";
7
8
  import { requireTamaguiCore } from "../helpers/requireTamaguiCore";
8
9
  import { minifyCSS } from "../minifyCSS";
9
10
  import { getNameToPaths, registerRequire } from "../registerRequire";
10
- import { TamaguiProjectInfo, getBundledConfig, hasBundledConfigChanged, loadComponents } from "./bundleConfig";
11
+ import { getBundledConfig, hasBundledConfigChanged, loadComponents } from "./bundleConfig";
11
12
  import { generateTamaguiStudioConfig, generateTamaguiStudioConfigSync, generateTamaguiThemes } from "./generateTamaguiStudioConfig";
12
13
  import { getTamaguiConfigPathFromOptionsConfig } from "./getTamaguiConfigPathFromOptionsConfig";
13
- import { readFile } from "fs/promises";
14
14
  function _array_like_to_array(arr, len) {
15
15
  (len == null || len > arr.length) && (len = arr.length);
16
16
  for (var i = 0, arr2 = new Array(len); i < len; i++)
@@ -256,7 +256,7 @@ function _loadTamagui() {
256
256
  3,
257
257
  10
258
258
  ];
259
- if (createTamagui = requireTamaguiCore(props.platform).createTamagui, config = createTamagui(bundleInfo.tamaguiConfig), outputCSS = props.outputCSS, !(outputCSS && props.platform === "web"))
259
+ if (createTamagui = requireTamaguiCore(props.platform || "web").createTamagui, config = createTamagui(bundleInfo.tamaguiConfig), outputCSS = props.outputCSS, !(outputCSS && props.platform === "web"))
260
260
  return [
261
261
  3,
262
262
  10
@@ -269,7 +269,7 @@ function _loadTamagui() {
269
269
  return colorLog(Color.FgYellow, " \u27A1 [tamagui] output css: ".concat(outputCSS, `
270
270
  `)), [
271
271
  4,
272
- writeFile(outputCSS, css)
272
+ fsExtra.writeFile(outputCSS, css)
273
273
  ];
274
274
  case 1:
275
275
  return _state2.sent(), [
@@ -396,7 +396,7 @@ var waiting = !1, hasLoggedOnce = !1, generateThemesAndLog = function() {
396
396
  }(), last = {}, lastVersion = {};
397
397
  function loadTamaguiBuildConfigSync(tamaguiOptions) {
398
398
  var _tamaguiOptions_buildFile, buildFilePath = (_tamaguiOptions_buildFile = tamaguiOptions == null ? void 0 : tamaguiOptions.buildFile) !== null && _tamaguiOptions_buildFile !== void 0 ? _tamaguiOptions_buildFile : "tamagui.build.ts";
399
- if (existsSync(buildFilePath)) {
399
+ if (fsExtra.existsSync(buildFilePath)) {
400
400
  var registered = registerRequire("web");
401
401
  try {
402
402
  var out = require(buildFilePath).default;
@@ -426,7 +426,7 @@ function loadTamaguiSync(_param) {
426
426
  lastVersion[key] = cacheKey || "";
427
427
  var props = getFilledOptions(propsIn);
428
428
  process.env.IS_STATIC = "is_static", process.env.TAMAGUI_IS_SERVER = "true";
429
- var unregister = registerRequire(props.platform, {
429
+ var unregister = registerRequire(props.platform || "web", {
430
430
  proxyWormImports: !!forceExports
431
431
  }).unregister;
432
432
  try {
@@ -443,7 +443,7 @@ function loadTamaguiSync(_param) {
443
443
  Be sure you "export default" or "export const config" the config.`));
444
444
  }
445
445
  if (tamaguiConfig) {
446
- var createTamagui = requireTamaguiCore(props.platform).createTamagui;
446
+ var createTamagui = requireTamaguiCore(props.platform || "web").createTamagui;
447
447
  createTamagui(tamaguiConfig);
448
448
  }
449
449
  }
@@ -480,7 +480,7 @@ function loadTamaguiSync(_param) {
480
480
  `.concat(err.message, `
481
481
 
482
482
  `))) : SHOULD_DEBUG && console.error(err) : console.error("Error loading tamagui.config.ts", err);
483
- var createTamagui1 = requireTamaguiCore(props.platform).createTamagui, getDefaultTamaguiConfig = require("@tamagui/config-default").getDefaultTamaguiConfig;
483
+ var createTamagui1 = requireTamaguiCore(props.platform || "web").createTamagui, getDefaultTamaguiConfig = require("@tamagui/config-default").getDefaultTamaguiConfig;
484
484
  return {
485
485
  components: [],
486
486
  tamaguiConfig: createTamagui1(getDefaultTamaguiConfig()),
@@ -509,7 +509,7 @@ function _getOptions() {
509
509
  4
510
510
  ]), [
511
511
  4,
512
- readJSON(join(root, "package.json"))
512
+ fsExtra.readJSON(join(root, "package.json"))
513
513
  ];
514
514
  case 2:
515
515
  return pkgJson = _state.sent(), [
@@ -562,7 +562,7 @@ function resolveWebOrNativeSpecificEntry(entry) {
562
562
  workspaceRoot
563
563
  ]
564
564
  }), ext = extname(resolved), fileName = basename(resolved).replace(ext, ""), specificExt = "native", specificFile = join(dirname(resolved), fileName + "." + specificExt + ext);
565
- return existsSync(specificFile) ? specificFile : entry;
565
+ return fsExtra.existsSync(specificFile) ? specificFile : entry;
566
566
  }
567
567
  var defaultPaths = [
568
568
  "tamagui.config.ts",
@@ -595,7 +595,7 @@ function _getDefaultTamaguiConfigPath() {
595
595
  5
596
596
  ] : (path = _step.value, [
597
597
  4,
598
- pathExists(path)
598
+ fsExtra.pathExists(path)
599
599
  ]);
600
600
  case 3:
601
601
  if (_state.sent())
@@ -640,68 +640,6 @@ function _getDefaultTamaguiConfigPath() {
640
640
  });
641
641
  }), _getDefaultTamaguiConfigPath.apply(this, arguments);
642
642
  }
643
- function watchTamaguiConfig(tamaguiOptions) {
644
- return _watchTamaguiConfig.apply(this, arguments);
645
- }
646
- function _watchTamaguiConfig() {
647
- return _watchTamaguiConfig = _async_to_generator(function(tamaguiOptions) {
648
- var _options_tamaguiOptions_themeBuilder, options, disposeConfigWatcher, themeBuilderInput, disposeThemesWatcher, inputPath;
649
- return _ts_generator(this, function(_state) {
650
- switch (_state.label) {
651
- case 0:
652
- return [
653
- 4,
654
- getOptions({
655
- tamaguiOptions
656
- })
657
- ];
658
- case 1:
659
- if (options = _state.sent(), !options.tamaguiOptions.config)
660
- throw new Error("No config");
661
- return process.env.NODE_ENV === "production" ? [
662
- 2,
663
- {
664
- dispose: function() {
665
- }
666
- }
667
- ] : [
668
- 4,
669
- esbuildWatchFiles(options.tamaguiOptions.config, function() {
670
- generateTamaguiStudioConfig(options.tamaguiOptions, null, !0);
671
- })
672
- ];
673
- case 2:
674
- if (disposeConfigWatcher = _state.sent(), themeBuilderInput = (_options_tamaguiOptions_themeBuilder = options.tamaguiOptions.themeBuilder) === null || _options_tamaguiOptions_themeBuilder === void 0 ? void 0 : _options_tamaguiOptions_themeBuilder.input, !themeBuilderInput)
675
- return [
676
- 3,
677
- 4
678
- ];
679
- inputPath = themeBuilderInput;
680
- try {
681
- inputPath = require.resolve(themeBuilderInput);
682
- } catch {
683
- }
684
- return [
685
- 4,
686
- esbuildWatchFiles(inputPath, function() {
687
- generateThemesAndLog(options.tamaguiOptions);
688
- })
689
- ];
690
- case 3:
691
- disposeThemesWatcher = _state.sent(), _state.label = 4;
692
- case 4:
693
- return [
694
- 2,
695
- {
696
- dispose: function() {
697
- disposeConfigWatcher(), disposeThemesWatcher == null || disposeThemesWatcher();
698
- }
699
- }
700
- ];
701
- }
702
- });
703
- }), _watchTamaguiConfig.apply(this, arguments);
704
- }
705
643
  function esbuildWatchFiles(entry, onChanged) {
706
644
  return _esbuildWatchFiles.apply(this, arguments);
707
645
  }
@@ -752,12 +690,12 @@ function _esbuildWatchFiles() {
752
690
  }), _esbuildWatchFiles.apply(this, arguments);
753
691
  }
754
692
  export {
755
- TamaguiProjectInfo,
693
+ esbuildWatchFiles,
694
+ generateThemesAndLog,
756
695
  getOptions,
757
696
  loadTamagui,
758
697
  loadTamaguiBuildConfigSync,
759
698
  loadTamaguiSync,
760
- resolveWebOrNativeSpecificEntry,
761
- watchTamaguiConfig
699
+ resolveWebOrNativeSpecificEntry
762
700
  };
763
701
  //# sourceMappingURL=loadTamagui.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/loadTamagui.ts"],
4
- "mappings": "AAAA,SAASA,cAAcC,qBAAqB;AAC5C,SAASC,UAAUC,SAASC,SAASC,MAAMC,UAAUC,eAAe;AAEpE,SAASC,OAAOC,gBAAgB;AAGhC,OAAOC,aAAa;AACpB,SAASC,YAAwBC,YAAYC,UAAUC,iBAAiB;AAExE,SAASC,oBAAoB;AAC7B,SAASC,0BAA0B;AACnC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgBC,uBAAuB;AAChD,SACEC,oBACAC,kBACAC,yBACAC,sBACK;AACP,SACEC,6BACAC,iCACAC,6BACK;AACP,SAASC,6CAA6C;AACtD,SAASC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,IAAMC,mBAAmB,SAACC,SAAAA;SAAsD,eAAA;;IAE9EC,UAAWC;IACXC,QAAQ;IACRC,YAAY;MAAC;;KACTJ,OAAAA;;AAGN,SAAsBK,YACpBL,SAAgC;SADZK,aAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,eAAAA;AAAAA,wBAAf,oBAAA,SACLL,SAAgC;QAE1BM,OAEAC,YAiBI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O,mBAAiB;gBAAG;gBAAO;gBAAQ;gBAAO;gBAAQ;;cAClDC,UAAU;cACVC,OAAO;cACPC,SAAO;gBACL;kBACEC,MAAO;kBACPC,OAAAA,SAAM,OAAS;wBAAPC,QAAF,MAAEA;AACNA,0BAAM,WAAA;AACJ,sBAAKX,aAGHD,UAAAA,IAFAC,aAAa;oBAIjB,CAAA;kBACF;gBACF;;YAEJ,CAAA;;;AApBMC,2BAAU,OAAA,KAAA,GAuBXA,QAAQW,MAAK,GAElB;;YAAO,WAAA;AACLX,sBAAQX,QAAO;YACjB;;;;EACF,CAAA,GApCeC,mBAAAA,MAAAA,MAAAA,SAAAA;;",
5
- "names": ["readFileSync", "writeFileSync", "basename", "dirname", "extname", "join", "relative", "resolve", "Color", "colorLog", "esbuild", "existsSync", "pathExists", "readJSON", "writeFile", "SHOULD_DEBUG", "requireTamaguiCore", "minifyCSS", "getNameToPaths", "registerRequire", "TamaguiProjectInfo", "getBundledConfig", "hasBundledConfigChanged", "loadComponents", "generateTamaguiStudioConfig", "generateTamaguiStudioConfigSync", "generateTamaguiThemes", "getTamaguiConfigPathFromOptionsConfig", "readFile", "getFilledOptions", "propsIn", "platform", "process", "config", "components", "loadTamagui", "props", "bundleInfo", "createTamagui", "outputCSS", "flush", "cssOut", "css", "generateThemesAndLog", "console", "warn", "tamaguiConfig", "FgYellow", "_state", "getCSS", "disableMinifyCSS", "code", "env", "NODE_ENV", "waiting", "hasLoggedOnce", "options", "force", "didGenerate", "whitespaceBefore", "themeBuilder", "Promise", "res", "setTimeout", "cwd", "output", "last", "lastVersion", "loadTamaguiBuildConfigSync", "tamaguiOptions", "buildFilePath", "buildFile", "registered", "out", "require", "default", "Error", "unregister", "loadTamaguiSync", "forceExports", "cacheKey", "key", "JSON", "stringify", "IS_STATIC", "TAMAGUI_IS_SERVER", "proxyWormImports", "devValueOG", "globalThis", "configPath", "exp", "parsed", "confPath", "DEBUG", "info", "undefined", "nameToPaths", "cached", "err", "message", "error", "getDefaultTamaguiConfig", "getOptions", "root", "tsconfigPath", "host", "debug", "dotDir", "pkgJson", "mode", "getDefaultTamaguiConfigPath", "paths", "conf", "types", "resolveWebOrNativeSpecificEntry", "entry", "workspaceRoot", "resolved", "ext", "fileName", "replace", "specificExt", "specificFile", "defaultPaths", "hasWarnedOnce", "searchPaths", "path", "Set", "filter", "Boolean", "map", "p", "watchTamaguiConfig", "tamaguiOptions", "options", "disposeConfigWatcher", "themeBuilderInput", "disposeThemesWatcher", "inputPath", "getOptions", "config", "Error", "process", "env", "NODE_ENV", "dispose", "esbuildWatchFiles", "generateTamaguiStudioConfig", "themeBuilder", "input", "require", "resolve", "generateThemesAndLog", "entry", "onChanged", "hasRunOnce", "context", "esbuild", "bundle", "entryPoints", "resolveExtensions", "logLevel", "write", "plugins", "name", "setup", "onEnd", "watch"]
4
+ "mappings": "AAAA,SAASA,cAAcC,qBAAqB;AAC5C,SAASC,UAAUC,SAASC,SAASC,MAAMC,UAAUC,eAAe;AAEpE,SAASC,OAAOC,gBAAgB;AAGhC,OAAOC,aAAa;AACpB,YAAYC,aAAa;AAEzB,SAASC,gBAAgB;AACzB,SAASC,oBAAoB;AAC7B,SAASC,0BAA0B;AACnC,SAASC,iBAAiB;AAC1B,SAASC,gBAAgBC,uBAAuB;AAChD,SAEEC,kBACAC,yBACAC,sBACK;AACP,SACEC,6BACAC,iCACAC,6BACK;AACP,SAASC,6CAA6C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,IAAMC,mBAAmB,SAACC,SAAAA;SAAsD,eAAA;;IAE9EC,UAAWC;IACXC,QAAQ;IACRC,YAAY;MAAC;;KACTJ,OAAAA;;AA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AAgB,IAChBnF,QAAQC,KAAM,wFACZmF,OADmGrC,YAAW;KAAA,EACrF,OAAzBqC,YAAYvH,KAAM;GAAA,GAAO;GAAA,CAAA;;;;;EAG/B,CAAA,GAnBewG,6BAAAA,MAAAA,MAAAA,SAAAA;;AAuBf,SAAsBuB,kBAAkBlB,OAAemB,WAAqB;SAAtDD,mBAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,qBAAAA;AAAAA,8BAAf,oBAAA,SAAiClB,OAAemB,WAAqB;QACtEC,YAOEC;;;;AAPFD,8BAAa,IAOD;;YAAM5H,QAAQ6H,QAAQ;cACpCC,QAAQ;cACRC,aAAW;gBAAGvB;;cACdwB,mBAAiB;gBAAG;gBAAO;gBAAQ;gBAAO;gBAAQ;;cAClDC,UAAU;cACVC,OAAO;cACPC,SAAO;gBACL;kBACEC,MAAO;kBACPC,OAAAA,SAAM,OAAS;wBAAPC,QAAF,MAAEA;AACNA,0BAAM,WAAA;AACJ,sBAAKV,aAGHD,UAAAA,IAFAC,aAAa;oBAIjB,CAAA;kBACF;gBACF;;YAEJ,CAAA;;;AApBMC,2BAAU,OAAA,KAAA,GAuBXA,QAAQU,MAAK,GAElB;;YAAO,WAAA;AACLV,sBAAQW,QAAO;YACjB;;;;EACF,CAAA,GApCsBd,mBAAAA,MAAAA,MAAAA,SAAAA;;",
5
+ "names": ["readFileSync", "writeFileSync", "basename", "dirname", "extname", "join", "relative", "resolve", "Color", "colorLog", "esbuild", "fsExtra", "readFile", "SHOULD_DEBUG", "requireTamaguiCore", "minifyCSS", "getNameToPaths", "registerRequire", "getBundledConfig", "hasBundledConfigChanged", "loadComponents", "generateTamaguiStudioConfig", "generateTamaguiStudioConfigSync", "generateTamaguiThemes", "getTamaguiConfigPathFromOptionsConfig", "getFilledOptions", "propsIn", "platform", "process", "config", "components", "loadTamagui", "props", "bundleInfo", "createTamagui", "outputCSS", "flush", "cssOut", "css", "generateThemesAndLog", "console", "warn", "tamaguiConfig", "FgYellow", "writeFile", "_state", "getCSS", "disableMinifyCSS", "code", "env", "NODE_ENV", "waiting", "hasLoggedOnce", "options", "force", "didGenerate", "whitespaceBefore", "themeBuilder", "Promise", "res", "setTimeout", "cwd", "output", "last", "lastVersion", "loadTamaguiBuildConfigSync", "tamaguiOptions", "buildFilePath", "buildFile", "existsSync", "registered", "out", "require", "default", "Error", "unregister", "loadTamaguiSync", "forceExports", "cacheKey", "key", "JSON", "stringify", "IS_STATIC", "TAMAGUI_IS_SERVER", "proxyWormImports", "devValueOG", "globalThis", "configPath", "exp", "parsed", "confPath", "DEBUG", "info", "undefined", "nameToPaths", "cached", "err", "message", "error", "getDefaultTamaguiConfig", "getOptions", "root", "tsconfigPath", "host", "debug", "dotDir", "pkgJson", "readJSON", "mode", "getDefaultTamaguiConfigPath", "paths", "conf", "types", "resolveWebOrNativeSpecificEntry", "entry", "workspaceRoot", "resolved", "ext", "fileName", "replace", "specificExt", "specificFile", "defaultPaths", "hasWarnedOnce", "searchPaths", "path", "Set", "filter", "Boolean", "map", "p", "pathExists", "esbuildWatchFiles", "onChanged", "hasRunOnce", "context", "bundle", "entryPoints", "resolveExtensions", "logLevel", "write", "plugins", "name", "setup", "onEnd", "watch", "dispose"]
6
6
  }
@@ -0,0 +1,38 @@
1
+ import { generateTamaguiStudioConfig } from "./generateTamaguiStudioConfig";
2
+ import { getOptions, esbuildWatchFiles, generateThemesAndLog } from "./loadTamagui";
3
+ async function watchTamaguiConfig(tamaguiOptions) {
4
+ const options = await getOptions({ tamaguiOptions });
5
+ if (!options.tamaguiOptions.config)
6
+ throw new Error("No config");
7
+ if (process.env.NODE_ENV === "production")
8
+ return {
9
+ dispose() {
10
+ }
11
+ };
12
+ const disposeConfigWatcher = await esbuildWatchFiles(
13
+ options.tamaguiOptions.config,
14
+ () => {
15
+ generateTamaguiStudioConfig(options.tamaguiOptions, null, !0);
16
+ }
17
+ ), themeBuilderInput = options.tamaguiOptions.themeBuilder?.input;
18
+ let disposeThemesWatcher;
19
+ if (themeBuilderInput) {
20
+ let inputPath = themeBuilderInput;
21
+ try {
22
+ inputPath = require.resolve(themeBuilderInput);
23
+ } catch {
24
+ }
25
+ disposeThemesWatcher = await esbuildWatchFiles(inputPath, () => {
26
+ generateThemesAndLog(options.tamaguiOptions);
27
+ });
28
+ }
29
+ return {
30
+ dispose() {
31
+ disposeConfigWatcher(), disposeThemesWatcher?.();
32
+ }
33
+ };
34
+ }
35
+ export {
36
+ watchTamaguiConfig
37
+ };
38
+ //# sourceMappingURL=watchTamaguiConfig.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/extractor/watchTamaguiConfig.ts"],
4
+ "mappings": "AACA,SAAS,mCAAmC;AAC5C,SAAS,YAAY,mBAAmB,4BAA4B;AAEpE,eAAsB,mBAAmB,gBAAgC;AACvE,QAAM,UAAU,MAAM,WAAW,EAAE,eAAe,CAAC;AAEnD,MAAI,CAAC,QAAQ,eAAe;AAC1B,UAAM,IAAI,MAAM,WAAW;AAG7B,MAAI,QAAQ,IAAI,aAAa;AAC3B,WAAO;AAAA,MACL,UAAU;AAAA,MAAC;AAAA,IACb;AAGF,QAAM,uBAAuB,MAAM;AAAA,IACjC,QAAQ,eAAe;AAAA,IACvB,MAAM;AACJ,MAAK,4BAA4B,QAAQ,gBAAgB,MAAM,EAAI;AAAA,IACrE;AAAA,EACF,GAEM,oBAAoB,QAAQ,eAAe,cAAc;AAC/D,MAAI;AAEJ,MAAI,mBAAmB;AACrB,QAAI,YAAY;AAChB,QAAI;AACF,kBAAY,QAAQ,QAAQ,iBAAiB;AAAA,IAC/C,QAAQ;AAAA,IAER;AACA,2BAAuB,MAAM,kBAAkB,WAAW,MAAM;AAC9D,MAAK,qBAAqB,QAAQ,cAAc;AAAA,IAClD,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,UAAU;AACR,2BAAqB,GACrB,uBAAuB;AAAA,IACzB;AAAA,EACF;AACF;",
5
+ "names": []
6
+ }
@@ -0,0 +1,31 @@
1
+ import { generateTamaguiStudioConfig } from "./generateTamaguiStudioConfig.mjs";
2
+ import { getOptions, esbuildWatchFiles, generateThemesAndLog } from "./loadTamagui.mjs";
3
+ async function watchTamaguiConfig(tamaguiOptions) {
4
+ const options = await getOptions({
5
+ tamaguiOptions
6
+ });
7
+ if (!options.tamaguiOptions.config) throw new Error("No config");
8
+ if (process.env.NODE_ENV === "production") return {
9
+ dispose() {}
10
+ };
11
+ const disposeConfigWatcher = await esbuildWatchFiles(options.tamaguiOptions.config, () => {
12
+ generateTamaguiStudioConfig(options.tamaguiOptions, null, !0);
13
+ }),
14
+ themeBuilderInput = options.tamaguiOptions.themeBuilder?.input;
15
+ let disposeThemesWatcher;
16
+ if (themeBuilderInput) {
17
+ let inputPath = themeBuilderInput;
18
+ try {
19
+ inputPath = require.resolve(themeBuilderInput);
20
+ } catch {}
21
+ disposeThemesWatcher = await esbuildWatchFiles(inputPath, () => {
22
+ generateThemesAndLog(options.tamaguiOptions);
23
+ });
24
+ }
25
+ return {
26
+ dispose() {
27
+ disposeConfigWatcher(), disposeThemesWatcher?.();
28
+ }
29
+ };
30
+ }
31
+ export { watchTamaguiConfig };
@@ -0,0 +1,183 @@
1
+ import { generateTamaguiStudioConfig } from "./generateTamaguiStudioConfig";
2
+ import { getOptions, esbuildWatchFiles, generateThemesAndLog } from "./loadTamagui";
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
4
+ try {
5
+ var info = gen[key](arg), value = info.value;
6
+ } catch (error) {
7
+ reject(error);
8
+ return;
9
+ }
10
+ info.done ? resolve(value) : Promise.resolve(value).then(_next, _throw);
11
+ }
12
+ function _async_to_generator(fn) {
13
+ return function() {
14
+ var self = this, args = arguments;
15
+ return new Promise(function(resolve, reject) {
16
+ var gen = fn.apply(self, args);
17
+ function _next(value) {
18
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
19
+ }
20
+ function _throw(err) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
22
+ }
23
+ _next(void 0);
24
+ });
25
+ };
26
+ }
27
+ function _ts_generator(thisArg, body) {
28
+ var f, y, t, g, _ = {
29
+ label: 0,
30
+ sent: function() {
31
+ if (t[0] & 1)
32
+ throw t[1];
33
+ return t[1];
34
+ },
35
+ trys: [],
36
+ ops: []
37
+ };
38
+ return g = {
39
+ next: verb(0),
40
+ throw: verb(1),
41
+ return: verb(2)
42
+ }, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
43
+ return this;
44
+ }), g;
45
+ function verb(n) {
46
+ return function(v) {
47
+ return step([
48
+ n,
49
+ v
50
+ ]);
51
+ };
52
+ }
53
+ function step(op) {
54
+ if (f)
55
+ throw new TypeError("Generator is already executing.");
56
+ for (; _; )
57
+ try {
58
+ 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)
59
+ return t;
60
+ switch (y = 0, t && (op = [
61
+ op[0] & 2,
62
+ t.value
63
+ ]), op[0]) {
64
+ case 0:
65
+ case 1:
66
+ t = op;
67
+ break;
68
+ case 4:
69
+ return _.label++, {
70
+ value: op[1],
71
+ done: !1
72
+ };
73
+ case 5:
74
+ _.label++, y = op[1], op = [
75
+ 0
76
+ ];
77
+ continue;
78
+ case 7:
79
+ op = _.ops.pop(), _.trys.pop();
80
+ continue;
81
+ default:
82
+ if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
+ _ = 0;
84
+ continue;
85
+ }
86
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
+ _.label = op[1];
88
+ break;
89
+ }
90
+ if (op[0] === 6 && _.label < t[1]) {
91
+ _.label = t[1], t = op;
92
+ break;
93
+ }
94
+ if (t && _.label < t[2]) {
95
+ _.label = t[2], _.ops.push(op);
96
+ break;
97
+ }
98
+ t[2] && _.ops.pop(), _.trys.pop();
99
+ continue;
100
+ }
101
+ op = body.call(thisArg, _);
102
+ } catch (e) {
103
+ op = [
104
+ 6,
105
+ e
106
+ ], y = 0;
107
+ } finally {
108
+ f = t = 0;
109
+ }
110
+ if (op[0] & 5)
111
+ throw op[1];
112
+ return {
113
+ value: op[0] ? op[1] : void 0,
114
+ done: !0
115
+ };
116
+ }
117
+ }
118
+ function watchTamaguiConfig(tamaguiOptions) {
119
+ return _watchTamaguiConfig.apply(this, arguments);
120
+ }
121
+ function _watchTamaguiConfig() {
122
+ return _watchTamaguiConfig = _async_to_generator(function(tamaguiOptions) {
123
+ var _options_tamaguiOptions_themeBuilder, options, disposeConfigWatcher, themeBuilderInput, disposeThemesWatcher, inputPath;
124
+ return _ts_generator(this, function(_state) {
125
+ switch (_state.label) {
126
+ case 0:
127
+ return [
128
+ 4,
129
+ getOptions({
130
+ tamaguiOptions
131
+ })
132
+ ];
133
+ case 1:
134
+ if (options = _state.sent(), !options.tamaguiOptions.config)
135
+ throw new Error("No config");
136
+ return process.env.NODE_ENV === "production" ? [
137
+ 2,
138
+ {
139
+ dispose: function() {
140
+ }
141
+ }
142
+ ] : [
143
+ 4,
144
+ esbuildWatchFiles(options.tamaguiOptions.config, function() {
145
+ generateTamaguiStudioConfig(options.tamaguiOptions, null, !0);
146
+ })
147
+ ];
148
+ case 2:
149
+ if (disposeConfigWatcher = _state.sent(), themeBuilderInput = (_options_tamaguiOptions_themeBuilder = options.tamaguiOptions.themeBuilder) === null || _options_tamaguiOptions_themeBuilder === void 0 ? void 0 : _options_tamaguiOptions_themeBuilder.input, !themeBuilderInput)
150
+ return [
151
+ 3,
152
+ 4
153
+ ];
154
+ inputPath = themeBuilderInput;
155
+ try {
156
+ inputPath = require.resolve(themeBuilderInput);
157
+ } catch {
158
+ }
159
+ return [
160
+ 4,
161
+ esbuildWatchFiles(inputPath, function() {
162
+ generateThemesAndLog(options.tamaguiOptions);
163
+ })
164
+ ];
165
+ case 3:
166
+ disposeThemesWatcher = _state.sent(), _state.label = 4;
167
+ case 4:
168
+ return [
169
+ 2,
170
+ {
171
+ dispose: function() {
172
+ disposeConfigWatcher(), disposeThemesWatcher == null || disposeThemesWatcher();
173
+ }
174
+ }
175
+ ];
176
+ }
177
+ });
178
+ }), _watchTamaguiConfig.apply(this, arguments);
179
+ }
180
+ export {
181
+ watchTamaguiConfig
182
+ };
183
+ //# sourceMappingURL=watchTamaguiConfig.js.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/watchTamaguiConfig.ts"],
4
+ "mappings": "AACA,SAASA,mCAAmC;AAC5C,SAASC,YAAYC,mBAAmBC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEpE,SAAsBC,mBAAmBC,gBAA8B;SAAjDD,oBAAAA,MAAAA,MAAAA,SAAAA;;SAAAA,sBAAAA;AAAAA,+BAAf,oBAAA,SAAkCC,gBAA8B;QAoB3CC,sCAnBpBA,SAYAC,sBAOAC,mBACFC,sBAGEC;;;;AAvBU,iBAAA;;YAAMT,WAAW;cAAEI;YAAe,CAAA;;;AAElD,cAFMC,UAAU,OAAA,KAAA,GAEZ,CAACA,QAAQD,eAAeM;AAC1B,kBAAM,IAAIC,MAAO,WAAA;AAGnB,iBAAIC,QAAQC,IAAIC,aAAa,eAC3B;;YAAO;cACLC,SAAAA,WAAAA;cAAW;YACb;cAG2B;;YAAMd,kBACjCI,QAAQD,eAAeM,QACvB,WAAA;AACE,cAAKX,4BAA4BM,QAAQD,gBAAgB,MAAM,EAAA;YACjE,CAAA;;;cAJIE,uBAAuB,OAAA,KAAA,GAOvBC,qBAAoBF,uCAAAA,QAAQD,eAAeY,kBAAY,QAAnCX,yCAAAA,SAAAA,SAAAA,qCAAqCY,QAG3DV;AAAAA,mBAAAA;;;;AACEE,sBAAYF;AAChB,cAAI;AACFE,wBAAYS,QAAQC,QAAQZ,iBAAAA;UAC9B,QAAQ;UAER;AACuB,iBAAA;;YAAMN,kBAAkBQ,WAAW,WAAA;AACxD,cAAKP,qBAAqBG,QAAQD,cAAc;YAClD,CAAA;;;AAFAI,iCAAuB,OAAA,KAAA;;AAKzB,iBAAA;;YAAO;cACLO,SAAAA,WAAAA;AACET,qCAAAA,GACAE,wBAAAA,QAAAA,qBAAAA;cACF;YACF;;;;EACF,CAAA,GAzCsBL,oBAAAA,MAAAA,MAAAA,SAAAA;;",
5
+ "names": ["generateTamaguiStudioConfig", "getOptions", "esbuildWatchFiles", "generateThemesAndLog", "watchTamaguiConfig", "tamaguiOptions", "options", "disposeConfigWatcher", "themeBuilderInput", "disposeThemesWatcher", "inputPath", "config", "Error", "process", "env", "NODE_ENV", "dispose", "themeBuilder", "input", "require", "resolve"]
6
+ }