create-coreback 1.0.2 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-coreback",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "CLI to generate production-ready backend projects with Node.js, TypeScript and Express",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,2 @@
1
+ onlyBuiltDependencies:
2
+ - esbuild
@@ -35,6 +35,15 @@ DATABASE_URL="${databaseUrl}"
35
35
  # JWT
36
36
  JWT_SECRET=your-super-secret-key-change-this-in-production
37
37
  JWT_EXPIRES_IN=7d
38
+
39
+ # Email (Optional - if not configured, uses test account)
40
+ # EMAIL_HOST=smtp.gmail.com
41
+ # EMAIL_PORT=587
42
+ # EMAIL_SECURE=false
43
+ # EMAIL_USER=your-email@gmail.com
44
+ # EMAIL_PASSWORD=your-app-password
45
+ EMAIL_FROM=noreply@coreback.app
46
+ APP_URL=http://localhost:3000
38
47
  `;
39
48
  }
40
49
 
@@ -2,37 +2,34 @@ import fs from 'fs-extra';
2
2
  import path from 'path';
3
3
 
4
4
  export async function generateEslintConfig(projectPath: string): Promise<void> {
5
- const eslintConfig = {
6
- parser: '@typescript-eslint/parser',
7
- parserOptions: {
5
+ // ESLint 9 uses flat config format
6
+ const eslintConfig = `import js from '@eslint/js';
7
+ import tseslint from 'typescript-eslint';
8
+
9
+ export default tseslint.config(
10
+ js.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ {
13
+ languageOptions: {
8
14
  ecmaVersion: 2022,
9
15
  sourceType: 'module',
10
- project: './tsconfig.json',
11
- },
12
- plugins: ['@typescript-eslint'],
13
- extends: [
14
- 'eslint:recommended',
15
- 'plugin:@typescript-eslint/recommended',
16
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
17
- ],
18
- root: true,
19
- env: {
20
- node: true,
21
- jest: true,
16
+ parserOptions: {
17
+ project: './tsconfig.json',
18
+ },
22
19
  },
23
- ignorePatterns: ['.eslintrc.json', 'dist', 'node_modules'],
24
20
  rules: {
25
- '@typescript-eslint/interface-name-prefix': 'off',
26
- '@typescript-eslint/explicit-function-return-type': 'off',
27
- '@typescript-eslint/explicit-module-boundary-types': 'off',
28
21
  '@typescript-eslint/no-explicit-any': 'warn',
29
22
  },
30
- };
23
+ },
24
+ {
25
+ ignores: ['dist', 'node_modules', '*.js'],
26
+ }
27
+ );
28
+ `;
31
29
 
32
- await fs.writeJSON(
33
- path.join(projectPath, '.eslintrc.json'),
34
- eslintConfig,
35
- { spaces: 2 }
30
+ await fs.writeFile(
31
+ path.join(projectPath, 'eslint.config.js'),
32
+ eslintConfig
36
33
  );
37
34
  }
38
35
 
@@ -7,45 +7,47 @@ export async function generatePackageJson(
7
7
  config: ProjectConfig
8
8
  ): Promise<void> {
9
9
  const dependencies: Record<string, string> = {
10
- express: '^4.18.2',
11
- 'express-rate-limit': '^7.1.5',
10
+ express: '^4.21.1',
11
+ 'express-rate-limit': '^8.2.1',
12
12
  cors: '^2.8.5',
13
- helmet: '^7.1.0',
14
- compression: '^1.7.4',
15
- dotenv: '^16.4.1',
16
- zod: '^3.22.4',
17
- winston: '^3.11.0',
18
- '@prisma/client': '^5.9.1',
13
+ helmet: '^8.1.0',
14
+ compression: '^1.8.1',
15
+ dotenv: '^17.2.3',
16
+ zod: '^3.25.76',
17
+ winston: '^3.19.0',
18
+ '@prisma/client': '^5.22.0',
19
19
  'swagger-jsdoc': '^6.2.8',
20
- 'swagger-ui-express': '^5.0.0',
20
+ 'swagger-ui-express': '^5.0.1',
21
21
  };
22
22
 
23
23
  if (config.includeAuth) {
24
24
  dependencies['jsonwebtoken'] = '^9.0.2';
25
25
  dependencies['bcrypt'] = '^5.1.1';
26
+ dependencies['nodemailer'] = '^6.9.8';
26
27
  }
27
28
 
28
29
  const devDependencies: Record<string, string> = {
29
- '@types/express': '^4.17.21',
30
- '@types/cors': '^2.8.17',
31
- '@types/compression': '^1.7.5',
32
- '@types/node': '^20.11.5',
33
- '@types/jsonwebtoken': '^9.0.5',
30
+ '@types/express': '^4.17.25',
31
+ '@types/cors': '^2.8.19',
32
+ '@types/compression': '^1.8.1',
33
+ '@types/node': '^20.19.27',
34
+ '@types/jsonwebtoken': '^9.0.10',
34
35
  '@types/bcrypt': '^5.0.2',
36
+ '@types/nodemailer': '^6.4.14',
35
37
  '@types/swagger-jsdoc': '^6.0.4',
36
- '@types/swagger-ui-express': '^4.1.6',
37
- '@types/jest': '^29.5.11',
38
- '@types/supertest': '^6.0.2',
39
- '@typescript-eslint/eslint-plugin': '^6.19.1',
40
- '@typescript-eslint/parser': '^6.19.1',
41
- eslint: '^8.56.0',
42
- prettier: '^3.2.4',
43
- 'ts-jest': '^29.1.2',
44
- jest: '^29.7.0',
45
- supertest: '^6.3.4',
46
- tsx: '^4.7.1',
47
- typescript: '^5.3.3',
48
- prisma: '^5.9.1',
38
+ '@types/swagger-ui-express': '^4.1.8',
39
+ '@types/jest': '^29.5.14',
40
+ '@types/supertest': '^6.0.3',
41
+ 'typescript-eslint': '^8.50.1',
42
+ '@eslint/js': '^9.39.2',
43
+ eslint: '^9.39.2',
44
+ prettier: '^3.7.4',
45
+ 'ts-jest': '^29.4.6',
46
+ jest: '^30.2.0',
47
+ supertest: '^7.1.4',
48
+ tsx: '^4.21.0',
49
+ typescript: '^5.9.3',
50
+ prisma: '^5.22.0',
49
51
  };
50
52
 
51
53
  const packageJson = {
@@ -57,8 +59,8 @@ export async function generatePackageJson(
57
59
  dev: 'tsx watch src/index.ts',
58
60
  build: 'tsc',
59
61
  start: 'node dist/index.js',
60
- lint: 'eslint src --ext .ts',
61
- 'lint:fix': 'eslint src --ext .ts --fix',
62
+ lint: 'eslint src',
63
+ 'lint:fix': 'eslint src --fix',
62
64
  format: 'prettier --write "src/**/*.ts"',
63
65
  test: 'jest',
64
66
  'test:watch': 'jest --watch',
@@ -52,7 +52,12 @@ model User {
52
52
  `;
53
53
 
54
54
  if (config.includeAuth) {
55
- schema += ` password String
55
+ schema += ` password String
56
+ emailVerified Boolean @default(false)
57
+ emailVerificationToken String?
58
+ emailVerificationExpires DateTime?
59
+ passwordResetToken String?
60
+ passwordResetExpires DateTime?
56
61
  `;
57
62
  }
58
63