create-esa-stack 0.1.2 → 0.1.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/cli.js +20 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -672,14 +672,22 @@ 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
|
+
}
|
|
675
683
|
const s = _2();
|
|
676
684
|
s.start("Scaffolding project...");
|
|
677
685
|
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
686
|
try {
|
|
679
687
|
s.stop("Starting scaffolding...");
|
|
680
688
|
execSync(command, { stdio: "inherit" });
|
|
689
|
+
const projectPath = join(process.cwd(), projectName);
|
|
681
690
|
if (installShadcn) {
|
|
682
|
-
const projectPath = join(process.cwd(), projectName);
|
|
683
691
|
console.log(`
|
|
684
692
|
Setting up shadcn/ui...`);
|
|
685
693
|
console.log("Installing dependencies...");
|
|
@@ -687,6 +695,17 @@ Setting up shadcn/ui...`);
|
|
|
687
695
|
console.log("Initializing shadcn/ui...");
|
|
688
696
|
execSync("npx shadcn@latest init", { stdio: "inherit", cwd: projectPath });
|
|
689
697
|
}
|
|
698
|
+
if (installTanstackQuery) {
|
|
699
|
+
console.log(`
|
|
700
|
+
Setting up TanStack Query...`);
|
|
701
|
+
const hasNodeModules = existsSync(join(projectPath, "node_modules"));
|
|
702
|
+
if (!installShadcn && !hasNodeModules) {
|
|
703
|
+
console.log("Installing dependencies...");
|
|
704
|
+
execSync("pnpm install", { stdio: "inherit", cwd: projectPath });
|
|
705
|
+
}
|
|
706
|
+
console.log("Installing @tanstack/react-query...");
|
|
707
|
+
execSync("pnpm add @tanstack/react-query", { stdio: "inherit", cwd: projectPath });
|
|
708
|
+
}
|
|
690
709
|
ge(`Successfully created ${projectName}!`);
|
|
691
710
|
} catch (error) {
|
|
692
711
|
s.stop("Failed to scaffold project.");
|