create-ej-app 2.9.0 → 3.1.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 ADDED
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ const commander_1 = require("commander");
17
+ const enquirer_1 = require("enquirer");
18
+ const fs_1 = __importDefault(require("fs"));
19
+ const path_1 = __importDefault(require("path"));
20
+ //@ts-ignore
21
+ const copy_dir_1 = __importDefault(require("copy-dir"));
22
+ commander_1.program.action(() => __awaiter(void 0, void 0, void 0, function* () {
23
+ const response = yield (0, enquirer_1.prompt)([
24
+ {
25
+ type: 'input',
26
+ name: 'projectName',
27
+ message: 'Enter the project name:',
28
+ initial: 'my-app'
29
+ },
30
+ {
31
+ type: 'input',
32
+ name: 'description',
33
+ message: 'Enter a description for the project:',
34
+ initial: 'A Legendary App'
35
+ },
36
+ {
37
+ type: 'select',
38
+ name: 'template',
39
+ message: 'Select a template:',
40
+ choices: [
41
+ {
42
+ name: 'base',
43
+ message: 'Base setup with ts, shadcn, prisma, auth, editor.js'
44
+ },
45
+ {
46
+ name: 'advanced',
47
+ message: 'Advanced setup with User Types and ACLs (roles & permissions)'
48
+ }
49
+ ]
50
+ }
51
+ ]);
52
+ const { projectName, description, template } = response;
53
+ const projectDir = path_1.default.join(process.cwd(), projectName);
54
+ if (fs_1.default.existsSync(projectDir)) {
55
+ console.error(`Error: Directory '${projectName}' already exists.`);
56
+ process.exit(1);
57
+ }
58
+ fs_1.default.mkdirSync(projectDir);
59
+ const templateDir = path_1.default.join(__dirname, 'template', template);
60
+ copy_dir_1.default.sync(templateDir, projectDir);
61
+ const packageJsonFile = path_1.default.join(projectDir, 'package.json');
62
+ const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonFile, 'utf-8'));
63
+ packageJson.name = projectName;
64
+ packageJson.description = description;
65
+ fs_1.default.writeFileSync(packageJsonFile, JSON.stringify(packageJson, null, 2));
66
+ const siteConfigFile = path_1.default.join(projectDir, 'src', 'lib', 'siteConfig.ts');
67
+ let siteConfig = fs_1.default.readFileSync(siteConfigFile, 'utf-8');
68
+ siteConfig = siteConfig.replace('Project Name', projectName);
69
+ siteConfig = siteConfig.replace('Project Description', description);
70
+ fs_1.default.writeFileSync(siteConfigFile, siteConfig);
71
+ const envExampleFile = path_1.default.join(projectDir, '.env.example');
72
+ const envExample = fs_1.default.readFileSync(envExampleFile, 'utf-8');
73
+ fs_1.default.writeFileSync(path_1.default.join(projectDir, '.env'), envExample);
74
+ console.log(`Created a new app called '${projectName}' 🎉\n\nTo get started, run the following commands:\n\ncd ${projectName}\nnpm install\nnpm run dev\n`);
75
+ }));
76
+ commander_1.program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ej-app",
3
- "version": "2.9.0",
3
+ "version": "3.1.0",
4
4
  "description": "Bootstrap a next.js app with my preferred setup",
5
5
  "main": "cli.js",
6
6
  "scripts": {
@@ -35,7 +35,7 @@
35
35
  "enquirer": "^2.4.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/node": "^20.9.4",
39
- "typescript": "^5.3.2"
38
+ "@types/node": "^20.10.5",
39
+ "typescript": "^5.3.3"
40
40
  }
41
41
  }
@@ -25,7 +25,7 @@
25
25
  "@ejekanshjain/cloud-storage": "^3.1.0",
26
26
  "@hookform/resolvers": "^3.3.2",
27
27
  "@next-auth/prisma-adapter": "^1.0.7",
28
- "@prisma/client": "^5.6.0",
28
+ "@prisma/client": "^5.7.1",
29
29
  "@radix-ui/react-alert-dialog": "^1.0.5",
30
30
  "@radix-ui/react-avatar": "^1.0.4",
31
31
  "@radix-ui/react-checkbox": "^1.0.4",
@@ -39,41 +39,42 @@
39
39
  "@radix-ui/react-toast": "^1.1.5",
40
40
  "@t3-oss/env-nextjs": "^0.7.1",
41
41
  "@tailwindcss/typography": "^0.5.10",
42
- "@tanstack/react-table": "^8.10.7",
43
- "@types/eslint": "^8.44.7",
42
+ "@tanstack/react-table": "^8.11.2",
43
+ "@types/eslint": "^8.56.0",
44
44
  "@types/lodash": "^4.14.202",
45
- "@types/node": "^20.9.4",
45
+ "@types/node": "^20.10.5",
46
46
  "@types/nodemailer": "^6.4.14",
47
- "@types/react": "^18.2.38",
48
- "@types/react-dom": "^18.2.17",
49
- "@typescript-eslint/eslint-plugin": "^6.12.0",
50
- "@typescript-eslint/parser": "^6.12.0",
47
+ "@types/react": "^18.2.45",
48
+ "@types/react-dom": "^18.2.18",
49
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
50
+ "@typescript-eslint/parser": "^6.15.0",
51
51
  "@vercel/analytics": "^1.1.1",
52
+ "@vercel/speed-insights": "^1.0.2",
52
53
  "autoprefixer": "^10.4.16",
53
54
  "class-variance-authority": "^0.7.0",
54
55
  "clsx": "^2.0.0",
55
56
  "cmdk": "^0.2.0",
56
57
  "dayjs": "^1.11.10",
57
58
  "editorjs-html": "^3.4.3",
58
- "eslint": "^8.54.0",
59
- "eslint-config-next": "^14.0.3",
59
+ "eslint": "^8.56.0",
60
+ "eslint-config-next": "^14.0.4",
60
61
  "lodash": "^4.17.21",
61
- "lucide-react": "^0.292.0",
62
- "next": "^14.0.3",
62
+ "lucide-react": "^0.302.0",
63
+ "next": "^14.0.4",
63
64
  "next-auth": "^4.24.5",
64
65
  "next-themes": "^0.2.1",
65
66
  "nodemailer": "^6.9.7",
66
- "postcss": "^8.4.31",
67
- "prettier": "^3.1.0",
68
- "prettier-plugin-tailwindcss": "^0.5.7",
69
- "prisma": "^5.6.0",
67
+ "postcss": "^8.4.32",
68
+ "prettier": "^3.1.1",
69
+ "prettier-plugin-tailwindcss": "^0.5.9",
70
+ "prisma": "^5.7.1",
70
71
  "react": "^18.2.0",
71
72
  "react-dom": "^18.2.0",
72
- "react-hook-form": "^7.48.2",
73
- "tailwind-merge": "^2.0.0",
74
- "tailwindcss": "^3.3.5",
73
+ "react-hook-form": "^7.49.2",
74
+ "tailwind-merge": "^2.2.0",
75
+ "tailwindcss": "^3.4.0",
75
76
  "tailwindcss-animate": "^1.0.7",
76
- "typescript": "^5.3.2",
77
+ "typescript": "^5.3.3",
77
78
  "zod": "^3.22.4"
78
79
  }
79
80
  }
@@ -1,4 +1,5 @@
1
1
  import { Analytics } from '@vercel/analytics/react'
2
+ import { SpeedInsights } from '@vercel/speed-insights/next'
2
3
  import { Metadata } from 'next'
3
4
  import { Inter } from 'next/font/google'
4
5
  import { ReactNode } from 'react'
@@ -22,6 +23,7 @@ const RootLayout = ({ children }: { children: ReactNode }) => {
22
23
  <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
23
24
  {children}
24
25
  <Analytics />
26
+ <SpeedInsights />
25
27
  <Toaster />
26
28
  </ThemeProvider>
27
29
  </body>
@@ -25,7 +25,7 @@
25
25
  "@ejekanshjain/cloud-storage": "^3.1.0",
26
26
  "@hookform/resolvers": "^3.3.2",
27
27
  "@next-auth/prisma-adapter": "^1.0.7",
28
- "@prisma/client": "^5.6.0",
28
+ "@prisma/client": "^5.7.1",
29
29
  "@radix-ui/react-alert-dialog": "^1.0.5",
30
30
  "@radix-ui/react-avatar": "^1.0.4",
31
31
  "@radix-ui/react-checkbox": "^1.0.4",
@@ -39,41 +39,42 @@
39
39
  "@radix-ui/react-toast": "^1.1.5",
40
40
  "@t3-oss/env-nextjs": "^0.7.1",
41
41
  "@tailwindcss/typography": "^0.5.10",
42
- "@tanstack/react-table": "^8.10.7",
43
- "@types/eslint": "^8.44.7",
42
+ "@tanstack/react-table": "^8.11.2",
43
+ "@types/eslint": "^8.56.0",
44
44
  "@types/lodash": "^4.14.202",
45
- "@types/node": "^20.9.4",
45
+ "@types/node": "^20.10.5",
46
46
  "@types/nodemailer": "^6.4.14",
47
- "@types/react": "^18.2.38",
48
- "@types/react-dom": "^18.2.17",
49
- "@typescript-eslint/eslint-plugin": "^6.12.0",
50
- "@typescript-eslint/parser": "^6.12.0",
47
+ "@types/react": "^18.2.45",
48
+ "@types/react-dom": "^18.2.18",
49
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
50
+ "@typescript-eslint/parser": "^6.15.0",
51
51
  "@vercel/analytics": "^1.1.1",
52
+ "@vercel/speed-insights": "^1.0.2",
52
53
  "autoprefixer": "^10.4.16",
53
54
  "class-variance-authority": "^0.7.0",
54
55
  "clsx": "^2.0.0",
55
56
  "cmdk": "^0.2.0",
56
57
  "dayjs": "^1.11.10",
57
58
  "editorjs-html": "^3.4.3",
58
- "eslint": "^8.54.0",
59
- "eslint-config-next": "^14.0.3",
59
+ "eslint": "^8.56.0",
60
+ "eslint-config-next": "^14.0.4",
60
61
  "lodash": "^4.17.21",
61
- "lucide-react": "^0.292.0",
62
- "next": "^14.0.3",
62
+ "lucide-react": "^0.302.0",
63
+ "next": "^14.0.4",
63
64
  "next-auth": "^4.24.5",
64
65
  "next-themes": "^0.2.1",
65
66
  "nodemailer": "^6.9.7",
66
- "postcss": "^8.4.31",
67
- "prettier": "^3.1.0",
68
- "prettier-plugin-tailwindcss": "^0.5.7",
69
- "prisma": "^5.6.0",
67
+ "postcss": "^8.4.32",
68
+ "prettier": "^3.1.1",
69
+ "prettier-plugin-tailwindcss": "^0.5.9",
70
+ "prisma": "^5.7.1",
70
71
  "react": "^18.2.0",
71
72
  "react-dom": "^18.2.0",
72
- "react-hook-form": "^7.48.2",
73
- "tailwind-merge": "^2.0.0",
74
- "tailwindcss": "^3.3.5",
73
+ "react-hook-form": "^7.49.2",
74
+ "tailwind-merge": "^2.2.0",
75
+ "tailwindcss": "^3.4.0",
75
76
  "tailwindcss-animate": "^1.0.7",
76
- "typescript": "^5.3.2",
77
+ "typescript": "^5.3.3",
77
78
  "zod": "^3.22.4"
78
79
  }
79
80
  }
@@ -1,4 +1,5 @@
1
1
  import { Analytics } from '@vercel/analytics/react'
2
+ import { SpeedInsights } from '@vercel/speed-insights/next'
2
3
  import { Metadata } from 'next'
3
4
  import { Inter } from 'next/font/google'
4
5
  import { ReactNode } from 'react'
@@ -22,6 +23,7 @@ const RootLayout = ({ children }: { children: ReactNode }) => {
22
23
  <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
23
24
  {children}
24
25
  <Analytics />
26
+ <SpeedInsights />
25
27
  <Toaster />
26
28
  </ThemeProvider>
27
29
  </body>