@bamboocss/config 1.11.1 → 1.11.3
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/diff-config-Co_3mDXE.cjs +197 -0
- package/dist/diff-config-KDQWMnQN.mjs +163 -0
- package/dist/diff-config.cjs +3 -0
- package/dist/diff-config.d.cts +10 -0
- package/dist/diff-config.d.mts +10 -0
- package/dist/diff-config.mjs +2 -6
- package/dist/index.cjs +575 -0
- package/dist/index.d.cts +84 -0
- package/dist/index.d.mts +84 -0
- package/dist/index.mjs +520 -589
- package/dist/merge-config-CcNpHJit.cjs +312 -0
- package/dist/merge-config-DI__LOWx.mjs +270 -0
- package/dist/merge-config-DVOlBQJY.d.cts +16 -0
- package/dist/merge-config-oEiBYbfB.d.mts +16 -0
- package/dist/merge-config.cjs +4 -0
- package/dist/merge-config.d.cts +2 -0
- package/dist/merge-config.d.mts +2 -0
- package/dist/merge-config.mjs +2 -8
- package/dist/resolve-ts-path-pattern.cjs +21 -0
- package/dist/resolve-ts-path-pattern.d.cts +9 -0
- package/dist/resolve-ts-path-pattern.d.mts +9 -0
- package/dist/resolve-ts-path-pattern.mjs +18 -5
- package/dist/ts-config-paths-CvGId8kq.d.mts +11 -0
- package/dist/ts-config-paths-wVx39QZ0.d.cts +11 -0
- package/package.json +19 -19
- package/dist/chunk-6TQW6KOI.mjs +0 -154
- package/dist/chunk-RIBK22OM.mjs +0 -265
- package/dist/chunk-RPIVZP2I.mjs +0 -22
- package/dist/diff-config.js +0 -188
- package/dist/index.js +0 -1086
- package/dist/merge-config.js +0 -259
- package/dist/resolve-ts-path-pattern.js +0 -46
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("@bamboocss/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
|
-
});
|