express-generator-typescript 2.7.1 → 2.7.3

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.
Files changed (36) hide show
  1. package/LICENSE +21 -21
  2. package/README-npm +20 -0
  3. package/README.md +85 -20
  4. package/lib/project-files/README.md +65 -65
  5. package/lib/project-files/config.ts +22 -22
  6. package/lib/project-files/eslint.config.ts +95 -95
  7. package/lib/project-files/package.json +58 -58
  8. package/lib/project-files/src/common/constants/ENV.ts +21 -21
  9. package/lib/project-files/src/common/constants/HttpStatusCodes.ts +391 -391
  10. package/lib/project-files/src/common/constants/Paths.ts +11 -11
  11. package/lib/project-files/src/common/constants/index.ts +11 -11
  12. package/lib/project-files/src/common/util/route-errors.ts +37 -37
  13. package/lib/project-files/src/common/util/validators.ts +22 -22
  14. package/lib/project-files/src/index.ts +17 -4
  15. package/lib/project-files/src/models/User.ts +4 -4
  16. package/lib/project-files/src/models/common/types/index.ts +5 -5
  17. package/lib/project-files/src/public/scripts/http.js +26 -26
  18. package/lib/project-files/src/public/scripts/users.js +141 -141
  19. package/lib/project-files/src/public/stylesheets/users.css +48 -48
  20. package/lib/project-files/src/repos/MockOrm.ts +62 -62
  21. package/lib/project-files/src/repos/database.json +1 -1
  22. package/lib/project-files/src/repos/database.test.json +1 -22
  23. package/lib/project-files/src/routes/common/types/index.ts +11 -11
  24. package/lib/project-files/src/routes/common/util/index.ts +18 -18
  25. package/lib/project-files/src/routes/index.ts +33 -33
  26. package/lib/project-files/src/services/UserService.ts +73 -73
  27. package/lib/project-files/src/views/users.html +132 -132
  28. package/lib/project-files/tests/common/Paths.ts +5 -5
  29. package/lib/project-files/tests/common/types/index.ts +16 -16
  30. package/lib/project-files/tests/common/util/index.ts +38 -38
  31. package/lib/project-files/tests/support/setup.ts +26 -26
  32. package/lib/project-files/tsconfig.json +1 -1
  33. package/lib/project-files/tsconfig.prod.json +30 -30
  34. package/lib/project-files/{vitest.config.ts → vitest.config.mts} +18 -18
  35. package/package.json +1 -1
  36. package/README-git +0 -95
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Sean Maxwell
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Sean Maxwell
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README-npm ADDED
@@ -0,0 +1,20 @@
1
+ <img alt='overnightjs' src='https://github.com/seanpmaxwell/express-generator-typescript/raw/master/express-typescript.png' border='0'>
2
+
3
+ [Express](https://www.npmjs.com/package/express) with [TypeScript's](https://www.npmjs.com/package/typescript) application generator.
4
+
5
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/v/express-generator-typescript.svg" alt="NPM Version" /></a>
6
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/l/express-generator-typescript.svg" alt="Package License" /></a>
7
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/dm/express-generator-typescript.svg" alt="NPM Downloads" /></a>
8
+
9
+
10
+ ## What is it?
11
+
12
+ Creates a new express application similar to the _express-generator_ module. Except this new application is configured to use TypeScript instead of plain JavaScript.
13
+
14
+ This project complies with Typescript best practices listed <a href="https://github.com/seanpmaxwell/Typescript-Best-Practices/blob/main/README.md">here</a>.
15
+ <br/>
16
+
17
+
18
+ ## Documenation
19
+
20
+ Please refer to the official <a href="https://github.com/seanpmaxwell/express-generator-typescript">github repo</a> for the most up-to-date documentation.
package/README.md CHANGED
@@ -1,20 +1,85 @@
1
- <img alt='overnightjs' src='https://github.com/seanpmaxwell/express-generator-typescript/raw/master/express-typescript.png' border='0'>
2
-
3
- [Express](https://www.npmjs.com/package/express) with [TypeScript's](https://www.npmjs.com/package/typescript) application generator.
4
-
5
- <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/v/express-generator-typescript.svg" alt="NPM Version" /></a>
6
- <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/l/express-generator-typescript.svg" alt="Package License" /></a>
7
- <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/dm/express-generator-typescript.svg" alt="NPM Downloads" /></a>
8
-
9
-
10
- ## What is it?
11
-
12
- Creates a new express application similar to the _express-generator_ module. Except this new application is configured to use TypeScript instead of plain JavaScript.
13
-
14
- This project complies with Typescript best practices listed <a href="https://github.com/seanpmaxwell/Typescript-Best-Practices/blob/main/README.md">here</a>.
15
- <br/>
16
-
17
-
18
- ## Documenation
19
-
20
- Please refer to the official <a href="https://github.com/seanpmaxwell/express-generator-typescript">github repo</a> for the most up-to-date documentation.
1
+ <img alt='overnightjs' src='https://github.com/seanpmaxwell/express-generator-typescript/raw/master/express-typescript.png' border='0'>
2
+
3
+ [Express](https://www.npmjs.com/package/express) with [TypeScript's](https://www.npmjs.com/package/typescript) application generator.
4
+
5
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/v/express-generator-typescript.svg" alt="NPM Version" /></a>
6
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/l/express-generator-typescript.svg" alt="Package License" /></a>
7
+ <a href="https://www.npmjs.com/package/express-generator-typescript" target="_blank"><img src="https://img.shields.io/npm/dm/express-generator-typescript.svg" alt="NPM Downloads" /></a>
8
+
9
+
10
+ ## What is it?
11
+
12
+ Creates a new express application similar to the _express-generator_ module. Except this new application is configured to use TypeScript instead of plain JavaScript.
13
+
14
+ This project complies with Typescript best practices listed <a href="https://github.com/seanpmaxwell/Typescript-Best-Practices/blob/main/README.md">here</a>.
15
+
16
+
17
+ ## Why express-generator-typescript?
18
+
19
+ NodeJS is great for the rapid development of web-projects, but is often neglected because of the lack of type safety. TypeScript solves this issue and (along with its linter file) can even make your code more robust than some other static languages like Java.
20
+
21
+ There are some other tools out there to generate express apps with TypeScript such as _express-generator-ts_, but these either haven't been updated in a while or install a lot of junk in your project (such as an ORM).
22
+
23
+ Due to the heavy use of single-page-applications, no view-engine is configured by default. Express is only setup with the minimal settings for calling APIs and serving an index.html file. All the tools you need to run for development (while restarting on changes), building, testing, and running for production are packaged with this library.
24
+
25
+ In addition, relative paths are also setup, so you don't have to go through the trouble of installing and configuring _tsconfig-paths_ and _module-alias_. Just make sure to update `paths` in _tsconfig.json_ and `_moduleAliases` in _preload.js_ if you want to add/edit the relative paths.
26
+
27
+
28
+ ## Sample-project
29
+
30
+ When you run _express-generator-typescript_, it sets up a simple application with routes for adding, updating, deleting, and fetching user objects. This is just to demonstrate how routing is done with express.
31
+
32
+ ### `--with-auth` option no longer available for version 2.5+
33
+
34
+ For the command-line, you used to be able to pass the `--with-auth` option to generate an app which required a login before using the routes; however, maintaining two separate projects became quite cumbersome. If you want an example of how to do authentication in expressjs with json-web-tokens you can refer to this sample project <a href="https://github.com/seanpmaxwell/express-jsonwebtoken-demo">here</a>.
35
+
36
+
37
+ ## Installation
38
+
39
+ ```sh
40
+ $ Just use 'npx'
41
+ Or
42
+ $ npm install -g express-generator-typescript
43
+ ```
44
+
45
+
46
+ ## Quick Start
47
+
48
+ The quickest way to get started is use npx and pass in the name of the project you want to create. If you don't specify a project name, the default _express-gen-ts_ will be used instead. If you want to use `yarn` instead of `npm`, pass the option `--use-yarn`.
49
+
50
+ Create the app:<br/>
51
+ With no options: `$ npx express-generator-typescript`<br/>
52
+ With all options (order doesn't matter): `$ npx express-generator-typescript --use-yarn "project name"`
53
+
54
+
55
+ Start your express-generator-typescript app in development mode at `http://localhost:3000/`:
56
+
57
+ ```bash
58
+ $ cd "project name" && npm run dev
59
+ ```
60
+
61
+
62
+ ## Available commands for the server.
63
+
64
+ - Run the server in development mode: `npm run dev` or `npm run dev:hot`.
65
+ - Run all unit-tests: `npm run test` or `npm run test:hot`.
66
+ - Run a single unit-test: `npm run test -- "name of test file" (i.e. users.test.ts)`.
67
+ - Check for linting errors: `npm run lint`.
68
+ - Build the project for production: `npm run build`.
69
+ - Run the production build: `npm start`.
70
+ - Check for typescript errors: `npm run type-check`.
71
+
72
+
73
+ ## Debugging
74
+
75
+ During development, _express-generator-typescript_ uses `nodemon` to restart the server when changes are detected. If you want to enable debugging for node, you'll need to modify the nodemon configurations. This is located under `nodemonConfig:` in `package.json` for the server and `./spec/nodemon.json` for unit-testing. For the `exec` property, replace `ts-node` with `node --inspect -r ts-node/register`.
76
+
77
+ <br/>
78
+
79
+
80
+ Happy web deving :)
81
+
82
+
83
+ ## License
84
+
85
+ [MIT](LICENSE)
@@ -1,65 +1,65 @@
1
- ## About
2
-
3
- This project was created with [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript).
4
-
5
- **IMPORTANT** for demo purposes I had to disable `helmet` in production. In any real world app you should change these 3 lines of code in `src/server.ts`:
6
- ```ts
7
- // eslint-disable-next-line n/no-process-env
8
- if (!process.env.DISABLE_HELMET) {
9
- app.use(helmet());
10
- }
11
- ```
12
-
13
- To just this:
14
- ```ts
15
- app.use(helmet());
16
- ```
17
-
18
-
19
- ## Available Scripts
20
-
21
- ### `npm run clean-install`
22
-
23
- Remove the existing `node_modules/` folder, `package-lock.json`, and reinstall all library modules.
24
-
25
-
26
- ### `npm run dev` or `npm run dev:hot` (hot reloading)
27
-
28
- Run the server in development mode.<br/>
29
-
30
- **IMPORTANT** development mode uses `swc` for performance reasons which DOES NOT check for typescript errors. Run `npm run type-check` to check for type errors. NOTE: you should use your IDE to prevent most type errors.
31
-
32
-
33
- ### `npm test` or `npm run test:hot` (hot reloading)
34
-
35
- Run all unit-tests.
36
-
37
-
38
- ### `npm test -- "name of test file" (i.e. users).`
39
-
40
- Run a single unit-test.
41
-
42
-
43
- ### `npm run lint`
44
-
45
- Check for linting errors.
46
-
47
-
48
- ### `npm run build`
49
-
50
- Build the project for production.
51
-
52
-
53
- ### `npm start`
54
-
55
- Run the production build (Must be built first).
56
-
57
-
58
- ### `npm run type-check`
59
-
60
- Check for typescript errors.
61
-
62
-
63
- ## Additional Notes
64
-
65
- - If `npm run dev` gives you issues with bcrypt on MacOS you may need to run: `npm rebuild bcrypt --build-from-source`.
1
+ ## About
2
+
3
+ This project was created with [express-generator-typescript](https://github.com/seanpmaxwell/express-generator-typescript).
4
+
5
+ **IMPORTANT** for demo purposes I had to disable `helmet` in production. In any real world app you should change these 3 lines of code in `src/server.ts`:
6
+ ```ts
7
+ // eslint-disable-next-line n/no-process-env
8
+ if (!process.env.DISABLE_HELMET) {
9
+ app.use(helmet());
10
+ }
11
+ ```
12
+
13
+ To just this:
14
+ ```ts
15
+ app.use(helmet());
16
+ ```
17
+
18
+
19
+ ## Available Scripts
20
+
21
+ ### `npm run clean-install`
22
+
23
+ Remove the existing `node_modules/` folder, `package-lock.json`, and reinstall all library modules.
24
+
25
+
26
+ ### `npm run dev` or `npm run dev:hot` (hot reloading)
27
+
28
+ Run the server in development mode.<br/>
29
+
30
+ **IMPORTANT** development mode uses `swc` for performance reasons which DOES NOT check for typescript errors. Run `npm run type-check` to check for type errors. NOTE: you should use your IDE to prevent most type errors.
31
+
32
+
33
+ ### `npm test` or `npm run test:hot` (hot reloading)
34
+
35
+ Run all unit-tests.
36
+
37
+
38
+ ### `npm test -- "name of test file" (i.e. users).`
39
+
40
+ Run a single unit-test.
41
+
42
+
43
+ ### `npm run lint`
44
+
45
+ Check for linting errors.
46
+
47
+
48
+ ### `npm run build`
49
+
50
+ Build the project for production.
51
+
52
+
53
+ ### `npm start`
54
+
55
+ Run the production build (Must be built first).
56
+
57
+
58
+ ### `npm run type-check`
59
+
60
+ Check for typescript errors.
61
+
62
+
63
+ ## Additional Notes
64
+
65
+ - If `npm run dev` gives you issues with bcrypt on MacOS you may need to run: `npm rebuild bcrypt --build-from-source`.
@@ -1,22 +1,22 @@
1
- /* eslint-disable n/no-process-env */
2
-
3
- import path from 'path';
4
- import dotenv from 'dotenv';
5
- import moduleAlias from 'module-alias';
6
-
7
-
8
- // Check the env
9
- const NODE_ENV = (process.env.NODE_ENV ?? 'development');
10
-
11
- // Configure "dotenv"
12
- const result2 = dotenv.config({
13
- path: path.join(__dirname, `./config/.env.${NODE_ENV}`),
14
- });
15
- if (result2.error) {
16
- throw result2.error;
17
- }
18
-
19
- // Configure moduleAlias
20
- if (__filename.endsWith('js')) {
21
- moduleAlias.addAlias('@src', __dirname + '/dist');
22
- }
1
+ /* eslint-disable n/no-process-env */
2
+
3
+ import path from 'path';
4
+ import dotenv from 'dotenv';
5
+ import moduleAlias from 'module-alias';
6
+
7
+
8
+ // Check the env
9
+ const NODE_ENV = (process.env.NODE_ENV ?? 'development');
10
+
11
+ // Configure "dotenv"
12
+ const result2 = dotenv.config({
13
+ path: path.join(__dirname, `./config/.env.${NODE_ENV}`),
14
+ });
15
+ if (result2.error) {
16
+ throw result2.error;
17
+ }
18
+
19
+ // Configure moduleAlias
20
+ if (__filename.endsWith('js')) {
21
+ moduleAlias.addAlias('@src', __dirname + '/dist');
22
+ }
@@ -1,95 +1,95 @@
1
- import eslint from '@eslint/js';
2
- import tseslint from 'typescript-eslint';
3
- import stylisticJs from '@stylistic/eslint-plugin-js';
4
- import stylisticTs from '@stylistic/eslint-plugin-ts';
5
- import nodePlugin from 'eslint-plugin-n';
6
-
7
- export default tseslint.config(
8
- eslint.configs.recommended,
9
- nodePlugin.configs['flat/recommended-script'],
10
- ...tseslint.configs.strictTypeChecked,
11
- ...tseslint.configs.stylisticTypeChecked,
12
- {
13
- ignores: [
14
- '**/node_modules/*',
15
- '**/*.mjs',
16
- '**/*.js',
17
- ],
18
- },
19
- {
20
- languageOptions: {
21
- parserOptions: {
22
- project: './tsconfig.json',
23
- warnOnUnsupportedTypeScriptVersion: false,
24
- },
25
- },
26
- },
27
- {
28
- plugins: {
29
- '@stylistic/js': stylisticJs,
30
- '@stylistic/ts': stylisticTs,
31
- },
32
- },
33
- {
34
- files: ['**/*.ts'],
35
- },
36
- {
37
- rules: {
38
- '@typescript-eslint/explicit-member-accessibility': 'warn',
39
- '@typescript-eslint/no-misused-promises': 0,
40
- '@typescript-eslint/no-floating-promises': 0,
41
- '@typescript-eslint/no-confusing-void-expression': 0,
42
- '@typescript-eslint/no-unnecessary-condition': 0,
43
- '@typescript-eslint/restrict-template-expressions': [
44
- 'error', { allowNumber: true },
45
- ],
46
- '@typescript-eslint/restrict-plus-operands': [
47
- 'warn', { allowNumberAndString: true },
48
- ],
49
- '@typescript-eslint/no-unused-vars': 'warn',
50
- '@typescript-eslint/no-unsafe-enum-comparison': 0,
51
- '@typescript-eslint/no-unnecessary-type-parameters': 0,
52
- '@stylistic/js/no-extra-semi': 'warn',
53
- 'max-len': [
54
- 'warn',
55
- {
56
- 'code': 80,
57
- },
58
- ],
59
- '@stylistic/ts/semi': ['warn', 'always'],
60
- '@stylistic/ts/member-delimiter-style': ['warn', {
61
- 'multiline': {
62
- 'delimiter': 'comma',
63
- 'requireLast': true,
64
- },
65
- 'singleline': {
66
- 'delimiter': 'comma',
67
- 'requireLast': false,
68
- },
69
- 'overrides': {
70
- 'interface': {
71
- 'singleline': {
72
- 'delimiter': 'semi',
73
- 'requireLast': false,
74
- },
75
- 'multiline': {
76
- 'delimiter': 'semi',
77
- 'requireLast': true,
78
- },
79
- },
80
- },
81
- }],
82
- '@typescript-eslint/no-non-null-assertion': 0,
83
- '@typescript-eslint/no-unused-expressions': 'warn',
84
- 'comma-dangle': ['warn', 'always-multiline'],
85
- 'no-console': 1,
86
- 'no-extra-boolean-cast': 0,
87
- 'indent': ['warn', 2],
88
- 'quotes': ['warn', 'single'],
89
- 'n/no-process-env': 1,
90
- 'n/no-missing-import': 0,
91
- 'n/no-unpublished-import': 0,
92
- 'prefer-const': 'warn',
93
- },
94
- },
95
- );
1
+ import eslint from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+ import stylisticJs from '@stylistic/eslint-plugin-js';
4
+ import stylisticTs from '@stylistic/eslint-plugin-ts';
5
+ import nodePlugin from 'eslint-plugin-n';
6
+
7
+ export default tseslint.config(
8
+ eslint.configs.recommended,
9
+ nodePlugin.configs['flat/recommended-script'],
10
+ ...tseslint.configs.strictTypeChecked,
11
+ ...tseslint.configs.stylisticTypeChecked,
12
+ {
13
+ ignores: [
14
+ '**/node_modules/*',
15
+ '**/*.mjs',
16
+ '**/*.js',
17
+ ],
18
+ },
19
+ {
20
+ languageOptions: {
21
+ parserOptions: {
22
+ project: './tsconfig.json',
23
+ warnOnUnsupportedTypeScriptVersion: false,
24
+ },
25
+ },
26
+ },
27
+ {
28
+ plugins: {
29
+ '@stylistic/js': stylisticJs,
30
+ '@stylistic/ts': stylisticTs,
31
+ },
32
+ },
33
+ {
34
+ files: ['**/*.ts'],
35
+ },
36
+ {
37
+ rules: {
38
+ '@typescript-eslint/explicit-member-accessibility': 'warn',
39
+ '@typescript-eslint/no-misused-promises': 0,
40
+ '@typescript-eslint/no-floating-promises': 0,
41
+ '@typescript-eslint/no-confusing-void-expression': 0,
42
+ '@typescript-eslint/no-unnecessary-condition': 0,
43
+ '@typescript-eslint/restrict-template-expressions': [
44
+ 'error', { allowNumber: true },
45
+ ],
46
+ '@typescript-eslint/restrict-plus-operands': [
47
+ 'warn', { allowNumberAndString: true },
48
+ ],
49
+ '@typescript-eslint/no-unused-vars': 'warn',
50
+ '@typescript-eslint/no-unsafe-enum-comparison': 0,
51
+ '@typescript-eslint/no-unnecessary-type-parameters': 0,
52
+ '@stylistic/js/no-extra-semi': 'warn',
53
+ 'max-len': [
54
+ 'warn',
55
+ {
56
+ 'code': 80,
57
+ },
58
+ ],
59
+ '@stylistic/ts/semi': ['warn', 'always'],
60
+ '@stylistic/ts/member-delimiter-style': ['warn', {
61
+ 'multiline': {
62
+ 'delimiter': 'comma',
63
+ 'requireLast': true,
64
+ },
65
+ 'singleline': {
66
+ 'delimiter': 'comma',
67
+ 'requireLast': false,
68
+ },
69
+ 'overrides': {
70
+ 'interface': {
71
+ 'singleline': {
72
+ 'delimiter': 'semi',
73
+ 'requireLast': false,
74
+ },
75
+ 'multiline': {
76
+ 'delimiter': 'semi',
77
+ 'requireLast': true,
78
+ },
79
+ },
80
+ },
81
+ }],
82
+ '@typescript-eslint/no-non-null-assertion': 0,
83
+ '@typescript-eslint/no-unused-expressions': 'warn',
84
+ 'comma-dangle': ['warn', 'always-multiline'],
85
+ 'no-console': 1,
86
+ 'no-extra-boolean-cast': 0,
87
+ 'indent': ['warn', 2],
88
+ 'quotes': ['warn', 'single'],
89
+ 'n/no-process-env': 1,
90
+ 'n/no-missing-import': 0,
91
+ 'n/no-unpublished-import': 0,
92
+ 'prefer-const': 'warn',
93
+ },
94
+ },
95
+ );
@@ -1,58 +1,58 @@
1
- {
2
- "name": "express-typescript-example",
3
- "version": "0.0.0",
4
- "scripts": {
5
- "build": "ts-node ./scripts/build.ts",
6
- "clean-install": "rm -rf ./node_modules && rm -r package-lock.json && npm i",
7
- "dev": "NODE_ENV=development ts-node ./src",
8
- "dev:hot": "nodemon --exec \"npm run dev\" --watch ./src --ext .ts",
9
- "lint": "eslint .",
10
- "start": "NODE_ENV=production node -r ./config.js ./dist",
11
- "test": "NODE_ENV=test vitest",
12
- "type-check": "tsc --noEmit"
13
- },
14
- "engines": {
15
- "node": ">=16.0.0"
16
- },
17
- "dependencies": {
18
- "cookie-parser": "^1.4.7",
19
- "dayjs": "^1.11.13",
20
- "dotenv": "^16.5.0",
21
- "express": "^5.1.0",
22
- "helmet": "^8.1.0",
23
- "inserturlparams": "^2.0.5",
24
- "jet-env": "^1.1.4",
25
- "jet-logger": "^2.0.1",
26
- "jet-paths": "^1.1.0",
27
- "jet-validators": "^1.4.0",
28
- "jsonfile": "^6.1.0",
29
- "module-alias": "^2.2.3",
30
- "morgan": "^1.10.0"
31
- },
32
- "devDependencies": {
33
- "@eslint/js": "^9.25.1",
34
- "@stylistic/eslint-plugin-js": "^4.2.0",
35
- "@stylistic/eslint-plugin-ts": "^4.2.0",
36
- "@swc/core": "^1.11.22",
37
- "@types/cookie-parser": "^1.4.8",
38
- "@types/find": "^0.2.4",
39
- "@types/fs-extra": "^11.0.4",
40
- "@types/jsonfile": "^6.1.4",
41
- "@types/module-alias": "^2.0.4",
42
- "@types/morgan": "^1.9.9",
43
- "@types/node": "^22.14.1",
44
- "@types/supertest": "^6.0.3",
45
- "eslint": "^9.25.1",
46
- "eslint-plugin-n": "^17.17.0",
47
- "find": "^0.3.0",
48
- "fs-extra": "^11.3.0",
49
- "jiti": "^2.4.2",
50
- "nodemon": "^3.1.10",
51
- "supertest": "^7.1.0",
52
- "ts-node": "^10.9.2",
53
- "tsconfig-paths": "^4.2.0",
54
- "typescript": "^5.8.3",
55
- "typescript-eslint": "^8.31.0",
56
- "vitest": "^3.1.2"
57
- }
58
- }
1
+ {
2
+ "name": "express-typescript-example",
3
+ "version": "0.0.0",
4
+ "scripts": {
5
+ "build": "ts-node ./scripts/build.ts",
6
+ "clean-install": "rm -rf ./node_modules && rm -r package-lock.json && npm i",
7
+ "dev": "NODE_ENV=development ts-node ./src",
8
+ "dev:hot": "nodemon --exec \"npm run dev\" --watch ./src --ext .ts",
9
+ "lint": "eslint .",
10
+ "start": "NODE_ENV=production node -r ./config.js ./dist",
11
+ "test": "NODE_ENV=test vitest",
12
+ "type-check": "tsc --noEmit"
13
+ },
14
+ "engines": {
15
+ "node": ">=16.0.0"
16
+ },
17
+ "dependencies": {
18
+ "cookie-parser": "^1.4.7",
19
+ "dayjs": "^1.11.13",
20
+ "dotenv": "^16.5.0",
21
+ "express": "^5.1.0",
22
+ "helmet": "^8.1.0",
23
+ "inserturlparams": "^2.0.5",
24
+ "jet-env": "^1.1.4",
25
+ "jet-logger": "^2.0.1",
26
+ "jet-paths": "^1.1.0",
27
+ "jet-validators": "^1.4.0",
28
+ "jsonfile": "^6.1.0",
29
+ "module-alias": "^2.2.3",
30
+ "morgan": "^1.10.0"
31
+ },
32
+ "devDependencies": {
33
+ "@eslint/js": "^9.25.1",
34
+ "@stylistic/eslint-plugin-js": "^4.2.0",
35
+ "@stylistic/eslint-plugin-ts": "^4.2.0",
36
+ "@swc/core": "^1.11.22",
37
+ "@types/cookie-parser": "^1.4.8",
38
+ "@types/find": "^0.2.4",
39
+ "@types/fs-extra": "^11.0.4",
40
+ "@types/jsonfile": "^6.1.4",
41
+ "@types/module-alias": "^2.0.4",
42
+ "@types/morgan": "^1.9.9",
43
+ "@types/node": "^22.14.1",
44
+ "@types/supertest": "^6.0.3",
45
+ "eslint": "^9.25.1",
46
+ "eslint-plugin-n": "^17.17.0",
47
+ "find": "^0.3.0",
48
+ "fs-extra": "^11.3.0",
49
+ "jiti": "^2.4.2",
50
+ "nodemon": "^3.1.10",
51
+ "supertest": "^7.1.0",
52
+ "ts-node": "^10.9.2",
53
+ "tsconfig-paths": "^4.2.0",
54
+ "typescript": "^5.8.3",
55
+ "typescript-eslint": "^8.31.0",
56
+ "vitest": "^3.1.2"
57
+ }
58
+ }