@polderlabs/bizar 2.6.0 → 2.6.1
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/cli/copy.mjs +39 -34
- package/package.json +1 -1
package/cli/copy.mjs
CHANGED
|
@@ -272,48 +272,53 @@ export async function installPluginBizar(projectRoot) {
|
|
|
272
272
|
// The Bizar plugin now lives in a separate npm package
|
|
273
273
|
// (@polderlabs/bizar-plugin). The interactive installer copies it from
|
|
274
274
|
// there; the source tree no longer carries plugins/bizar/.
|
|
275
|
-
|
|
275
|
+
spinner.info(chalk.dim(' ℹ No local plugins/bizar/ — using @polderlabs/bizar-plugin from npm'));
|
|
276
276
|
return { copied: 0, errors: [] };
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
part
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
279
|
+
try {
|
|
280
|
+
const destDir = join(projectRoot, '.opencode', 'plugins', 'bizar');
|
|
281
|
+
await mkdir(destDir, { recursive: true });
|
|
282
|
+
|
|
283
|
+
// Exclude patterns per spec §9.2
|
|
284
|
+
const isExcluded = (entry) => {
|
|
285
|
+
const parts = entry.split('/');
|
|
286
|
+
return parts.some(part =>
|
|
287
|
+
part === 'node_modules' ||
|
|
288
|
+
part === 'dist' ||
|
|
289
|
+
part === '.DS_Store' ||
|
|
290
|
+
part.endsWith('.log')
|
|
291
|
+
);
|
|
292
|
+
};
|
|
292
293
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
const files = await readdirRecursive(srcDir);
|
|
295
|
+
const errors = [];
|
|
296
|
+
let copied = 0;
|
|
296
297
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
298
|
+
for (const file of files) {
|
|
299
|
+
if (isExcluded(file)) continue;
|
|
300
|
+
const src = join(srcDir, file);
|
|
301
|
+
const dst = join(destDir, file);
|
|
302
|
+
const dstParent = dirname(dst);
|
|
303
|
+
try {
|
|
304
|
+
await mkdir(dstParent, { recursive: true });
|
|
305
|
+
await copyFile(src, dst);
|
|
306
|
+
copied++;
|
|
307
|
+
} catch (err) {
|
|
308
|
+
errors.push(`Failed to copy ${file}: ${err.message}`);
|
|
309
|
+
}
|
|
308
310
|
}
|
|
309
|
-
}
|
|
310
311
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
if (errors.length === 0) {
|
|
313
|
+
spinner.succeed(chalk.green(`Installed Bizar plugin (${copied} files)`));
|
|
314
|
+
} else {
|
|
315
|
+
spinner.warn(chalk.yellow(`Installed Bizar plugin (${copied} files, ${errors.length} errors)`));
|
|
316
|
+
}
|
|
317
|
+
return { copied, errors };
|
|
318
|
+
} catch (err) {
|
|
319
|
+
spinner.fail(chalk.red(`Failed to install Bizar plugin: ${err.message}`));
|
|
320
|
+
return { copied: 0, errors: [err.message] };
|
|
315
321
|
}
|
|
316
|
-
return { copied, errors };
|
|
317
322
|
}
|
|
318
323
|
|
|
319
324
|
export async function installRtk() {
|
package/package.json
CHANGED