create-next-pro-stack 1.0.1 → 1.0.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/README.md +5 -1
- package/index.js +3 -2
- package/package.json +1 -1
- package/templates/next-config-setup.js +29 -0
package/README.md
CHANGED
|
@@ -36,10 +36,14 @@ BlitzStack automatically installs and configures the following professional pack
|
|
|
36
36
|
|
|
37
37
|
## 🚀 Getting Started
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
> [!IMPORTANT]
|
|
40
|
+
> **Use npx for Instant Setup:**
|
|
41
|
+
> To avoid installation issues, we recommend using **npx**. This ensures you are always using the latest version of BlitzStack.
|
|
40
42
|
|
|
41
43
|
### 1. Create a New Project
|
|
42
44
|
|
|
45
|
+
Run this command in your terminal:
|
|
46
|
+
|
|
43
47
|
```bash
|
|
44
48
|
npx create-next-pro-stack my-awesome-project
|
|
45
49
|
```
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
import fs from "fs";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
7
7
|
import readline from "readline";
|
|
8
8
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -113,6 +113,7 @@ async function main() {
|
|
|
113
113
|
"react-query-setup.js",
|
|
114
114
|
"providers-setup.js",
|
|
115
115
|
"page-files.js",
|
|
116
|
+
"next-config-setup.js",
|
|
116
117
|
"gitignore-setup.js",
|
|
117
118
|
"vercel-setup.js",
|
|
118
119
|
"env-setup.js",
|
|
@@ -122,7 +123,7 @@ async function main() {
|
|
|
122
123
|
for (const moduleName of setupModules) {
|
|
123
124
|
const modulePath = path.join(templatesDir, moduleName);
|
|
124
125
|
if (fs.existsSync(modulePath)) {
|
|
125
|
-
const module = await import(
|
|
126
|
+
const module = await import(pathToFileURL(modulePath).href);
|
|
126
127
|
if (module.default) {
|
|
127
128
|
await module.default(projectName, isTypeScript);
|
|
128
129
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export default async function setup(projectName, isTypeScript) {
|
|
5
|
+
const appDir = projectName;
|
|
6
|
+
const configPath = path.join(appDir, "next.config.mjs");
|
|
7
|
+
|
|
8
|
+
const configContent = `import path from "path";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
13
|
+
|
|
14
|
+
/** @type {import('next').NextConfig} */
|
|
15
|
+
const nextConfig = {
|
|
16
|
+
/* Turbopack root — must be absolute (Next.js 15+ / 16) */
|
|
17
|
+
turbopack: {
|
|
18
|
+
root: path.resolve(__dirname),
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default nextConfig;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
// যদি ফাইলটি আগে থেকেই থাকে (create-next-app দিয়ে তৈরি হওয়া), আমরা সেটি ওভাররাইট করব
|
|
26
|
+
fs.writeFileSync(configPath, configContent);
|
|
27
|
+
|
|
28
|
+
console.log(" ✅ Next.js Config updated: Turbopack root fixed.");
|
|
29
|
+
}
|