{
  "title": "Node Library Package Target",
  "description": "Packages a Node library using TypeScript",
  "cli": "nx",
  "type": "object",
  "properties": {
    "main": {
      "type": "string",
      "description": "The name of the main entry-point file."
    },
    "tsConfig": {
      "type": "string",
      "description": "The name of the Typescript configuration file."
    },
    "outputPath": {
      "type": "string",
      "description": "The output path of the generated files."
    },
    "watch": {
      "type": "boolean",
      "description": "Enable re-building when files change.",
      "default": false
    },
    "sourceMap": {
      "type": "boolean",
      "description": "Output sourcemaps.",
      "default": true
    },
    "updateBuildableProjectDepsInPackageJson": {
      "type": "boolean",
      "description": "Update buildable project dependencies in package.json",
      "default": true
    },
    "buildableProjectDepsInPackageJsonType": {
      "type": "string",
      "description": "When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`",
      "enum": ["dependencies", "peerDependencies"],
      "default": "dependencies"
    },
    "assets": {
      "type": "array",
      "description": "List of static library assets.",
      "default": [],
      "items": {
        "$ref": "#/definitions/assetPattern"
      }
    },
    "packageJson": {
      "type": "string",
      "description": "The name of the package.json file"
    },
    "srcRootForCompilationRoot": {
      "type": "string",
      "description": "Sets the rootDir for TypeScript compilation. When not defined, it uses the project's root property"
    }
  },
  "required": ["tsConfig", "main"],

  "definitions": {
    "assetPattern": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "glob": {
              "type": "string",
              "description": "The pattern to match."
            },
            "input": {
              "type": "string",
              "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
            },
            "ignore": {
              "description": "An array of globs to ignore.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "output": {
              "type": "string",
              "description": "Absolute path within the output."
            }
          },
          "additionalProperties": false,
          "required": ["glob", "input", "output"]
        },
        {
          "type": "string"
        }
      ]
    }
  }
}
