@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.
Files changed (2) hide show
  1. package/dist/index.js +19 -7
  2. 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 projectName = opts.project || opts.name || (existsSync7(join5(repoRoot, "package.json")) ? (() => {
26073
- try {
26074
- const pkg2 = JSON.parse(readFileSync7(join5(repoRoot, "package.json"), "utf-8"));
26075
- return pkg2.name?.replace(/^@.*\//, "") || "monorepo";
26076
- } catch {
26077
- return "monorepo";
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
- })() : "monorepo");
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}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchmatic/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Launchmatic CLI — deploy from your terminal",
5
5
  "private": false,
6
6
  "type": "module",