create-ej-app 21.0.0 → 24.0.0
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/cli.js +33 -26
- package/cli.ts +14 -2
- package/package.json +8 -6
- package/template/api/gitignore +4 -0
- package/template/api/package.json +2 -2
- package/template/nextjs/gitignore +7 -0
- package/template/nextjs/package.json +21 -21
- package/template/nextjs/terraform/gitignore +4 -0
package/cli.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const child_process_1 = require("child_process");
|
|
8
|
-
const commander_1 = require("commander");
|
|
9
|
-
const enquirer_1 = require("enquirer");
|
|
10
|
-
const fs_1 = __importDefault(require("fs"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
import { program } from 'commander';
|
|
4
|
+
import enquirer from 'enquirer';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import path from 'path';
|
|
12
7
|
const detectPackageManager = () => {
|
|
13
8
|
const userAgent = process.env.npm_config_user_agent;
|
|
14
9
|
if (userAgent) {
|
|
@@ -45,8 +40,8 @@ const getDevCommand = (packageManager) => {
|
|
|
45
40
|
return 'npm run dev';
|
|
46
41
|
}
|
|
47
42
|
};
|
|
48
|
-
|
|
49
|
-
const response = await
|
|
43
|
+
program.action(async () => {
|
|
44
|
+
const response = await enquirer.prompt([
|
|
50
45
|
{
|
|
51
46
|
type: 'input',
|
|
52
47
|
name: 'projectName',
|
|
@@ -82,29 +77,41 @@ commander_1.program.action(async () => {
|
|
|
82
77
|
}
|
|
83
78
|
]);
|
|
84
79
|
const { projectName, description, template, git } = response;
|
|
85
|
-
const projectDir =
|
|
86
|
-
if (
|
|
80
|
+
const projectDir = path.join(process.cwd(), projectName);
|
|
81
|
+
if (fs.existsSync(projectDir)) {
|
|
87
82
|
console.error(`Error: Directory '${projectName}' already exists.`);
|
|
88
83
|
process.exit(1);
|
|
89
84
|
}
|
|
90
|
-
|
|
91
|
-
const templateDir =
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
85
|
+
fs.mkdirSync(projectDir);
|
|
86
|
+
const templateDir = path.join(__dirname, 'template', template);
|
|
87
|
+
fs.cpSync(templateDir, projectDir, { recursive: true });
|
|
88
|
+
const renameGitignore = (dir) => {
|
|
89
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
90
|
+
const fullPath = path.join(dir, entry.name);
|
|
91
|
+
if (entry.isDirectory()) {
|
|
92
|
+
renameGitignore(fullPath);
|
|
93
|
+
}
|
|
94
|
+
else if (entry.name === 'gitignore') {
|
|
95
|
+
fs.renameSync(fullPath, path.join(dir, '.gitignore'));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
renameGitignore(projectDir);
|
|
100
|
+
const packageJsonFile = path.join(projectDir, 'package.json');
|
|
101
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf-8'));
|
|
95
102
|
packageJson.name = projectName;
|
|
96
103
|
packageJson.description = description;
|
|
97
|
-
|
|
98
|
-
const envExampleFile =
|
|
99
|
-
const envExample =
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
|
|
105
|
+
const envExampleFile = path.join(projectDir, '.env.example');
|
|
106
|
+
const envExample = fs.readFileSync(envExampleFile, 'utf-8');
|
|
107
|
+
fs.writeFileSync(path.join(projectDir, '.env'), envExample);
|
|
108
|
+
fs.writeFileSync(path.join(projectDir, 'README.md'), `# ${projectName}
|
|
102
109
|
|
|
103
110
|
${description}
|
|
104
111
|
`);
|
|
105
112
|
if (git === 'yes') {
|
|
106
113
|
try {
|
|
107
|
-
|
|
114
|
+
execSync('git init', { cwd: projectDir, stdio: 'inherit' });
|
|
108
115
|
}
|
|
109
116
|
catch (err) {
|
|
110
117
|
console.error('Error initializing git repository:', err);
|
|
@@ -131,4 +138,4 @@ ${devCommand}
|
|
|
131
138
|
Happy coding! 🚀
|
|
132
139
|
`);
|
|
133
140
|
});
|
|
134
|
-
|
|
141
|
+
program.parse(process.argv);
|
package/cli.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { execSync } from 'child_process'
|
|
4
4
|
import { program } from 'commander'
|
|
5
|
-
import
|
|
5
|
+
import enquirer from 'enquirer'
|
|
6
6
|
import fs from 'fs'
|
|
7
7
|
import path from 'path'
|
|
8
8
|
|
|
@@ -52,7 +52,7 @@ const getDevCommand = (packageManager: string) => {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
program.action(async () => {
|
|
55
|
-
const response: Response = await prompt([
|
|
55
|
+
const response: Response = await enquirer.prompt([
|
|
56
56
|
{
|
|
57
57
|
type: 'input',
|
|
58
58
|
name: 'projectName',
|
|
@@ -103,6 +103,18 @@ program.action(async () => {
|
|
|
103
103
|
const templateDir = path.join(__dirname, 'template', template)
|
|
104
104
|
fs.cpSync(templateDir, projectDir, { recursive: true })
|
|
105
105
|
|
|
106
|
+
const renameGitignore = (dir: string) => {
|
|
107
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
108
|
+
const fullPath = path.join(dir, entry.name)
|
|
109
|
+
if (entry.isDirectory()) {
|
|
110
|
+
renameGitignore(fullPath)
|
|
111
|
+
} else if (entry.name === 'gitignore') {
|
|
112
|
+
fs.renameSync(fullPath, path.join(dir, '.gitignore'))
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
renameGitignore(projectDir)
|
|
117
|
+
|
|
106
118
|
const packageJsonFile = path.join(projectDir, 'package.json')
|
|
107
119
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf-8'))
|
|
108
120
|
packageJson.name = projectName
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ej-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.0.0",
|
|
4
4
|
"description": "Bootstrap a next.js app with my preferred setup",
|
|
5
5
|
"main": "cli.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"build": "tsc",
|
|
8
9
|
"start": "node ."
|
|
@@ -14,10 +15,11 @@
|
|
|
14
15
|
"create-ej-app",
|
|
15
16
|
"nextjs",
|
|
16
17
|
"typescript",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
18
|
+
"better-auth",
|
|
19
|
+
"drizzle",
|
|
19
20
|
"tailwind",
|
|
20
|
-
"shadcn"
|
|
21
|
+
"shadcn",
|
|
22
|
+
"starter"
|
|
21
23
|
],
|
|
22
24
|
"author": "Ekansh Jain",
|
|
23
25
|
"license": "MIT",
|
|
@@ -30,11 +32,11 @@
|
|
|
30
32
|
},
|
|
31
33
|
"homepage": "https://github.com/ejekanshjain/create-ej-app#readme",
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"commander": "^
|
|
35
|
+
"commander": "^15.0.0",
|
|
34
36
|
"enquirer": "^2.4.1"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^25.
|
|
39
|
+
"@types/node": "^25.9.1",
|
|
38
40
|
"typescript": "^6.0.3"
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"zod": "4.4.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/bun": "1.3.
|
|
25
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
24
|
+
"@types/bun": "1.3.14",
|
|
25
|
+
"@typescript/native-preview": "7.0.0-dev.20260603.1",
|
|
26
26
|
"drizzle-kit": "0.31.10",
|
|
27
27
|
"postgres": "3.4.9",
|
|
28
28
|
"prettier": "3.8.3",
|
|
@@ -22,54 +22,54 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@ejekanshjain/simple-email-validator": "1.0.4",
|
|
25
|
-
"@hookform/resolvers": "5.
|
|
26
|
-
"@next/third-parties": "16.2.
|
|
25
|
+
"@hookform/resolvers": "5.4.0",
|
|
26
|
+
"@next/third-parties": "16.2.7",
|
|
27
27
|
"@opentelemetry/api": "1.9.1",
|
|
28
28
|
"@opentelemetry/sdk-trace-base": "2.7.1",
|
|
29
29
|
"@paralleldrive/cuid2": "3.3.0",
|
|
30
30
|
"@react-email/render": "2.0.8",
|
|
31
31
|
"@t3-oss/env-nextjs": "0.13.11",
|
|
32
|
-
"@tanstack/react-query": "5.
|
|
32
|
+
"@tanstack/react-query": "5.101.0",
|
|
33
33
|
"@vercel/otel": "2.1.2",
|
|
34
|
-
"better-auth": "1.6.
|
|
34
|
+
"better-auth": "1.6.14",
|
|
35
35
|
"class-variance-authority": "0.7.1",
|
|
36
36
|
"clsx": "2.1.1",
|
|
37
37
|
"drizzle-orm": "0.45.2",
|
|
38
|
-
"lucide-react": "1.
|
|
39
|
-
"next": "16.2.
|
|
40
|
-
"next-safe-action": "8.5.
|
|
38
|
+
"lucide-react": "1.17.0",
|
|
39
|
+
"next": "16.2.7",
|
|
40
|
+
"next-safe-action": "8.5.3",
|
|
41
41
|
"next-themes": "^0.4.6",
|
|
42
42
|
"nextjs-toploader": "3.9.17",
|
|
43
|
-
"nodemailer": "8.0.
|
|
43
|
+
"nodemailer": "8.0.10",
|
|
44
44
|
"postgres": "3.4.9",
|
|
45
45
|
"radix-ui": "1.4.3",
|
|
46
|
-
"react": "19.2.
|
|
47
|
-
"react-dom": "19.2.
|
|
48
|
-
"react-hook-form": "7.
|
|
46
|
+
"react": "19.2.7",
|
|
47
|
+
"react-dom": "19.2.7",
|
|
48
|
+
"react-hook-form": "7.77.0",
|
|
49
49
|
"sonner": "^2.0.7",
|
|
50
|
-
"tailwind-merge": "3.
|
|
50
|
+
"tailwind-merge": "3.6.0",
|
|
51
51
|
"tw-animate-css": "1.4.0",
|
|
52
|
-
"workflow": "4.
|
|
52
|
+
"workflow": "4.3.1",
|
|
53
53
|
"zod": "4.4.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@next/bundle-analyzer": "16.2.
|
|
56
|
+
"@next/bundle-analyzer": "16.2.7",
|
|
57
57
|
"@react-email/preview-server": "5.2.10",
|
|
58
|
-
"@tailwindcss/postcss": "4.
|
|
59
|
-
"@types/bun": "1.3.
|
|
58
|
+
"@tailwindcss/postcss": "4.3.0",
|
|
59
|
+
"@types/bun": "1.3.14",
|
|
60
60
|
"@types/nodemailer": "8.0.0",
|
|
61
|
-
"@types/react": "19.2.
|
|
61
|
+
"@types/react": "19.2.16",
|
|
62
62
|
"@types/react-dom": "19.2.3",
|
|
63
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
63
|
+
"@typescript/native-preview": "7.0.0-dev.20260603.1",
|
|
64
64
|
"babel-plugin-react-compiler": "1.0.0",
|
|
65
65
|
"drizzle-kit": "0.31.10",
|
|
66
66
|
"eslint": "9.39.4",
|
|
67
|
-
"eslint-config-next": "16.2.
|
|
67
|
+
"eslint-config-next": "16.2.7",
|
|
68
68
|
"prettier": "3.8.3",
|
|
69
69
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
70
70
|
"prettier-plugin-tailwindcss": "0.8.0",
|
|
71
|
-
"react-email": "6.
|
|
72
|
-
"tailwindcss": "4.
|
|
71
|
+
"react-email": "6.5.0",
|
|
72
|
+
"tailwindcss": "4.3.0",
|
|
73
73
|
"typescript": "6.0.3"
|
|
74
74
|
},
|
|
75
75
|
"trustedDependencies": [
|