Skip to content

Instantly share code, notes, and snippets.

@shaolinjr
Created December 8, 2022 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaolinjr/91da164fd78ffeb97366eacbf3157c24 to your computer and use it in GitHub Desktop.
Save shaolinjr/91da164fd78ffeb97366eacbf3157c24 to your computer and use it in GitHub Desktop.
NX project.json to build temporal.io workflow
{
"name": "temporal-worker",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/temporal-worker/src",
"projectType": "application",
"targets": {
"bundle-workflow": {
"executor": "nx:run-commands",
"dependsOn": [],
"options": {
"commands": [
"rm -f apps/temporal-worker/src/workflows/workflow-bundle.js",
"node apps/temporal-worker/src/utils/create-workflow-bundle.js"
],
"parallel": false
},
"configurations": {}
},
"build": {
"executor": "@nrwl/webpack:webpack",
"dependsOn": [
"^build",
"bundle-workflow"
],
"outputs": [
"{options.outputPath}"
],
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/temporal-worker",
"main": "apps/temporal-worker/src/main.ts",
"tsConfig": "apps/temporal-worker/tsconfig.app.json",
"assets": [
"apps/temporal-worker/src/assets"
],
"generatePackageJson": true
},
"configurations": {
"production": {
"optimization": false,
"extractLicenses": true,
"inspect": false,
"fileReplacements": [
{
"replace": "apps/temporal-worker/src/environments/environment.ts",
"with": "apps/temporal-worker/src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"executor": "@nrwl/js:node",
"dependsOn": [
"build"
],
"options": {
"buildTarget": "temporal-worker:build"
},
"configurations": {
"production": {
"buildTarget": "temporal-worker:build:production"
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": [
"apps/temporal-worker/**/*.ts"
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "apps/temporal-worker/jest.config.ts",
"passWithNoTests": true
}
}
},
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment