@pandacss/config 0.39.0 → 0.39.2

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.
package/dist/index.js CHANGED
@@ -53,9 +53,16 @@ var import_sync = __toESM(require("escalade/sync"));
53
53
  var import_path = require("path");
54
54
 
55
55
  // src/is-panda-config.ts
56
- var configs = [".ts", ".js", ".mts", ".mjs", ".cts", ".cjs"];
57
- var pandaConfigRegex = new RegExp(`panda.config(${configs.join("|")})$`);
58
- var isPandaConfig = (file) => pandaConfigRegex.test(file);
56
+ var configName = "panda";
57
+ var pandaConfigFiles = /* @__PURE__ */ new Set([
58
+ `${configName}.config.ts`,
59
+ `${configName}.config.js`,
60
+ `${configName}.config.mts`,
61
+ `${configName}.config.mjs`,
62
+ `${configName}.config.cts`,
63
+ `${configName}.config.cjs`
64
+ ]);
65
+ var isPandaConfig = (file) => pandaConfigFiles.has(file);
59
66
 
60
67
  // src/find-config.ts
61
68
  function findConfig(options) {
@@ -570,25 +577,25 @@ var compact = (obj) => {
570
577
  }, {});
571
578
  };
572
579
  var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
573
- function mergeConfigs(configs2) {
574
- const [userConfig] = configs2;
580
+ function mergeConfigs(configs) {
581
+ const [userConfig] = configs;
575
582
  const pluginHooks = userConfig.plugins ?? [];
576
583
  if (userConfig.hooks) {
577
584
  pluginHooks.push({ name: "__panda.config__", hooks: userConfig.hooks });
578
585
  }
579
586
  const mergedResult = (0, import_shared5.assign)(
580
587
  {
581
- conditions: mergeExtensions(configs2.map((config) => config.conditions ?? {})),
582
- theme: mergeExtensions(configs2.map((config) => config.theme ?? {})),
583
- patterns: mergeExtensions(configs2.map((config) => config.patterns ?? {})),
584
- utilities: mergeExtensions(configs2.map((config) => config.utilities ?? {})),
585
- globalCss: mergeExtensions(configs2.map((config) => config.globalCss ?? {})),
586
- globalVars: mergeExtensions(configs2.map((config) => config.globalVars ?? {})),
587
- staticCss: mergeExtensions(configs2.map((config) => config.staticCss ?? {})),
588
- themes: mergeExtensions(configs2.map((config) => config.themes ?? {})),
588
+ conditions: mergeExtensions(configs.map((config) => config.conditions ?? {})),
589
+ theme: mergeExtensions(configs.map((config) => config.theme ?? {})),
590
+ patterns: mergeExtensions(configs.map((config) => config.patterns ?? {})),
591
+ utilities: mergeExtensions(configs.map((config) => config.utilities ?? {})),
592
+ globalCss: mergeExtensions(configs.map((config) => config.globalCss ?? {})),
593
+ globalVars: mergeExtensions(configs.map((config) => config.globalVars ?? {})),
594
+ staticCss: mergeExtensions(configs.map((config) => config.staticCss ?? {})),
595
+ themes: mergeExtensions(configs.map((config) => config.themes ?? {})),
589
596
  hooks: mergeHooks(pluginHooks)
590
597
  },
591
- ...configs2
598
+ ...configs
592
599
  );
593
600
  const withoutEmpty = compact(mergedResult);
594
601
  if (withoutEmpty.theme?.tokens) {
@@ -618,20 +625,20 @@ function mergeConfigs(configs2) {
618
625
  // src/get-resolved-config.ts
619
626
  async function getResolvedConfig(config, cwd) {
620
627
  const presets = config.presets ?? [];
621
- const configs2 = [];
628
+ const configs = [];
622
629
  while (presets.length > 0) {
623
630
  const preset = await presets.shift();
624
631
  if (typeof preset === "string") {
625
632
  const presetModule = await bundle(preset, cwd);
626
- configs2.unshift(await presetModule.config);
633
+ configs.unshift(await presetModule.config);
627
634
  presets.unshift(...await presetModule.config.presets ?? []);
628
635
  } else {
629
- configs2.unshift(preset);
636
+ configs.unshift(preset);
630
637
  presets.unshift(...preset.presets ?? []);
631
638
  }
632
639
  }
633
- configs2.unshift(config);
634
- return mergeConfigs(configs2);
640
+ configs.unshift(config);
641
+ return mergeConfigs(configs);
635
642
  }
636
643
 
637
644
  // src/resolve-config.ts
package/dist/index.mjs CHANGED
@@ -25,9 +25,16 @@ import findUp from "escalade/sync";
25
25
  import { resolve } from "path";
26
26
 
27
27
  // src/is-panda-config.ts
28
- var configs = [".ts", ".js", ".mts", ".mjs", ".cts", ".cjs"];
29
- var pandaConfigRegex = new RegExp(`panda.config(${configs.join("|")})$`);
30
- var isPandaConfig = (file) => pandaConfigRegex.test(file);
28
+ var configName = "panda";
29
+ var pandaConfigFiles = /* @__PURE__ */ new Set([
30
+ `${configName}.config.ts`,
31
+ `${configName}.config.js`,
32
+ `${configName}.config.mts`,
33
+ `${configName}.config.mjs`,
34
+ `${configName}.config.cts`,
35
+ `${configName}.config.cjs`
36
+ ]);
37
+ var isPandaConfig = (file) => pandaConfigFiles.has(file);
31
38
 
32
39
  // src/find-config.ts
33
40
  function findConfig(options) {
@@ -202,20 +209,20 @@ function getConfigDependencies(filePath, tsOptions = { pathMappings: [] }, compi
202
209
  // src/get-resolved-config.ts
203
210
  async function getResolvedConfig(config, cwd) {
204
211
  const presets = config.presets ?? [];
205
- const configs2 = [];
212
+ const configs = [];
206
213
  while (presets.length > 0) {
207
214
  const preset = await presets.shift();
208
215
  if (typeof preset === "string") {
209
216
  const presetModule = await bundle(preset, cwd);
210
- configs2.unshift(await presetModule.config);
217
+ configs.unshift(await presetModule.config);
211
218
  presets.unshift(...await presetModule.config.presets ?? []);
212
219
  } else {
213
- configs2.unshift(preset);
220
+ configs.unshift(preset);
214
221
  presets.unshift(...preset.presets ?? []);
215
222
  }
216
223
  }
217
- configs2.unshift(config);
218
- return mergeConfigs(configs2);
224
+ configs.unshift(config);
225
+ return mergeConfigs(configs);
219
226
  }
220
227
 
221
228
  // src/resolve-config.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/config",
3
- "version": "0.39.0",
3
+ "version": "0.39.2",
4
4
  "description": "Find and load panda config",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -73,11 +73,11 @@
73
73
  "merge-anything": "5.1.7",
74
74
  "microdiff": "1.3.2",
75
75
  "typescript": "5.3.3",
76
- "@pandacss/logger": "0.39.0",
77
- "@pandacss/preset-base": "0.39.0",
78
- "@pandacss/preset-panda": "0.39.0",
79
- "@pandacss/shared": "0.39.0",
80
- "@pandacss/types": "0.39.0"
76
+ "@pandacss/logger": "0.39.2",
77
+ "@pandacss/preset-base": "0.39.2",
78
+ "@pandacss/preset-panda": "0.39.2",
79
+ "@pandacss/shared": "0.39.2",
80
+ "@pandacss/types": "0.39.2"
81
81
  },
82
82
  "devDependencies": {
83
83
  "pkg-types": "1.0.3"