nextjs-starter-kit 0.1.8 → 0.1.10
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/bin/cli.js +46 -41
- package/package.json +29 -3
- package/template/package.json +14 -14
- package/template/pnpm-lock.yaml +5593 -7246
package/bin/cli.js
CHANGED
|
@@ -12,30 +12,34 @@ const __dirname = path.dirname(__filename);
|
|
|
12
12
|
|
|
13
13
|
function runCommand(command, options = {}) {
|
|
14
14
|
try {
|
|
15
|
-
execSync(command, {
|
|
15
|
+
return execSync(command, {
|
|
16
|
+
stdio: "pipe",
|
|
17
|
+
encoding: "utf-8",
|
|
18
|
+
...options,
|
|
19
|
+
}).trim();
|
|
16
20
|
} catch {
|
|
17
|
-
|
|
18
|
-
process.exit(1);
|
|
21
|
+
return null;
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
async function main() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
let projectName = process.argv[2];
|
|
27
|
+
if (!projectName) {
|
|
28
|
+
const response = await prompts({
|
|
29
|
+
type: "text",
|
|
30
|
+
name: "projectName",
|
|
31
|
+
message: "What is your project named?",
|
|
32
|
+
initial: "my-app",
|
|
33
|
+
});
|
|
34
|
+
projectName = response.projectName;
|
|
35
|
+
}
|
|
30
36
|
|
|
31
37
|
const projectPath = path.resolve(process.cwd(), projectName);
|
|
32
|
-
|
|
33
|
-
if (existsSync(projectPath)) {
|
|
38
|
+
if (projectName !== "." && existsSync(projectPath)) {
|
|
34
39
|
console.error(chalk.red(`❌ Folder "${projectName}" already exists.`));
|
|
35
40
|
process.exit(1);
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
// Step 2: Ask for package manager
|
|
39
43
|
const { packageManager } = await prompts({
|
|
40
44
|
type: "select",
|
|
41
45
|
name: "packageManager",
|
|
@@ -49,43 +53,44 @@ async function main() {
|
|
|
49
53
|
initial: 0,
|
|
50
54
|
});
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
).start();
|
|
56
|
+
console.log(`\nCreating a new Next.js app in ${chalk.cyan(projectPath)}.\n`);
|
|
57
|
+
console.log(`Using ${chalk.cyan(packageManager)}.\n`);
|
|
58
|
+
console.log(`Initializing project with template: app-tw\n`);
|
|
56
59
|
|
|
57
|
-
mkdirSync(projectPath);
|
|
58
|
-
|
|
59
|
-
// Copy template files (keeps empty folders too)
|
|
60
|
+
if (projectName !== ".") mkdirSync(projectPath);
|
|
60
61
|
const templateDir = path.join(__dirname, "../template");
|
|
61
62
|
cpSync(templateDir, projectPath, { recursive: true });
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
spinner.text = "Initializing Git repository...";
|
|
64
|
+
const spinner = ora("Initializing git repository...").start();
|
|
65
65
|
runCommand("git init", { cwd: projectPath });
|
|
66
|
-
|
|
67
66
|
spinner.stop();
|
|
67
|
+
console.log(chalk.green("Initialized a git repository.\n"));
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
console.log(chalk.cyan(`Installing dependencies...\n`));
|
|
70
|
+
try {
|
|
71
|
+
if (packageManager === "npm")
|
|
72
|
+
runCommand("npm install", { cwd: projectPath });
|
|
73
|
+
else if (packageManager === "pnpm")
|
|
74
|
+
runCommand("pnpm install", { cwd: projectPath });
|
|
75
|
+
else if (packageManager === "yarn")
|
|
76
|
+
runCommand("yarn install", { cwd: projectPath });
|
|
77
|
+
else if (packageManager === "bun")
|
|
78
|
+
runCommand("bun install", { cwd: projectPath });
|
|
79
|
+
} catch {
|
|
80
|
+
console.log(
|
|
81
|
+
chalk.yellow("\n⚠ Warning: Some build scripts were ignored.\n")
|
|
82
|
+
);
|
|
83
|
+
}
|
|
70
84
|
console.log(
|
|
71
|
-
chalk.
|
|
85
|
+
chalk.green(
|
|
86
|
+
`Done in ${chalk.cyan("~10s")} using ${chalk.cyan(packageManager)}.`
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
console.log(
|
|
90
|
+
chalk.green(
|
|
91
|
+
`\n✅ Success! Created ${projectName} at ${chalk.cyan(projectPath)}`
|
|
92
|
+
)
|
|
72
93
|
);
|
|
73
|
-
|
|
74
|
-
if (packageManager === "npm") {
|
|
75
|
-
runCommand("npm install", { cwd: projectPath });
|
|
76
|
-
} else if (packageManager === "pnpm") {
|
|
77
|
-
runCommand("pnpm install", { cwd: projectPath });
|
|
78
|
-
} else if (packageManager === "yarn") {
|
|
79
|
-
runCommand("yarn install", { cwd: projectPath });
|
|
80
|
-
} else if (packageManager === "bun") {
|
|
81
|
-
runCommand("bun install", { cwd: projectPath });
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Step 5: Success
|
|
85
|
-
console.log(chalk.green("\n✅ Success!"));
|
|
86
|
-
console.log(`\nNext steps:\n`);
|
|
87
|
-
console.log(` ${chalk.cyan("cd")} ${projectName}`);
|
|
88
|
-
console.log(` ${chalk.cyan(`${packageManager} dev`)}\n`);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
main();
|
package/package.json
CHANGED
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nextjs-starter-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"bin": {
|
|
5
|
-
"create-nextjs-starter": "bin/cli.js"
|
|
5
|
+
"create-nextjs-starter": "@/bin/cli.js"
|
|
6
6
|
},
|
|
7
|
+
"keywords": [
|
|
8
|
+
"react",
|
|
9
|
+
"next",
|
|
10
|
+
"next.js"
|
|
11
|
+
],
|
|
12
|
+
"description": "Create Next.js-powered React apps with one command",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/harshit-ostwal/nextjs-starter-kit.git"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/harshit-ostwal/nextjs-starter-kit.git",
|
|
18
|
+
"author": "Harshit Ostwal <codewithharshitjain@gmail.com>",
|
|
7
19
|
"type": "module",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/harshit-ostwal/nextjs-starter-kit.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
8
24
|
"files": [
|
|
9
25
|
"bin",
|
|
10
26
|
"template"
|
|
11
27
|
],
|
|
12
28
|
"dependencies": {
|
|
13
29
|
"chalk": "^5.6.0",
|
|
30
|
+
"commander": "^14.0.0",
|
|
14
31
|
"ora": "^8.2.0",
|
|
15
32
|
"prompts": "^2.4.2",
|
|
16
33
|
"readline": "^1.3.0"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.17.0"
|
|
37
|
+
},
|
|
38
|
+
"nextBundleAnalysis": {
|
|
39
|
+
"budget": 358400,
|
|
40
|
+
"budgetPercentIncreaseRed": 20,
|
|
41
|
+
"minimumChangeThreshold": 0,
|
|
42
|
+
"showDetails": true
|
|
17
43
|
}
|
|
18
|
-
}
|
|
44
|
+
}
|
package/template/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@hookform/resolvers": "^5.2.1",
|
|
16
|
-
"@next/third-parties": "^15.5.
|
|
16
|
+
"@next/third-parties": "^15.5.2",
|
|
17
17
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
18
18
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
19
19
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
33
33
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
34
34
|
"@tabler/icons-react": "^3.34.1",
|
|
35
|
-
"@tanstack/react-query": "^5.
|
|
36
|
-
"@tanstack/react-query-devtools": "^5.
|
|
35
|
+
"@tanstack/react-query": "^5.87.1",
|
|
36
|
+
"@tanstack/react-query-devtools": "^5.87.3",
|
|
37
37
|
"axios": "^1.11.0",
|
|
38
38
|
"class-variance-authority": "^0.7.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
@@ -41,32 +41,32 @@
|
|
|
41
41
|
"date-fns": "^4.1.0",
|
|
42
42
|
"embla-carousel-react": "^8.6.0",
|
|
43
43
|
"input-otp": "^1.4.2",
|
|
44
|
-
"lucide-react": "^0.
|
|
45
|
-
"next": "15.5.
|
|
44
|
+
"lucide-react": "^0.542.0",
|
|
45
|
+
"next": "15.5.2",
|
|
46
46
|
"next-themes": "^0.4.6",
|
|
47
|
-
"react": "19.1.
|
|
47
|
+
"react": "19.1.1",
|
|
48
48
|
"react-day-picker": "^9.9.0",
|
|
49
|
-
"react-dom": "19.1.
|
|
49
|
+
"react-dom": "19.1.1",
|
|
50
50
|
"react-hook-form": "^7.62.0",
|
|
51
|
-
"recharts": "2.
|
|
51
|
+
"recharts": "3.2.0",
|
|
52
52
|
"sonner": "^2.0.7",
|
|
53
53
|
"tailwind-merge": "^3.3.1",
|
|
54
54
|
"vaul": "^1.1.2",
|
|
55
|
-
"zod": "^4.
|
|
55
|
+
"zod": "^4.1.5"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/eslintrc": "^3",
|
|
59
|
-
"@tailwindcss/postcss": "^
|
|
60
|
-
"@tanstack/eslint-plugin-query": "^5.
|
|
59
|
+
"@tailwindcss/postcss": "^4.1.13",
|
|
60
|
+
"@tanstack/eslint-plugin-query": "^5.86.0",
|
|
61
61
|
"eslint": "^9",
|
|
62
|
-
"eslint-config-next": "15.5.
|
|
62
|
+
"eslint-config-next": "15.5.2",
|
|
63
63
|
"eslint-config-prettier": "^10.1.8",
|
|
64
64
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
65
65
|
"husky": "^9.1.7",
|
|
66
|
-
"lint-staged": "^16.1.
|
|
66
|
+
"lint-staged": "^16.1.6",
|
|
67
67
|
"prettier": "^3.6.2",
|
|
68
68
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
69
69
|
"tailwindcss": "^4",
|
|
70
|
-
"tw-animate-css": "^1.3.
|
|
70
|
+
"tw-animate-css": "^1.3.8"
|
|
71
71
|
}
|
|
72
72
|
}
|