@launchmatic/cli 0.6.1 → 0.6.2
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 +19 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26069,14 +26069,26 @@ Discovered ${discovered.length} service${discovered.length === 1 ? "" : "s"}:`))
|
|
|
26069
26069
|
teamId = teams[parseInt(ans) - 1]?.id ?? teams[0].id;
|
|
26070
26070
|
}
|
|
26071
26071
|
}
|
|
26072
|
-
const
|
|
26073
|
-
|
|
26074
|
-
|
|
26075
|
-
|
|
26076
|
-
|
|
26077
|
-
|
|
26072
|
+
const explicitName = opts.project || opts.name;
|
|
26073
|
+
const derivedName = (() => {
|
|
26074
|
+
if (existsSync7(join5(repoRoot, "package.json"))) {
|
|
26075
|
+
try {
|
|
26076
|
+
const pkg2 = JSON.parse(readFileSync7(join5(repoRoot, "package.json"), "utf-8"));
|
|
26077
|
+
const n = pkg2.name?.replace(/^@.*\//, "");
|
|
26078
|
+
if (n && n !== "monorepo") return n;
|
|
26079
|
+
} catch {
|
|
26080
|
+
}
|
|
26078
26081
|
}
|
|
26079
|
-
|
|
26082
|
+
const folder = repoRoot.split(/[\\/]/).filter(Boolean).pop();
|
|
26083
|
+
return folder || "monorepo";
|
|
26084
|
+
})();
|
|
26085
|
+
let projectName = explicitName ?? derivedName;
|
|
26086
|
+
if (!explicitName && !opts.yes) {
|
|
26087
|
+
const answer = await prompt6(
|
|
26088
|
+
`Project name [${source_default.cyan(derivedName)}]: `
|
|
26089
|
+
);
|
|
26090
|
+
if (answer) projectName = answer;
|
|
26091
|
+
}
|
|
26080
26092
|
const projectSlug = projectName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "monorepo";
|
|
26081
26093
|
const { data: existingProjects } = await api(
|
|
26082
26094
|
`/api/projects?teamId=${teamId}`
|