{
  "name": "monolith",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "humand-packages/monolith/src",
  "projectType": "application",
  "targets": {
    "build-proto": {
      "cache": true,
      "executor": "nx:run-commands",
      "options": {
        "command": "./build-proto.sh",
        "cwd": "humand-packages/monolith"
      },
      "inputs": [
        "sharedWorkspace",
        "{projectRoot}/src/protos/**/*.proto",
        "{projectRoot}/src/proto/**/*.proto",
        "{projectRoot}/package.json"
      ],
      "outputs": [
        "{projectRoot}/src/api/grpc/generated/exposed",
        "{projectRoot}/src/api/grpc/generated/external"
      ]
    },
    "build": {
      "cache": false,
      "executor": "@nx/js:tsc",
      "outputs": [
        "{options.outputPath}"
      ],
      "options": {
        "outputPath": "{projectRoot}/build",
        "outputFileName": "index.js",
        "rootDir": "{projectRoot}/src/api",
        "main": "{projectRoot}/src/api/index.ts",
        "tsConfig": "{projectRoot}/tsconfig.prd.json",
        "assets": [
          {
            "glob": "**/*.mustache",
            "input": "{projectRoot}/src/api/services/html/adapters",
            "output": "services/html/adapters"
          },
          {
            "glob": "**/*.mustache",
            "input": "{projectRoot}/src/api/modules/learningCertificates/business/templates",
            "output": "modules/learningCertificates/business/templates"
          },
          {
            "glob": "*.html",
            "input": "{projectRoot}/src/api/helpers/emailBuilder/components",
            "output": "helpers/emailBuilder/components"
          },
          {
            "glob": "**/*",
            "input": "{projectRoot}/src/api/assets",
            "output": "assets"
          }
        ],
        "generatePackageJson": false
      },
      "dependsOn": [
        "common:build",
        "app-ratings:build",
        "scheduled-actions:build",
        "community-features:build",
        "migrations-runner:build",
        "build-proto"
      ],
      "inputs": [
        "shared",
        "{projectRoot}/src/api/**/*",
        "{projectRoot}/tsconfig.prd.json",
        "{projectRoot}/tsconfig.json",
        "{projectRoot}/package.json"
      ]
    },
    "build:watch": {
      "executor": "@nx/js:tsc",
      "options": {
        "outputPath": "{projectRoot}/build",
        "rootDir": "{projectRoot}/src/api",
        "main": "{projectRoot}/src/api/index.ts",
        "tsConfig": "{projectRoot}/tsconfig.prd.json",
        "assets": [
          {
            "glob": "**/*.mustache",
            "input": "{projectRoot}/src/api/services/html/adapters/emails",
            "output": "services/html/adapters/emails"
          },
          {
            "glob": "**/*.mustache",
            "input": "{projectRoot}/src/api/modules/learningCertificates/business/templates",
            "output": "modules/learningCertificates/business/templates"
          },
          {
            "glob": "*.html",
            "input": "{projectRoot}/src/api/helpers/emailBuilder/components",
            "output": "helpers/emailBuilder/components"
          },
          {
            "glob": "**/*",
            "input": "{projectRoot}/src/api/assets",
            "output": "assets"
          }
        ],
        "generatePackageJson": false,
        "watch": true
      },
      "dependsOn": [
        "build-proto"
      ]
    },
    "serve": {
      "executor": "@nx/js:node",
      "options": {
        "buildTarget": "monolith:build",
        "host": "0.0.0.0"
      }
    },
    "check-i18n-keys": {
      "cache": true,
      "executor": "nx:run-commands",
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm i18n-check --locales src/api/modules/**/presentation/i18n -s es -f i18next -o missingKeys"
      },
      "inputs": [
        "sharedWorkspace",
        "{projectRoot}/src/api/modules/**/presentation/i18n/**/*",
        "{projectRoot}/package.json"
      ]
    },
    "lint:postman": {
      "cache": true,
      "executor": "nx:run-commands",
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm eslint ./postman"
      },
      "inputs": [
        "sharedWorkspace",
        "{projectRoot}/postman/**/*",
        "{projectRoot}/eslint.config.js",
        "{projectRoot}/package.json"
      ]
    },
    "lint": {
      "cache": false,
      "executor": "nx:run-commands",
      "dependsOn": [
        "check-i18n-keys",
        "lint:postman",
        "build-proto"
      ],
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm eslint ./src/api"
      },
      "inputs": [
        "shared",
        "{projectRoot}/src/api/**/*",
        "{projectRoot}/eslint.config.js",
        "{projectRoot}/package.json",
        "{projectRoot}/tsconfig.json"
      ]
    },
    "lint:pre-commit": {
      "executor": "nx:run-commands",
      "dependsOn": [],
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm eslint"
      },
      "inputs": [
        "shared",
        "{projectRoot}/src/api/**/*",
        "{projectRoot}/eslint.config.js",
        "{projectRoot}/package.json",
        "{projectRoot}/tsconfig.json"
      ]
    },
    "test-all": {
      "cache": false,
      "executor": "nx:run-commands",
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm run test"
      },
      "dependsOn": [
        "common:build",
        "app-ratings:build",
        "scheduled-actions:build",
        "community-features:build",
        "build-proto"
      ],
      "inputs": [
        "shared",
        "{projectRoot}/test/**/*",
        "{projectRoot}/src/**/*",
        "{projectRoot}/package.json",
        "{projectRoot}/tsconfig.test.json",
        "{projectRoot}/jest.config.js"
      ]
    },
    "test-integration-all": {
      "executor": "nx:run-commands",
      "cache": false,
      "options": {
        "cwd": "humand-packages/monolith",
        "command": "pnpm run test-integration"
      },
      "dependsOn": [
        "common:build",
        "app-ratings:build",
        "scheduled-actions:build",
        "community-features:build",
        "migrations-runner:build",
        "build-proto"
      ],
      "inputs": [
        "shared",
        "{projectRoot}/test-integration/**/*",
        "{projectRoot}/src/**/*",
        "{projectRoot}/package.json",
        "{projectRoot}/tsconfig.test.json",
        "{projectRoot}/jest.config.js"
      ]
    }
  },
  "tags": [
    "scope:monolith"
  ]
}