@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,64 +0,0 @@
1
- /**
2
- * Consumer-side JSX scanner.
3
- *
4
- * Walks a consumer source tree, resolves @pathscale/ui imports with SWC, and
5
- * records canonical component/part usage plus prop facts for database-first CSS
6
- * purge decisions.
7
- *
8
- * Usage: bun run src/scan-consumer.ts <consumer-src-dir> <purge-manifest.json>
9
- */
10
- interface LegacyComponentManifest {
11
- classes: {
12
- always: string[];
13
- byProp: Record<string, string[] | Record<string, string[]>>;
14
- };
15
- attrs?: Record<string, Record<string, string>>;
16
- deps?: string[];
17
- }
18
- interface ComponentPurgeRecord extends LegacyComponentManifest {
19
- key?: string;
20
- component?: string;
21
- part?: string;
22
- selectors?: string[];
23
- attributeSelectors?: string[];
24
- cssVars?: {
25
- declared?: string[];
26
- referenced?: string[];
27
- };
28
- keyframes?: {
29
- declared?: string[];
30
- referenced?: string[];
31
- };
32
- }
33
- interface PurgeDatabaseV2 {
34
- version: 2;
35
- components: Record<string, ComponentPurgeRecord>;
36
- shared?: {
37
- selectors?: unknown[];
38
- cssVars?: Record<string, unknown>;
39
- keyframes?: Record<string, unknown>;
40
- };
41
- }
42
- type PurgeManifest = Record<string, LegacyComponentManifest> | PurgeDatabaseV2;
43
- /** What we collect per component usage from JSX */
44
- interface PropUsage {
45
- component: string;
46
- props: Map<string, string | "DYNAMIC">;
47
- booleanProps: Set<string>;
48
- hasSpread: boolean;
49
- source?: string;
50
- }
51
- interface Safelists {
52
- classSafelist: Set<string>;
53
- attrSafelist: Set<string>;
54
- usedComponents: Set<string>;
55
- dynamicComponents: Set<string>;
56
- }
57
- /** Back-compatible import extraction API: local binding -> canonical component. */
58
- declare function extractUIImports(ast: unknown): Map<string, string>;
59
- /** Extract JSX usages of UI components. */
60
- declare function extractJSXUsages(ast: unknown, uiComponents: Map<string, string>): PropUsage[];
61
- declare function buildSafelists(allUsages: PropUsage[], manifest: PurgeManifest): Safelists;
62
- declare function scanConsumerSource(srcDir: string): Promise<PropUsage[]>;
63
- export { buildSafelists, extractJSXUsages, extractUIImports, scanConsumerSource, };
64
- export type { LegacyComponentManifest as ComponentManifest, ComponentPurgeRecord, LegacyComponentManifest, PropUsage, PurgeDatabaseV2, PurgeManifest, Safelists, };