create-ej-app 21.0.0 → 25.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 +35 -26
- package/cli.ts +17 -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 +22 -22
- package/template/nextjs/postcss.config.mjs +3 -1
- package/template/nextjs/terraform/gitignore +4 -0
package/cli.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
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';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
9
|
const detectPackageManager = () => {
|
|
13
10
|
const userAgent = process.env.npm_config_user_agent;
|
|
14
11
|
if (userAgent) {
|
|
@@ -45,8 +42,8 @@ const getDevCommand = (packageManager) => {
|
|
|
45
42
|
return 'npm run dev';
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
|
-
|
|
49
|
-
const response = await
|
|
45
|
+
program.action(async () => {
|
|
46
|
+
const response = await enquirer.prompt([
|
|
50
47
|
{
|
|
51
48
|
type: 'input',
|
|
52
49
|
name: 'projectName',
|
|
@@ -82,29 +79,41 @@ commander_1.program.action(async () => {
|
|
|
82
79
|
}
|
|
83
80
|
]);
|
|
84
81
|
const { projectName, description, template, git } = response;
|
|
85
|
-
const projectDir =
|
|
86
|
-
if (
|
|
82
|
+
const projectDir = path.join(process.cwd(), projectName);
|
|
83
|
+
if (fs.existsSync(projectDir)) {
|
|
87
84
|
console.error(`Error: Directory '${projectName}' already exists.`);
|
|
88
85
|
process.exit(1);
|
|
89
86
|
}
|
|
90
|
-
|
|
91
|
-
const templateDir =
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
|
|
87
|
+
fs.mkdirSync(projectDir);
|
|
88
|
+
const templateDir = path.join(__dirname, 'template', template);
|
|
89
|
+
fs.cpSync(templateDir, projectDir, { recursive: true });
|
|
90
|
+
const renameGitignore = (dir) => {
|
|
91
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
92
|
+
const fullPath = path.join(dir, entry.name);
|
|
93
|
+
if (entry.isDirectory()) {
|
|
94
|
+
renameGitignore(fullPath);
|
|
95
|
+
}
|
|
96
|
+
else if (entry.name === 'gitignore') {
|
|
97
|
+
fs.renameSync(fullPath, path.join(dir, '.gitignore'));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
renameGitignore(projectDir);
|
|
102
|
+
const packageJsonFile = path.join(projectDir, 'package.json');
|
|
103
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf-8'));
|
|
95
104
|
packageJson.name = projectName;
|
|
96
105
|
packageJson.description = description;
|
|
97
|
-
|
|
98
|
-
const envExampleFile =
|
|
99
|
-
const envExample =
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
fs.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
|
|
107
|
+
const envExampleFile = path.join(projectDir, '.env.example');
|
|
108
|
+
const envExample = fs.readFileSync(envExampleFile, 'utf-8');
|
|
109
|
+
fs.writeFileSync(path.join(projectDir, '.env'), envExample);
|
|
110
|
+
fs.writeFileSync(path.join(projectDir, 'README.md'), `# ${projectName}
|
|
102
111
|
|
|
103
112
|
${description}
|
|
104
113
|
`);
|
|
105
114
|
if (git === 'yes') {
|
|
106
115
|
try {
|
|
107
|
-
|
|
116
|
+
execSync('git init', { cwd: projectDir, stdio: 'inherit' });
|
|
108
117
|
}
|
|
109
118
|
catch (err) {
|
|
110
119
|
console.error('Error initializing git repository:', err);
|
|
@@ -131,4 +140,4 @@ ${devCommand}
|
|
|
131
140
|
Happy coding! 🚀
|
|
132
141
|
`);
|
|
133
142
|
});
|
|
134
|
-
|
|
143
|
+
program.parse(process.argv);
|
package/cli.ts
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
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
|
+
import { fileURLToPath } from 'url'
|
|
9
|
+
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
11
|
|
|
9
12
|
interface Response {
|
|
10
13
|
projectName: string
|
|
@@ -52,7 +55,7 @@ const getDevCommand = (packageManager: string) => {
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
program.action(async () => {
|
|
55
|
-
const response: Response = await prompt([
|
|
58
|
+
const response: Response = await enquirer.prompt([
|
|
56
59
|
{
|
|
57
60
|
type: 'input',
|
|
58
61
|
name: 'projectName',
|
|
@@ -103,6 +106,18 @@ program.action(async () => {
|
|
|
103
106
|
const templateDir = path.join(__dirname, 'template', template)
|
|
104
107
|
fs.cpSync(templateDir, projectDir, { recursive: true })
|
|
105
108
|
|
|
109
|
+
const renameGitignore = (dir: string) => {
|
|
110
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
111
|
+
const fullPath = path.join(dir, entry.name)
|
|
112
|
+
if (entry.isDirectory()) {
|
|
113
|
+
renameGitignore(fullPath)
|
|
114
|
+
} else if (entry.name === 'gitignore') {
|
|
115
|
+
fs.renameSync(fullPath, path.join(dir, '.gitignore'))
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
renameGitignore(projectDir)
|
|
120
|
+
|
|
106
121
|
const packageJsonFile = path.join(projectDir, 'package.json')
|
|
107
122
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonFile, 'utf-8'))
|
|
108
123
|
packageJson.name = projectName
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ej-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.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.2",
|
|
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.20260607.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
|
-
"radix-ui": "1.
|
|
46
|
-
"react": "19.2.
|
|
47
|
-
"react-dom": "19.2.
|
|
48
|
-
"react-hook-form": "7.
|
|
45
|
+
"radix-ui": "1.5.0",
|
|
46
|
+
"react": "19.2.7",
|
|
47
|
+
"react-dom": "19.2.7",
|
|
48
|
+
"react-hook-form": "7.78.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.17",
|
|
62
62
|
"@types/react-dom": "19.2.3",
|
|
63
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
63
|
+
"@typescript/native-preview": "7.0.0-dev.20260607.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": [
|