@pandacss/config 0.4.0 → 0.5.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.
@@ -0,0 +1,57 @@
1
+ import * as _pandacss_types from '@pandacss/types';
2
+ import { LoadConfigResult, Config } from '@pandacss/types';
3
+
4
+ declare function findConfigFile({ cwd, file }: {
5
+ cwd: string;
6
+ file?: string;
7
+ }): string | void;
8
+
9
+ type PathMapping = {
10
+ pattern: RegExp;
11
+ paths: string[];
12
+ };
13
+
14
+ type GetDepsOptions = {
15
+ filename: string;
16
+ ext: string;
17
+ cwd: string;
18
+ seen: Set<string>;
19
+ baseUrl: string | undefined;
20
+ pathMappings: PathMapping[];
21
+ foundModuleAliases: Map<string, string>;
22
+ };
23
+ type GetConfigDependenciesTsOptions = {
24
+ baseUrl?: string | undefined;
25
+ pathMappings: PathMapping[];
26
+ };
27
+ declare function getConfigDependencies(filePath: string, tsOptions?: GetConfigDependenciesTsOptions): {
28
+ deps: Set<string>;
29
+ aliases: Map<string, string>;
30
+ };
31
+
32
+ type ConfigFileOptions = {
33
+ cwd: string;
34
+ file?: string;
35
+ };
36
+ declare function loadConfigFile(options: ConfigFileOptions): Promise<LoadConfigResult>;
37
+ declare function resolveConfigFile(result: Awaited<ReturnType<typeof bundleConfigFile>>, cwd: string): Promise<LoadConfigResult>;
38
+ declare function bundleConfigFile(options: ConfigFileOptions): Promise<{
39
+ config: _pandacss_types.Config;
40
+ path: string;
41
+ dependencies: string[];
42
+ }>;
43
+
44
+ type Extendable<T> = T & {
45
+ extend?: T;
46
+ };
47
+ type ExtendableConfig = Extendable<Config>;
48
+ /**
49
+ * Merge all configs into a single config
50
+ */
51
+ declare function mergeConfigs(configs: ExtendableConfig[]): any;
52
+ /**
53
+ * Recursively merge all presets into a single config
54
+ */
55
+ declare function getResolvedConfig(config: ExtendableConfig, cwd: string): Promise<Config>;
56
+
57
+ export { GetConfigDependenciesTsOptions, GetDepsOptions, bundleConfigFile, findConfigFile, getConfigDependencies, getResolvedConfig, loadConfigFile, mergeConfigs, resolveConfigFile };
package/dist/index.js CHANGED
@@ -296,10 +296,10 @@ async function loadConfigFile(options) {
296
296
  }
297
297
  async function resolveConfigFile(result, cwd) {
298
298
  const presets = /* @__PURE__ */ new Set();
299
- presets.add(import_preset_base.preset);
300
- if (!result.config.presets) {
301
- presets.add(import_preset_panda.preset);
302
- } else {
299
+ if (!result.config.eject) {
300
+ presets.add(import_preset_base.preset);
301
+ }
302
+ if (result.config.presets) {
303
303
  result.config.presets.forEach((preset) => {
304
304
  if (typeof preset === "string" && isBundledPreset(preset)) {
305
305
  presets.add(bundledPresets[preset]);
@@ -307,6 +307,8 @@ async function resolveConfigFile(result, cwd) {
307
307
  presets.add(preset);
308
308
  }
309
309
  });
310
+ } else if (!result.config.eject) {
311
+ presets.add(import_preset_panda.preset);
310
312
  }
311
313
  result.config.presets = Array.from(presets);
312
314
  const mergedConfig = await getResolvedConfig(result.config, cwd);
package/dist/index.mjs CHANGED
@@ -254,10 +254,10 @@ async function loadConfigFile(options) {
254
254
  }
255
255
  async function resolveConfigFile(result, cwd) {
256
256
  const presets = /* @__PURE__ */ new Set();
257
- presets.add(presetBase);
258
- if (!result.config.presets) {
259
- presets.add(presetPanda);
260
- } else {
257
+ if (!result.config.eject) {
258
+ presets.add(presetBase);
259
+ }
260
+ if (result.config.presets) {
261
261
  result.config.presets.forEach((preset) => {
262
262
  if (typeof preset === "string" && isBundledPreset(preset)) {
263
263
  presets.add(bundledPresets[preset]);
@@ -265,6 +265,8 @@ async function resolveConfigFile(result, cwd) {
265
265
  presets.add(preset);
266
266
  }
267
267
  });
268
+ } else if (!result.config.eject) {
269
+ presets.add(presetPanda);
268
270
  }
269
271
  result.config.presets = Array.from(presets);
270
272
  const mergedConfig = await getResolvedConfig(result.config, cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/config",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Find and load panda config",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -19,11 +19,11 @@
19
19
  "jiti": "^1.18.2",
20
20
  "merge-anything": "^5.1.7",
21
21
  "tsconfck": "^2.1.1",
22
- "@pandacss/error": "0.4.0",
23
- "@pandacss/logger": "0.4.0",
24
- "@pandacss/preset-base": "0.4.0",
25
- "@pandacss/preset-panda": "0.4.0",
26
- "@pandacss/types": "0.4.0"
22
+ "@pandacss/error": "0.5.0",
23
+ "@pandacss/logger": "0.5.0",
24
+ "@pandacss/preset-base": "0.5.0",
25
+ "@pandacss/preset-panda": "0.5.0",
26
+ "@pandacss/types": "0.5.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "pkg-types": "1.0.3"