create-esa-stack 0.1.2 → 0.1.4
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/cli.js +39 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -672,14 +672,30 @@ async function main() {
|
|
|
672
672
|
he("Operation cancelled.");
|
|
673
673
|
process.exit(0);
|
|
674
674
|
}
|
|
675
|
+
const installTanstackQuery = await ce({
|
|
676
|
+
message: "Do you want to install TanStack Query?",
|
|
677
|
+
initialValue: true
|
|
678
|
+
});
|
|
679
|
+
if (typeof installTanstackQuery === "symbol") {
|
|
680
|
+
he("Operation cancelled.");
|
|
681
|
+
process.exit(0);
|
|
682
|
+
}
|
|
683
|
+
const installNextThirdParties = await ce({
|
|
684
|
+
message: "Do you want to install @next/third-parties?",
|
|
685
|
+
initialValue: true
|
|
686
|
+
});
|
|
687
|
+
if (typeof installNextThirdParties === "symbol") {
|
|
688
|
+
he("Operation cancelled.");
|
|
689
|
+
process.exit(0);
|
|
690
|
+
}
|
|
675
691
|
const s = _2();
|
|
676
692
|
s.start("Scaffolding project...");
|
|
677
693
|
const command = `npx create-next-app@latest ${projectName} --biome --ts --tailwind --react-compiler --app --src-dir --import-alias "@/*" --use-pnpm --turbopack --skip-install --yes`;
|
|
678
694
|
try {
|
|
679
695
|
s.stop("Starting scaffolding...");
|
|
680
696
|
execSync(command, { stdio: "inherit" });
|
|
697
|
+
const projectPath = join(process.cwd(), projectName);
|
|
681
698
|
if (installShadcn) {
|
|
682
|
-
const projectPath = join(process.cwd(), projectName);
|
|
683
699
|
console.log(`
|
|
684
700
|
Setting up shadcn/ui...`);
|
|
685
701
|
console.log("Installing dependencies...");
|
|
@@ -687,6 +703,28 @@ Setting up shadcn/ui...`);
|
|
|
687
703
|
console.log("Initializing shadcn/ui...");
|
|
688
704
|
execSync("npx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
|
|
689
705
|
}
|
|
706
|
+
if (installTanstackQuery) {
|
|
707
|
+
console.log(`
|
|
708
|
+
Setting up TanStack Query...`);
|
|
709
|
+
const hasNodeModules = existsSync(join(projectPath, "node_modules"));
|
|
710
|
+
if (!hasNodeModules) {
|
|
711
|
+
console.log("Installing dependencies...");
|
|
712
|
+
execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
|
|
713
|
+
}
|
|
714
|
+
console.log("Installing @tanstack/react-query...");
|
|
715
|
+
execSync("pnpm add @tanstack/react-query", { stdio: "inherit", cwd: projectPath });
|
|
716
|
+
}
|
|
717
|
+
if (installNextThirdParties) {
|
|
718
|
+
console.log(`
|
|
719
|
+
Setting up @next/third-parties...`);
|
|
720
|
+
const hasNodeModules = existsSync(join(projectPath, "node_modules"));
|
|
721
|
+
if (!hasNodeModules) {
|
|
722
|
+
console.log("Installing dependencies...");
|
|
723
|
+
execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
|
|
724
|
+
}
|
|
725
|
+
console.log("Installing @next/third-parties...");
|
|
726
|
+
execSync("pnpm add @next/third-parties", { stdio: "inherit", cwd: projectPath });
|
|
727
|
+
}
|
|
690
728
|
ge(`Successfully created ${projectName}!`);
|
|
691
729
|
} catch (error) {
|
|
692
730
|
s.stop("Failed to scaffold project.");
|