@pandacss/config 2.0.0-beta.17 → 2.0.0-beta.18
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.
|
@@ -112,6 +112,18 @@ var sectionKeys = [
|
|
|
112
112
|
var sectionKeySet2 = new Set(sectionKeys);
|
|
113
113
|
var runtimeOnlyKeys = /* @__PURE__ */ new Set(["presets", "plugins", "hooks", "name", "extend"]);
|
|
114
114
|
var tokenKeys2 = /* @__PURE__ */ new Set(["description", "extensions", "type", "value", "deprecated"]);
|
|
115
|
+
var themeRegistryKeys = /* @__PURE__ */ new Set([
|
|
116
|
+
"tokens",
|
|
117
|
+
"semanticTokens",
|
|
118
|
+
"keyframes",
|
|
119
|
+
"recipes",
|
|
120
|
+
"slotRecipes",
|
|
121
|
+
"textStyles",
|
|
122
|
+
"layerStyles",
|
|
123
|
+
"animationStyles",
|
|
124
|
+
"viewTransitions",
|
|
125
|
+
"positionTry"
|
|
126
|
+
]);
|
|
115
127
|
function mergeConfigsWithSources(configs) {
|
|
116
128
|
const tracker = new SourceTracker(configs.map((item) => item.source));
|
|
117
129
|
const config = mergeConfigs(configs, tracker);
|
|
@@ -130,7 +142,9 @@ function mergeConfigs(configs, tracker) {
|
|
|
130
142
|
}
|
|
131
143
|
for (const key of sectionKeys) {
|
|
132
144
|
const section = config[key];
|
|
133
|
-
if (isPlainObject(section))
|
|
145
|
+
if (!isPlainObject(section)) continue;
|
|
146
|
+
applySectionBase(key, sections[key], section, context);
|
|
147
|
+
applySectionExtend(key, sections[key], section, context);
|
|
134
148
|
}
|
|
135
149
|
}
|
|
136
150
|
for (const key of sectionKeys) {
|
|
@@ -139,21 +153,45 @@ function mergeConfigs(configs, tracker) {
|
|
|
139
153
|
if (result.theme?.tokens) normalizeNestedTokens(result.theme.tokens, tracker);
|
|
140
154
|
return result;
|
|
141
155
|
}
|
|
142
|
-
function
|
|
156
|
+
function applySectionBase(sectionName, target, section, context) {
|
|
143
157
|
const childContext = context && { ...context, path: [sectionName] };
|
|
144
158
|
for (const [key, value] of Object.entries(section)) {
|
|
145
159
|
if (key === "extend" || value === void 0 || omitKeys.has(key)) continue;
|
|
146
|
-
|
|
160
|
+
if (isRegistry(sectionName, key, value)) {
|
|
161
|
+
replaceRegistryEntries(target, key, value, childContext);
|
|
162
|
+
} else {
|
|
163
|
+
replaceValue(target, key, value, childContext);
|
|
164
|
+
}
|
|
147
165
|
}
|
|
166
|
+
}
|
|
167
|
+
function isRegistry(sectionName, key, value) {
|
|
168
|
+
return sectionName === "theme" && themeRegistryKeys.has(key) && isPlainObject(value);
|
|
169
|
+
}
|
|
170
|
+
function replaceRegistryEntries(target, key, registry, context) {
|
|
171
|
+
const entries = isPlainObject(target[key]) ? target[key] : target[key] = {};
|
|
172
|
+
const entryContext = context && { ...context, path: context.path.concat(key) };
|
|
173
|
+
for (const [name, value] of Object.entries(registry)) {
|
|
174
|
+
if (value === void 0 || omitKeys.has(name)) continue;
|
|
175
|
+
replaceValue(entries, name, value, entryContext);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function applySectionExtend(sectionName, target, section, context) {
|
|
148
179
|
if (section.extend === void 0) return;
|
|
149
180
|
if (!isPlainObject(section.extend)) {
|
|
150
181
|
throw new PandaError("CONFIG_ERROR", `\u{1F4A5} Config section \`${sectionName}.extend\` must be an object.`);
|
|
151
182
|
}
|
|
183
|
+
const childContext = context && { ...context, path: [sectionName] };
|
|
152
184
|
for (const [key, value] of Object.entries(section.extend)) {
|
|
153
185
|
if (value === void 0 || omitKeys.has(key)) continue;
|
|
154
186
|
mergeValue(target, key, value, "concat", childContext);
|
|
155
187
|
}
|
|
156
188
|
}
|
|
189
|
+
function replaceValue(target, key, value, context) {
|
|
190
|
+
const path = context?.path.concat(key);
|
|
191
|
+
recordSource(context, path, value, target[key], "replace");
|
|
192
|
+
target[key] = clone(value);
|
|
193
|
+
recordNestedSources(context, path, value);
|
|
194
|
+
}
|
|
157
195
|
function mergeValue(target, key, value, arrayMode, context) {
|
|
158
196
|
const current = target[key];
|
|
159
197
|
const path = context?.path.concat(key);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DesignSystemManifest, CodegenOverlay, Diagnostic, SerializedConfig, ProjectCallbacks, ProjectHooks, ConfigSnapshot, DiffConfigResult, DesignSystemManifestImportMap } from '@pandacss/compiler-shared';
|
|
2
2
|
export { DiffConfigResult } from '@pandacss/compiler-shared';
|
|
3
3
|
import { HookRegistry, Config, UserConfig } from '@pandacss/types';
|
|
4
|
-
import { C as ConfigSources } from './merge-
|
|
5
|
-
export { a as ConfigSourceEntry, m as mergeConfigs } from './merge-
|
|
4
|
+
import { C as ConfigSources } from './merge-EXcM0jFd.js';
|
|
5
|
+
export { a as ConfigSourceEntry, m as mergeConfigs } from './merge-EXcM0jFd.js';
|
|
6
6
|
export { ConfigSnapshot, createConfigSnapshot } from './serialize.js';
|
|
7
7
|
|
|
8
8
|
interface PluginHookEntry<Name extends keyof HookRegistry> {
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mergeConfigs,
|
|
3
3
|
mergeConfigsWithSources
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LDC4ZCDS.js";
|
|
5
5
|
import {
|
|
6
6
|
collectPluginHookHandlers,
|
|
7
7
|
createConfigSnapshot,
|
|
@@ -21,19 +21,19 @@ import {
|
|
|
21
21
|
import { applyConfigDefaults as applyConfigDefaults2 } from "@pandacss/compiler-shared";
|
|
22
22
|
|
|
23
23
|
// src/bundle.ts
|
|
24
|
-
import { existsSync, realpathSync } from "fs";
|
|
25
|
-
import { mkdir, unlink, writeFile } from "fs/promises";
|
|
26
|
-
import { builtinModules } from "module";
|
|
27
|
-
import { tmpdir } from "os";
|
|
28
|
-
import { basename, dirname, isAbsolute as isAbsolute2, join, normalize, relative } from "path";
|
|
29
|
-
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
24
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
25
|
+
import { mkdir, unlink, writeFile } from "node:fs/promises";
|
|
26
|
+
import { builtinModules } from "node:module";
|
|
27
|
+
import { tmpdir } from "node:os";
|
|
28
|
+
import { basename, dirname, isAbsolute as isAbsolute2, join, normalize, relative } from "node:path";
|
|
29
|
+
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
30
30
|
|
|
31
31
|
// src/bundle-plugins.ts
|
|
32
32
|
import { parse } from "acorn";
|
|
33
33
|
import { simple } from "acorn-walk";
|
|
34
34
|
import MagicString from "magic-string";
|
|
35
|
-
import { isAbsolute } from "path";
|
|
36
|
-
import { pathToFileURL } from "url";
|
|
35
|
+
import { isAbsolute } from "node:path";
|
|
36
|
+
import { pathToFileURL } from "node:url";
|
|
37
37
|
function importMetaUrlPlugin() {
|
|
38
38
|
return {
|
|
39
39
|
name: "panda-import-meta-url",
|
|
@@ -178,8 +178,8 @@ function canonical(filepath) {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
// src/find.ts
|
|
181
|
-
import { readdirSync } from "fs";
|
|
182
|
-
import { dirname as dirname2, resolve } from "path";
|
|
181
|
+
import { readdirSync } from "node:fs";
|
|
182
|
+
import { dirname as dirname2, resolve } from "node:path";
|
|
183
183
|
var configFiles = /* @__PURE__ */ new Set([
|
|
184
184
|
"panda.config.ts",
|
|
185
185
|
"panda.config.js",
|
|
@@ -435,19 +435,19 @@ function diffRuntimeOptions(appConfig, leafPreset, sources, dsIds, cwd) {
|
|
|
435
435
|
}
|
|
436
436
|
|
|
437
437
|
// src/preset.ts
|
|
438
|
-
import { normalize as normalize2, relative as relative5 } from "path";
|
|
438
|
+
import { normalize as normalize2, relative as relative5 } from "node:path";
|
|
439
439
|
|
|
440
440
|
// src/design-system/chain.ts
|
|
441
441
|
import {
|
|
442
442
|
outdirBasename
|
|
443
443
|
} from "@pandacss/compiler-shared";
|
|
444
|
-
import { readFileSync as readFileSync2, statSync } from "fs";
|
|
445
|
-
import { dirname as dirname4, resolve as resolve4 } from "path";
|
|
446
|
-
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
444
|
+
import { readFileSync as readFileSync2, statSync } from "node:fs";
|
|
445
|
+
import { dirname as dirname4, resolve as resolve4 } from "node:path";
|
|
446
|
+
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
447
447
|
|
|
448
448
|
// src/resolve.ts
|
|
449
|
-
import { createRequire } from "module";
|
|
450
|
-
import { resolve as resolve2 } from "path";
|
|
449
|
+
import { createRequire } from "node:module";
|
|
450
|
+
import { resolve as resolve2 } from "node:path";
|
|
451
451
|
function tryResolveFrom(request, fromDir) {
|
|
452
452
|
try {
|
|
453
453
|
return createRequire(resolve2(fromDir, "noop.js")).resolve(request, { paths: [fromDir] });
|
|
@@ -475,14 +475,14 @@ function errorCode(error) {
|
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
// src/design-system/package.ts
|
|
478
|
-
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
479
|
-
import { dirname as dirname3, join as join2 } from "path";
|
|
478
|
+
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
479
|
+
import { dirname as dirname3, join as join2 } from "node:path";
|
|
480
480
|
|
|
481
481
|
// src/design-system/publishable-files.ts
|
|
482
|
-
import { relative as relative3, resolve as resolve3 } from "path";
|
|
482
|
+
import { relative as relative3, resolve as resolve3 } from "node:path";
|
|
483
483
|
|
|
484
484
|
// src/paths.ts
|
|
485
|
-
import { isAbsolute as isAbsolute3, relative as relative2 } from "path";
|
|
485
|
+
import { isAbsolute as isAbsolute3, relative as relative2 } from "node:path";
|
|
486
486
|
function toPosixPath(path) {
|
|
487
487
|
return path.includes("\\") ? path.split("\\").join("/") : path;
|
|
488
488
|
}
|
|
@@ -1009,8 +1009,8 @@ function unsupportedSpecifierError(spec, protocol) {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
1011
|
// src/design-system/smart-include.ts
|
|
1012
|
-
import { existsSync as existsSync3 } from "fs";
|
|
1013
|
-
import { dirname as dirname5, isAbsolute as isAbsolute4, join as join3, relative as relative4, resolve as resolve5, sep } from "path";
|
|
1012
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
1013
|
+
import { dirname as dirname5, isAbsolute as isAbsolute4, join as join3, relative as relative4, resolve as resolve5, sep } from "node:path";
|
|
1014
1014
|
var SMART_INCLUDE_EXTENSIONS = ["js", "mjs", "cjs", "jsx", "ts", "cts", "mts", "tsx", "vue", "svelte", "astro"];
|
|
1015
1015
|
var MANIFEST_SUBPATH = "panda/lib.json";
|
|
1016
1016
|
var PACKAGE_SPECIFIER = /^(?:@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/i;
|
|
@@ -1112,7 +1112,7 @@ function inIncludeError(specs) {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
|
|
1114
1114
|
// src/design-system/token-paths.ts
|
|
1115
|
-
import { isDeepStrictEqual } from "util";
|
|
1115
|
+
import { isDeepStrictEqual } from "node:util";
|
|
1116
1116
|
function collectTokenPaths(config) {
|
|
1117
1117
|
return [...collectTokenEntries(config).keys()].sort();
|
|
1118
1118
|
}
|
|
@@ -1551,9 +1551,9 @@ function isConfigSnapshot(input) {
|
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
1553
|
// src/version.ts
|
|
1554
|
-
import { readFileSync as readFileSync3 } from "fs";
|
|
1555
|
-
import { dirname as dirname6, join as join4 } from "path";
|
|
1556
|
-
import { fileURLToPath } from "url";
|
|
1554
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
1555
|
+
import { dirname as dirname6, join as join4 } from "node:path";
|
|
1556
|
+
import { fileURLToPath } from "node:url";
|
|
1557
1557
|
var MAJOR_VERSION_RE = /\d+/;
|
|
1558
1558
|
var STAMPABLE_PANDA_RANGE_RE = /^[v=><~^]|^\d/;
|
|
1559
1559
|
function readPandaVersion() {
|
|
@@ -1573,7 +1573,7 @@ function isStampablePandaRange(range) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
|
|
1575
1575
|
// src/design-system/compile-preset.ts
|
|
1576
|
-
import { builtinModules as builtinModules2 } from "module";
|
|
1576
|
+
import { builtinModules as builtinModules2 } from "node:module";
|
|
1577
1577
|
var APP_FIELDS = ["designSystem", "include", "exclude", "outdir", "cwd", "watch", "clean", "gitignore", "importMap"];
|
|
1578
1578
|
var VIRTUAL_ENTRY = "\0panda-lib-preset-entry";
|
|
1579
1579
|
var nodeBuiltins2 = /* @__PURE__ */ new Set([...builtinModules2, ...builtinModules2.map((mod) => `node:${mod}`)]);
|
|
@@ -38,7 +38,7 @@ declare function mergeConfigsWithSources(configs: SourcedConfig[]): {
|
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
* Merges an ordered list of configs (presets first, user config last) into one flat config.
|
|
41
|
-
*
|
|
41
|
+
* A key written without `extend` replaces the entry it names; `extend` merges into it.
|
|
42
42
|
*/
|
|
43
43
|
declare function mergeConfigs(configs: ExtendableConfig[]): Dict;
|
|
44
44
|
declare function mergeConfigs(configs: SourcedConfig[], tracker: SourceTracker): Dict;
|
package/dist/merge.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { S as SourcedConfig, m as mergeConfigs, b as mergeConfigsWithSources } from './merge-
|
|
1
|
+
export { S as SourcedConfig, m as mergeConfigs, b as mergeConfigsWithSources } from './merge-EXcM0jFd.js';
|
|
2
2
|
import '@pandacss/types';
|
package/dist/merge.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/config",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.18",
|
|
4
4
|
"description": "Self-contained loader that bundles and serializes a Panda config for the Rust compiler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@pandacss/compiler-shared": "2.0.0-beta.
|
|
43
|
-
"@pandacss/types": "2.0.0-beta.
|
|
42
|
+
"@pandacss/compiler-shared": "2.0.0-beta.18",
|
|
43
|
+
"@pandacss/types": "2.0.0-beta.18",
|
|
44
44
|
"acorn": "^8.17.0",
|
|
45
45
|
"acorn-walk": "^8.3.5",
|
|
46
46
|
"javascript-stringify": "2.1.0",
|