Skip to content

Commit

Permalink
Add prisma migrations to server build output
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed May 23, 2024
1 parent cc4851d commit 68ab170
Showing 1 changed file with 105 additions and 89 deletions.
194 changes: 105 additions & 89 deletions apps/server-asset-sg/project.json
Original file line number Diff line number Diff line change
@@ -1,94 +1,110 @@
{
"name": "server-asset-sg",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/server-asset-sg/src",
"projectType": "application",
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"parallel": false,
"commands": [
{
"command": "npx nx run server-asset-sg:gen-prisma-client"
},
{
"command": "npx nx run server-asset-sg:build-app:production"
},
{
"command": "npx shx cp apps/server-asset-sg/docker/* dist/apps/server-asset-sg"
},
{
"command": "npx shx cp ./apps/server-asset-sg/src/app/prisma/schema.prisma dist/apps/server-asset-sg"
},
{
"command": "npx shx sed -i \"s/(\\.\\.\\/)*node_modules/\\.\\/node_modules/g\" dist/apps/server-asset-sg/schema.prisma"
}
]
}
},
"build-app": {
"executor": "@nrwl/webpack:webpack",
"outputs": ["{options.outputPath}"],
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/server-asset-sg",
"main": "apps/server-asset-sg/src/main.ts",
"tsConfig": "apps/server-asset-sg/tsconfig.app.json",
"assets": ["apps/server-asset-sg/src/assets"],
"externalDependencies": "all",
"generatePackageJson": true
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/server-asset-sg/src/environments/environment.ts",
"with": "apps/server-asset-sg/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/js:node",
"options": {
"buildTarget": "server-asset-sg:build-app"
},
"configurations": {
"production": {
"buildTarget": "server-asset-sg:build-app:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/server-asset-sg/**/*.ts"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/server-asset-sg/jest.config.ts",
"passWithNoTests": true,
"codeCoverage": true
}
},
"gen-prisma-client": {
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "npx prisma generate --schema ./src/app/prisma/schema.prisma",
"cwd": "apps/server-asset-sg"
"name": "server-asset-sg",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/server-asset-sg/src",
"projectType": "application",
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"parallel": false,
"commands": [
{
"command": "npx nx run server-asset-sg:gen-prisma-client"
},
{
"command": "npx nx run server-asset-sg:build-app"
},
{
"command": "npx shx cp apps/server-asset-sg/docker/* dist/apps/server-asset-sg"
},
{
"command": "npx shx mkdir dist/apps/server-asset-sg/prisma"
},
{
"command": "npx shx cp ./apps/server-asset-sg/src/app/prisma/schema.prisma dist/apps/server-asset-sg/prisma/"
},
{
"command": "npx shx cp -R ./apps/server-asset-sg/src/app/prisma/migrations dist/apps/server-asset-sg/prisma/"
},
{
"command": "npx shx sed -i \"s/(\\.\\.\\/)*node_modules/\\.\\/node_modules/g\" dist/apps/server-asset-sg/prisma/schema.prisma"
}
]
}
},
"build-app": {
"executor": "@nrwl/webpack:webpack",
"outputs": [
"{options.outputPath}"
],
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/server-asset-sg",
"main": "apps/server-asset-sg/src/main.ts",
"tsConfig": "apps/server-asset-sg/tsconfig.app.json",
"assets": [
"apps/server-asset-sg/src/assets"
],
"externalDependencies": "all",
"generatePackageJson": true
},
"configurations": {
"production": {
"optimization": true,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/server-asset-sg/src/environments/environment.ts",
"with": "apps/server-asset-sg/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/js:node",
"options": {
"buildTarget": "server-asset-sg:build-app"
},
"configurations": {
"production": {
"buildTarget": "server-asset-sg:build-app:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": [
"apps/server-asset-sg/**/*.ts"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "apps/server-asset-sg/jest.config.ts",
"passWithNoTests": true,
"codeCoverage": true
}
},
"tags": []
"gen-prisma-client": {
"executor": "nx:run-commands",
"outputs": [],
"options": {
"command": "npx prisma generate --schema ./src/app/prisma/schema.prisma",
"cwd": "apps/server-asset-sg"
}
}
},
"tags": []
}

0 comments on commit 68ab170

Please sign in to comment.