@pandacss/config 0.42.0 → 0.44.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.
- package/dist/{chunk-F5ESIWB7.mjs → chunk-K5ODX2PU.mjs} +14 -12
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -24
- package/dist/index.mjs +18 -15
- package/dist/merge-config.d.mts +2 -2
- package/dist/merge-config.d.ts +2 -2
- package/dist/merge-config.js +13 -11
- package/dist/merge-config.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/merge-config.ts
|
|
2
|
-
import { assign, mergeWith, walkObject } from "@pandacss/shared";
|
|
2
|
+
import { PANDA_CONFIG_NAME, assign, mergeWith, walkObject } from "@pandacss/shared";
|
|
3
3
|
import { mergeAndConcat } from "merge-anything";
|
|
4
4
|
|
|
5
5
|
// src/merge-hooks.ts
|
|
@@ -188,24 +188,26 @@ var compact = (obj) => {
|
|
|
188
188
|
};
|
|
189
189
|
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
190
190
|
function mergeConfigs(configs) {
|
|
191
|
-
const
|
|
191
|
+
const userConfig = configs.at(-1);
|
|
192
192
|
const pluginHooks = userConfig.plugins ?? [];
|
|
193
193
|
if (userConfig.hooks) {
|
|
194
|
-
pluginHooks.push({ name:
|
|
194
|
+
pluginHooks.push({ name: PANDA_CONFIG_NAME, hooks: userConfig.hooks });
|
|
195
195
|
}
|
|
196
|
+
const reversed = Array.from(configs).reverse();
|
|
196
197
|
const mergedResult = assign(
|
|
197
198
|
{
|
|
198
|
-
conditions: mergeExtensions(
|
|
199
|
-
theme: mergeExtensions(
|
|
200
|
-
patterns: mergeExtensions(
|
|
201
|
-
utilities: mergeExtensions(
|
|
202
|
-
globalCss: mergeExtensions(
|
|
203
|
-
globalVars: mergeExtensions(
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
conditions: mergeExtensions(reversed.map((config) => config.conditions ?? {})),
|
|
200
|
+
theme: mergeExtensions(reversed.map((config) => config.theme ?? {})),
|
|
201
|
+
patterns: mergeExtensions(reversed.map((config) => config.patterns ?? {})),
|
|
202
|
+
utilities: mergeExtensions(reversed.map((config) => config.utilities ?? {})),
|
|
203
|
+
globalCss: mergeExtensions(reversed.map((config) => config.globalCss ?? {})),
|
|
204
|
+
globalVars: mergeExtensions(reversed.map((config) => config.globalVars ?? {})),
|
|
205
|
+
globalFontface: mergeExtensions(reversed.map((config) => config.globalFontface ?? {})),
|
|
206
|
+
staticCss: mergeExtensions(reversed.map((config) => config.staticCss ?? {})),
|
|
207
|
+
themes: mergeExtensions(reversed.map((config) => config.themes ?? {})),
|
|
206
208
|
hooks: mergeHooks(pluginHooks)
|
|
207
209
|
},
|
|
208
|
-
...
|
|
210
|
+
...reversed
|
|
209
211
|
);
|
|
210
212
|
const withoutEmpty = compact(mergedResult);
|
|
211
213
|
if (withoutEmpty.theme?.tokens) {
|
package/dist/index.d.mts
CHANGED
|
@@ -40,9 +40,9 @@ type Extendable<T> = T & {
|
|
|
40
40
|
};
|
|
41
41
|
type ExtendableConfig = Extendable<Config>;
|
|
42
42
|
/**
|
|
43
|
-
* Recursively merge all presets into a single config
|
|
43
|
+
* Recursively merge all presets into a single config (depth-first using stack)
|
|
44
44
|
*/
|
|
45
|
-
declare function getResolvedConfig(config: ExtendableConfig, cwd: string): Promise<
|
|
45
|
+
declare function getResolvedConfig(config: ExtendableConfig, cwd: string): Promise<Config>;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Find, load and resolve the final config (including presets)
|
package/dist/index.d.ts
CHANGED
|
@@ -40,9 +40,9 @@ type Extendable<T> = T & {
|
|
|
40
40
|
};
|
|
41
41
|
type ExtendableConfig = Extendable<Config>;
|
|
42
42
|
/**
|
|
43
|
-
* Recursively merge all presets into a single config
|
|
43
|
+
* Recursively merge all presets into a single config (depth-first using stack)
|
|
44
44
|
*/
|
|
45
|
-
declare function getResolvedConfig(config: ExtendableConfig, cwd: string): Promise<
|
|
45
|
+
declare function getResolvedConfig(config: ExtendableConfig, cwd: string): Promise<Config>;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Find, load and resolve the final config (including presets)
|
package/dist/index.js
CHANGED
|
@@ -577,24 +577,26 @@ var compact = (obj) => {
|
|
|
577
577
|
};
|
|
578
578
|
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
579
579
|
function mergeConfigs(configs) {
|
|
580
|
-
const
|
|
580
|
+
const userConfig = configs.at(-1);
|
|
581
581
|
const pluginHooks = userConfig.plugins ?? [];
|
|
582
582
|
if (userConfig.hooks) {
|
|
583
|
-
pluginHooks.push({ name:
|
|
583
|
+
pluginHooks.push({ name: import_shared5.PANDA_CONFIG_NAME, hooks: userConfig.hooks });
|
|
584
584
|
}
|
|
585
|
+
const reversed = Array.from(configs).reverse();
|
|
585
586
|
const mergedResult = (0, import_shared5.assign)(
|
|
586
587
|
{
|
|
587
|
-
conditions: mergeExtensions(
|
|
588
|
-
theme: mergeExtensions(
|
|
589
|
-
patterns: mergeExtensions(
|
|
590
|
-
utilities: mergeExtensions(
|
|
591
|
-
globalCss: mergeExtensions(
|
|
592
|
-
globalVars: mergeExtensions(
|
|
593
|
-
|
|
594
|
-
|
|
588
|
+
conditions: mergeExtensions(reversed.map((config) => config.conditions ?? {})),
|
|
589
|
+
theme: mergeExtensions(reversed.map((config) => config.theme ?? {})),
|
|
590
|
+
patterns: mergeExtensions(reversed.map((config) => config.patterns ?? {})),
|
|
591
|
+
utilities: mergeExtensions(reversed.map((config) => config.utilities ?? {})),
|
|
592
|
+
globalCss: mergeExtensions(reversed.map((config) => config.globalCss ?? {})),
|
|
593
|
+
globalVars: mergeExtensions(reversed.map((config) => config.globalVars ?? {})),
|
|
594
|
+
globalFontface: mergeExtensions(reversed.map((config) => config.globalFontface ?? {})),
|
|
595
|
+
staticCss: mergeExtensions(reversed.map((config) => config.staticCss ?? {})),
|
|
596
|
+
themes: mergeExtensions(reversed.map((config) => config.themes ?? {})),
|
|
595
597
|
hooks: mergeHooks(pluginHooks)
|
|
596
598
|
},
|
|
597
|
-
...
|
|
599
|
+
...reversed
|
|
598
600
|
);
|
|
599
601
|
const withoutEmpty = compact(mergedResult);
|
|
600
602
|
if (withoutEmpty.theme?.tokens) {
|
|
@@ -623,21 +625,24 @@ function mergeConfigs(configs) {
|
|
|
623
625
|
|
|
624
626
|
// src/get-resolved-config.ts
|
|
625
627
|
async function getResolvedConfig(config, cwd) {
|
|
626
|
-
const
|
|
628
|
+
const stack = [config];
|
|
627
629
|
const configs = [];
|
|
628
|
-
while (
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
630
|
+
while (stack.length > 0) {
|
|
631
|
+
const current = stack.pop();
|
|
632
|
+
const subPresets = current.presets ?? [];
|
|
633
|
+
for (const subPreset of subPresets) {
|
|
634
|
+
if (typeof subPreset === "string") {
|
|
635
|
+
const presetModule = await bundle(subPreset, cwd);
|
|
636
|
+
stack.push(presetModule.config);
|
|
637
|
+
} else {
|
|
638
|
+
stack.push(await subPreset);
|
|
639
|
+
}
|
|
637
640
|
}
|
|
641
|
+
configs.unshift(current);
|
|
638
642
|
}
|
|
639
|
-
configs
|
|
640
|
-
|
|
643
|
+
const merged = mergeConfigs(configs);
|
|
644
|
+
merged.presets = configs.slice(0, -1);
|
|
645
|
+
return merged;
|
|
641
646
|
}
|
|
642
647
|
|
|
643
648
|
// src/resolve-config.ts
|
|
@@ -972,7 +977,7 @@ async function resolveConfig(result, cwd) {
|
|
|
972
977
|
loadConfigResult.config = result2;
|
|
973
978
|
}
|
|
974
979
|
}
|
|
975
|
-
const serialized = (0, import_shared10.stringifyJson)(loadConfigResult.config);
|
|
980
|
+
const serialized = (0, import_shared10.stringifyJson)(Object.assign({}, loadConfigResult.config, { name: import_shared10.PANDA_CONFIG_NAME, presets: [] }));
|
|
976
981
|
const deserialize = () => (0, import_shared10.parseJson)(serialized);
|
|
977
982
|
return { ...loadConfigResult, serialized, deserialize, hooks };
|
|
978
983
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
isValidToken,
|
|
7
7
|
mergeConfigs,
|
|
8
8
|
serializeTokenValue
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K5ODX2PU.mjs";
|
|
10
10
|
import {
|
|
11
11
|
diffConfigs
|
|
12
12
|
} from "./chunk-Q2O7DCQS.mjs";
|
|
@@ -208,26 +208,29 @@ function getConfigDependencies(filePath, tsOptions = { pathMappings: [] }, compi
|
|
|
208
208
|
|
|
209
209
|
// src/get-resolved-config.ts
|
|
210
210
|
async function getResolvedConfig(config, cwd) {
|
|
211
|
-
const
|
|
211
|
+
const stack = [config];
|
|
212
212
|
const configs = [];
|
|
213
|
-
while (
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
213
|
+
while (stack.length > 0) {
|
|
214
|
+
const current = stack.pop();
|
|
215
|
+
const subPresets = current.presets ?? [];
|
|
216
|
+
for (const subPreset of subPresets) {
|
|
217
|
+
if (typeof subPreset === "string") {
|
|
218
|
+
const presetModule = await bundle(subPreset, cwd);
|
|
219
|
+
stack.push(presetModule.config);
|
|
220
|
+
} else {
|
|
221
|
+
stack.push(await subPreset);
|
|
222
|
+
}
|
|
222
223
|
}
|
|
224
|
+
configs.unshift(current);
|
|
223
225
|
}
|
|
224
|
-
configs
|
|
225
|
-
|
|
226
|
+
const merged = mergeConfigs(configs);
|
|
227
|
+
merged.presets = configs.slice(0, -1);
|
|
228
|
+
return merged;
|
|
226
229
|
}
|
|
227
230
|
|
|
228
231
|
// src/resolve-config.ts
|
|
229
232
|
import { logger as logger3 } from "@pandacss/logger";
|
|
230
|
-
import { omit, parseJson, stringifyJson, traverse } from "@pandacss/shared";
|
|
233
|
+
import { PANDA_CONFIG_NAME, omit, parseJson, stringifyJson, traverse } from "@pandacss/shared";
|
|
231
234
|
|
|
232
235
|
// src/bundled-preset.ts
|
|
233
236
|
import { preset as presetBase } from "@pandacss/preset-base";
|
|
@@ -557,7 +560,7 @@ async function resolveConfig(result, cwd) {
|
|
|
557
560
|
loadConfigResult.config = result2;
|
|
558
561
|
}
|
|
559
562
|
}
|
|
560
|
-
const serialized = stringifyJson(loadConfigResult.config);
|
|
563
|
+
const serialized = stringifyJson(Object.assign({}, loadConfigResult.config, { name: PANDA_CONFIG_NAME, presets: [] }));
|
|
561
564
|
const deserialize = () => parseJson(serialized);
|
|
562
565
|
return { ...loadConfigResult, serialized, deserialize, hooks };
|
|
563
566
|
}
|
package/dist/merge-config.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config } from '@pandacss/types';
|
|
2
2
|
|
|
3
3
|
type Extendable<T> = T & {
|
|
4
4
|
extend?: T;
|
|
@@ -7,6 +7,6 @@ type ExtendableConfig = Extendable<Config>;
|
|
|
7
7
|
/**
|
|
8
8
|
* Merge all configs into a single config
|
|
9
9
|
*/
|
|
10
|
-
declare function mergeConfigs(configs: ExtendableConfig[]):
|
|
10
|
+
declare function mergeConfigs(configs: ExtendableConfig[]): any;
|
|
11
11
|
|
|
12
12
|
export { mergeConfigs };
|
package/dist/merge-config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config } from '@pandacss/types';
|
|
2
2
|
|
|
3
3
|
type Extendable<T> = T & {
|
|
4
4
|
extend?: T;
|
|
@@ -7,6 +7,6 @@ type ExtendableConfig = Extendable<Config>;
|
|
|
7
7
|
/**
|
|
8
8
|
* Merge all configs into a single config
|
|
9
9
|
*/
|
|
10
|
-
declare function mergeConfigs(configs: ExtendableConfig[]):
|
|
10
|
+
declare function mergeConfigs(configs: ExtendableConfig[]): any;
|
|
11
11
|
|
|
12
12
|
export { mergeConfigs };
|
package/dist/merge-config.js
CHANGED
|
@@ -185,24 +185,26 @@ var compact = (obj) => {
|
|
|
185
185
|
};
|
|
186
186
|
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
187
187
|
function mergeConfigs(configs) {
|
|
188
|
-
const
|
|
188
|
+
const userConfig = configs.at(-1);
|
|
189
189
|
const pluginHooks = userConfig.plugins ?? [];
|
|
190
190
|
if (userConfig.hooks) {
|
|
191
|
-
pluginHooks.push({ name:
|
|
191
|
+
pluginHooks.push({ name: import_shared2.PANDA_CONFIG_NAME, hooks: userConfig.hooks });
|
|
192
192
|
}
|
|
193
|
+
const reversed = Array.from(configs).reverse();
|
|
193
194
|
const mergedResult = (0, import_shared2.assign)(
|
|
194
195
|
{
|
|
195
|
-
conditions: mergeExtensions(
|
|
196
|
-
theme: mergeExtensions(
|
|
197
|
-
patterns: mergeExtensions(
|
|
198
|
-
utilities: mergeExtensions(
|
|
199
|
-
globalCss: mergeExtensions(
|
|
200
|
-
globalVars: mergeExtensions(
|
|
201
|
-
|
|
202
|
-
|
|
196
|
+
conditions: mergeExtensions(reversed.map((config) => config.conditions ?? {})),
|
|
197
|
+
theme: mergeExtensions(reversed.map((config) => config.theme ?? {})),
|
|
198
|
+
patterns: mergeExtensions(reversed.map((config) => config.patterns ?? {})),
|
|
199
|
+
utilities: mergeExtensions(reversed.map((config) => config.utilities ?? {})),
|
|
200
|
+
globalCss: mergeExtensions(reversed.map((config) => config.globalCss ?? {})),
|
|
201
|
+
globalVars: mergeExtensions(reversed.map((config) => config.globalVars ?? {})),
|
|
202
|
+
globalFontface: mergeExtensions(reversed.map((config) => config.globalFontface ?? {})),
|
|
203
|
+
staticCss: mergeExtensions(reversed.map((config) => config.staticCss ?? {})),
|
|
204
|
+
themes: mergeExtensions(reversed.map((config) => config.themes ?? {})),
|
|
203
205
|
hooks: mergeHooks(pluginHooks)
|
|
204
206
|
},
|
|
205
|
-
...
|
|
207
|
+
...reversed
|
|
206
208
|
);
|
|
207
209
|
const withoutEmpty = compact(mergedResult);
|
|
208
210
|
if (withoutEmpty.theme?.tokens) {
|
package/dist/merge-config.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
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.
|
|
77
|
-
"@pandacss/preset-base": "0.
|
|
78
|
-
"@pandacss/preset-panda": "0.
|
|
79
|
-
"@pandacss/shared": "0.
|
|
80
|
-
"@pandacss/types": "0.
|
|
76
|
+
"@pandacss/logger": "0.44.0",
|
|
77
|
+
"@pandacss/preset-base": "0.44.0",
|
|
78
|
+
"@pandacss/preset-panda": "0.44.0",
|
|
79
|
+
"@pandacss/shared": "0.44.0",
|
|
80
|
+
"@pandacss/types": "0.44.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"pkg-types": "1.0.3"
|