@bamboocss/config 1.55.7 → 1.56.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/diff-config.cjs +0 -19
- package/dist/diff-config.mjs +0 -19
- package/dist/index.cjs +6 -21
- package/dist/index.mjs +6 -21
- package/dist/merge-config.cjs +6 -2
- package/dist/merge-config.mjs +6 -2
- package/package.json +6 -6
package/dist/diff-config.cjs
CHANGED
|
@@ -85,11 +85,6 @@ const artifactConfigDeps = {
|
|
|
85
85
|
cva: [],
|
|
86
86
|
sva: [],
|
|
87
87
|
cx: [],
|
|
88
|
-
"create-recipe": [
|
|
89
|
-
"separator",
|
|
90
|
-
"prefix",
|
|
91
|
-
"hash"
|
|
92
|
-
],
|
|
93
88
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
94
89
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
95
90
|
"patterns-index": ["patterns"],
|
|
@@ -120,17 +115,6 @@ Array.from(new Set([...all, ...Object.values(artifactConfigDeps).flat()]));
|
|
|
120
115
|
//#region src/diff-config.ts
|
|
121
116
|
const runIfFn = (fn) => typeof fn === "function" ? fn() : fn;
|
|
122
117
|
/**
|
|
123
|
-
* Check if recipes were empty before and non-empty now (or vice versa)
|
|
124
|
-
*/
|
|
125
|
-
const hasRecipeStateTransition = (prevConfig, nextConfig) => {
|
|
126
|
-
const prevRecipes = prevConfig.theme?.recipes ?? {};
|
|
127
|
-
const prevSlotRecipes = prevConfig.theme?.slotRecipes ?? {};
|
|
128
|
-
const prevHasRecipes = Object.keys(prevRecipes).length > 0 || Object.keys(prevSlotRecipes).length > 0;
|
|
129
|
-
const nextRecipes = nextConfig.theme?.recipes ?? {};
|
|
130
|
-
const nextSlotRecipes = nextConfig.theme?.slotRecipes ?? {};
|
|
131
|
-
return prevHasRecipes !== (Object.keys(nextRecipes).length > 0 || Object.keys(nextSlotRecipes).length > 0);
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
118
|
* Diff the two config objects and return the list of affected properties
|
|
135
119
|
*/
|
|
136
120
|
function diffConfigs(config, prevConfig) {
|
|
@@ -163,9 +147,6 @@ function diffConfigs(config, prevConfig) {
|
|
|
163
147
|
affected.artifacts.add(id);
|
|
164
148
|
});
|
|
165
149
|
});
|
|
166
|
-
if (affected.artifacts.has("recipes") || affected.artifacts.has("recipes-index")) {
|
|
167
|
-
if (hasRecipeStateTransition(prevConfig, runIfFn(config))) affected.artifacts.add("create-recipe");
|
|
168
|
-
}
|
|
169
150
|
return affected;
|
|
170
151
|
}
|
|
171
152
|
//#endregion
|
package/dist/diff-config.mjs
CHANGED
|
@@ -61,11 +61,6 @@ const artifactConfigDeps = {
|
|
|
61
61
|
cva: [],
|
|
62
62
|
sva: [],
|
|
63
63
|
cx: [],
|
|
64
|
-
"create-recipe": [
|
|
65
|
-
"separator",
|
|
66
|
-
"prefix",
|
|
67
|
-
"hash"
|
|
68
|
-
],
|
|
69
64
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
70
65
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
71
66
|
"patterns-index": ["patterns"],
|
|
@@ -96,17 +91,6 @@ Array.from(new Set([...all, ...Object.values(artifactConfigDeps).flat()]));
|
|
|
96
91
|
//#region src/diff-config.ts
|
|
97
92
|
const runIfFn = (fn) => typeof fn === "function" ? fn() : fn;
|
|
98
93
|
/**
|
|
99
|
-
* Check if recipes were empty before and non-empty now (or vice versa)
|
|
100
|
-
*/
|
|
101
|
-
const hasRecipeStateTransition = (prevConfig, nextConfig) => {
|
|
102
|
-
const prevRecipes = prevConfig.theme?.recipes ?? {};
|
|
103
|
-
const prevSlotRecipes = prevConfig.theme?.slotRecipes ?? {};
|
|
104
|
-
const prevHasRecipes = Object.keys(prevRecipes).length > 0 || Object.keys(prevSlotRecipes).length > 0;
|
|
105
|
-
const nextRecipes = nextConfig.theme?.recipes ?? {};
|
|
106
|
-
const nextSlotRecipes = nextConfig.theme?.slotRecipes ?? {};
|
|
107
|
-
return prevHasRecipes !== (Object.keys(nextRecipes).length > 0 || Object.keys(nextSlotRecipes).length > 0);
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
94
|
* Diff the two config objects and return the list of affected properties
|
|
111
95
|
*/
|
|
112
96
|
function diffConfigs(config, prevConfig) {
|
|
@@ -139,9 +123,6 @@ function diffConfigs(config, prevConfig) {
|
|
|
139
123
|
affected.artifacts.add(id);
|
|
140
124
|
});
|
|
141
125
|
});
|
|
142
|
-
if (affected.artifacts.has("recipes") || affected.artifacts.has("recipes-index")) {
|
|
143
|
-
if (hasRecipeStateTransition(prevConfig, runIfFn(config))) affected.artifacts.add("create-recipe");
|
|
144
|
-
}
|
|
145
126
|
return affected;
|
|
146
127
|
}
|
|
147
128
|
//#endregion
|
package/dist/index.cjs
CHANGED
|
@@ -165,11 +165,6 @@ const artifactConfigDeps = {
|
|
|
165
165
|
cva: [],
|
|
166
166
|
sva: [],
|
|
167
167
|
cx: [],
|
|
168
|
-
"create-recipe": [
|
|
169
|
-
"separator",
|
|
170
|
-
"prefix",
|
|
171
|
-
"hash"
|
|
172
|
-
],
|
|
173
168
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
174
169
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
175
170
|
"patterns-index": ["patterns"],
|
|
@@ -200,17 +195,6 @@ Array.from(new Set([...all, ...Object.values(artifactConfigDeps).flat()]));
|
|
|
200
195
|
//#region src/diff-config.ts
|
|
201
196
|
const runIfFn = (fn) => typeof fn === "function" ? fn() : fn;
|
|
202
197
|
/**
|
|
203
|
-
* Check if recipes were empty before and non-empty now (or vice versa)
|
|
204
|
-
*/
|
|
205
|
-
const hasRecipeStateTransition = (prevConfig, nextConfig) => {
|
|
206
|
-
const prevRecipes = prevConfig.theme?.recipes ?? {};
|
|
207
|
-
const prevSlotRecipes = prevConfig.theme?.slotRecipes ?? {};
|
|
208
|
-
const prevHasRecipes = Object.keys(prevRecipes).length > 0 || Object.keys(prevSlotRecipes).length > 0;
|
|
209
|
-
const nextRecipes = nextConfig.theme?.recipes ?? {};
|
|
210
|
-
const nextSlotRecipes = nextConfig.theme?.slotRecipes ?? {};
|
|
211
|
-
return prevHasRecipes !== (Object.keys(nextRecipes).length > 0 || Object.keys(nextSlotRecipes).length > 0);
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
198
|
* Diff the two config objects and return the list of affected properties
|
|
215
199
|
*/
|
|
216
200
|
function diffConfigs(config, prevConfig) {
|
|
@@ -243,9 +227,6 @@ function diffConfigs(config, prevConfig) {
|
|
|
243
227
|
affected.artifacts.add(id);
|
|
244
228
|
});
|
|
245
229
|
});
|
|
246
|
-
if (affected.artifacts.has("recipes") || affected.artifacts.has("recipes-index")) {
|
|
247
|
-
if (hasRecipeStateTransition(prevConfig, runIfFn(config))) affected.artifacts.add("create-recipe");
|
|
248
|
-
}
|
|
249
230
|
return affected;
|
|
250
231
|
}
|
|
251
232
|
//#endregion
|
|
@@ -499,14 +480,18 @@ const reducers = {
|
|
|
499
480
|
const args = Object.assign({}, _args);
|
|
500
481
|
const original = _args.css;
|
|
501
482
|
let css = args.css;
|
|
483
|
+
let optimized = false;
|
|
502
484
|
for (const hookFn of fns) {
|
|
503
485
|
const result = hookFn(Object.assign(args, {
|
|
504
486
|
css,
|
|
505
487
|
original
|
|
506
488
|
}));
|
|
507
|
-
if (result !== void 0)
|
|
489
|
+
if (result !== void 0) {
|
|
490
|
+
css = result;
|
|
491
|
+
optimized = true;
|
|
492
|
+
}
|
|
508
493
|
}
|
|
509
|
-
return css;
|
|
494
|
+
return optimized ? css : void 0;
|
|
510
495
|
})
|
|
511
496
|
};
|
|
512
497
|
const syncHooks = [
|
package/dist/index.mjs
CHANGED
|
@@ -138,11 +138,6 @@ const artifactConfigDeps = {
|
|
|
138
138
|
cva: [],
|
|
139
139
|
sva: [],
|
|
140
140
|
cx: [],
|
|
141
|
-
"create-recipe": [
|
|
142
|
-
"separator",
|
|
143
|
-
"prefix",
|
|
144
|
-
"hash"
|
|
145
|
-
],
|
|
146
141
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
147
142
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
148
143
|
"patterns-index": ["patterns"],
|
|
@@ -173,17 +168,6 @@ Array.from(new Set([...all, ...Object.values(artifactConfigDeps).flat()]));
|
|
|
173
168
|
//#region src/diff-config.ts
|
|
174
169
|
const runIfFn = (fn) => typeof fn === "function" ? fn() : fn;
|
|
175
170
|
/**
|
|
176
|
-
* Check if recipes were empty before and non-empty now (or vice versa)
|
|
177
|
-
*/
|
|
178
|
-
const hasRecipeStateTransition = (prevConfig, nextConfig) => {
|
|
179
|
-
const prevRecipes = prevConfig.theme?.recipes ?? {};
|
|
180
|
-
const prevSlotRecipes = prevConfig.theme?.slotRecipes ?? {};
|
|
181
|
-
const prevHasRecipes = Object.keys(prevRecipes).length > 0 || Object.keys(prevSlotRecipes).length > 0;
|
|
182
|
-
const nextRecipes = nextConfig.theme?.recipes ?? {};
|
|
183
|
-
const nextSlotRecipes = nextConfig.theme?.slotRecipes ?? {};
|
|
184
|
-
return prevHasRecipes !== (Object.keys(nextRecipes).length > 0 || Object.keys(nextSlotRecipes).length > 0);
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
171
|
* Diff the two config objects and return the list of affected properties
|
|
188
172
|
*/
|
|
189
173
|
function diffConfigs(config, prevConfig) {
|
|
@@ -216,9 +200,6 @@ function diffConfigs(config, prevConfig) {
|
|
|
216
200
|
affected.artifacts.add(id);
|
|
217
201
|
});
|
|
218
202
|
});
|
|
219
|
-
if (affected.artifacts.has("recipes") || affected.artifacts.has("recipes-index")) {
|
|
220
|
-
if (hasRecipeStateTransition(prevConfig, runIfFn(config))) affected.artifacts.add("create-recipe");
|
|
221
|
-
}
|
|
222
203
|
return affected;
|
|
223
204
|
}
|
|
224
205
|
//#endregion
|
|
@@ -472,14 +453,18 @@ const reducers = {
|
|
|
472
453
|
const args = Object.assign({}, _args);
|
|
473
454
|
const original = _args.css;
|
|
474
455
|
let css = args.css;
|
|
456
|
+
let optimized = false;
|
|
475
457
|
for (const hookFn of fns) {
|
|
476
458
|
const result = hookFn(Object.assign(args, {
|
|
477
459
|
css,
|
|
478
460
|
original
|
|
479
461
|
}));
|
|
480
|
-
if (result !== void 0)
|
|
462
|
+
if (result !== void 0) {
|
|
463
|
+
css = result;
|
|
464
|
+
optimized = true;
|
|
465
|
+
}
|
|
481
466
|
}
|
|
482
|
-
return css;
|
|
467
|
+
return optimized ? css : void 0;
|
|
483
468
|
})
|
|
484
469
|
};
|
|
485
470
|
const syncHooks = [
|
package/dist/merge-config.cjs
CHANGED
|
@@ -88,14 +88,18 @@ const reducers = {
|
|
|
88
88
|
const args = Object.assign({}, _args);
|
|
89
89
|
const original = _args.css;
|
|
90
90
|
let css = args.css;
|
|
91
|
+
let optimized = false;
|
|
91
92
|
for (const hookFn of fns) {
|
|
92
93
|
const result = hookFn(Object.assign(args, {
|
|
93
94
|
css,
|
|
94
95
|
original
|
|
95
96
|
}));
|
|
96
|
-
if (result !== void 0)
|
|
97
|
+
if (result !== void 0) {
|
|
98
|
+
css = result;
|
|
99
|
+
optimized = true;
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
|
-
return css;
|
|
102
|
+
return optimized ? css : void 0;
|
|
99
103
|
})
|
|
100
104
|
};
|
|
101
105
|
const syncHooks = [
|
package/dist/merge-config.mjs
CHANGED
|
@@ -87,14 +87,18 @@ const reducers = {
|
|
|
87
87
|
const args = Object.assign({}, _args);
|
|
88
88
|
const original = _args.css;
|
|
89
89
|
let css = args.css;
|
|
90
|
+
let optimized = false;
|
|
90
91
|
for (const hookFn of fns) {
|
|
91
92
|
const result = hookFn(Object.assign(args, {
|
|
92
93
|
css,
|
|
93
94
|
original
|
|
94
95
|
}));
|
|
95
|
-
if (result !== void 0)
|
|
96
|
+
if (result !== void 0) {
|
|
97
|
+
css = result;
|
|
98
|
+
optimized = true;
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
|
-
return css;
|
|
101
|
+
return optimized ? css : void 0;
|
|
98
102
|
})
|
|
99
103
|
};
|
|
100
104
|
const syncHooks = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.56.0",
|
|
4
4
|
"description": "Find and load bamboo config",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"escalade": "3.2.0",
|
|
65
65
|
"microdiff": "1.5.0",
|
|
66
66
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
67
|
-
"@bamboocss/logger": "1.
|
|
68
|
-
"@bamboocss/preset-
|
|
69
|
-
"@bamboocss/preset-
|
|
70
|
-
"@bamboocss/
|
|
71
|
-
"@bamboocss/
|
|
67
|
+
"@bamboocss/logger": "1.56.0",
|
|
68
|
+
"@bamboocss/preset-base": "1.56.0",
|
|
69
|
+
"@bamboocss/preset-bamboo": "1.56.0",
|
|
70
|
+
"@bamboocss/types": "1.56.0",
|
|
71
|
+
"@bamboocss/shared": "1.56.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"pkg-types": "2.3.0"
|