@tamagui/generate-themes 2.0.0-rc.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,33 +2,35 @@ var __create = Object.create;
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf,
6
- __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf;
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: !0
11
- });
12
- },
13
- __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
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, {
15
16
  get: () => from[key],
16
17
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
18
  });
18
- return to;
19
- };
19
+ }
20
+ return to;
21
+ };
20
22
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
- value: mod,
27
- enumerable: !0
28
- }) : target, mod)),
29
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
- value: !0
31
- }), mod);
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
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
32
34
  var write_generate_themes_exports = {};
33
35
  __export(write_generate_themes_exports, {
34
36
  writeGeneratedThemes: () => writeGeneratedThemes
@@ -40,8 +42,14 @@ async function writeGeneratedThemes(tamaguiDotDir, outPath, generatedOutput) {
40
42
  const {
41
43
  generated
42
44
  } = generatedOutput;
43
- process.env.DEBUG === "tamagui" && console.info("Generated themes:", JSON.stringify(generatedOutput, null, 2));
45
+ if (process.env.DEBUG === "tamagui") {
46
+ console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
47
+ }
44
48
  const newContent = `// @ts-nocheck
45
49
  ` + generated;
46
- (await fs.readFile(outPath, "utf-8").catch(() => null)) !== newContent && (await fs.writeFile(outPath, newContent));
50
+ const existingContent = await fs.readFile(outPath, "utf-8").catch(() => null);
51
+ if (existingContent === newContent) {
52
+ return;
53
+ }
54
+ await fs.writeFile(outPath, newContent);
47
55
  }
@@ -4,33 +4,35 @@ var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf,
8
- __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
9
  var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: !0
13
- });
14
- },
15
- __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
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, {
17
18
  get: () => from[key],
18
19
  enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
20
  });
20
- return to;
21
- };
21
+ }
22
+ return to;
23
+ };
22
24
  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: !0
30
- }) : target, mod)),
31
- __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: !0
33
- }), mod);
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
+ value: true
35
+ }), mod);
34
36
  var write_generate_themes_exports = {};
35
37
  __export(write_generate_themes_exports, {
36
38
  writeGeneratedThemes: () => writeGeneratedThemes
@@ -38,17 +40,21 @@ __export(write_generate_themes_exports, {
38
40
  module.exports = __toCommonJS(write_generate_themes_exports);
39
41
  var fs = __toESM(require("fs-extra"), 1);
40
42
  async function writeGeneratedThemes(tamaguiDotDir, outPath, generatedOutput) {
41
- if (generatedOutput) {
42
- var {
43
- generated
44
- } = generatedOutput;
45
- process.env.DEBUG === "tamagui" && console.info("Generated themes:", JSON.stringify(generatedOutput, null, 2));
46
- var newContent = `// @ts-nocheck
47
- ` + generated,
48
- existingContent = await fs.readFile(outPath, "utf-8").catch(function () {
49
- return null;
50
- });
51
- existingContent !== newContent && (await fs.writeFile(outPath, newContent));
43
+ if (!generatedOutput) return;
44
+ var {
45
+ generated
46
+ } = generatedOutput;
47
+ if (process.env.DEBUG === "tamagui") {
48
+ console.info(`Generated themes:`, JSON.stringify(generatedOutput, null, 2));
49
+ }
50
+ var newContent = `// @ts-nocheck
51
+ ` + generated;
52
+ var existingContent = await fs.readFile(outPath, "utf-8").catch(function () {
53
+ return null;
54
+ });
55
+ if (existingContent === newContent) {
56
+ return;
52
57
  }
58
+ await fs.writeFile(outPath, newContent);
53
59
  }
54
60
  //# sourceMappingURL=write-generate-themes.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","write_generate_themes_exports","__export","writeGeneratedThemes","module","exports","fs","__toESM","require","tamaguiDotDir","outPath","generatedOutput","generated","process","env","DEBUG","console","info","JSON","stringify","newContent","existingContent","readFile","catch"],"sources":["../../src/write-generate-themes.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,6BAAA;AAAAC,QAAA,CAAAD,6BAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAoB,GAAAT,YAAA,CAAAK,6BAAA;AAIpB,IAAAK,EAAA,GAAAC,OAAsB,CAAAC,OAAA,YACpB;AAIA,eAAKL,oBAAiBA,CAAAM,aAAA,EAAAC,OAAA,EAAAC,eAAA;EAEtB,IAAAA,eAAkB;IAEd;MAAQC;IAAI,IAAUD,eACxB;IAGFE,OAAM,CAAAC,GAAA,CAAAC,KAAa,kBAAAC,OAAA,CAAAC,IAAA,sBAAAC,IAAA,CAAAC,SAAA,CAAAR,eAAA;IAAqB,IAAAS,UAAA;AAIxC,IADwBR,SAAS;MAAAS,eAAkB,SAASf,EAAA,CAAAgB,QAAY,CAAAZ,OAAI,EACpD,SAAAa,KAIxB,aAAS;QACX","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","write_generate_themes_exports","__export","writeGeneratedThemes","module","exports","fs","__toESM","require","tamaguiDotDir","outPath","generatedOutput","generated","process","env","DEBUG","console","info","JSON","stringify","newContent","existingContent","readFile","catch"],"sources":["../../src/write-generate-themes.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,6BAAA;AAAAC,QAAA,CAAAD,6BAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAoB,GAAAT,YAAA,CAAAK,6BAAA;AAIpB,IAAAK,EAAA,GAAAC,OAAsB,CAAAC,OAAA,YACpB;AAIA,eAAKL,oBAAiBA,CAAAM,aAAA,EAAAC,OAAA,EAAAC,eAAA;EAEtB,KAAAA,eAAkB,EAAI;EAEtB,IAAI;IAAAC;EAAY,IAAAD,eAAU;EACxB,IAAAE,OAAQ,CAAAC,GAAK,CAAAC,KAAA,gBAAqB;IACpCC,OAAA,CAAAC,IAAA,sBAAAC,IAAA,CAAAC,SAAA,CAAAR,eAAA;EAEA;EAAmB,IAAqBS,UAAA;AAGxC,IAAAR,SAAM;EACN,IAAIS,eAAA,SAAoBf,EAAA,CAAAgB,QAAY,CAAAZ,OAAA,WAAAa,KAAA;IAClC;EACF;EAEA,IAAAF,eAAmB,KAAAD,UAAS;IAC9B","ignoreList":[]}
@@ -1,29 +1,36 @@
1
1
  import { join } from "node:path";
2
- let didRegisterOnce = !1;
2
+ let didRegisterOnce = false;
3
3
  async function generateThemes(inputFile) {
4
4
  const inputFilePath = inputFile[0] === "." ? join(process.cwd(), inputFile) : inputFile;
5
- didRegisterOnce ? purgeCache(inputFilePath) : (didRegisterOnce = !0, require("esbuild-register/dist/node").register({
6
- hookIgnoreNodeModules: !1
7
- }));
5
+ if (!didRegisterOnce) {
6
+ didRegisterOnce = true;
7
+ require("esbuild-register/dist/node").register({
8
+ hookIgnoreNodeModules: false
9
+ });
10
+ } else {
11
+ purgeCache(inputFilePath);
12
+ }
8
13
  let og = process.env.TAMAGUI_KEEP_THEMES;
9
- process.env.TAMAGUI_KEEP_THEMES = "1", process.env.TAMAGUI_RUN_THEMEBUILDER = "1";
14
+ process.env.TAMAGUI_KEEP_THEMES = "1";
15
+ process.env.TAMAGUI_RUN_THEMEBUILDER = "1";
10
16
  try {
11
- const requiredThemes = require(inputFilePath),
12
- themes = requiredThemes.default || requiredThemes.themes || requiredThemes[Object.keys(requiredThemes)[0]];
17
+ const requiredThemes = require(inputFilePath);
18
+ const themes = requiredThemes["default"] || requiredThemes["themes"] || requiredThemes[Object.keys(requiredThemes)[0]];
19
+ const generatedThemes = generatedThemesToTypescript(themes);
13
20
  return {
14
- generated: generatedThemesToTypescript(themes)
21
+ generated: generatedThemes
15
22
  };
16
23
  } catch (err) {
17
24
  console.warn(` \u26A0\uFE0F Error running theme builder:
18
- `, err?.stack || err);
25
+ `, err?.["stack"] || err);
19
26
  } finally {
20
27
  process.env.TAMAGUI_KEEP_THEMES = og;
21
28
  }
22
29
  }
23
30
  const dedupedTokens = /* @__PURE__ */new Map();
24
31
  function generatedThemesToTypescript(themes) {
25
- const dedupedThemes = /* @__PURE__ */new Map(),
26
- dedupedThemeToNames = /* @__PURE__ */new Map();
32
+ const dedupedThemes = /* @__PURE__ */new Map();
33
+ const dedupedThemeToNames = /* @__PURE__ */new Map();
27
34
  let i = 0;
28
35
  for (const name in themes) {
29
36
  i++;
@@ -32,17 +39,29 @@ function generatedThemesToTypescript(themes) {
32
39
  for (const [key2, value] of Object.entries(theme)) {
33
40
  i++;
34
41
  const uniqueKey = `t${i}${j}`;
35
- dedupedTokens.has(value) || dedupedTokens.set(value, uniqueKey);
42
+ if (!dedupedTokens.has(value)) {
43
+ dedupedTokens.set(value, uniqueKey);
44
+ }
36
45
  }
37
46
  const key = JSON.stringify(theme);
38
- dedupedThemes.has(key) ? dedupedThemeToNames.set(key, [...dedupedThemeToNames.get(key), name]) : (dedupedThemes.set(key, theme), dedupedThemeToNames.set(key, [name]));
47
+ if (dedupedThemes.has(key)) {
48
+ dedupedThemeToNames.set(key, [...dedupedThemeToNames.get(key), name]);
49
+ } else {
50
+ dedupedThemes.set(key, theme);
51
+ dedupedThemeToNames.set(key, [name]);
52
+ }
53
+ }
54
+ if (!themes) {
55
+ throw new Error(`Didn't find any themes exported or returned`);
39
56
  }
40
- if (!themes) throw new Error("Didn't find any themes exported or returned");
41
57
  const baseKeys = Object.entries(themes.light || themes[Object.keys(themes)[0]]);
42
- let out = `${`type Theme = {
43
- ${baseKeys.map(([k]) => ` ${k}: string;
44
- `).join("")}
45
- }`}
58
+ const baseTypeString = `export type Theme = {
59
+ ${baseKeys.map(([k]) => {
60
+ return ` ${k}: string;
61
+ `;
62
+ }).join("")}
63
+ }`;
64
+ let out = `${baseTypeString}
46
65
  `;
47
66
  out += `
48
67
  function t(a: [number, number][]) {
@@ -52,50 +71,61 @@ function t(a: [number, number][]) {
52
71
  }
53
72
  return res as Theme
54
73
  }
55
- `, out += `export const colors = [
74
+ `;
75
+ out += `export const colors = [
56
76
  `;
57
77
  let index = 0;
58
78
  const valueToIndex = {};
59
79
  dedupedTokens.forEach((name, value) => {
60
- valueToIndex[value] = index, index++, out += ` '${value}',
61
- `;
62
- }), out += `]
63
-
80
+ valueToIndex[value] = index;
81
+ index++;
82
+ out += ` '${value}',
64
83
  `;
84
+ });
85
+ out += "]\n\n";
65
86
  const keys = baseKeys.map(([k]) => k);
66
87
  out += `const ks = [
67
- `, out += keys.map(k => `'${k}'`).join(`,
68
- `), out += `]
88
+ `;
89
+ out += keys.map(k => `'${k}'`).join(",\n");
90
+ out += `]
69
91
 
70
92
  `;
71
- let nameI = 0,
72
- themeTypes = "type ThemeNames =",
73
- exported = "export const themes: Record<ThemeNames, Theme> = {";
74
- return dedupedThemes.forEach(theme => {
93
+ let nameI = 0;
94
+ let themeTypes = `export type ThemeNames =`;
95
+ let exported = `export type Themes = Record<ThemeNames, Theme>
96
+
97
+ export const themes: Themes = {`;
98
+ dedupedThemes.forEach(theme => {
75
99
  nameI++;
76
- const key = JSON.stringify(theme),
77
- names = dedupedThemeToNames.get(key),
78
- name = `n${nameI}`,
79
- baseTheme = `const ${name} = ${objectToJsString(theme, keys, valueToIndex)}`;
100
+ const key = JSON.stringify(theme);
101
+ const names = dedupedThemeToNames.get(key);
102
+ const name = `n${nameI}`;
103
+ const baseTheme = `const ${name} = ${objectToJsString(theme, keys, valueToIndex)}`;
80
104
  out += `
81
- ${baseTheme}`, names.forEach(n => {
105
+ ${baseTheme}`;
106
+ names.forEach(n => {
82
107
  exported += `
83
- ${n}: ${name},`, n.toLowerCase() === n && (themeTypes += `
84
- | '${n}'`);
108
+ ${n}: ${name},`;
109
+ if (n.toLowerCase() === n) {
110
+ themeTypes += `
111
+ | '${n}'`;
112
+ }
85
113
  });
86
- }), out += `
114
+ });
115
+ out += `
87
116
 
88
117
  ${themeTypes}
89
118
 
90
119
  ${exported}
91
120
  }
92
- `, out;
121
+ `;
122
+ return out;
93
123
  }
94
124
  function objectToJsString(obj, keys, valueToIndex) {
95
125
  let arrItems = [];
96
126
  for (const key in obj) {
97
- const ki = keys.indexOf(key),
98
- vi = valueToIndex[obj[key]];
127
+ const ki = keys.indexOf(key);
128
+ const vi = valueToIndex[obj[key]];
99
129
  arrItems.push(`[${ki}, ${vi}]`);
100
130
  }
101
131
  return `t([${arrItems.join(",")}])`;
@@ -103,17 +133,28 @@ function objectToJsString(obj, keys, valueToIndex) {
103
133
  function purgeCache(moduleName) {
104
134
  searchCache(moduleName, mod => {
105
135
  delete require.cache[mod.id];
106
- }), !(!module.constructor || !module.constructor._pathCache) && Object.keys(module.constructor._pathCache).forEach(cacheKey => {
107
- cacheKey.indexOf(moduleName) > 0 && delete module.constructor._pathCache[cacheKey];
136
+ });
137
+ if (!module.constructor || !module.constructor._pathCache) {
138
+ return;
139
+ }
140
+ Object.keys(module.constructor._pathCache).forEach(cacheKey => {
141
+ if (cacheKey.indexOf(moduleName) > 0) {
142
+ delete module.constructor._pathCache[cacheKey];
143
+ }
108
144
  });
109
145
  }
110
146
  function searchCache(moduleName, callback) {
111
147
  let mod = require.resolve(moduleName);
112
- mod && (mod = require.cache[mod]) !== void 0 && function traverse(mod2, depth = 0) {
113
- depth > 10 || (mod2.children.forEach(child => {
114
- traverse(child, depth + 1);
115
- }), callback(mod2));
116
- }(mod);
148
+ if (mod && (mod = require.cache[mod]) !== void 0) {
149
+ ;
150
+ (function traverse(mod2, depth = 0) {
151
+ if (depth > 10) return;
152
+ mod2.children.forEach(child => {
153
+ traverse(child, depth + 1);
154
+ });
155
+ callback(mod2);
156
+ })(mod);
157
+ }
117
158
  }
118
159
  export { generateThemes };
119
160
  //# sourceMappingURL=generate-themes.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["join","didRegisterOnce","generateThemes","inputFile","inputFilePath","process","cwd","purgeCache","require","register","hookIgnoreNodeModules","og","env","TAMAGUI_KEEP_THEMES","TAMAGUI_RUN_THEMEBUILDER","requiredThemes","themes","default","Object","keys","generated","generatedThemesToTypescript","err","console","warn","stack","dedupedTokens","Map","dedupedThemes","dedupedThemeToNames","i","name","theme","j","key2","value","entries","uniqueKey","has","set","key","JSON","stringify","get","Error","baseKeys","light","out","map","k","index","valueToIndex","forEach","nameI","themeTypes","exported","names","baseTheme","objectToJsString","n","toLowerCase","obj","arrItems","ki","indexOf","vi","push","moduleName","searchCache","mod","cache","id","module","constructor","_pathCache","cacheKey","callback","resolve","traverse","mod2","depth","children","child"],"sources":["../../src/generate-themes.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,QAAY;AAMrB,IAAIC,eAAA,GAAkB;AAEtB,eAAsBC,eAAeC,SAAA,EAAmB;EACtD,MAAMC,aAAA,GAAgBD,SAAA,CAAU,CAAC,MAAM,MAAMH,IAAA,CAAKK,OAAA,CAAQC,GAAA,CAAI,GAAGH,SAAS,IAAIA,SAAA;EAEzEF,eAAA,GAOHM,UAAA,CAAWH,aAAa,KANxBH,eAAA,GAAkB,IAElBO,OAAA,CAAQ,4BAA4B,EAAEC,QAAA,CAAS;IAC7CC,qBAAA,EAAuB;EACzB,CAAC;EAKH,IAAIC,EAAA,GAAKN,OAAA,CAAQO,GAAA,CAAIC,mBAAA;EACrBR,OAAA,CAAQO,GAAA,CAAIC,mBAAA,GAAsB,KAClCR,OAAA,CAAQO,GAAA,CAAIE,wBAAA,GAA2B;EAEvC,IAAI;IACF,MAAMC,cAAA,GAAiBP,OAAA,CAAQJ,aAAa;MAEtCY,MAAA,GACJD,cAAA,CAAeE,OAAA,IACfF,cAAA,CAAeC,MAAA,IACfD,cAAA,CAAeG,MAAA,CAAOC,IAAA,CAAKJ,cAAc,EAAE,CAAC,CAAC;IAI/C,OAAO;MACLK,SAAA,EAHsBC,2BAAA,CAA4BL,MAAM;IAI1D;EACF,SAASM,GAAA,EAAK;IACZC,OAAA,CAAQC,IAAA,CAAK;AAAA,GAAsCF,GAAA,EAAMG,KAAA,IAAYH,GAAG;EAC1E,UAAE;IACAjB,OAAA,CAAQO,GAAA,CAAIC,mBAAA,GAAsBF,EAAA;EACpC;AACF;AAKA,MAAMe,aAAA,GAAgB,mBAAIC,GAAA,CAAoB;AAE9C,SAASN,4BAA4BL,MAAA,EAA6B;EAChE,MAAMY,aAAA,GAAgB,mBAAID,GAAA,CAAoB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,QAAA,CAASI,KAAA,EAAOF,KAAA,GAAQ,CAAC;IAC3B,CAAC,GAIDJ,QAAA,CAASG,IAAG;EACd,EAAGV,GAAG;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["join","didRegisterOnce","generateThemes","inputFile","inputFilePath","process","cwd","require","register","hookIgnoreNodeModules","purgeCache","og","env","TAMAGUI_KEEP_THEMES","TAMAGUI_RUN_THEMEBUILDER","requiredThemes","themes","Object","keys","generatedThemes","generatedThemesToTypescript","generated","err","console","warn","dedupedTokens","Map","dedupedThemes","dedupedThemeToNames","i","name","theme","j","key2","value","entries","uniqueKey","has","set","key","JSON","stringify","get","Error","baseKeys","light","baseTypeString","map","k","out","index","valueToIndex","forEach","nameI","themeTypes","exported","names","baseTheme","objectToJsString","n","toLowerCase","obj","arrItems","ki","indexOf","vi","push","moduleName","searchCache","mod","cache","id","module","constructor","_pathCache","cacheKey","callback","resolve","traverse","mod2","depth","children","child"],"sources":["../../src/generate-themes.ts"],"sourcesContent":[null],"mappings":"AACA,SAASA,IAAA,QAAY;AAMrB,IAAIC,eAAA,GAAkB;AAEtB,eAAsBC,eAAeC,SAAA,EAAmB;EACtD,MAAMC,aAAA,GAAgBD,SAAA,CAAU,CAAC,MAAM,MAAMH,IAAA,CAAKK,OAAA,CAAQC,GAAA,CAAI,GAAGH,SAAS,IAAIA,SAAA;EAE9E,IAAI,CAACF,eAAA,EAAiB;IACpBA,eAAA,GAAkB;IAElBM,OAAA,CAAQ,4BAA4B,EAAEC,QAAA,CAAS;MAC7CC,qBAAA,EAAuB;IACzB,CAAC;EACH,OAAO;IACLC,UAAA,CAAWN,aAAa;EAC1B;EAEA,IAAIO,EAAA,GAAKN,OAAA,CAAQO,GAAA,CAAIC,mBAAA;EACrBR,OAAA,CAAQO,GAAA,CAAIC,mBAAA,GAAsB;EAClCR,OAAA,CAAQO,GAAA,CAAIE,wBAAA,GAA2B;EAEvC,IAAI;IACF,MAAMC,cAAA,GAAiBR,OAAA,CAAQH,aAA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