clikit-plugin 0.2.25 → 0.2.26
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/cli.d.ts +0 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -22
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -7,6 +7,5 @@ interface ScaffoldStats {
|
|
|
7
7
|
export declare function resolveProjectDir(env?: NodeJS.ProcessEnv, cwd?: string): string;
|
|
8
8
|
export declare function upsertPluginEntry(existingPlugins: string[], pluginName: string, version: string): string[];
|
|
9
9
|
export declare function scaffoldProjectOpencode(projectDir: string, packageRoot?: string): ScaffoldStats;
|
|
10
|
-
export declare function scaffoldGlobalPluginAssets(configDir: string, packageRoot?: string): ScaffoldStats;
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4BD,wBAAgB,iBAAiB,CAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,MAAM,CAiBR;AAED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1G;AA0CD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAmB,GAAG,aAAa,CA0DzG
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4BD,wBAAgB,iBAAiB,CAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,MAAM,CAiBR;AAED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1G;AA0CD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAmB,GAAG,aAAa,CA0DzG"}
|
package/dist/cli.js
CHANGED
|
@@ -122,16 +122,17 @@ export default CliKitPlugin;
|
|
|
122
122
|
}
|
|
123
123
|
return stats;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
function removeLegacyGlobalPluginAssets(configDir) {
|
|
126
|
+
const legacyPluginPath = path.join(configDir, "plugins", "clikit.js");
|
|
127
|
+
const legacyAgentsDir = path.join(configDir, "plugins", "agents");
|
|
128
|
+
if (fs.existsSync(legacyPluginPath)) {
|
|
129
|
+
fs.rmSync(legacyPluginPath, { force: true });
|
|
130
|
+
console.log(`\u2713 Removed legacy local plugin file: ${legacyPluginPath}`);
|
|
131
|
+
}
|
|
132
|
+
if (fs.existsSync(legacyAgentsDir)) {
|
|
133
|
+
fs.rmSync(legacyAgentsDir, { recursive: true, force: true });
|
|
134
|
+
console.log(`\u2713 Removed legacy local agents directory: ${legacyAgentsDir}`);
|
|
135
|
+
}
|
|
135
136
|
}
|
|
136
137
|
function getRealHome() {
|
|
137
138
|
if (process.env.SNAP_REAL_HOME) {
|
|
@@ -249,19 +250,12 @@ async function install() {
|
|
|
249
250
|
return 1;
|
|
250
251
|
}
|
|
251
252
|
console.log(`
|
|
252
|
-
[3/5]
|
|
253
|
+
[3/5] Cleaning legacy local plugin assets...`);
|
|
253
254
|
try {
|
|
254
|
-
|
|
255
|
-
console.log(
|
|
256
|
-
console.log(` Copied: ${stats.copied}, Skipped existing: ${stats.skipped}`);
|
|
257
|
-
if (stats.missingSources.length > 0) {
|
|
258
|
-
console.log(" Missing bundled sources (skipped):");
|
|
259
|
-
for (const missing of stats.missingSources) {
|
|
260
|
-
console.log(` - ${missing}`);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
255
|
+
removeLegacyGlobalPluginAssets(getConfigDir());
|
|
256
|
+
console.log("\u2713 Global install mode uses npm plugin from opencode config");
|
|
263
257
|
} catch (err) {
|
|
264
|
-
console.error(`\u2717 Failed to
|
|
258
|
+
console.error(`\u2717 Failed to clean legacy assets: ${err}`);
|
|
265
259
|
return 1;
|
|
266
260
|
}
|
|
267
261
|
console.log(`
|
|
@@ -361,6 +355,5 @@ if (import.meta.main) {
|
|
|
361
355
|
export {
|
|
362
356
|
upsertPluginEntry,
|
|
363
357
|
scaffoldProjectOpencode,
|
|
364
|
-
scaffoldGlobalPluginAssets,
|
|
365
358
|
resolveProjectDir
|
|
366
359
|
};
|