@navigate-ai/vite 0.1.27 → 0.1.29
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/ClippyVitePlugin.js +12 -0
- package/package.json +1 -1
package/dist/ClippyVitePlugin.js
CHANGED
|
@@ -15,6 +15,11 @@ function generatePolicyFromFiles(files) {
|
|
|
15
15
|
}
|
|
16
16
|
// Resolve imports and link routes to component files
|
|
17
17
|
linkCrossReferences(graph);
|
|
18
|
+
// Debug: Check files before pruning
|
|
19
|
+
console.log(`[Clippy Debug] Files before pruning: ${[...graph.getAllFiles()].length}`);
|
|
20
|
+
for (const file of graph.getAllFiles()) {
|
|
21
|
+
console.log(`[Clippy Debug] Before prune - ${file.filePath}: components=${file.components.length}, routes=${file.routes.length}`);
|
|
22
|
+
}
|
|
18
23
|
// Free memory: drop components/jsxTree from files that are not
|
|
19
24
|
// route-defining files or route component targets — we only need
|
|
20
25
|
// those for element extraction in PolicyGenerator.
|
|
@@ -50,6 +55,11 @@ function generatePolicyFromFiles(files) {
|
|
|
50
55
|
sf.components = [];
|
|
51
56
|
}
|
|
52
57
|
}
|
|
58
|
+
// Debug: Check files after pruning
|
|
59
|
+
console.log(`[Clippy Debug] Files after pruning (routeFiles: ${routeFiles.size}):`);
|
|
60
|
+
for (const file of graph.getAllFiles()) {
|
|
61
|
+
console.log(`[Clippy Debug] After prune - ${file.filePath}: components=${file.components.length}`);
|
|
62
|
+
}
|
|
53
63
|
return new PolicyGenerator(graph).generate();
|
|
54
64
|
}
|
|
55
65
|
export function clippyVitePlugin(options) {
|
|
@@ -80,6 +90,8 @@ export function clippyVitePlugin(options) {
|
|
|
80
90
|
const cleanId = id.split('?')[0];
|
|
81
91
|
if (!/\.[jt]sx?$/.test(cleanId))
|
|
82
92
|
return null;
|
|
93
|
+
if (cleanId.includes('node_modules'))
|
|
94
|
+
return null;
|
|
83
95
|
// Process file: extract metadata and inject IDs in one pass
|
|
84
96
|
const result = processFile(source, cleanId);
|
|
85
97
|
// Accumulate metadata for policy generation
|