create-esa-stack 0.1.7 → 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 +43 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -712,6 +712,26 @@ async function main() {
712
712
  he("Operation cancelled.");
713
713
  process.exit(0);
714
714
  }
715
+ const installStorybook = await ce({
716
+ message: "Do you want to install Storybook?",
717
+ initialValue: false
718
+ });
719
+ if (typeof installStorybook === "symbol") {
720
+ he("Operation cancelled.");
721
+ process.exit(0);
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
+ }
715
735
  const s = _2();
716
736
  s.start("Scaffolding project...");
717
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`;
@@ -725,7 +745,7 @@ Setting up shadcn/ui...`);
725
745
  console.log("Installing dependencies...");
726
746
  execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
727
747
  console.log("Initializing shadcn/ui...");
728
- execSync("pnpm dlx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
748
+ execSync("npx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
729
749
  }
730
750
  if (installTanstackQuery) {
731
751
  console.log(`
@@ -786,6 +806,28 @@ Setting up Supabase...`);
786
806
  console.log("Installing supabase CLI...");
787
807
  execSync("pnpm add supabase -D -E", { stdio: "inherit", cwd: projectPath });
788
808
  }
809
+ if (installTesting) {
810
+ console.log(`
811
+ Setting up Testing tools...`);
812
+ const hasNodeModules = existsSync(join(projectPath, "node_modules"));
813
+ if (!hasNodeModules) {
814
+ console.log("Installing dependencies...");
815
+ execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
816
+ }
817
+ console.log("Installing Vitest, React Testing Library, and related tools...");
818
+ execSync("pnpm add vitest @vitejs/plugin-react jsdom @testing-library/react @testing-library/dom vite-tsconfig-paths -D -E", { stdio: "inherit", cwd: projectPath });
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
+ }
789
831
  ge(`Successfully created ${projectName}!`);
790
832
  } catch (error) {
791
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.7",
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": {