@pandacss/config 0.0.0-dev-20240720123529 → 0.0.0-dev-20240722083328
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-TISWX7II.mjs → chunk-K5ODX2PU.mjs} +14 -13
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -25
- 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 -12
- 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,25 +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
|
-
globalFontface: mergeExtensions(
|
|
205
|
-
staticCss: mergeExtensions(
|
|
206
|
-
themes: mergeExtensions(
|
|
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 ?? {})),
|
|
207
208
|
hooks: mergeHooks(pluginHooks)
|
|
208
209
|
},
|
|
209
|
-
...
|
|
210
|
+
...reversed
|
|
210
211
|
);
|
|
211
212
|
const withoutEmpty = compact(mergedResult);
|
|
212
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,25 +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
|
-
globalFontface: mergeExtensions(
|
|
594
|
-
staticCss: mergeExtensions(
|
|
595
|
-
themes: mergeExtensions(
|
|
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 ?? {})),
|
|
596
597
|
hooks: mergeHooks(pluginHooks)
|
|
597
598
|
},
|
|
598
|
-
...
|
|
599
|
+
...reversed
|
|
599
600
|
);
|
|
600
601
|
const withoutEmpty = compact(mergedResult);
|
|
601
602
|
if (withoutEmpty.theme?.tokens) {
|
|
@@ -624,21 +625,24 @@ function mergeConfigs(configs) {
|
|
|
624
625
|
|
|
625
626
|
// src/get-resolved-config.ts
|
|
626
627
|
async function getResolvedConfig(config, cwd) {
|
|
627
|
-
const
|
|
628
|
+
const stack = [config];
|
|
628
629
|
const configs = [];
|
|
629
|
-
while (
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
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
|
+
}
|
|
638
640
|
}
|
|
641
|
+
configs.unshift(current);
|
|
639
642
|
}
|
|
640
|
-
configs
|
|
641
|
-
|
|
643
|
+
const merged = mergeConfigs(configs);
|
|
644
|
+
merged.presets = configs.slice(0, -1);
|
|
645
|
+
return merged;
|
|
642
646
|
}
|
|
643
647
|
|
|
644
648
|
// src/resolve-config.ts
|
|
@@ -973,7 +977,7 @@ async function resolveConfig(result, cwd) {
|
|
|
973
977
|
loadConfigResult.config = result2;
|
|
974
978
|
}
|
|
975
979
|
}
|
|
976
|
-
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: [] }));
|
|
977
981
|
const deserialize = () => (0, import_shared10.parseJson)(serialized);
|
|
978
982
|
return { ...loadConfigResult, serialized, deserialize, hooks };
|
|
979
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,25 +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
|
-
globalFontface: mergeExtensions(
|
|
202
|
-
staticCss: mergeExtensions(
|
|
203
|
-
themes: mergeExtensions(
|
|
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 ?? {})),
|
|
204
205
|
hooks: mergeHooks(pluginHooks)
|
|
205
206
|
},
|
|
206
|
-
...
|
|
207
|
+
...reversed
|
|
207
208
|
);
|
|
208
209
|
const withoutEmpty = compact(mergedResult);
|
|
209
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.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20240722083328",
|
|
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.0.0-dev-
|
|
77
|
-
"@pandacss/preset-base": "0.0.0-dev-
|
|
78
|
-
"@pandacss/preset-panda": "0.0.0-dev-
|
|
79
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
80
|
-
"@pandacss/types": "0.0.0-dev-
|
|
76
|
+
"@pandacss/logger": "0.0.0-dev-20240722083328",
|
|
77
|
+
"@pandacss/preset-base": "0.0.0-dev-20240722083328",
|
|
78
|
+
"@pandacss/preset-panda": "0.0.0-dev-20240722083328",
|
|
79
|
+
"@pandacss/shared": "0.0.0-dev-20240722083328",
|
|
80
|
+
"@pandacss/types": "0.0.0-dev-20240722083328"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"pkg-types": "1.0.3"
|