@navigate-ai/vite 0.1.22 → 0.1.23
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 +4 -7
- package/package.json +4 -4
package/dist/ClippyVitePlugin.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { processFile, PolicyGenerator, KnowledgeGraph, deriveBuildId, performUpload } from '@navigate_ai/plugin-shared';
|
|
2
|
+
import { processFile, PolicyGenerator, KnowledgeGraph, linkCrossReferences, deriveBuildId, performUpload } from '@navigate_ai/plugin-shared';
|
|
3
3
|
import { PackageBuilder } from '@navigate_ai/plugin-shared/upload/PackageBuilder';
|
|
4
|
-
import { PackageWriter } from '@navigate_ai/plugin-shared/upload/PackageWriter';
|
|
5
4
|
/** Convert any absolute or backslash path to a forward-slash path relative to cwd. */
|
|
6
5
|
function toRelKey(absPath) {
|
|
7
6
|
return path.relative(process.cwd(), absPath).replace(/\\/g, '/');
|
|
@@ -14,6 +13,8 @@ function generatePolicyFromFiles(files) {
|
|
|
14
13
|
for (const file of files) {
|
|
15
14
|
graph.addFile(file);
|
|
16
15
|
}
|
|
16
|
+
// Resolve imports across files so route.resolvedComponent is populated
|
|
17
|
+
linkCrossReferences(graph);
|
|
17
18
|
return new PolicyGenerator(graph).generate();
|
|
18
19
|
}
|
|
19
20
|
export function clippyVitePlugin(options) {
|
|
@@ -84,17 +85,13 @@ export function clippyVitePlugin(options) {
|
|
|
84
85
|
const fs = await import('fs');
|
|
85
86
|
const path = await import('path');
|
|
86
87
|
fs.mkdirSync(options.localOutputDir, { recursive: true });
|
|
87
|
-
// Write new policy format
|
|
88
88
|
fs.writeFileSync(path.join(options.localOutputDir, 'clippy-policy.json'), JSON.stringify(policy, null, 2), 'utf-8');
|
|
89
|
+
console.log(`[Clippy] Policy written to ${options.localOutputDir}/clippy-policy.json`);
|
|
89
90
|
}
|
|
90
91
|
catch (e) {
|
|
91
92
|
/* ignore write errors */
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
if (options.localOutputDir) {
|
|
95
|
-
const written = new PackageWriter().writeArtifacts(options.localOutputDir, artifacts);
|
|
96
|
-
console.log(`[Clippy] Policy artifacts written: ${written.policyPath}, ${written.selectorsPath}`);
|
|
97
|
-
}
|
|
98
95
|
const artifactUpload = await performUpload(artifacts, options);
|
|
99
96
|
if (artifactUpload.skipped) {
|
|
100
97
|
console.log('[Clippy] Policy artifact upload skipped.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navigate-ai/vite",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@navigate_ai/plugin-shared": "
|
|
21
|
+
"@navigate_ai/plugin-shared": "file:../../../../../tmp/navigate_ai-plugin-shared-0.1.22.tgz"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"vite": ">=4.0.0",
|
|
25
24
|
"@babel/parser": "^7.0.0",
|
|
26
|
-
"@babel/traverse": "^7.0.0"
|
|
25
|
+
"@babel/traverse": "^7.0.0",
|
|
26
|
+
"vite": ">=4.0.0"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc -p tsconfig.json"
|