@maestro-js/cli 1.0.0-alpha.5 → 1.0.0-alpha.7
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/bin.js +36 -18
- package/package.json +11 -11
package/dist/bin.js
CHANGED
|
@@ -650,8 +650,11 @@ async function componentsAdd(name, opts) {
|
|
|
650
650
|
|
|
651
651
|
// src/commands/skills.ts
|
|
652
652
|
import { execSync as execSync4 } from "child_process";
|
|
653
|
+
import fs from "fs";
|
|
654
|
+
import path from "path";
|
|
655
|
+
import { fileURLToPath } from "url";
|
|
653
656
|
function skillsInstall(opts) {
|
|
654
|
-
const args = ["npx", "--yes",
|
|
657
|
+
const args = ["npx", "--yes", `@maestro-js/agent-skills@${getCurrentVersion()}`];
|
|
655
658
|
if (opts.interactive) args.push("--interactive");
|
|
656
659
|
if (opts.copy) args.push("--copy");
|
|
657
660
|
try {
|
|
@@ -660,16 +663,22 @@ function skillsInstall(opts) {
|
|
|
660
663
|
process.exit(1);
|
|
661
664
|
}
|
|
662
665
|
}
|
|
666
|
+
function getCurrentVersion() {
|
|
667
|
+
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
668
|
+
const raw = fs.readFileSync(path.join(dir, "../package.json"), "utf-8");
|
|
669
|
+
const pkg = JSON.parse(raw);
|
|
670
|
+
return pkg.version;
|
|
671
|
+
}
|
|
663
672
|
|
|
664
673
|
// src/commands/upgrade.ts
|
|
665
674
|
import { execSync as execSync5 } from "child_process";
|
|
666
|
-
import
|
|
667
|
-
import
|
|
668
|
-
import { fileURLToPath } from "url";
|
|
675
|
+
import fs2 from "fs";
|
|
676
|
+
import path2 from "path";
|
|
677
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
669
678
|
import prompts4 from "prompts";
|
|
670
679
|
var onCancel2 = () => process.exit(0);
|
|
671
680
|
async function upgrade() {
|
|
672
|
-
const current =
|
|
681
|
+
const current = getCurrentVersion2();
|
|
673
682
|
console.log(`Current @maestro-js version: ${current}`);
|
|
674
683
|
const versions = fetchAvailableVersions();
|
|
675
684
|
const newer = filterNewerVersions(versions, current);
|
|
@@ -688,9 +697,9 @@ async function upgrade() {
|
|
|
688
697
|
Updated ${updated} package.json file${updated === 1 ? "" : "s"}.`);
|
|
689
698
|
await runInstall();
|
|
690
699
|
}
|
|
691
|
-
function
|
|
692
|
-
const dir =
|
|
693
|
-
const raw =
|
|
700
|
+
function getCurrentVersion2() {
|
|
701
|
+
const dir = path2.dirname(fileURLToPath2(import.meta.url));
|
|
702
|
+
const raw = fs2.readFileSync(path2.join(dir, "../package.json"), "utf-8");
|
|
694
703
|
const pkg = JSON.parse(raw);
|
|
695
704
|
return pkg.version;
|
|
696
705
|
}
|
|
@@ -755,19 +764,19 @@ function findAndUpdatePackageJsonFiles(targetVersion) {
|
|
|
755
764
|
function findPackageJsonFiles(dir) {
|
|
756
765
|
const results = [];
|
|
757
766
|
const skipDirs = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".next", ".nuxt"]);
|
|
758
|
-
for (const entry of
|
|
767
|
+
for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
|
|
759
768
|
if (entry.isDirectory()) {
|
|
760
769
|
if (!skipDirs.has(entry.name)) {
|
|
761
|
-
results.push(...findPackageJsonFiles(
|
|
770
|
+
results.push(...findPackageJsonFiles(path2.join(dir, entry.name)));
|
|
762
771
|
}
|
|
763
772
|
} else if (entry.name === "package.json") {
|
|
764
|
-
results.push(
|
|
773
|
+
results.push(path2.join(dir, entry.name));
|
|
765
774
|
}
|
|
766
775
|
}
|
|
767
776
|
return results;
|
|
768
777
|
}
|
|
769
778
|
function updateMaestroDependencies(filePath, targetVersion) {
|
|
770
|
-
const raw =
|
|
779
|
+
const raw = fs2.readFileSync(filePath, "utf-8");
|
|
771
780
|
const pkg = JSON.parse(raw);
|
|
772
781
|
let changed = false;
|
|
773
782
|
for (const depKey of ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"]) {
|
|
@@ -790,8 +799,8 @@ function updateMaestroDependencies(filePath, targetVersion) {
|
|
|
790
799
|
const trailingNewline = raw.endsWith("\n");
|
|
791
800
|
let output = JSON.stringify(pkg, null, indent);
|
|
792
801
|
if (trailingNewline) output += "\n";
|
|
793
|
-
|
|
794
|
-
console.log(` Updated ${
|
|
802
|
+
fs2.writeFileSync(filePath, output, "utf-8");
|
|
803
|
+
console.log(` Updated ${path2.relative(process.cwd(), filePath)}`);
|
|
795
804
|
}
|
|
796
805
|
return changed;
|
|
797
806
|
}
|
|
@@ -810,7 +819,7 @@ ${pm} install failed. package.json files have been updated \u2014 run install ma
|
|
|
810
819
|
function detectPackageManager() {
|
|
811
820
|
const root = process.cwd();
|
|
812
821
|
try {
|
|
813
|
-
const raw =
|
|
822
|
+
const raw = fs2.readFileSync(path2.join(root, "package.json"), "utf-8");
|
|
814
823
|
const pkg = JSON.parse(raw);
|
|
815
824
|
if (pkg.packageManager) {
|
|
816
825
|
const name = pkg.packageManager.split("@")[0];
|
|
@@ -818,8 +827,8 @@ function detectPackageManager() {
|
|
|
818
827
|
}
|
|
819
828
|
} catch {
|
|
820
829
|
}
|
|
821
|
-
if (
|
|
822
|
-
if (
|
|
830
|
+
if (fs2.existsSync(path2.join(root, "pnpm-lock.yaml"))) return "pnpm";
|
|
831
|
+
if (fs2.existsSync(path2.join(root, "yarn.lock"))) return "yarn";
|
|
823
832
|
return "npm";
|
|
824
833
|
}
|
|
825
834
|
function detectIndent(json) {
|
|
@@ -862,13 +871,22 @@ function compareSemver(a, b) {
|
|
|
862
871
|
|
|
863
872
|
// src/commands/init.ts
|
|
864
873
|
import { execSync as execSync6 } from "child_process";
|
|
874
|
+
import fs3 from "fs";
|
|
875
|
+
import path3 from "path";
|
|
876
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
865
877
|
function init(name) {
|
|
866
878
|
try {
|
|
867
|
-
execSync6(`npx --yes @maestro-js/init ${name}`, { stdio: "inherit" });
|
|
879
|
+
execSync6(`npx --yes @maestro-js/init@${getCurrentVersion3()} ${name}`, { stdio: "inherit" });
|
|
868
880
|
} catch {
|
|
869
881
|
process.exit(1);
|
|
870
882
|
}
|
|
871
883
|
}
|
|
884
|
+
function getCurrentVersion3() {
|
|
885
|
+
const dir = path3.dirname(fileURLToPath3(import.meta.url));
|
|
886
|
+
const raw = fs3.readFileSync(path3.join(dir, "../package.json"), "utf-8");
|
|
887
|
+
const pkg = JSON.parse(raw);
|
|
888
|
+
return pkg.version;
|
|
889
|
+
}
|
|
872
890
|
|
|
873
891
|
// src/bin.ts
|
|
874
892
|
var require2 = createRequire(import.meta.url);
|
package/package.json
CHANGED
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
"sade": "^1.8.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@maestro-js/
|
|
17
|
-
"@maestro-js/
|
|
18
|
-
"@maestro-js/
|
|
19
|
-
"@maestro-js/
|
|
20
|
-
"@maestro-js/db": "1.0.0-alpha.
|
|
16
|
+
"@maestro-js/components": "1.0.0-alpha.7",
|
|
17
|
+
"@maestro-js/agent-container": "1.0.0-alpha.7",
|
|
18
|
+
"@maestro-js/config": "1.0.0-alpha.7",
|
|
19
|
+
"@maestro-js/db": "1.0.0-alpha.7",
|
|
20
|
+
"@maestro-js/db-migrate": "1.0.0-alpha.7"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/node": "^22.19.11",
|
|
24
24
|
"@types/prompts": "^2.4.9",
|
|
25
|
-
"@maestro-js/
|
|
26
|
-
"@maestro-js/components": "1.0.0-alpha.
|
|
27
|
-
"@maestro-js/
|
|
28
|
-
"@maestro-js/
|
|
29
|
-
"@maestro-js/db-migrate": "1.0.0-alpha.
|
|
25
|
+
"@maestro-js/config": "1.0.0-alpha.7",
|
|
26
|
+
"@maestro-js/components": "1.0.0-alpha.7",
|
|
27
|
+
"@maestro-js/db": "1.0.0-alpha.7",
|
|
28
|
+
"@maestro-js/agent-container": "1.0.0-alpha.7",
|
|
29
|
+
"@maestro-js/db-migrate": "1.0.0-alpha.7"
|
|
30
30
|
},
|
|
31
|
-
"version": "1.0.0-alpha.
|
|
31
|
+
"version": "1.0.0-alpha.7",
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "restricted"
|
|
34
34
|
},
|