@igniter-js/cli 0.2.1 → 0.2.3

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 CHANGED
@@ -12509,48 +12509,36 @@ async function runSetupPrompts(targetDir, isExistingProject = false) {
12509
12509
  format: (value) => value.trim().toLowerCase().replace(/\s+/g, "-")
12510
12510
  },
12511
12511
  {
12512
- type: "select",
12512
+ type: !(isExistingProject && detectedFramework) ? "select" : null,
12513
+ // Show if not existing project OR if existing but no framework detected
12513
12514
  name: "framework",
12514
- message: isExistingProject && detectedFramework !== "generic" ? `We detected ${import_chalk2.default.cyan(detectedFramework)}. Please confirm or select another.` : import_chalk2.default.bold("\u2022 Which framework are you using?"),
12515
+ message: "\u2022 Which starter would you like to use?",
12515
12516
  choices: [
12516
12517
  {
12517
- title: `${import_chalk2.default.green("Next.js")} ${detectedFramework === "nextjs" ? import_chalk2.default.dim("(detected)") : ""}`,
12518
- value: "nextjs"
12519
- },
12520
- {
12521
- title: `${import_chalk2.default.yellow("Vite")} ${detectedFramework === "vite" ? import_chalk2.default.dim("(detected)") : ""}`,
12522
- value: "vite"
12523
- },
12524
- {
12525
- title: `${import_chalk2.default.cyan("Nuxt")} ${detectedFramework === "nuxt" ? import_chalk2.default.dim("(detected)") : ""}`,
12526
- value: "nuxt"
12518
+ title: `${import_chalk2.default.green("Next.js")} ${import_chalk2.default.dim("(Fullstack)")}`,
12519
+ value: "starter-nextjs"
12527
12520
  },
12528
12521
  {
12529
- title: `${import_chalk2.default.magenta("SvelteKit")} ${detectedFramework === "sveltekit" ? import_chalk2.default.dim("(detected)") : ""}`,
12530
- value: "sveltekit"
12522
+ title: `${import_chalk2.default.yellow("Express.js")} ${import_chalk2.default.dim("(REST API)")}`,
12523
+ value: "starter-express-rest-api"
12531
12524
  },
12532
12525
  {
12533
- title: `${import_chalk2.default.red("Remix")} ${detectedFramework === "remix" ? import_chalk2.default.dim("(detected)") : ""}`,
12534
- value: "remix"
12526
+ title: `${import_chalk2.default.cyan("Deno")} ${import_chalk2.default.dim("(REST API)")}`,
12527
+ value: "starter-deno-rest-api"
12535
12528
  },
12536
12529
  {
12537
- title: `${import_chalk2.default.white("Astro")} ${detectedFramework === "astro" ? import_chalk2.default.dim("(detected)") : ""}`,
12538
- value: "astro"
12530
+ title: `${import_chalk2.default.magenta("Bun")} ${import_chalk2.default.dim("(REST API)")}`,
12531
+ value: "starter-bun-rest-api"
12539
12532
  },
12540
12533
  {
12541
- title: `${import_chalk2.default.blue("Express")} ${detectedFramework === "express" ? import_chalk2.default.dim("(detected)") : ""}`,
12542
- value: "express"
12534
+ title: `${import_chalk2.default.red("Bun + React (Vite)")} ${import_chalk2.default.dim("(Fullstack)")}`,
12535
+ value: "starter-bun-react-app"
12543
12536
  },
12544
12537
  {
12545
- title: `${import_chalk2.default.magenta("TanStack Start")} ${detectedFramework === "tanstack-start" ? import_chalk2.default.dim("(detected)") : ""}`,
12546
- value: "tanstack-start"
12547
- },
12548
- {
12549
- title: import_chalk2.default.gray("Generic/Other"),
12550
- value: "generic"
12538
+ title: `${import_chalk2.default.magenta("TanStack Start")} ${import_chalk2.default.dim("(Fullstack)")}`,
12539
+ value: "starter-tanstack-start"
12551
12540
  }
12552
- ],
12553
- initial: getFrameworkChoiceIndex(detectedFramework)
12541
+ ]
12554
12542
  },
12555
12543
  {
12556
12544
  type: "multiselect",
@@ -12710,10 +12698,6 @@ function showConfigSummary(config) {
12710
12698
  }
12711
12699
  console.log();
12712
12700
  }
12713
- function getFrameworkChoiceIndex(detected) {
12714
- const frameworks = ["nextjs", "vite", "nuxt", "sveltekit", "remix", "astro", "express", "tanstack-start", "generic"];
12715
- return Math.max(0, frameworks.indexOf(detected));
12716
- }
12717
12701
  function getPackageManagerChoiceIndex(detected) {
12718
12702
  const managers = ["npm", "yarn", "pnpm", "bun"];
12719
12703
  return Math.max(0, managers.indexOf(detected));
@@ -13596,9 +13580,9 @@ var ProjectGenerator = class {
13596
13580
  async downloadTemplate() {
13597
13581
  const { framework } = this.config;
13598
13582
  const templateUrl = `https://github.com/felipebarcelospro/igniter-js.git`;
13599
- const branch = "release/0.2.0-alpha.0";
13583
+ const branch = "main";
13600
13584
  const tempDir = import_path2.default.join(this.targetDir, "__igniter_tmp__");
13601
- const starterDir = import_path2.default.join(tempDir, "apps", `starter-${framework}`);
13585
+ const starterDir = import_path2.default.join(tempDir, "apps", framework);
13602
13586
  const destDir = this.targetDir;
13603
13587
  let isValidStarter = false;
13604
13588
  this.spinner.start(`Baixando apenas o conte\xFAdo da pasta starter (${framework}) do branch ${branch}...`);