-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update scaffolding for project
- Loading branch information
Showing
10 changed files
with
347 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { nodeExternalsPlugin } = require('esbuild-node-externals') | ||
|
||
require('esbuild') | ||
.build({ | ||
entryPoints: ['app.ts'], | ||
bundle: true, | ||
outfile: 'dist/index.js', | ||
platform: 'node', | ||
plugins: [ | ||
nodeExternalsPlugin({ | ||
dependencies: false, | ||
}), | ||
], | ||
external: ['cors', 'kcors'], | ||
}) | ||
.catch(err => { | ||
console.log(err) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum ENVS { | ||
DEVELOPMENT = 'DEVELOPMENT', | ||
STAGING = 'STAGING', | ||
PRODUCTION = 'PRODUCTION', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ | |
"description": "The best practice of building Koa2 with TypeScript", | ||
"main": "app.ts", | ||
"scripts": { | ||
"dev": "export NODE_ENV=development; nodemon --config nodemon.json", | ||
"dev": "export NODE_ENV=development; ts-node-dev -r tsconfig-paths/register app.ts", | ||
"dev:db": "docker compose -f docker-compose.yml up -d", | ||
"prettier": "prettier --write '**/*.{js,ts}'", | ||
"test": "jest --config .jest.config.js --no-cache --detectOpenHandles", | ||
"prod:build": "bash ./build.sh", | ||
"prod:start": "prisma generate && prisma migrate deploy && export NODE_ENV=production; node ./releases/app.js" | ||
"prod:build": "node ./build.js", | ||
"prod:start": "prisma generate && prisma migrate deploy && export NODE_ENV=production; node ./dist/index.js" | ||
}, | ||
"author": "unix ([email protected])", | ||
"bugs": { | ||
|
@@ -27,17 +27,16 @@ | |
"@types/koa": "^2.13.4", | ||
"@types/koa-bodyparser": "^4.3.5", | ||
"@types/node": "^17.0.8", | ||
"esbuild": "^0.14.11", | ||
"esbuild-node-externals": "^1.4.1", | ||
"jest": "^26.6.3", | ||
"nodemon": "^2.0.15", | ||
"prettier": "^2.5.1", | ||
"prisma": "^3.8.1", | ||
"supertest": "^4.0.2", | ||
"ts-jest": "^26.5.3", | ||
"ts-node": "^10.4.0", | ||
"ts-node-dev": "^1.1.8", | ||
"tsconfig-paths": "^3.12.0", | ||
"ttypescript": "^1.5.13", | ||
"typescript": "^4.5.4", | ||
"typescript-transform-paths": "^3.3.1" | ||
"typescript": "^4.5.4" | ||
}, | ||
"dependencies": { | ||
"@prisma/client": "^3.8.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.