@tamagui/generate-themes 2.7.7 → 3.0.0-beta.1093.1

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.
@@ -1,118 +1,128 @@
1
1
  "use strict";
2
2
 
3
+ var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
6
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
9
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
12
14
  };
13
15
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
21
23
  };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
25
+ value: mod,
26
+ enumerable: true
27
+ }) : target, mod));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
29
  var generate_themes_exports = {};
26
- __export(generate_themes_exports, {
27
- generateThemes: () => generateThemes
28
- });
30
+ __export(generate_themes_exports, { generateThemes: () => generateThemes });
29
31
  module.exports = __toCommonJS(generate_themes_exports);
32
+ var import_module = __toESM(require("module"), 1);
30
33
  var import_path = require("path");
34
+ var ModuleInternals = import_module.default;
31
35
  var didRegisterOnce = false;
32
36
  async function generateThemes(inputFile) {
33
- var inputFilePath = inputFile[0] === "." ? (0, import_path.join)(process.cwd(), inputFile) : inputFile;
34
- if (!didRegisterOnce) {
35
- didRegisterOnce = true;
36
- require("esbuild-register/dist/node").register({
37
- hookIgnoreNodeModules: false
38
- });
39
- } else {
40
- purgeCache(inputFilePath);
41
- }
42
- var og = process.env.TAMAGUI_KEEP_THEMES;
43
- process.env.TAMAGUI_KEEP_THEMES = "1";
44
- process.env.TAMAGUI_RUN_THEMEBUILDER = "1";
45
- try {
46
- var requiredThemes = require(inputFilePath);
47
- var themes = requiredThemes["default"] || requiredThemes["themes"] || requiredThemes[Object.keys(requiredThemes)[0]];
48
- var generatedThemes = generatedThemesToTypescript(themes);
49
- return {
50
- generated: generatedThemes
51
- };
52
- } catch (err) {
53
- console.warn(` \u26A0\uFE0F Error running theme builder:
37
+ var inputFilePath = inputFile[0] === "." ? (0, import_path.join)(process.cwd(), inputFile) : inputFile;
38
+ if (!didRegisterOnce) {
39
+ didRegisterOnce = true;
40
+ var nodeResolve = ModuleInternals._resolveFilename;
41
+ require("esbuild-register/dist/node").register({ hookIgnoreNodeModules: false });
42
+ var chained = ModuleInternals._resolveFilename;
43
+ ModuleInternals._resolveFilename = function(request) {
44
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
45
+ args[_key - 1] = arguments[_key];
46
+ }
47
+ if (request[0] !== "." && !request.startsWith("/")) {
48
+ try {
49
+ return nodeResolve.call(this, request, ...args);
50
+ } catch (e) {}
51
+ }
52
+ return chained.call(this, request, ...args);
53
+ };
54
+ } else {
55
+ purgeCache(inputFilePath);
56
+ }
57
+ var og = process.env.TAMAGUI_KEEP_THEMES;
58
+ process.env.TAMAGUI_KEEP_THEMES = "1";
59
+ try {
60
+ var requiredThemes = require(inputFilePath);
61
+ var themes = requiredThemes["default"] || requiredThemes["themes"] || requiredThemes[Object.keys(requiredThemes)[0]];
62
+ var generatedThemes = generatedThemesToTypescript(themes);
63
+ return { generated: generatedThemes };
64
+ } catch (err) {
65
+ console.warn(` \u26A0\uFE0F Error running theme builder:
54
66
  `, (err === null || err === void 0 ? void 0 : err["stack"]) || err);
55
- } finally {
56
- process.env.TAMAGUI_KEEP_THEMES = og;
57
- }
67
+ } finally {
68
+ process.env.TAMAGUI_KEEP_THEMES = og;
69
+ }
58
70
  }
59
- var dedupedTokens = /* @__PURE__ */new Map();
60
71
  function generatedThemesToTypescript(themes) {
61
- var dedupedThemes = /* @__PURE__ */new Map();
62
- var dedupedThemeToNames = /* @__PURE__ */new Map();
63
- var i = 0;
64
- for (var name in themes) {
65
- i++;
66
- var theme = themes[name];
67
- var j = 0;
68
- var _iteratorNormalCompletion = true,
69
- _didIteratorError = false,
70
- _iteratorError = void 0;
71
- try {
72
- for (var _iterator = Object.entries(theme)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
73
- var [key, value] = _step.value;
74
- i++;
75
- var uniqueKey = `t${i}${j}`;
76
- if (!dedupedTokens.has(value)) {
77
- dedupedTokens.set(value, uniqueKey);
78
- }
79
- }
80
- } catch (err) {
81
- _didIteratorError = true;
82
- _iteratorError = err;
83
- } finally {
84
- try {
85
- if (!_iteratorNormalCompletion && _iterator.return != null) {
86
- _iterator.return();
87
- }
88
- } finally {
89
- if (_didIteratorError) {
90
- throw _iteratorError;
91
- }
92
- }
93
- }
94
- var key1 = JSON.stringify(theme);
95
- if (dedupedThemes.has(key1)) {
96
- dedupedThemeToNames.set(key1, [...dedupedThemeToNames.get(key1), name]);
97
- } else {
98
- dedupedThemes.set(key1, theme);
99
- dedupedThemeToNames.set(key1, [name]);
100
- }
101
- }
102
- if (!themes) {
103
- throw new Error(`Didn't find any themes exported or returned`);
104
- }
105
- var baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);
106
- var baseTypeString = `export type Theme = {
107
- ${baseKeys.map(function (param) {
108
- var [k] = param;
109
- return ` ${k}: string;
72
+ var dedupedTokens = /* @__PURE__ */ new Map();
73
+ var dedupedThemes = /* @__PURE__ */ new Map();
74
+ var dedupedThemeToNames = /* @__PURE__ */ new Map();
75
+ var i = 0;
76
+ for (var name in themes) {
77
+ i++;
78
+ var theme = themes[name];
79
+ var j = 0;
80
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
81
+ try {
82
+ for (var _iterator = Object.entries(theme)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
83
+ var [key, value] = _step.value;
84
+ i++;
85
+ var uniqueKey = `t${i}${j}`;
86
+ if (!dedupedTokens.has(value)) {
87
+ dedupedTokens.set(value, uniqueKey);
88
+ }
89
+ }
90
+ } catch (err) {
91
+ _didIteratorError = true;
92
+ _iteratorError = err;
93
+ } finally {
94
+ try {
95
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
96
+ _iterator.return();
97
+ }
98
+ } finally {
99
+ if (_didIteratorError) {
100
+ throw _iteratorError;
101
+ }
102
+ }
103
+ }
104
+ var key1 = JSON.stringify(theme);
105
+ if (dedupedThemes.has(key1)) {
106
+ dedupedThemeToNames.set(key1, [...dedupedThemeToNames.get(key1), name]);
107
+ } else {
108
+ dedupedThemes.set(key1, theme);
109
+ dedupedThemeToNames.set(key1, [name]);
110
+ }
111
+ }
112
+ if (!themes) {
113
+ throw new Error(`Didn't find any themes exported or returned`);
114
+ }
115
+ var baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);
116
+ var baseTypeString = `export type Theme = {
117
+ ${baseKeys.map(function(param) {
118
+ var [k] = param;
119
+ return ` ${JSON.stringify(k)}: string;
110
120
  `;
111
- }).join("")}
121
+ }).join("")}
112
122
  }`;
113
- var out = `${baseTypeString}
123
+ var out = `${baseTypeString}
114
124
  `;
115
- out += `
125
+ out += `
116
126
  function t(a: [number, number][]) {
117
127
  let res: Record<string,string> = {}
118
128
  for (const [ki, vi] of a) {
@@ -121,94 +131,96 @@ function t(a: [number, number][]) {
121
131
  return res as Theme
122
132
  }
123
133
  `;
124
- out += `export const colors = [
134
+ out += `export const colors = [
125
135
  `;
126
- var index = 0;
127
- var valueToIndex = {};
128
- dedupedTokens.forEach(function (name2, value2) {
129
- valueToIndex[value2] = index;
130
- index++;
131
- out += ` '${value2}',
136
+ var index = 0;
137
+ var valueToIndex = {};
138
+ dedupedTokens.forEach(function(name2, value2) {
139
+ valueToIndex[value2] = index;
140
+ index++;
141
+ out += ` '${value2}',
132
142
  `;
133
- });
134
- out += "]\n\n";
135
- var keys = baseKeys.map(function (param) {
136
- var [k] = param;
137
- return k;
138
- });
139
- out += `const ks = [
143
+ });
144
+ out += "]\n\n";
145
+ var keys = baseKeys.map(function(param) {
146
+ var [k] = param;
147
+ return k;
148
+ });
149
+ out += `const ks = [
140
150
  `;
141
- out += keys.map(function (k) {
142
- return `'${k}'`;
143
- }).join(",\n");
144
- out += `]
151
+ out += keys.map(function(k) {
152
+ return JSON.stringify(k);
153
+ }).join(",\n");
154
+ out += `]
145
155
 
146
156
  `;
147
- var nameI = 0;
148
- var themeTypes = `export type ThemeNames =`;
149
- var exported = `export type Themes = Record<ThemeNames, Theme>
157
+ var nameI = 0;
158
+ var themeTypes = `export type ThemeNames =`;
159
+ var exported = `export type Themes = Record<ThemeNames, Theme>
150
160
 
151
161
  export const themes: Themes = {`;
152
- dedupedThemes.forEach(function (theme2) {
153
- nameI++;
154
- var key2 = JSON.stringify(theme2);
155
- var names = dedupedThemeToNames.get(key2);
156
- var name2 = `n${nameI}`;
157
- var baseTheme = `const ${name2} = ${objectToJsString(theme2, keys, valueToIndex)}`;
158
- out += `
162
+ dedupedThemes.forEach(function(theme2) {
163
+ nameI++;
164
+ var key2 = JSON.stringify(theme2);
165
+ var names = dedupedThemeToNames.get(key2);
166
+ var name2 = `n${nameI}`;
167
+ var baseTheme = `const ${name2} = ${objectToJsString(theme2, keys, valueToIndex)}`;
168
+ out += `
159
169
  ${baseTheme}`;
160
- names.forEach(function (n) {
161
- exported += `
170
+ names.forEach(function(n) {
171
+ exported += `
162
172
  ${n}: ${name2},`;
163
- if (n.toLowerCase() === n) {
164
- themeTypes += `
173
+ if (n.toLowerCase() === n) {
174
+ themeTypes += `
165
175
  | '${n}'`;
166
- }
167
- });
168
- });
169
- out += `
176
+ }
177
+ });
178
+ });
179
+ out += `
170
180
 
171
181
  ${themeTypes}
172
182
 
173
183
  ${exported}
174
184
  }
175
185
  `;
176
- return out;
186
+ return out;
177
187
  }
178
188
  function objectToJsString(obj, keys, valueToIndex) {
179
- var arrItems = [];
180
- for (var key in obj) {
181
- var ki = keys.indexOf(key);
182
- var vi = valueToIndex[obj[key]];
183
- arrItems.push(`[${ki}, ${vi}]`);
184
- }
185
- return `t([${arrItems.join(",")}])`;
189
+ var arrItems = [];
190
+ for (var key in obj) {
191
+ var ki = keys.indexOf(key);
192
+ var vi = valueToIndex[obj[key]];
193
+ arrItems.push(`[${ki}, ${vi}]`);
194
+ }
195
+ return `t([${arrItems.join(",")}])`;
186
196
  }
187
197
  function purgeCache(moduleName) {
188
- searchCache(moduleName, function (mod) {
189
- delete require.cache[mod.id];
190
- });
191
- if (!module.constructor || !module.constructor._pathCache) {
192
- return;
193
- }
194
- Object.keys(module.constructor._pathCache).forEach(function (cacheKey) {
195
- if (cacheKey.indexOf(moduleName) > 0) {
196
- delete module.constructor._pathCache[cacheKey];
197
- }
198
- });
198
+ searchCache(moduleName, function(mod) {
199
+ delete require.cache[mod.id];
200
+ });
201
+ var pathCache = ModuleInternals._pathCache;
202
+ if (!pathCache) {
203
+ return;
204
+ }
205
+ Object.keys(pathCache).forEach(function(cacheKey) {
206
+ if (cacheKey.indexOf(moduleName) > 0) {
207
+ delete pathCache[cacheKey];
208
+ }
209
+ });
199
210
  }
200
211
  function searchCache(moduleName, callback) {
201
- var mod = require.resolve(moduleName);
202
- if (mod && (mod = require.cache[mod]) !== void 0) {
203
- ;
204
- (function traverse(mod2) {
205
- var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
206
- if (depth > 10) return;
207
- mod2.children.forEach(function (child) {
208
- traverse(child, depth + 1);
209
- });
210
- callback(mod2);
211
- })(mod);
212
- }
212
+ var mod = require.resolve(moduleName);
213
+ if (mod && (mod = require.cache[mod]) !== void 0) {
214
+ ;
215
+ (function traverse(mod2) {
216
+ var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
217
+ if (depth > 10) return;
218
+ mod2.children.forEach(function(child) {
219
+ traverse(child, depth + 1);
220
+ });
221
+ callback(mod2);
222
+ })(mod);
223
+ }
213
224
  }
225
+
214
226
  //# sourceMappingURL=generate-themes.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","generate_themes_exports","generateThemes","module","exports","import_path","require","didRegisterOnce","inputFile","inputFilePath","join","process","cwd","register","hookIgnoreNodeModules","purgeCache","og","env","TAMAGUI_KEEP_THEMES","TAMAGUI_RUN_THEMEBUILDER","requiredThemes","themes","keys","generatedThemes","generatedThemesToTypescript","generated","err","console","warn","dedupedTokens","Map","dedupedThemes","dedupedThemeToNames","i","theme","j","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","entries","Symbol","iterator","_step","next","done","uniqueKey","has","set","return","key1","JSON","stringify","Error","baseKeys","light","baseTypeString","map","param","k","out","index","valueToIndex","forEach","name2","value2","nameI","themeTypes","exported","theme2","key2","names","baseTheme","objectToJsString","n","toLowerCase","obj","arrItems","ki","indexOf","vi","push","moduleName","searchCache","cache","id","constructor","_pathCache","cacheKey","callback","resolve","traverse","mod2","depth","arguments","length","children","child"],"sources":["generate-themes.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar generate_themes_exports = {};\n__export(generate_themes_exports, {\n generateThemes: () => generateThemes\n});\nmodule.exports = __toCommonJS(generate_themes_exports);\nvar import_path = require(\"path\");\nvar didRegisterOnce = false;\nasync function generateThemes(inputFile) {\n var inputFilePath = inputFile[0] === \".\" ? (0, import_path.join)(process.cwd(), inputFile) : inputFile;\n if (!didRegisterOnce) {\n didRegisterOnce = true;\n require(\"esbuild-register/dist/node\").register({\n hookIgnoreNodeModules: false\n });\n } else {\n purgeCache(inputFilePath);\n }\n var og = process.env.TAMAGUI_KEEP_THEMES;\n process.env.TAMAGUI_KEEP_THEMES = \"1\";\n process.env.TAMAGUI_RUN_THEMEBUILDER = \"1\";\n try {\n var requiredThemes = require(inputFilePath);\n var themes = requiredThemes[\"default\"] || requiredThemes[\"themes\"] || requiredThemes[Object.keys(requiredThemes)[0]];\n var generatedThemes = generatedThemesToTypescript(themes);\n return {\n generated: generatedThemes\n };\n } catch (err) {\n console.warn(` \\u26A0\\uFE0F Error running theme builder:\n`, (err === null || err === void 0 ? void 0 : err[\"stack\"]) || err);\n } finally {\n process.env.TAMAGUI_KEEP_THEMES = og;\n }\n}\nvar dedupedTokens = /* @__PURE__ */ new Map();\nfunction generatedThemesToTypescript(themes) {\n var dedupedThemes = /* @__PURE__ */ new Map();\n var dedupedThemeToNames = /* @__PURE__ */ new Map();\n var i = 0;\n for (var name in themes) {\n i++;\n var theme = themes[name];\n var j = 0;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(theme)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n i++;\n var uniqueKey = `t${i}${j}`;\n if (!dedupedTokens.has(value)) {\n dedupedTokens.set(value, uniqueKey);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var key1 = JSON.stringify(theme);\n if (dedupedThemes.has(key1)) {\n dedupedThemeToNames.set(key1, [\n ...dedupedThemeToNames.get(key1),\n name\n ]);\n } else {\n dedupedThemes.set(key1, theme);\n dedupedThemeToNames.set(key1, [\n name\n ]);\n }\n }\n if (!themes) {\n throw new Error(`Didn't find any themes exported or returned`);\n }\n var baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);\n var baseTypeString = `export type Theme = {\n${baseKeys.map(function(param) {\n var [k] = param;\n return ` ${k}: string;\n`;\n }).join(\"\")}\n}`;\n var out = `${baseTypeString}\n`;\n out += `\nfunction t(a: [number, number][]) {\n let res: Record<string,string> = {}\n for (const [ki, vi] of a) {\n res[ks[ki] as string] = colors[vi] as string\n }\n return res as Theme\n}\n`;\n out += `export const colors = [\n`;\n var index = 0;\n var valueToIndex = {};\n dedupedTokens.forEach(function(name2, value2) {\n valueToIndex[value2] = index;\n index++;\n out += ` '${value2}',\n`;\n });\n out += \"]\\n\\n\";\n var keys = baseKeys.map(function(param) {\n var [k] = param;\n return k;\n });\n out += `const ks = [\n`;\n out += keys.map(function(k) {\n return `'${k}'`;\n }).join(\",\\n\");\n out += `]\n\n`;\n var nameI = 0;\n var themeTypes = `export type ThemeNames =`;\n var exported = `export type Themes = Record<ThemeNames, Theme>\n\nexport const themes: Themes = {`;\n dedupedThemes.forEach(function(theme2) {\n nameI++;\n var key2 = JSON.stringify(theme2);\n var names = dedupedThemeToNames.get(key2);\n var name2 = `n${nameI}`;\n var baseTheme = `const ${name2} = ${objectToJsString(theme2, keys, valueToIndex)}`;\n out += `\n${baseTheme}`;\n names.forEach(function(n) {\n exported += `\n ${n}: ${name2},`;\n if (n.toLowerCase() === n) {\n themeTypes += `\n | '${n}'`;\n }\n });\n });\n out += `\n\n${themeTypes}\n\n${exported}\n}\n`;\n return out;\n}\nfunction objectToJsString(obj, keys, valueToIndex) {\n var arrItems = [];\n for (var key in obj) {\n var ki = keys.indexOf(key);\n var vi = valueToIndex[obj[key]];\n arrItems.push(`[${ki}, ${vi}]`);\n }\n return `t([${arrItems.join(\",\")}])`;\n}\nfunction purgeCache(moduleName) {\n searchCache(moduleName, function(mod) {\n delete require.cache[mod.id];\n });\n if (!module.constructor || !module.constructor._pathCache) {\n return;\n }\n Object.keys(module.constructor._pathCache).forEach(function(cacheKey) {\n if (cacheKey.indexOf(moduleName) > 0) {\n delete module.constructor._pathCache[cacheKey];\n }\n });\n}\nfunction searchCache(moduleName, callback) {\n var mod = require.resolve(moduleName);\n if (mod && (mod = require.cache[mod]) !== void 0) {\n ;\n (function traverse(mod2) {\n var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;\n if (depth > 10) return;\n mod2.children.forEach(function(child) {\n traverse(child, depth + 1);\n });\n callback(mod2);\n })(mod);\n }\n}\n//# sourceMappingURL=generate-themes.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAA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AU,CAACC,QAAQ,CAAC;IAChD;EACF,CAAC,CAAC;AACJ;AACA,SAASL,WAAWA,CAACD,UAAU,EAAEO,QAAQ,EAAE;EACzC,IAAI1F,GAAG,GAAGO,OAAO,CAACoF,OAAO,CAACR,UAAU,CAAC;EACrC,IAAInF,GAAG,IAAI,CAACA,GAAG,GAAGO,OAAO,CAAC8E,KAAK,CAACrF,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;IAChD;IACA,CAAC,SAAS4F,QAAQA,CAACC,IAAI,EAAE;MACvB,IAAIC,KAAK,GAAGC,SAAS,CAACC,MAAM,GAAG,CAAC,IAAID,SAAS,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,GAAGA,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;MAC9E,IAAID,KAAK,GAAG,EAAE,EAAE;MAChBD,IAAI,CAACI,QAAQ,CAACjC,OAAO,CAAC,UAASkC,KAAK,EAAE;QACpCN,QAAQ,CAACM,KAAK,EAAEJ,KAAK,GAAG,CAAC,CAAC;MAC5B,CAAC,CAAC;MACFJ,QAAQ,CAACG,IAAI,CAAC;IAChB,CAAC,EAAE7F,GAAG,CAAC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"generate-themes.native.js","names":[],"sources":["cjs/generate-themes.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar generate_themes_exports = {};\n__export(generate_themes_exports, {\n generateThemes: () => generateThemes\n});\nmodule.exports = __toCommonJS(generate_themes_exports);\nvar import_module = __toESM(require(\"module\"), 1);\nvar import_path = require(\"path\");\nvar ModuleInternals = import_module.default;\nvar didRegisterOnce = false;\nasync function generateThemes(inputFile) {\n var inputFilePath = inputFile[0] === \".\" ? (0, import_path.join)(process.cwd(), inputFile) : inputFile;\n if (!didRegisterOnce) {\n didRegisterOnce = true;\n var nodeResolve = ModuleInternals._resolveFilename;\n require(\"esbuild-register/dist/node\").register({\n hookIgnoreNodeModules: false\n });\n var chained = ModuleInternals._resolveFilename;\n ModuleInternals._resolveFilename = function(request) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (request[0] !== \".\" && !request.startsWith(\"/\")) {\n try {\n return nodeResolve.call(this, request, ...args);\n } catch (e) {\n }\n }\n return chained.call(this, request, ...args);\n };\n } else {\n purgeCache(inputFilePath);\n }\n var og = process.env.TAMAGUI_KEEP_THEMES;\n process.env.TAMAGUI_KEEP_THEMES = \"1\";\n try {\n var requiredThemes = require(inputFilePath);\n var themes = requiredThemes[\"default\"] || requiredThemes[\"themes\"] || requiredThemes[Object.keys(requiredThemes)[0]];\n var generatedThemes = generatedThemesToTypescript(themes);\n return {\n generated: generatedThemes\n };\n } catch (err) {\n console.warn(` \\u26A0\\uFE0F Error running theme builder:\n`, (err === null || err === void 0 ? void 0 : err[\"stack\"]) || err);\n } finally {\n process.env.TAMAGUI_KEEP_THEMES = og;\n }\n}\nfunction generatedThemesToTypescript(themes) {\n var dedupedTokens = /* @__PURE__ */ new Map();\n var dedupedThemes = /* @__PURE__ */ new Map();\n var dedupedThemeToNames = /* @__PURE__ */ new Map();\n var i = 0;\n for (var name in themes) {\n i++;\n var theme = themes[name];\n var j = 0;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.entries(theme)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var [key, value] = _step.value;\n i++;\n var uniqueKey = `t${i}${j}`;\n if (!dedupedTokens.has(value)) {\n dedupedTokens.set(value, uniqueKey);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var key1 = JSON.stringify(theme);\n if (dedupedThemes.has(key1)) {\n dedupedThemeToNames.set(key1, [\n ...dedupedThemeToNames.get(key1),\n name\n ]);\n } else {\n dedupedThemes.set(key1, theme);\n dedupedThemeToNames.set(key1, [\n name\n ]);\n }\n }\n if (!themes) {\n throw new Error(`Didn't find any themes exported or returned`);\n }\n var baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);\n var baseTypeString = `export type Theme = {\n${baseKeys.map(function(param) {\n var [k] = param;\n return ` ${JSON.stringify(k)}: string;\n`;\n }).join(\"\")}\n}`;\n var out = `${baseTypeString}\n`;\n out += `\nfunction t(a: [number, number][]) {\n let res: Record<string,string> = {}\n for (const [ki, vi] of a) {\n res[ks[ki] as string] = colors[vi] as string\n }\n return res as Theme\n}\n`;\n out += `export const colors = [\n`;\n var index = 0;\n var valueToIndex = {};\n dedupedTokens.forEach(function(name2, value2) {\n valueToIndex[value2] = index;\n index++;\n out += ` '${value2}',\n`;\n });\n out += \"]\\n\\n\";\n var keys = baseKeys.map(function(param) {\n var [k] = param;\n return k;\n });\n out += `const ks = [\n`;\n out += keys.map(function(k) {\n return JSON.stringify(k);\n }).join(\",\\n\");\n out += `]\n\n`;\n var nameI = 0;\n var themeTypes = `export type ThemeNames =`;\n var exported = `export type Themes = Record<ThemeNames, Theme>\n\nexport const themes: Themes = {`;\n dedupedThemes.forEach(function(theme2) {\n nameI++;\n var key2 = JSON.stringify(theme2);\n var names = dedupedThemeToNames.get(key2);\n var name2 = `n${nameI}`;\n var baseTheme = `const ${name2} = ${objectToJsString(theme2, keys, valueToIndex)}`;\n out += `\n${baseTheme}`;\n names.forEach(function(n) {\n exported += `\n ${n}: ${name2},`;\n if (n.toLowerCase() === n) {\n themeTypes += `\n | '${n}'`;\n }\n });\n });\n out += `\n\n${themeTypes}\n\n${exported}\n}\n`;\n return out;\n}\nfunction objectToJsString(obj, keys, valueToIndex) {\n var arrItems = [];\n for (var key in obj) {\n var ki = keys.indexOf(key);\n var vi = valueToIndex[obj[key]];\n arrItems.push(`[${ki}, ${vi}]`);\n }\n return `t([${arrItems.join(\",\")}])`;\n}\nfunction purgeCache(moduleName) {\n searchCache(moduleName, function(mod) {\n delete require.cache[mod.id];\n });\n var pathCache = ModuleInternals._pathCache;\n if (!pathCache) {\n return;\n }\n Object.keys(pathCache).forEach(function(cacheKey) {\n if (cacheKey.indexOf(moduleName) > 0) {\n delete pathCache[cacheKey];\n }\n });\n}\nfunction searchCache(moduleName, callback) {\n var mod = require.resolve(moduleName);\n if (mod && (mod = require.cache[mod]) !== void 0) {\n ;\n (function traverse(mod2) {\n var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;\n if (depth > 10) return;\n mod2.children.forEach(function(child) {\n traverse(child, depth + 1);\n });\n callback(mod2);\n })(mod);\n }\n}\n//# sourceMappingURL=generate-themes.js.map\n"],"mappings":";;;AACA,IAAI,WAA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,WAAW;EACd;CACF;CACA,OAAO,KAAK,SAAS,CAAC,CAAC,QAAQ,SAAS,UAAU;EAChD,IAAI,SAAS,QAAQ,UAAU,IAAI,GAAG;GACpC,OAAO,UAAU;EACnB;CACF,CAAC;AACH;AACA,SAAS,YAAY,YAAY,UAAU;CACzC,IAAI,MAAM,QAAQ,QAAQ,UAAU;CACpC,IAAI,QAAQ,MAAM,QAAQ,MAAM,UAAU,KAAK,GAAG;EAChD;EACA,CAAC,SAAS,SAAS,MAAM;GACvB,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;GAC7E,IAAI,QAAQ,IAAI;GAChB,KAAK,SAAS,QAAQ,SAAS,OAAO;IACpC,SAAS,OAAO,QAAQ,CAAC;GAC3B,CAAC;GACD,SAAS,IAAI;EACf,EAAC,CAAE,GAAG;CACR;AACF"}
@@ -3,19 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
5
  var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
- get: () => from[key],
9
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
- });
11
- }
12
- return to;
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
8
+ get: () => from[key],
9
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
10
+ });
11
+ }
12
+ return to;
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
16
- value: true
17
- }), mod);
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
16
  var index_exports = {};
19
17
  module.exports = __toCommonJS(index_exports);
20
18
  __reExport(index_exports, require("./generate-themes.cjs"), module.exports);
21
- __reExport(index_exports, require("./write-generate-themes.cjs"), module.exports);
19
+ __reExport(index_exports, require("./write-generate-themes.cjs"), module.exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
+ };
16
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
20
+ __reExport(index_exports, require("./generate-themes.native.js"), module.exports);
21
+ __reExport(index_exports, require("./write-generate-themes.native.js"), module.exports);
@@ -5,20 +5,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __copyProps = (to, from, except, desc) => {
8
- if (from && typeof from === "object" || typeof from === "function") {
9
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
- get: () => from[key],
11
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
- });
13
- }
14
- return to;
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
10
+ get: () => from[key],
11
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
12
+ });
13
+ }
14
+ return to;
15
15
  };
16
16
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
17
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
18
- value: true
19
- }), mod);
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
18
  var index_exports = {};
21
19
  module.exports = __toCommonJS(index_exports);
22
20
  __reExport(index_exports, require("./generate-themes.native.js"), module.exports);
23
21
  __reExport(index_exports, require("./write-generate-themes.native.js"), module.exports);
22
+
24
23
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./generate-themes\"), module.exports);\n__reExport(index_exports, require(\"./write-generate-themes\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIV,iBAAiB,CAACO,IAAI,CAAC,EACrC,IAAI,CAACL,YAAY,CAACS,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/Cb,SAAS,CAACW,EAAE,EAAEI,GAAG,EAAE;MAAEE,GAAG,EAAEA,CAAA,KAAML,IAAI,CAACG,GAAG,CAAC;MAAEG,UAAU,EAAE,EAAEJ,IAAI,GAAGX,gBAAgB,CAACS,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACI;IAAW,CAAC,CAAC;EACxH;EACA,OAAOP,EAAE;AACX,CAAC;AACD,IAAIQ,UAAU,GAAGA,CAACC,MAAM,EAAEC,GAAG,EAAEC,YAAY,MAAMZ,WAAW,CAACU,MAAM,EAAEC,GAAG,EAAE,SAAS,CAAC,EAAEC,YAAY,IAAIZ,WAAW,CAACY,YAAY,EAAED,GAAG,EAAE,SAAS,CAAC,CAAC;AAChJ,IAAIE,YAAY,GAAIF,GAAG,IAAKX,WAAW,CAACV,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEwB,KAAK,EAAE;AAAK,CAAC,CAAC,EAAEH,GAAG,CAAC;AAC1F,IAAII,aAAa,GAAG,CAAC,CAAC;AACtBC,MAAM,CAACC,OAAO,GAAGJ,YAAY,CAACE,aAAa,CAAC;AAC5CN,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,6BAAmB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AACvER,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,mCAAyB,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["cjs/index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./generate-themes\"), module.exports);\n__reExport(index_exports, require(\"./write-generate-themes\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,cAAc,QAAQ,KAAK,kBAAkB,YAAY,QAAQ,KAAK,SAAS,GAAG,gBAAgB,YAAY,cAAc,KAAK,SAAS;AAC9I,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gBAAgB,CAAC;AACrB,OAAO,UAAU,aAAa,aAAa;AAC3C,WAAW,eAAe,QAAQ,6BAAmB,GAAG,OAAO,OAAO;AACtE,WAAW,eAAe,QAAQ,mCAAyB,GAAG,OAAO,OAAO"}
@@ -5,51 +5,40 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
7
  var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
12
  };
13
13
  var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
21
  };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
30
25
  }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
27
  var write_generate_themes_exports = {};
35
- __export(write_generate_themes_exports, {
36
- writeGeneratedThemes: () => writeGeneratedThemes
37
- });
28
+ __export(write_generate_themes_exports, { writeGeneratedThemes: () => writeGeneratedThemes });
38
29
  module.exports = __toCommonJS(write_generate_themes_exports);
39
30
  var fs = __toESM(require("fs-extra"), 1);
40
31
  async function writeGeneratedThemes(tamaguiDotDir, outPath, generatedOutput) {
41
- if (!generatedOutput) return;
42
- const {
43
- generated
44
- } = generatedOutput;
45
- if (process.env.DEBUG === "tamagui") {
46
- console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
47
- }
48
- const newContent = `// @ts-nocheck
32
+ if (!generatedOutput) return;
33
+ const { generated } = generatedOutput;
34
+ if (process.env.DEBUG === "tamagui") {
35
+ console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
36
+ }
37
+ const newContent = `// @ts-nocheck
49
38
  ` + generated;
50
- const existingContent = await fs.readFile(outPath, "utf-8").catch(() => null);
51
- if (existingContent === newContent) {
52
- return;
53
- }
54
- await fs.writeFile(outPath, newContent);
55
- }
39
+ const existingContent = await fs.readFile(outPath, "utf-8").catch(() => null);
40
+ if (existingContent === newContent) {
41
+ return;
42
+ }
43
+ await fs.writeFile(outPath, newContent);
44
+ }