469 lines
16 KiB
JSON
469 lines
16 KiB
JSON
{
|
|
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
|
"name": "js",
|
|
"description": "The Nx plugin that provides the best experience for developing JavaScript and TypeScript projects.",
|
|
"root": "/packages/js",
|
|
"source": "/packages/js/src",
|
|
"generators": [
|
|
{
|
|
"name": "library",
|
|
"factory": "./src/generators/library/library#libraryGenerator",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"$id": "NxTypescriptLibrary",
|
|
"cli": "nx",
|
|
"title": "Create a TypeScript Library",
|
|
"description": "Create a TypeScript Library.",
|
|
"type": "object",
|
|
"examples": [
|
|
{
|
|
"command": "nx g lib mylib --directory=myapp",
|
|
"description": "Generate libs/myapp/mylib"
|
|
}
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"description": "Library name.",
|
|
"$default": { "$source": "argv", "index": 0 },
|
|
"x-prompt": "What name would you like to use for the library?",
|
|
"pattern": "^[a-zA-Z].*$"
|
|
},
|
|
"directory": {
|
|
"type": "string",
|
|
"description": "A directory where the lib is placed."
|
|
},
|
|
"linter": {
|
|
"description": "The tool to use for running lint checks.",
|
|
"type": "string",
|
|
"enum": ["eslint", "none"],
|
|
"default": "eslint"
|
|
},
|
|
"unitTestRunner": {
|
|
"type": "string",
|
|
"enum": ["jest", "none"],
|
|
"description": "Test runner to use for unit tests.",
|
|
"default": "jest"
|
|
},
|
|
"tags": {
|
|
"type": "string",
|
|
"description": "Add tags to the library (used for linting)."
|
|
},
|
|
"skipFormat": {
|
|
"description": "Skip formatting files.",
|
|
"type": "boolean",
|
|
"default": false
|
|
},
|
|
"skipTsConfig": {
|
|
"type": "boolean",
|
|
"description": "Do not update tsconfig.json for development experience.",
|
|
"default": false
|
|
},
|
|
"testEnvironment": {
|
|
"type": "string",
|
|
"enum": ["jsdom", "node"],
|
|
"description": "The test environment to use if unitTestRunner is set to jest.",
|
|
"default": "jsdom"
|
|
},
|
|
"importPath": {
|
|
"type": "string",
|
|
"description": "The library name used to import it, like @myorg/my-awesome-lib."
|
|
},
|
|
"pascalCaseFiles": {
|
|
"type": "boolean",
|
|
"description": "Use pascal case file names.",
|
|
"alias": "P",
|
|
"default": false
|
|
},
|
|
"js": {
|
|
"type": "boolean",
|
|
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
"default": false
|
|
},
|
|
"strict": {
|
|
"type": "boolean",
|
|
"description": "Whether to enable tsconfig strict mode or not.",
|
|
"default": true
|
|
},
|
|
"publishable": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Generate a publishable library."
|
|
},
|
|
"buildable": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Generate a buildable library."
|
|
},
|
|
"setParserOptionsProject": {
|
|
"type": "boolean",
|
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
"default": false
|
|
},
|
|
"config": {
|
|
"type": "string",
|
|
"enum": ["workspace", "project", "npm-scripts"],
|
|
"default": "project",
|
|
"description": "Determines whether the project's executors should be configured in `workspace.json`, `project.json` or as npm scripts."
|
|
},
|
|
"compiler": {
|
|
"type": "string",
|
|
"enum": ["tsc", "swc"],
|
|
"default": "tsc",
|
|
"description": "The compiler used by the build and test targets"
|
|
},
|
|
"skipTypeCheck": {
|
|
"type": "boolean",
|
|
"description": "Whether to skip TypeScript type checking for SWC compiler.",
|
|
"default": false
|
|
}
|
|
},
|
|
"required": ["name"],
|
|
"presets": []
|
|
},
|
|
"aliases": ["lib"],
|
|
"x-type": "library",
|
|
"description": "Create a library",
|
|
"implementation": "/packages/js/src/generators/library/library#libraryGenerator.ts",
|
|
"hidden": false,
|
|
"path": "/packages/js/src/generators/library/schema.json"
|
|
},
|
|
{
|
|
"name": "init",
|
|
"factory": "./src/generators/init/init#initGenerator",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"$id": "NxTypescriptInit",
|
|
"cli": "nx",
|
|
"title": "Init nrwl/js",
|
|
"description": "Init generator placeholder for nrwl/js.",
|
|
"presets": []
|
|
},
|
|
"aliases": ["lib"],
|
|
"x-type": "init",
|
|
"description": "Init placeholder.",
|
|
"implementation": "/packages/js/src/generators/init/init#initGenerator.ts",
|
|
"hidden": false,
|
|
"path": "/packages/js/src/generators/init/schema.json"
|
|
},
|
|
{
|
|
"name": "convert-to-swc",
|
|
"factory": "./src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"$id": "NxTypescriptLibrary",
|
|
"cli": "nx",
|
|
"title": "Convert a TSC library to SWC",
|
|
"description": "Convert a TSC library to SWC.",
|
|
"type": "object",
|
|
"examples": [
|
|
{
|
|
"command": "nx g swc mylib",
|
|
"description": "Convert `libs/myapp/mylib` to SWC."
|
|
}
|
|
],
|
|
"properties": {
|
|
"project": {
|
|
"type": "string",
|
|
"description": "Library name.",
|
|
"$default": { "$source": "argv", "index": 0 },
|
|
"x-prompt": "What name would you like to use for the library?",
|
|
"pattern": "^[a-zA-Z].*$"
|
|
},
|
|
"targets": {
|
|
"type": "array",
|
|
"description": "List of targets to convert.",
|
|
"items": { "type": "string", "description": "Target to convert." },
|
|
"default": ["build"]
|
|
}
|
|
},
|
|
"required": ["project"],
|
|
"presets": []
|
|
},
|
|
"aliases": ["swc"],
|
|
"x-type": "library",
|
|
"description": "Convert a TypeScript library to compile with SWC.",
|
|
"implementation": "/packages/js/src/generators/convert-to-swc/convert-to-swc#convertToSwcGenerator.ts",
|
|
"hidden": false,
|
|
"path": "/packages/js/src/generators/convert-to-swc/schema.json"
|
|
}
|
|
],
|
|
"executors": [
|
|
{
|
|
"name": "tsc",
|
|
"implementation": "/packages/js/src/executors/tsc/tsc.impl.ts",
|
|
"schema": {
|
|
"title": "Typescript Build Target",
|
|
"description": "Builds using TypeScript.",
|
|
"cli": "nx",
|
|
"type": "object",
|
|
"properties": {
|
|
"main": {
|
|
"type": "string",
|
|
"description": "The name of the main entry-point file."
|
|
},
|
|
"outputPath": {
|
|
"type": "string",
|
|
"description": "The output path of the generated files."
|
|
},
|
|
"tsConfig": {
|
|
"type": "string",
|
|
"description": "The path to the Typescript configuration file."
|
|
},
|
|
"assets": {
|
|
"type": "array",
|
|
"description": "List of static assets.",
|
|
"default": [],
|
|
"items": {
|
|
"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" }
|
|
]
|
|
}
|
|
},
|
|
"watch": {
|
|
"type": "boolean",
|
|
"description": "Enable re-building when files change.",
|
|
"default": false
|
|
},
|
|
"transformers": {
|
|
"type": "array",
|
|
"description": "List of TypeScript Transformer Plugins.",
|
|
"default": [],
|
|
"items": {
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string" },
|
|
"options": {
|
|
"type": "object",
|
|
"additionalProperties": true
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["name"]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"updateBuildableProjectDepsInPackageJson": {
|
|
"type": "boolean",
|
|
"description": "Whether to update the 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": "peerDependencies"
|
|
}
|
|
},
|
|
"required": ["main", "outputPath", "tsConfig"],
|
|
"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" }
|
|
]
|
|
},
|
|
"transformerPattern": {
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{
|
|
"type": "object",
|
|
"properties": {
|
|
"name": { "type": "string" },
|
|
"options": { "type": "object", "additionalProperties": true }
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["name"]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"presets": []
|
|
},
|
|
"description": "Build a project using TypeScript.",
|
|
"aliases": [],
|
|
"hidden": false,
|
|
"path": "/packages/js/src/executors/tsc/schema.json"
|
|
},
|
|
{
|
|
"name": "swc",
|
|
"implementation": "/packages/js/src/executors/swc/swc.impl.ts",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"cli": "nx",
|
|
"title": "Typescript Build Target",
|
|
"description": "Builds using SWC.",
|
|
"type": "object",
|
|
"properties": {
|
|
"main": {
|
|
"type": "string",
|
|
"description": "The name of the main entry-point file."
|
|
},
|
|
"outputPath": {
|
|
"type": "string",
|
|
"description": "The output path of the generated files."
|
|
},
|
|
"tsConfig": {
|
|
"type": "string",
|
|
"description": "The path to the Typescript configuration file."
|
|
},
|
|
"assets": {
|
|
"type": "array",
|
|
"description": "List of static assets.",
|
|
"default": [],
|
|
"items": {
|
|
"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" }
|
|
]
|
|
}
|
|
},
|
|
"watch": {
|
|
"type": "boolean",
|
|
"description": "Enable re-building when files change.",
|
|
"default": false
|
|
},
|
|
"skipTypeCheck": {
|
|
"type": "boolean",
|
|
"description": "Whether to skip TypeScript type checking.",
|
|
"default": false
|
|
},
|
|
"swcExclude": {
|
|
"type": "array",
|
|
"description": "List of SWC Glob/Regex to be excluded from compilation (https://swc.rs/docs/configuration/compilation#exclude).",
|
|
"default": [
|
|
"./src/**/.*.spec.ts$",
|
|
"./**/.*.spec.ts$",
|
|
"./src/**/jest-setup.ts$",
|
|
"./**/jest-setup.ts$",
|
|
"./**/.*.js$"
|
|
]
|
|
},
|
|
"updateBuildableProjectDepsInPackageJson": {
|
|
"type": "boolean",
|
|
"description": "Whether to update the 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": "peerDependencies"
|
|
}
|
|
},
|
|
"required": ["main", "outputPath", "tsConfig"],
|
|
"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" }
|
|
]
|
|
}
|
|
},
|
|
"presets": []
|
|
},
|
|
"description": "Build a project using SWC.",
|
|
"aliases": [],
|
|
"hidden": false,
|
|
"path": "/packages/js/src/executors/swc/schema.json"
|
|
}
|
|
]
|
|
}
|