Каркас api: NestJS со сборкой через webpack, health-контроллер с версией и статусом БД, Dockerfile, тесты Vitest и e2e-тесты на Jest.
203 lines
5.9 KiB
JSON
203 lines
5.9 KiB
JSON
{
|
|
"name": "api",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"sourceRoot": "apps/api/src",
|
|
"projectType": "application",
|
|
"tags": [],
|
|
"targets": {
|
|
"build": {
|
|
"executor": "nx:run-commands",
|
|
"dependsOn": [
|
|
"db-migrations-list"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/dist"
|
|
],
|
|
"options": {
|
|
"commands": [
|
|
"webpack-cli build",
|
|
"webpack-cli build --config webpack.data-source.config.js"
|
|
],
|
|
"parallel": false,
|
|
"args": [
|
|
"--node-env=production"
|
|
],
|
|
"cwd": "apps/api"
|
|
},
|
|
"configurations": {
|
|
"development": {
|
|
"args": [
|
|
"--node-env=development"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"typecheck": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "tsc --noEmit -p tsconfig.spec.json",
|
|
"cwd": "apps/api"
|
|
}
|
|
},
|
|
"lint": {
|
|
"executor": "@nx/eslint:lint",
|
|
"options": {
|
|
"lintFilePatterns": [
|
|
"{projectRoot}/**/*.ts"
|
|
],
|
|
"eslintConfig": "{projectRoot}/eslint.config.mjs",
|
|
"fix": true
|
|
}
|
|
},
|
|
"lint-check": {
|
|
"executor": "@nx/eslint:lint",
|
|
"options": {
|
|
"lintFilePatterns": [
|
|
"{projectRoot}/**/*.ts"
|
|
],
|
|
"eslintConfig": "{projectRoot}/eslint.config.mjs"
|
|
}
|
|
},
|
|
"format": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "prettier --write {projectRoot}"
|
|
}
|
|
},
|
|
"format-check": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "prettier --check {projectRoot}"
|
|
}
|
|
},
|
|
"serve": {
|
|
"continuous": true,
|
|
"executor": "@nx/js:node",
|
|
"defaultConfiguration": "development",
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"options": {
|
|
"buildTarget": "api:build",
|
|
"runBuildTargetDependencies": false
|
|
},
|
|
"configurations": {
|
|
"development": {
|
|
"buildTarget": "api:build:development"
|
|
},
|
|
"production": {
|
|
"buildTarget": "api:build:production"
|
|
}
|
|
}
|
|
},
|
|
"prune-lockfile": {
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"cache": true,
|
|
"executor": "@nx/js:prune-lockfile",
|
|
"outputs": [
|
|
"{workspaceRoot}/apps/api/dist/package.json",
|
|
"{workspaceRoot}/apps/api/dist/yarn.lock"
|
|
],
|
|
"options": {
|
|
"buildTarget": "build"
|
|
}
|
|
},
|
|
"copy-workspace-modules": {
|
|
"dependsOn": [
|
|
"build"
|
|
],
|
|
"cache": true,
|
|
"outputs": [
|
|
"{workspaceRoot}/apps/api/dist/workspace_modules"
|
|
],
|
|
"executor": "@nx/js:copy-workspace-modules",
|
|
"options": {
|
|
"buildTarget": "build"
|
|
}
|
|
},
|
|
"prune": {
|
|
"dependsOn": [
|
|
"prune-lockfile",
|
|
"copy-workspace-modules"
|
|
],
|
|
"executor": "nx:noop"
|
|
},
|
|
"db-migrations-list": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "ts-node",
|
|
"args": [
|
|
"--transpile-only",
|
|
"tools/buildDataSource.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-show": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "typeorm-ts-node-commonjs",
|
|
"args": [
|
|
"migration:show",
|
|
"--dataSource=apps/api/src/config/typeorm.config.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-migrate": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "typeorm-ts-node-commonjs",
|
|
"args": [
|
|
"migration:run",
|
|
"--dataSource=apps/api/src/config/typeorm.config.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-revert": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "typeorm-ts-node-commonjs",
|
|
"args": [
|
|
"migration:revert",
|
|
"--dataSource=apps/api/src/config/typeorm.config.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-drop": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "typeorm-ts-node-commonjs",
|
|
"args": [
|
|
"schema:drop",
|
|
"--dataSource=apps/api/src/config/typeorm.config.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-snapshot": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "ts-node",
|
|
"args": [
|
|
"tools/dbSnapshot.ts"
|
|
]
|
|
}
|
|
},
|
|
"db-restore": {
|
|
"executor": "nx:run-commands",
|
|
"options": {
|
|
"command": "ts-node",
|
|
"args": [
|
|
"tools/dbRestore.ts"
|
|
]
|
|
}
|
|
},
|
|
"test": {
|
|
"executor": "@nx/vitest:test",
|
|
"options": {
|
|
"configFile": "apps/api/vitest.config.ts"
|
|
}
|
|
}
|
|
}
|
|
}
|