@aspects-ai/workspace-cli 0.1.4 → 0.1.6
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/index.js +82 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { Command as
|
|
4
|
+
import { Command as Command7 } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/init.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -514,12 +514,91 @@ function createCreateFrameCommand() {
|
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
+
// src/commands/update-template.ts
|
|
518
|
+
import { Command as Command6 } from "commander";
|
|
519
|
+
import path6 from "path";
|
|
520
|
+
import fs6 from "fs-extra";
|
|
521
|
+
import chalk6 from "chalk";
|
|
522
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
523
|
+
var __filename2 = fileURLToPath2(import.meta.url);
|
|
524
|
+
var __dirname2 = path6.dirname(__filename2);
|
|
525
|
+
function createUpdateTemplateCommand() {
|
|
526
|
+
return new Command6("update-template").description("Update EDITING.md file from noodle-base template").action(async () => {
|
|
527
|
+
try {
|
|
528
|
+
const workspaceRoot = await ensureWorkspaceRoot();
|
|
529
|
+
const noodleBasePath = path6.resolve(__dirname2, "../../../noodle-base");
|
|
530
|
+
const sourceFile = path6.join(noodleBasePath, "EDITING.md");
|
|
531
|
+
const targetFile = path6.join(workspaceRoot, "EDITING.md");
|
|
532
|
+
if (!await fs6.pathExists(sourceFile)) {
|
|
533
|
+
throw new Error(
|
|
534
|
+
`Template file not found at: ${sourceFile}
|
|
535
|
+
Make sure noodle-base is available in the monorepo.`
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
const targetExists = await fs6.pathExists(targetFile);
|
|
539
|
+
if (targetExists) {
|
|
540
|
+
logger.info("Existing EDITING.md found, it will be overwritten.");
|
|
541
|
+
}
|
|
542
|
+
logger.info(`Copying EDITING.md from noodle-base...`);
|
|
543
|
+
await fs6.copy(sourceFile, targetFile, { overwrite: true });
|
|
544
|
+
logger.success(
|
|
545
|
+
`Successfully ${targetExists ? "updated" : "copied"} EDITING.md to workspace`
|
|
546
|
+
);
|
|
547
|
+
logger.log("\n" + chalk6.bold("Next steps:"));
|
|
548
|
+
logger.log(` ${chalk6.gray("Review the file:")} cat EDITING.md`);
|
|
549
|
+
logger.log("");
|
|
550
|
+
} catch (error) {
|
|
551
|
+
logger.error(error.message);
|
|
552
|
+
process.exit(1);
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// package.json
|
|
558
|
+
var package_default = {
|
|
559
|
+
name: "@aspects-ai/workspace-cli",
|
|
560
|
+
version: "0.1.5",
|
|
561
|
+
private: false,
|
|
562
|
+
description: "Lightweight CLI for installing libraries into workspaces",
|
|
563
|
+
type: "module",
|
|
564
|
+
bin: {
|
|
565
|
+
"workspace-cli": "./dist/index.js"
|
|
566
|
+
},
|
|
567
|
+
scripts: {
|
|
568
|
+
build: "tsup src/index.ts --format esm --dts --clean && npm run copy:registry",
|
|
569
|
+
"copy:registry": "mkdir -p dist/registry && cp src/registry/libraries.json dist/registry/",
|
|
570
|
+
dev: "tsup src/index.ts --format esm --watch",
|
|
571
|
+
typecheck: "tsc --noEmit"
|
|
572
|
+
},
|
|
573
|
+
files: [
|
|
574
|
+
"dist",
|
|
575
|
+
"src/registry"
|
|
576
|
+
],
|
|
577
|
+
dependencies: {
|
|
578
|
+
chalk: "^5.3.0",
|
|
579
|
+
commander: "^12.0.0",
|
|
580
|
+
execa: "^8.0.0",
|
|
581
|
+
"fs-extra": "^11.2.0",
|
|
582
|
+
zod: "^3.22.0"
|
|
583
|
+
},
|
|
584
|
+
devDependencies: {
|
|
585
|
+
"@types/fs-extra": "^11.0.0",
|
|
586
|
+
"@types/node": "^20",
|
|
587
|
+
tsup: "^8.0.0",
|
|
588
|
+
typescript: "^5"
|
|
589
|
+
},
|
|
590
|
+
engines: {
|
|
591
|
+
node: ">=18.0.0"
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
|
|
517
595
|
// src/index.ts
|
|
518
|
-
var program = new
|
|
519
|
-
program.name("workspace-cli").description("Lightweight CLI for installing libraries into workspaces").version(
|
|
596
|
+
var program = new Command7();
|
|
597
|
+
program.name("workspace-cli").description("Lightweight CLI for installing libraries into workspaces").version(package_default.version);
|
|
520
598
|
program.addCommand(createInitCommand());
|
|
521
599
|
program.addCommand(createListCommand());
|
|
522
600
|
program.addCommand(createAddCommand());
|
|
523
601
|
program.addCommand(createUpdateCommand());
|
|
524
602
|
program.addCommand(createCreateFrameCommand());
|
|
603
|
+
program.addCommand(createUpdateTemplateCommand());
|
|
525
604
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aspects-ai/workspace-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Lightweight CLI for installing libraries into workspaces",
|
|
6
6
|
"type": "module",
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18.0.0"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|