@pandacss/config 1.11.2 → 2.0.0-beta.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/LICENSE.md +1 -1
- package/README.md +12 -0
- package/dist/chunk-LUSBBUHX.js +250 -0
- package/dist/chunk-VYX3JX5J.js +106 -0
- package/dist/index.d.ts +68 -43
- package/dist/index.js +476 -1020
- package/dist/merge-Bt4BM1CH.d.ts +47 -0
- package/dist/merge.d.ts +2 -0
- package/dist/merge.js +8 -0
- package/dist/serialize.d.ts +17 -0
- package/dist/serialize.js +6 -0
- package/package.json +25 -58
- package/dist/chunk-BJRWQ6BQ.mjs +0 -154
- package/dist/chunk-FQ7G6ORY.mjs +0 -265
- package/dist/chunk-RPIVZP2I.mjs +0 -22
- package/dist/diff-config.d.mts +0 -9
- package/dist/diff-config.d.ts +0 -9
- package/dist/diff-config.js +0 -188
- package/dist/diff-config.mjs +0 -6
- package/dist/index.d.mts +0 -59
- package/dist/index.mjs +0 -628
- package/dist/merge-config.d.mts +0 -14
- package/dist/merge-config.d.ts +0 -14
- package/dist/merge-config.js +0 -259
- package/dist/merge-config.mjs +0 -8
- package/dist/resolve-ts-path-pattern.d.mts +0 -8
- package/dist/resolve-ts-path-pattern.d.ts +0 -8
- package/dist/resolve-ts-path-pattern.js +0 -46
- package/dist/resolve-ts-path-pattern.mjs +0 -6
- package/dist/ts-config-paths-qwrwgu2Q.d.mts +0 -10
- package/dist/ts-config-paths-qwrwgu2Q.d.ts +0 -10
package/dist/diff-config.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all2) => {
|
|
9
|
-
for (var name in all2)
|
|
10
|
-
__defProp(target, name, { get: all2[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/diff-config.ts
|
|
31
|
-
var diff_config_exports = {};
|
|
32
|
-
__export(diff_config_exports, {
|
|
33
|
-
diffConfigs: () => diffConfigs
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(diff_config_exports);
|
|
36
|
-
var import_shared = require("@pandacss/shared");
|
|
37
|
-
var import_microdiff = __toESM(require("microdiff"));
|
|
38
|
-
|
|
39
|
-
// src/create-matcher.ts
|
|
40
|
-
function createMatcher(id, patterns) {
|
|
41
|
-
if (!patterns?.length) return () => void 0;
|
|
42
|
-
const includePatterns = [];
|
|
43
|
-
const excludePatterns = [];
|
|
44
|
-
const deduped = new Set(patterns);
|
|
45
|
-
deduped.forEach((pattern) => {
|
|
46
|
-
const regexString = pattern.replace(/\*/g, ".*");
|
|
47
|
-
if (pattern.startsWith("!")) {
|
|
48
|
-
excludePatterns.push(regexString.slice(1));
|
|
49
|
-
} else {
|
|
50
|
-
includePatterns.push(regexString);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const include = new RegExp(includePatterns.join("|"));
|
|
54
|
-
const exclude = new RegExp(excludePatterns.join("|"));
|
|
55
|
-
return (path) => {
|
|
56
|
-
if (excludePatterns.length && exclude.test(path)) return;
|
|
57
|
-
return include.test(path) ? id : void 0;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// src/config-deps.ts
|
|
62
|
-
var all = [
|
|
63
|
-
"clean",
|
|
64
|
-
"cwd",
|
|
65
|
-
"eject",
|
|
66
|
-
"outdir",
|
|
67
|
-
"forceConsistentTypeExtension",
|
|
68
|
-
"outExtension",
|
|
69
|
-
"emitTokensOnly",
|
|
70
|
-
"presets",
|
|
71
|
-
"plugins",
|
|
72
|
-
"hooks"
|
|
73
|
-
];
|
|
74
|
-
var format = [
|
|
75
|
-
"syntax",
|
|
76
|
-
"hash",
|
|
77
|
-
"prefix",
|
|
78
|
-
"separator",
|
|
79
|
-
"strictTokens",
|
|
80
|
-
"strictPropertyValues",
|
|
81
|
-
"shorthands"
|
|
82
|
-
];
|
|
83
|
-
var tokens = [
|
|
84
|
-
"utilities",
|
|
85
|
-
"conditions",
|
|
86
|
-
"theme.tokens",
|
|
87
|
-
"theme.semanticTokens",
|
|
88
|
-
"theme.breakpoints",
|
|
89
|
-
"theme.containerNames",
|
|
90
|
-
"theme.containerSizes"
|
|
91
|
-
];
|
|
92
|
-
var jsx = ["jsxFramework", "jsxFactory", "jsxStyleProps", "syntax"];
|
|
93
|
-
var common = tokens.concat(jsx, format);
|
|
94
|
-
var artifactConfigDeps = {
|
|
95
|
-
helpers: ["syntax", "jsxFramework"],
|
|
96
|
-
keyframes: ["theme.keyframes", "layers"],
|
|
97
|
-
"design-tokens": ["layers", "!utilities.*.className"].concat(tokens),
|
|
98
|
-
types: ["!utilities.*.className"].concat(common),
|
|
99
|
-
"css-fn": common,
|
|
100
|
-
cva: ["syntax"],
|
|
101
|
-
sva: ["syntax"],
|
|
102
|
-
cx: [],
|
|
103
|
-
"create-recipe": ["separator", "prefix", "hash"],
|
|
104
|
-
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
105
|
-
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
106
|
-
"patterns-index": ["syntax", "patterns"],
|
|
107
|
-
patterns: ["syntax", "patterns"],
|
|
108
|
-
"jsx-is-valid-prop": common,
|
|
109
|
-
"jsx-factory": jsx,
|
|
110
|
-
"jsx-helpers": jsx,
|
|
111
|
-
"jsx-patterns": jsx.concat("patterns"),
|
|
112
|
-
"jsx-patterns-index": jsx.concat("patterns"),
|
|
113
|
-
"jsx-create-style-context": jsx,
|
|
114
|
-
"css-index": ["syntax"],
|
|
115
|
-
"package.json": ["forceConsistentTypeExtension", "outExtension"],
|
|
116
|
-
"types-styles": ["shorthands"],
|
|
117
|
-
"types-conditions": ["conditions"],
|
|
118
|
-
"types-jsx": jsx,
|
|
119
|
-
"types-entry": [],
|
|
120
|
-
"types-gen": [],
|
|
121
|
-
"types-gen-system": [],
|
|
122
|
-
themes: ["themes"].concat(tokens),
|
|
123
|
-
// staticCss depends on tokens (for wildcards) and recipes (for recipe rules)
|
|
124
|
-
"static-css": ["staticCss", "patterns", "theme.recipes", "theme.slotRecipes"].concat(tokens),
|
|
125
|
-
// Split CSS artifacts (generated via cssgen --splitting)
|
|
126
|
-
styles: [],
|
|
127
|
-
"styles.css": []
|
|
128
|
-
};
|
|
129
|
-
var artifactMatchers = Object.entries(artifactConfigDeps).map(([key, paths]) => {
|
|
130
|
-
if (!paths.length) return () => void 0;
|
|
131
|
-
return createMatcher(key, paths.concat(all));
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// src/diff-config.ts
|
|
135
|
-
var runIfFn = (fn) => typeof fn === "function" ? fn() : fn;
|
|
136
|
-
var hasRecipeStateTransition = (prevConfig, nextConfig) => {
|
|
137
|
-
const prevRecipes = prevConfig.theme?.recipes ?? {};
|
|
138
|
-
const prevSlotRecipes = prevConfig.theme?.slotRecipes ?? {};
|
|
139
|
-
const prevHasRecipes = Object.keys(prevRecipes).length > 0 || Object.keys(prevSlotRecipes).length > 0;
|
|
140
|
-
const nextRecipes = nextConfig.theme?.recipes ?? {};
|
|
141
|
-
const nextSlotRecipes = nextConfig.theme?.slotRecipes ?? {};
|
|
142
|
-
const nextHasRecipes = Object.keys(nextRecipes).length > 0 || Object.keys(nextSlotRecipes).length > 0;
|
|
143
|
-
return prevHasRecipes !== nextHasRecipes;
|
|
144
|
-
};
|
|
145
|
-
function diffConfigs(config, prevConfig) {
|
|
146
|
-
const affected = {
|
|
147
|
-
artifacts: /* @__PURE__ */ new Set(),
|
|
148
|
-
hasConfigChanged: false,
|
|
149
|
-
diffs: []
|
|
150
|
-
};
|
|
151
|
-
if (!prevConfig) {
|
|
152
|
-
affected.hasConfigChanged = true;
|
|
153
|
-
return affected;
|
|
154
|
-
}
|
|
155
|
-
const configDiff = (0, import_microdiff.default)(prevConfig, runIfFn(config));
|
|
156
|
-
if (!configDiff.length) {
|
|
157
|
-
return affected;
|
|
158
|
-
}
|
|
159
|
-
affected.hasConfigChanged = true;
|
|
160
|
-
affected.diffs = configDiff;
|
|
161
|
-
configDiff.forEach((change) => {
|
|
162
|
-
const changePath = change.path.join(".");
|
|
163
|
-
artifactMatchers.forEach((matcher) => {
|
|
164
|
-
const id = matcher(changePath);
|
|
165
|
-
if (!id) return;
|
|
166
|
-
if (id === "recipes") {
|
|
167
|
-
const name = (0, import_shared.dashCase)(change.path.slice(1, 3).join("."));
|
|
168
|
-
affected.artifacts.add(name);
|
|
169
|
-
}
|
|
170
|
-
if (id === "patterns") {
|
|
171
|
-
const name = (0, import_shared.dashCase)(change.path.slice(0, 2).join("."));
|
|
172
|
-
affected.artifacts.add(name);
|
|
173
|
-
}
|
|
174
|
-
affected.artifacts.add(id);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
if (affected.artifacts.has("recipes") || affected.artifacts.has("recipes-index")) {
|
|
178
|
-
const nextConfig = runIfFn(config);
|
|
179
|
-
if (hasRecipeStateTransition(prevConfig, nextConfig)) {
|
|
180
|
-
affected.artifacts.add("create-recipe");
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
return affected;
|
|
184
|
-
}
|
|
185
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
186
|
-
0 && (module.exports = {
|
|
187
|
-
diffConfigs
|
|
188
|
-
});
|
package/dist/diff-config.mjs
DELETED
package/dist/index.d.mts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import * as _pandacss_types from '@pandacss/types';
|
|
2
|
-
import { Config, ConfigTsOptions, PandaHooks, LoadConfigResult } from '@pandacss/types';
|
|
3
|
-
export { diffConfigs } from './diff-config.mjs';
|
|
4
|
-
import { TSConfig } from 'pkg-types';
|
|
5
|
-
import { P as PathMapping } from './ts-config-paths-qwrwgu2Q.mjs';
|
|
6
|
-
export { c as convertTsPathsToRegexes } from './ts-config-paths-qwrwgu2Q.mjs';
|
|
7
|
-
export { mergeConfigs, mergeHooks } from './merge-config.mjs';
|
|
8
|
-
|
|
9
|
-
interface ConfigFileOptions {
|
|
10
|
-
cwd: string;
|
|
11
|
-
file?: string;
|
|
12
|
-
}
|
|
13
|
-
interface BundleConfigResult<T = Config> {
|
|
14
|
-
config: T;
|
|
15
|
-
dependencies: string[];
|
|
16
|
-
path: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare function bundleConfig(options: ConfigFileOptions): Promise<BundleConfigResult>;
|
|
20
|
-
|
|
21
|
-
declare function findConfig(options: Partial<ConfigFileOptions>): string;
|
|
22
|
-
|
|
23
|
-
interface GetDepsOptions {
|
|
24
|
-
filename: string;
|
|
25
|
-
ext: string;
|
|
26
|
-
cwd: string;
|
|
27
|
-
seen: Set<string>;
|
|
28
|
-
baseUrl: string | undefined;
|
|
29
|
-
pathMappings: PathMapping[];
|
|
30
|
-
foundModuleAliases: Map<string, string>;
|
|
31
|
-
compilerOptions?: TSConfig['compilerOptions'];
|
|
32
|
-
}
|
|
33
|
-
declare function getConfigDependencies(filePath: string, tsOptions?: ConfigTsOptions, compilerOptions?: TSConfig['compilerOptions']): {
|
|
34
|
-
deps: Set<string>;
|
|
35
|
-
aliases: Map<string, string>;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
type Extendable<T> = T & {
|
|
39
|
-
extend?: T;
|
|
40
|
-
};
|
|
41
|
-
type ExtendableConfig = Extendable<Config>;
|
|
42
|
-
/**
|
|
43
|
-
* Recursively merge all presets into a single config (depth-first using stack)
|
|
44
|
-
*/
|
|
45
|
-
declare function getResolvedConfig(config: ExtendableConfig, cwd: string, hooks?: Partial<PandaHooks>): Promise<Config>;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Find, load and resolve the final config (including presets)
|
|
49
|
-
*/
|
|
50
|
-
declare function loadConfig(options: ConfigFileOptions): Promise<_pandacss_types.LoadConfigResult>;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Resolve the final config (including presets)
|
|
54
|
-
* @pandacss/preset-base: ALWAYS included if NOT using eject: true
|
|
55
|
-
* @pandacss/preset-panda: only included by default if no presets
|
|
56
|
-
*/
|
|
57
|
-
declare function resolveConfig(result: BundleConfigResult, cwd: string): Promise<LoadConfigResult>;
|
|
58
|
-
|
|
59
|
-
export { type BundleConfigResult, type GetDepsOptions, bundleConfig, findConfig, getConfigDependencies, getResolvedConfig, loadConfig, resolveConfig };
|