@bamboocss/vite 1.36.0 → 1.36.2
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/index.cjs +33 -3
- package/dist/index.mjs +33 -3
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -89,6 +89,33 @@ const pruneStaticCss = (css, session, { prune = true } = {}) => {
|
|
|
89
89
|
removed = true;
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
if (prune) {
|
|
93
|
+
const present = /* @__PURE__ */ new Set();
|
|
94
|
+
root.walkRules((rule) => {
|
|
95
|
+
if (!isUtilityRule(rule)) return;
|
|
96
|
+
try {
|
|
97
|
+
(0, postcss_selector_parser.default)((selectors) => {
|
|
98
|
+
selectors.walkClasses((classNode) => {
|
|
99
|
+
present.add(classNode.toString().slice(1));
|
|
100
|
+
});
|
|
101
|
+
}).processSync(rule.selector);
|
|
102
|
+
} catch {}
|
|
103
|
+
});
|
|
104
|
+
const orphaned = [];
|
|
105
|
+
for (const className of session.usedClasses) {
|
|
106
|
+
if (/\s/.test(className)) {
|
|
107
|
+
orphaned.push(className);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (!session.prunableClasses.has(className)) continue;
|
|
111
|
+
if (present.has(className)) continue;
|
|
112
|
+
orphaned.push(className);
|
|
113
|
+
}
|
|
114
|
+
if (orphaned.length) throw new Error(`bamboocss: ${orphaned.length} compiled class(es) have no rule in the emitted stylesheet. Elements carrying them would render unstyled.\n\n${(0, _bamboocss_shared.truncateList)(orphaned, {
|
|
115
|
+
unit: "class",
|
|
116
|
+
separator: "\n"
|
|
117
|
+
})}\n\nThis is a compiler bug rather than anything to fix in your source — please report it with the class names above.`);
|
|
118
|
+
}
|
|
92
119
|
if (session.denseClassNames) root.walkRules((rule) => {
|
|
93
120
|
if (!isUtilityRule(rule)) return;
|
|
94
121
|
const transitionClasses = /* @__PURE__ */ new Set();
|
|
@@ -2693,8 +2720,11 @@ const createStaticCompilationSession = (denseClassNames = true) => {
|
|
|
2693
2720
|
}).join(" ");
|
|
2694
2721
|
},
|
|
2695
2722
|
markClassUsed(className) {
|
|
2696
|
-
const
|
|
2697
|
-
|
|
2723
|
+
for (const token of className.split(" ")) {
|
|
2724
|
+
if (!token) continue;
|
|
2725
|
+
const semantic = session.semanticClasses.get(token) ?? token;
|
|
2726
|
+
session.usedClasses.add((0, _bamboocss_shared.esc)(semantic));
|
|
2727
|
+
}
|
|
2698
2728
|
}
|
|
2699
2729
|
};
|
|
2700
2730
|
return session;
|
|
@@ -2912,7 +2942,7 @@ const bamboocss = (options = {}) => {
|
|
|
2912
2942
|
name: "compiler",
|
|
2913
2943
|
reason: "compile-failed"
|
|
2914
2944
|
});
|
|
2915
|
-
if (command === "serve") throw error;
|
|
2945
|
+
if (command === "serve") throw error instanceof Error ? error : new Error(`bamboocss: failed to compile ${filePath}: ${String(error)}`, { cause: error });
|
|
2916
2946
|
return null;
|
|
2917
2947
|
}
|
|
2918
2948
|
totals.files++;
|
package/dist/index.mjs
CHANGED
|
@@ -59,6 +59,33 @@ const pruneStaticCss = (css, session, { prune = true } = {}) => {
|
|
|
59
59
|
removed = true;
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
+
if (prune) {
|
|
63
|
+
const present = /* @__PURE__ */ new Set();
|
|
64
|
+
root.walkRules((rule) => {
|
|
65
|
+
if (!isUtilityRule(rule)) return;
|
|
66
|
+
try {
|
|
67
|
+
selectorParser((selectors) => {
|
|
68
|
+
selectors.walkClasses((classNode) => {
|
|
69
|
+
present.add(classNode.toString().slice(1));
|
|
70
|
+
});
|
|
71
|
+
}).processSync(rule.selector);
|
|
72
|
+
} catch {}
|
|
73
|
+
});
|
|
74
|
+
const orphaned = [];
|
|
75
|
+
for (const className of session.usedClasses) {
|
|
76
|
+
if (/\s/.test(className)) {
|
|
77
|
+
orphaned.push(className);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (!session.prunableClasses.has(className)) continue;
|
|
81
|
+
if (present.has(className)) continue;
|
|
82
|
+
orphaned.push(className);
|
|
83
|
+
}
|
|
84
|
+
if (orphaned.length) throw new Error(`bamboocss: ${orphaned.length} compiled class(es) have no rule in the emitted stylesheet. Elements carrying them would render unstyled.\n\n${truncateList(orphaned, {
|
|
85
|
+
unit: "class",
|
|
86
|
+
separator: "\n"
|
|
87
|
+
})}\n\nThis is a compiler bug rather than anything to fix in your source — please report it with the class names above.`);
|
|
88
|
+
}
|
|
62
89
|
if (session.denseClassNames) root.walkRules((rule) => {
|
|
63
90
|
if (!isUtilityRule(rule)) return;
|
|
64
91
|
const transitionClasses = /* @__PURE__ */ new Set();
|
|
@@ -2663,8 +2690,11 @@ const createStaticCompilationSession = (denseClassNames = true) => {
|
|
|
2663
2690
|
}).join(" ");
|
|
2664
2691
|
},
|
|
2665
2692
|
markClassUsed(className) {
|
|
2666
|
-
const
|
|
2667
|
-
|
|
2693
|
+
for (const token of className.split(" ")) {
|
|
2694
|
+
if (!token) continue;
|
|
2695
|
+
const semantic = session.semanticClasses.get(token) ?? token;
|
|
2696
|
+
session.usedClasses.add(esc(semantic));
|
|
2697
|
+
}
|
|
2668
2698
|
}
|
|
2669
2699
|
};
|
|
2670
2700
|
return session;
|
|
@@ -2882,7 +2912,7 @@ const bamboocss = (options = {}) => {
|
|
|
2882
2912
|
name: "compiler",
|
|
2883
2913
|
reason: "compile-failed"
|
|
2884
2914
|
});
|
|
2885
|
-
if (command === "serve") throw error;
|
|
2915
|
+
if (command === "serve") throw error instanceof Error ? error : new Error(`bamboocss: failed to compile ${filePath}: ${String(error)}`, { cause: error });
|
|
2886
2916
|
return null;
|
|
2887
2917
|
}
|
|
2888
2918
|
totals.files++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/vite",
|
|
3
|
-
"version": "1.36.
|
|
3
|
+
"version": "1.36.2",
|
|
4
4
|
"description": "Vite integration for Bamboo CSS",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"postcss": "8.5.26",
|
|
41
41
|
"postcss-selector-parser": "7.1.5",
|
|
42
42
|
"ts-morph": "28.0.0",
|
|
43
|
-
"@bamboocss/config": "1.36.
|
|
44
|
-
"@bamboocss/core": "1.36.
|
|
45
|
-
"@bamboocss/extractor": "1.36.
|
|
46
|
-
"@bamboocss/
|
|
47
|
-
"@bamboocss/
|
|
48
|
-
"@bamboocss/shared": "1.36.
|
|
49
|
-
"@bamboocss/types": "1.36.
|
|
43
|
+
"@bamboocss/config": "1.36.2",
|
|
44
|
+
"@bamboocss/core": "1.36.2",
|
|
45
|
+
"@bamboocss/extractor": "1.36.2",
|
|
46
|
+
"@bamboocss/node": "1.36.2",
|
|
47
|
+
"@bamboocss/logger": "1.36.2",
|
|
48
|
+
"@bamboocss/shared": "1.36.2",
|
|
49
|
+
"@bamboocss/types": "1.36.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
53
53
|
"vite": "7.2.6",
|
|
54
|
-
"@bamboocss/fixture": "1.36.
|
|
54
|
+
"@bamboocss/fixture": "1.36.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"vite": ">=5"
|