@pathscale/rsbuild-plugin-ui-css-purge 0.9.8 → 0.9.10

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.
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Postbuild CSS purge — standalone Bun script.
4
- *
5
- * Runs after rsbuild build, purges CSS files in dist/ using a database-first
6
- * component manifest and consumer JSX usage analysis.
7
- *
8
- * Conservative rules:
9
- * - selectors owned only by unused known components can be removed
10
- * - selectors owned by used components but unused known prop variants can be removed
11
- * - selectors with unknown ownership are kept
12
- * - data/aria runtime state is kept when the owning component selector is kept
13
- * - vars/keyframes are removed only after selector purge proves them unreferenced
14
- */
15
- import type { LegacyComponentManifest, PurgeManifest, Safelists } from "./scan-consumer";
16
- interface NormalizedComponentRecord extends LegacyComponentManifest {
17
- key: string;
18
- component: string;
19
- part?: string;
20
- selectors: string[];
21
- attributeSelectors: string[];
22
- cssVars: {
23
- declared: string[];
24
- referenced: string[];
25
- };
26
- keyframes: {
27
- declared: string[];
28
- referenced: string[];
29
- };
30
- }
31
- interface NormalizedPurgeDatabase {
32
- version: 2;
33
- components: Record<string, NormalizedComponentRecord>;
34
- }
35
- declare function normalizePurgeDatabase(manifest: PurgeManifest): NormalizedPurgeDatabase;
36
- interface SelectorPurgeReport {
37
- selectorsKeptKnown: number;
38
- selectorsKeptUnknown: number;
39
- selectorsRemoved: number;
40
- selectorsRemovedUnusedComponent: number;
41
- selectorsRemovedUnusedVariant: number;
42
- attrSelectorsSeen: number;
43
- keyframesRemoved: number;
44
- fontFacesRemoved: number;
45
- }
46
- interface PurgeResult {
47
- css: string;
48
- report: SelectorPurgeReport;
49
- }
50
- declare function purgeCssWithDatabase(css: string, manifest: PurgeManifest | NormalizedPurgeDatabase, safelists: Safelists): PurgeResult;
51
- interface VarCleanupResult {
52
- css: string;
53
- removed: number;
54
- }
55
- declare function cleanUnusedVarsWithReport(css: string, externallyReferencedVars: Set<string>): VarCleanupResult;
56
- declare function cleanUnusedVars(css: string, externallyReferencedVars: Set<string>): string;
57
- export type { NormalizedPurgeDatabase, PurgeResult, SelectorPurgeReport, VarCleanupResult, };
58
- export { cleanUnusedVars, cleanUnusedVarsWithReport, normalizePurgeDatabase, purgeCssWithDatabase, };