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/.github/workflows/publish.yml +39 -3
- package/dist/generators/envExample.d.ts.map +1 -1
- package/dist/generators/envExample.js +9 -0
- package/dist/generators/envExample.js.map +1 -1
- package/dist/generators/eslint.d.ts.map +1 -1
- package/dist/generators/eslint.js +25 -27
- package/dist/generators/eslint.js.map +1 -1
- package/dist/generators/packageJson.d.ts.map +1 -1
- package/dist/generators/packageJson.js +31 -29
- package/dist/generators/packageJson.js.map +1 -1
- package/dist/generators/prisma.d.ts.map +1 -1
- package/dist/generators/prisma.js +6 -1
- package/dist/generators/prisma.js.map +1 -1
- package/dist/generators/sourceFiles.js +481 -9
- package/dist/generators/sourceFiles.js.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/pnpm-workspace.yaml +2 -0
- package/src/generators/envExample.ts +9 -0
- package/src/generators/eslint.ts +21 -24
- package/src/generators/packageJson.ts +31 -29
- package/src/generators/prisma.ts +6 -1
- package/src/generators/sourceFiles.ts +486 -9
- package/src/index.ts +12 -12
package/package.json
CHANGED
|
@@ -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
|
|
package/src/generators/eslint.ts
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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.
|
|
33
|
-
path.join(projectPath, '.
|
|
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.
|
|
11
|
-
'express-rate-limit': '^
|
|
10
|
+
express: '^4.21.1',
|
|
11
|
+
'express-rate-limit': '^8.2.1',
|
|
12
12
|
cors: '^2.8.5',
|
|
13
|
-
helmet: '^
|
|
14
|
-
compression: '^1.
|
|
15
|
-
dotenv: '^
|
|
16
|
-
zod: '^3.
|
|
17
|
-
winston: '^3.
|
|
18
|
-
'@prisma/client': '^5.
|
|
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.
|
|
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.
|
|
30
|
-
'@types/cors': '^2.8.
|
|
31
|
-
'@types/compression': '^1.
|
|
32
|
-
'@types/node': '^20.
|
|
33
|
-
'@types/jsonwebtoken': '^9.0.
|
|
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.
|
|
37
|
-
'@types/jest': '^29.5.
|
|
38
|
-
'@types/supertest': '^6.0.
|
|
39
|
-
'
|
|
40
|
-
'@
|
|
41
|
-
eslint: '^
|
|
42
|
-
prettier: '^3.
|
|
43
|
-
'ts-jest': '^29.
|
|
44
|
-
jest: '^
|
|
45
|
-
supertest: '^
|
|
46
|
-
tsx: '^4.
|
|
47
|
-
typescript: '^5.
|
|
48
|
-
prisma: '^5.
|
|
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
|
|
61
|
-
'lint:fix': 'eslint src --
|
|
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',
|
package/src/generators/prisma.ts
CHANGED
|
@@ -52,7 +52,12 @@ model User {
|
|
|
52
52
|
`;
|
|
53
53
|
|
|
54
54
|
if (config.includeAuth) {
|
|
55
|
-
schema += ` password
|
|
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
|
|