Skip to content

Commit

Permalink
feat: provide json schema for nx.json
Browse files Browse the repository at this point in the history
  • Loading branch information
puku0x committed Dec 5, 2021
1 parent a20805b commit 81be231
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/vscode/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"tsConfig": "apps/vscode/tsconfig.app.json",
"assets": [
"apps/vscode/src/package.json",
"apps/vscode/src/nx-schema.json",
"apps/vscode/src/tree-view-icon.svg",
"apps/vscode/src/assets",
"apps/vscode/src/getting-started",
Expand Down
126 changes: 126 additions & 0 deletions apps/vscode/src/nx-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"title": "JSON schema for Nx configuration",
"id": "https://nx.dev/core-concepts/configuration#nxjson",
"type": "object",
"properties": {
"implicitDependencies": {
"type": "object",
"description": "Map of files to projects that implicitly depend on them."
},
"affected": {
"type": "object",
"description": "Default options for `nx affected`.",
"properties": {
"defaultBase": {
"type": "string",
"description": "Default based branch used by affected commands."
}
},
"additionalProperties": false
},
"npmScope": {
"type": "string",
"description": "NPM Scope that the workspace uses."
},
"tasksRunnerOptions": {
"additionalProperties": {
"$ref": "#/definitions/tasksRunnerOptions"
}
},
"targetDependencies": {
"type": "object",
"description": "Dependencies between different target names across all projects.",
"additionalProperties": {
"$ref": "#/definitions/targetDependencyConfig"
}
},
"workspaceLayout": {
"type": "object",
"description": "Where new apps + libs should be placed.",
"properties": {
"libsDir": {
"type": "string",
"description": "Default folder name for libs."
},
"appsDir": {
"type": "string",
"description": "Default folder name for apps."
}
},
"additionalProperties": false
},
"cli": {
"$ref": "#/definitions/cliOptions"
},
"generators": {
"$ref": "#/definitions/generatorOptions"
},
"plugins": {
"type": "array",
"description": "Plugins for extending the project graph.",
"items": {
"type": "string"
}
},
"defaultProject": {
"type": "string",
"description": "Default project. When project isn't provided, the default project will be used."
}
},
"definitions": {
"cliOptions": {
"type": "object",
"description": "Default generator collection.",
"properties": {
"packageManager": {
"type": "string",
"description": "The default package manager to use.",
"enum": ["yarn", "pnpm", "npm"]
},
"defaultCollection": {
"type": "string",
"description": "The default schematics collection to use."
}
},
"additionalProperties": false
},
"generatorOptions": {
"type": "object",
"description": "List of default values used by generators."
},
"tasksRunnerOptions": {
"type": "object",
"description": "Available Task Runners.",
"properties": {
"runner": {
"type": "string",
"description": "Path to resolve the runner."
},
"options": {
"type": "object",
"description": "Default options for the runner."
}
},
"additionalProperties": false
},
"targetDependencyConfig": {
"type": "array",
"description": "Target dependency.",
"items": {
"type": "object",
"properties": {
"projects": {
"type": "string",
"description": "The projects that the targets belong to.",
"enum": ["self", "dependencies"]
},
"target": {
"type": "string",
"description": "The name of the target."
}
},
"additionalProperties": false
}
}
}
}
4 changes: 4 additions & 0 deletions apps/vscode/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,10 @@
{
"fileMatch": "project.json",
"url": "./project-schema.json"
},
{
"fileMatch": "nx.json",
"url": "./nx-schema.json"
}
]
}
Expand Down

0 comments on commit 81be231

Please sign in to comment.