@bamboocss/config 1.15.0 → 1.16.1
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 +7 -21
- package/dist/diff-config.mjs +7 -21
- package/dist/index.cjs +13 -37
- package/dist/index.mjs +13 -37
- package/dist/merge-config.cjs +0 -14
- package/dist/merge-config.mjs +0 -14
- package/package.json +6 -6
package/dist/diff-config.cjs
CHANGED
|
@@ -61,7 +61,6 @@ const all = [
|
|
|
61
61
|
"hooks"
|
|
62
62
|
];
|
|
63
63
|
const format = [
|
|
64
|
-
"syntax",
|
|
65
64
|
"hash",
|
|
66
65
|
"prefix",
|
|
67
66
|
"separator",
|
|
@@ -78,21 +77,15 @@ const tokens = [
|
|
|
78
77
|
"theme.containerNames",
|
|
79
78
|
"theme.containerSizes"
|
|
80
79
|
];
|
|
81
|
-
const
|
|
82
|
-
"jsxFramework",
|
|
83
|
-
"jsxFactory",
|
|
84
|
-
"jsxStyleProps",
|
|
85
|
-
"syntax"
|
|
86
|
-
];
|
|
87
|
-
const common = tokens.concat(jsx, format);
|
|
80
|
+
const common = tokens.concat(format);
|
|
88
81
|
const artifactConfigDeps = {
|
|
89
|
-
helpers: [
|
|
82
|
+
helpers: [],
|
|
90
83
|
keyframes: ["theme.keyframes", "layers"],
|
|
91
84
|
"design-tokens": ["layers", "!utilities.*.className"].concat(tokens),
|
|
92
85
|
types: ["!utilities.*.className"].concat(common),
|
|
93
86
|
"css-fn": common,
|
|
94
|
-
cva: [
|
|
95
|
-
sva: [
|
|
87
|
+
cva: [],
|
|
88
|
+
sva: [],
|
|
96
89
|
cx: [],
|
|
97
90
|
"create-recipe": [
|
|
98
91
|
"separator",
|
|
@@ -101,19 +94,12 @@ const artifactConfigDeps = {
|
|
|
101
94
|
],
|
|
102
95
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
103
96
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
104
|
-
"patterns-index": ["
|
|
105
|
-
patterns: ["
|
|
106
|
-
"
|
|
107
|
-
"jsx-factory": jsx,
|
|
108
|
-
"jsx-helpers": jsx,
|
|
109
|
-
"jsx-patterns": jsx.concat("patterns"),
|
|
110
|
-
"jsx-patterns-index": jsx.concat("patterns"),
|
|
111
|
-
"jsx-create-style-context": jsx,
|
|
112
|
-
"css-index": ["syntax"],
|
|
97
|
+
"patterns-index": ["patterns"],
|
|
98
|
+
patterns: ["patterns"],
|
|
99
|
+
"css-index": [],
|
|
113
100
|
"package.json": ["forceConsistentTypeExtension", "outExtension"],
|
|
114
101
|
"types-styles": ["shorthands"],
|
|
115
102
|
"types-conditions": ["conditions"],
|
|
116
|
-
"types-jsx": jsx,
|
|
117
103
|
"types-entry": [],
|
|
118
104
|
"types-gen": [],
|
|
119
105
|
"types-gen-system": [],
|
package/dist/diff-config.mjs
CHANGED
|
@@ -37,7 +37,6 @@ const all = [
|
|
|
37
37
|
"hooks"
|
|
38
38
|
];
|
|
39
39
|
const format = [
|
|
40
|
-
"syntax",
|
|
41
40
|
"hash",
|
|
42
41
|
"prefix",
|
|
43
42
|
"separator",
|
|
@@ -54,21 +53,15 @@ const tokens = [
|
|
|
54
53
|
"theme.containerNames",
|
|
55
54
|
"theme.containerSizes"
|
|
56
55
|
];
|
|
57
|
-
const
|
|
58
|
-
"jsxFramework",
|
|
59
|
-
"jsxFactory",
|
|
60
|
-
"jsxStyleProps",
|
|
61
|
-
"syntax"
|
|
62
|
-
];
|
|
63
|
-
const common = tokens.concat(jsx, format);
|
|
56
|
+
const common = tokens.concat(format);
|
|
64
57
|
const artifactConfigDeps = {
|
|
65
|
-
helpers: [
|
|
58
|
+
helpers: [],
|
|
66
59
|
keyframes: ["theme.keyframes", "layers"],
|
|
67
60
|
"design-tokens": ["layers", "!utilities.*.className"].concat(tokens),
|
|
68
61
|
types: ["!utilities.*.className"].concat(common),
|
|
69
62
|
"css-fn": common,
|
|
70
|
-
cva: [
|
|
71
|
-
sva: [
|
|
63
|
+
cva: [],
|
|
64
|
+
sva: [],
|
|
72
65
|
cx: [],
|
|
73
66
|
"create-recipe": [
|
|
74
67
|
"separator",
|
|
@@ -77,19 +70,12 @@ const artifactConfigDeps = {
|
|
|
77
70
|
],
|
|
78
71
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
79
72
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
80
|
-
"patterns-index": ["
|
|
81
|
-
patterns: ["
|
|
82
|
-
"
|
|
83
|
-
"jsx-factory": jsx,
|
|
84
|
-
"jsx-helpers": jsx,
|
|
85
|
-
"jsx-patterns": jsx.concat("patterns"),
|
|
86
|
-
"jsx-patterns-index": jsx.concat("patterns"),
|
|
87
|
-
"jsx-create-style-context": jsx,
|
|
88
|
-
"css-index": ["syntax"],
|
|
73
|
+
"patterns-index": ["patterns"],
|
|
74
|
+
patterns: ["patterns"],
|
|
75
|
+
"css-index": [],
|
|
89
76
|
"package.json": ["forceConsistentTypeExtension", "outExtension"],
|
|
90
77
|
"types-styles": ["shorthands"],
|
|
91
78
|
"types-conditions": ["conditions"],
|
|
92
|
-
"types-jsx": jsx,
|
|
93
79
|
"types-entry": [],
|
|
94
80
|
"types-gen": [],
|
|
95
81
|
"types-gen-system": [],
|
package/dist/index.cjs
CHANGED
|
@@ -123,7 +123,6 @@ const all = [
|
|
|
123
123
|
"hooks"
|
|
124
124
|
];
|
|
125
125
|
const format = [
|
|
126
|
-
"syntax",
|
|
127
126
|
"hash",
|
|
128
127
|
"prefix",
|
|
129
128
|
"separator",
|
|
@@ -140,21 +139,15 @@ const tokens = [
|
|
|
140
139
|
"theme.containerNames",
|
|
141
140
|
"theme.containerSizes"
|
|
142
141
|
];
|
|
143
|
-
const
|
|
144
|
-
"jsxFramework",
|
|
145
|
-
"jsxFactory",
|
|
146
|
-
"jsxStyleProps",
|
|
147
|
-
"syntax"
|
|
148
|
-
];
|
|
149
|
-
const common = tokens.concat(jsx, format);
|
|
142
|
+
const common = tokens.concat(format);
|
|
150
143
|
const artifactConfigDeps = {
|
|
151
|
-
helpers: [
|
|
144
|
+
helpers: [],
|
|
152
145
|
keyframes: ["theme.keyframes", "layers"],
|
|
153
146
|
"design-tokens": ["layers", "!utilities.*.className"].concat(tokens),
|
|
154
147
|
types: ["!utilities.*.className"].concat(common),
|
|
155
148
|
"css-fn": common,
|
|
156
|
-
cva: [
|
|
157
|
-
sva: [
|
|
149
|
+
cva: [],
|
|
150
|
+
sva: [],
|
|
158
151
|
cx: [],
|
|
159
152
|
"create-recipe": [
|
|
160
153
|
"separator",
|
|
@@ -163,19 +156,12 @@ const artifactConfigDeps = {
|
|
|
163
156
|
],
|
|
164
157
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
165
158
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
166
|
-
"patterns-index": ["
|
|
167
|
-
patterns: ["
|
|
168
|
-
"
|
|
169
|
-
"jsx-factory": jsx,
|
|
170
|
-
"jsx-helpers": jsx,
|
|
171
|
-
"jsx-patterns": jsx.concat("patterns"),
|
|
172
|
-
"jsx-patterns-index": jsx.concat("patterns"),
|
|
173
|
-
"jsx-create-style-context": jsx,
|
|
174
|
-
"css-index": ["syntax"],
|
|
159
|
+
"patterns-index": ["patterns"],
|
|
160
|
+
patterns: ["patterns"],
|
|
161
|
+
"css-index": [],
|
|
175
162
|
"package.json": ["forceConsistentTypeExtension", "outExtension"],
|
|
176
163
|
"types-styles": ["shorthands"],
|
|
177
164
|
"types-conditions": ["conditions"],
|
|
178
|
-
"types-jsx": jsx,
|
|
179
165
|
"types-entry": [],
|
|
180
166
|
"types-gen": [],
|
|
181
167
|
"types-gen-system": [],
|
|
@@ -442,19 +428,6 @@ const reducers = {
|
|
|
442
428
|
}
|
|
443
429
|
return content;
|
|
444
430
|
}),
|
|
445
|
-
"parser:preprocess": createReducer((fns) => (_args) => {
|
|
446
|
-
const args = Object.assign({}, _args);
|
|
447
|
-
const original = _args.data;
|
|
448
|
-
let data = args.data;
|
|
449
|
-
for (const hookFn of fns) {
|
|
450
|
-
const result = hookFn(Object.assign(args, {
|
|
451
|
-
data,
|
|
452
|
-
original
|
|
453
|
-
}));
|
|
454
|
-
if (result !== void 0) data = result;
|
|
455
|
-
}
|
|
456
|
-
return data;
|
|
457
|
-
}),
|
|
458
431
|
"cssgen:done": createReducer((fns) => (_args) => {
|
|
459
432
|
const args = Object.assign({}, _args);
|
|
460
433
|
const original = _args.content;
|
|
@@ -511,7 +484,6 @@ const reducers = {
|
|
|
511
484
|
const syncHooks = [
|
|
512
485
|
"context:created",
|
|
513
486
|
"parser:before",
|
|
514
|
-
"parser:preprocess",
|
|
515
487
|
"parser:after",
|
|
516
488
|
"cssgen:done",
|
|
517
489
|
"css:optimize"
|
|
@@ -789,13 +761,17 @@ const validatePatterns = (patterns, names) => {
|
|
|
789
761
|
//#endregion
|
|
790
762
|
//#region src/validation/validate-recipes.ts
|
|
791
763
|
const validateRecipes = (options) => {
|
|
792
|
-
const { config: { theme }, artifacts } = options;
|
|
764
|
+
const { config: { theme }, artifacts, addError } = options;
|
|
793
765
|
if (!theme) return;
|
|
794
766
|
if (theme.recipes) Object.keys(theme.recipes).forEach((recipeName) => {
|
|
795
767
|
artifacts.recipes.add(recipeName);
|
|
796
768
|
});
|
|
797
|
-
if (theme.slotRecipes) Object.
|
|
769
|
+
if (theme.slotRecipes) Object.entries(theme.slotRecipes).forEach(([recipeName, recipe]) => {
|
|
798
770
|
artifacts.slotRecipes.add(recipeName);
|
|
771
|
+
recipe.scopeRoots?.forEach((scopeRoot) => {
|
|
772
|
+
if (recipe.slots?.includes(scopeRoot)) return;
|
|
773
|
+
addError("slot-recipes", `\`scopeRoots\` in \`${recipeName}\` names \`${scopeRoot}\`, which is not a slot it declares. Expected one of: ${recipe.slots?.join(", ")}`);
|
|
774
|
+
});
|
|
799
775
|
});
|
|
800
776
|
return artifacts;
|
|
801
777
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -95,7 +95,6 @@ const all = [
|
|
|
95
95
|
"hooks"
|
|
96
96
|
];
|
|
97
97
|
const format = [
|
|
98
|
-
"syntax",
|
|
99
98
|
"hash",
|
|
100
99
|
"prefix",
|
|
101
100
|
"separator",
|
|
@@ -112,21 +111,15 @@ const tokens = [
|
|
|
112
111
|
"theme.containerNames",
|
|
113
112
|
"theme.containerSizes"
|
|
114
113
|
];
|
|
115
|
-
const
|
|
116
|
-
"jsxFramework",
|
|
117
|
-
"jsxFactory",
|
|
118
|
-
"jsxStyleProps",
|
|
119
|
-
"syntax"
|
|
120
|
-
];
|
|
121
|
-
const common = tokens.concat(jsx, format);
|
|
114
|
+
const common = tokens.concat(format);
|
|
122
115
|
const artifactConfigDeps = {
|
|
123
|
-
helpers: [
|
|
116
|
+
helpers: [],
|
|
124
117
|
keyframes: ["theme.keyframes", "layers"],
|
|
125
118
|
"design-tokens": ["layers", "!utilities.*.className"].concat(tokens),
|
|
126
119
|
types: ["!utilities.*.className"].concat(common),
|
|
127
120
|
"css-fn": common,
|
|
128
|
-
cva: [
|
|
129
|
-
sva: [
|
|
121
|
+
cva: [],
|
|
122
|
+
sva: [],
|
|
130
123
|
cx: [],
|
|
131
124
|
"create-recipe": [
|
|
132
125
|
"separator",
|
|
@@ -135,19 +128,12 @@ const artifactConfigDeps = {
|
|
|
135
128
|
],
|
|
136
129
|
"recipes-index": ["theme.recipes", "theme.slotRecipes"],
|
|
137
130
|
recipes: ["theme.recipes", "theme.slotRecipes"],
|
|
138
|
-
"patterns-index": ["
|
|
139
|
-
patterns: ["
|
|
140
|
-
"
|
|
141
|
-
"jsx-factory": jsx,
|
|
142
|
-
"jsx-helpers": jsx,
|
|
143
|
-
"jsx-patterns": jsx.concat("patterns"),
|
|
144
|
-
"jsx-patterns-index": jsx.concat("patterns"),
|
|
145
|
-
"jsx-create-style-context": jsx,
|
|
146
|
-
"css-index": ["syntax"],
|
|
131
|
+
"patterns-index": ["patterns"],
|
|
132
|
+
patterns: ["patterns"],
|
|
133
|
+
"css-index": [],
|
|
147
134
|
"package.json": ["forceConsistentTypeExtension", "outExtension"],
|
|
148
135
|
"types-styles": ["shorthands"],
|
|
149
136
|
"types-conditions": ["conditions"],
|
|
150
|
-
"types-jsx": jsx,
|
|
151
137
|
"types-entry": [],
|
|
152
138
|
"types-gen": [],
|
|
153
139
|
"types-gen-system": [],
|
|
@@ -414,19 +400,6 @@ const reducers = {
|
|
|
414
400
|
}
|
|
415
401
|
return content;
|
|
416
402
|
}),
|
|
417
|
-
"parser:preprocess": createReducer((fns) => (_args) => {
|
|
418
|
-
const args = Object.assign({}, _args);
|
|
419
|
-
const original = _args.data;
|
|
420
|
-
let data = args.data;
|
|
421
|
-
for (const hookFn of fns) {
|
|
422
|
-
const result = hookFn(Object.assign(args, {
|
|
423
|
-
data,
|
|
424
|
-
original
|
|
425
|
-
}));
|
|
426
|
-
if (result !== void 0) data = result;
|
|
427
|
-
}
|
|
428
|
-
return data;
|
|
429
|
-
}),
|
|
430
403
|
"cssgen:done": createReducer((fns) => (_args) => {
|
|
431
404
|
const args = Object.assign({}, _args);
|
|
432
405
|
const original = _args.content;
|
|
@@ -483,7 +456,6 @@ const reducers = {
|
|
|
483
456
|
const syncHooks = [
|
|
484
457
|
"context:created",
|
|
485
458
|
"parser:before",
|
|
486
|
-
"parser:preprocess",
|
|
487
459
|
"parser:after",
|
|
488
460
|
"cssgen:done",
|
|
489
461
|
"css:optimize"
|
|
@@ -761,13 +733,17 @@ const validatePatterns = (patterns, names) => {
|
|
|
761
733
|
//#endregion
|
|
762
734
|
//#region src/validation/validate-recipes.ts
|
|
763
735
|
const validateRecipes = (options) => {
|
|
764
|
-
const { config: { theme }, artifacts } = options;
|
|
736
|
+
const { config: { theme }, artifacts, addError } = options;
|
|
765
737
|
if (!theme) return;
|
|
766
738
|
if (theme.recipes) Object.keys(theme.recipes).forEach((recipeName) => {
|
|
767
739
|
artifacts.recipes.add(recipeName);
|
|
768
740
|
});
|
|
769
|
-
if (theme.slotRecipes) Object.
|
|
741
|
+
if (theme.slotRecipes) Object.entries(theme.slotRecipes).forEach(([recipeName, recipe]) => {
|
|
770
742
|
artifacts.slotRecipes.add(recipeName);
|
|
743
|
+
recipe.scopeRoots?.forEach((scopeRoot) => {
|
|
744
|
+
if (recipe.slots?.includes(scopeRoot)) return;
|
|
745
|
+
addError("slot-recipes", `\`scopeRoots\` in \`${recipeName}\` names \`${scopeRoot}\`, which is not a slot it declares. Expected one of: ${recipe.slots?.join(", ")}`);
|
|
746
|
+
});
|
|
771
747
|
});
|
|
772
748
|
return artifacts;
|
|
773
749
|
};
|
package/dist/merge-config.cjs
CHANGED
|
@@ -45,19 +45,6 @@ const reducers = {
|
|
|
45
45
|
}
|
|
46
46
|
return content;
|
|
47
47
|
}),
|
|
48
|
-
"parser:preprocess": createReducer((fns) => (_args) => {
|
|
49
|
-
const args = Object.assign({}, _args);
|
|
50
|
-
const original = _args.data;
|
|
51
|
-
let data = args.data;
|
|
52
|
-
for (const hookFn of fns) {
|
|
53
|
-
const result = hookFn(Object.assign(args, {
|
|
54
|
-
data,
|
|
55
|
-
original
|
|
56
|
-
}));
|
|
57
|
-
if (result !== void 0) data = result;
|
|
58
|
-
}
|
|
59
|
-
return data;
|
|
60
|
-
}),
|
|
61
48
|
"cssgen:done": createReducer((fns) => (_args) => {
|
|
62
49
|
const args = Object.assign({}, _args);
|
|
63
50
|
const original = _args.content;
|
|
@@ -114,7 +101,6 @@ const reducers = {
|
|
|
114
101
|
const syncHooks = [
|
|
115
102
|
"context:created",
|
|
116
103
|
"parser:before",
|
|
117
|
-
"parser:preprocess",
|
|
118
104
|
"parser:after",
|
|
119
105
|
"cssgen:done",
|
|
120
106
|
"css:optimize"
|
package/dist/merge-config.mjs
CHANGED
|
@@ -44,19 +44,6 @@ const reducers = {
|
|
|
44
44
|
}
|
|
45
45
|
return content;
|
|
46
46
|
}),
|
|
47
|
-
"parser:preprocess": createReducer((fns) => (_args) => {
|
|
48
|
-
const args = Object.assign({}, _args);
|
|
49
|
-
const original = _args.data;
|
|
50
|
-
let data = args.data;
|
|
51
|
-
for (const hookFn of fns) {
|
|
52
|
-
const result = hookFn(Object.assign(args, {
|
|
53
|
-
data,
|
|
54
|
-
original
|
|
55
|
-
}));
|
|
56
|
-
if (result !== void 0) data = result;
|
|
57
|
-
}
|
|
58
|
-
return data;
|
|
59
|
-
}),
|
|
60
47
|
"cssgen:done": createReducer((fns) => (_args) => {
|
|
61
48
|
const args = Object.assign({}, _args);
|
|
62
49
|
const original = _args.content;
|
|
@@ -113,7 +100,6 @@ const reducers = {
|
|
|
113
100
|
const syncHooks = [
|
|
114
101
|
"context:created",
|
|
115
102
|
"parser:before",
|
|
116
|
-
"parser:preprocess",
|
|
117
103
|
"parser:after",
|
|
118
104
|
"cssgen:done",
|
|
119
105
|
"css:optimize"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.1",
|
|
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": "6.0.2",
|
|
67
|
-
"@bamboocss/logger": "1.
|
|
68
|
-
"@bamboocss/preset-bamboo": "1.
|
|
69
|
-
"@bamboocss/preset-base": "1.
|
|
70
|
-
"@bamboocss/shared": "1.
|
|
71
|
-
"@bamboocss/types": "1.
|
|
67
|
+
"@bamboocss/logger": "1.16.1",
|
|
68
|
+
"@bamboocss/preset-bamboo": "1.16.1",
|
|
69
|
+
"@bamboocss/preset-base": "1.16.1",
|
|
70
|
+
"@bamboocss/shared": "1.16.1",
|
|
71
|
+
"@bamboocss/types": "1.16.1"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"pkg-types": "2.3.0"
|