create-esa-stack 0.1.8 → 0.1.9

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/cli.js +29 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -712,17 +712,29 @@ async function main() {
712
712
  he("Operation cancelled.");
713
713
  process.exit(0);
714
714
  }
715
- const installTesting = await ce({
716
- message: "Do you want to install Testing tools (Vitest + React Testing Library)?",
717
- initialValue: true
715
+ const installStorybook = await ce({
716
+ message: "Do you want to install Storybook?",
717
+ initialValue: false
718
718
  });
719
- if (typeof installTesting === "symbol") {
719
+ if (typeof installStorybook === "symbol") {
720
720
  he("Operation cancelled.");
721
721
  process.exit(0);
722
722
  }
723
+ let installTesting = false;
724
+ if (!installStorybook) {
725
+ const testing = await ce({
726
+ message: "Do you want to install Testing tools (Vitest + React Testing Library)?",
727
+ initialValue: true
728
+ });
729
+ if (typeof testing === "symbol") {
730
+ he("Operation cancelled.");
731
+ process.exit(0);
732
+ }
733
+ installTesting = testing;
734
+ }
723
735
  const s = _2();
724
736
  s.start("Scaffolding project...");
725
- const command = `pnpm create next-app@latest ${projectName} --biome --ts --tailwind --react-compiler --app --src-dir --import-alias "@/*" --use-pnpm --turbopack --skip-install --yes`;
737
+ const command = `npx create-next-app@latest ${projectName} --biome --ts --tailwind --react-compiler --app --src-dir --import-alias "@/*" --use-pnpm --turbopack --skip-install --yes`;
726
738
  try {
727
739
  s.stop("Starting scaffolding...");
728
740
  execSync(command, { stdio: "inherit" });
@@ -733,7 +745,7 @@ Setting up shadcn/ui...`);
733
745
  console.log("Installing dependencies...");
734
746
  execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
735
747
  console.log("Initializing shadcn/ui...");
736
- execSync("pnpm dlx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
748
+ execSync("npx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
737
749
  }
738
750
  if (installTanstackQuery) {
739
751
  console.log(`
@@ -805,6 +817,17 @@ Setting up Testing tools...`);
805
817
  console.log("Installing Vitest, React Testing Library, and related tools...");
806
818
  execSync("pnpm add vitest @vitejs/plugin-react jsdom @testing-library/react @testing-library/dom vite-tsconfig-paths -D -E", { stdio: "inherit", cwd: projectPath });
807
819
  }
820
+ if (installStorybook) {
821
+ console.log(`
822
+ Setting up Storybook...`);
823
+ const hasNodeModules = existsSync(join(projectPath, "node_modules"));
824
+ if (!hasNodeModules) {
825
+ console.log("Installing dependencies...");
826
+ execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
827
+ }
828
+ console.log("Installing Storybook...");
829
+ execSync("pnpm create storybook@latest --no-dev -y --package-manager pnpm", { stdio: "inherit", cwd: projectPath });
830
+ }
808
831
  ge(`Successfully created ${projectName}!`);
809
832
  } catch (error) {
810
833
  s.stop("Failed to scaffold project.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-esa-stack",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "CLI tool to scaffold Next.js projects with ESA's preferred tech stack",
5
5
  "type": "module",
6
6
  "bin": {