Skip to content

Commit

Permalink
feat(core): clean up workspace configuration code
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored and vsavkin committed Jan 24, 2023
1 parent 5ae53c6 commit d7536aa
Show file tree
Hide file tree
Showing 394 changed files with 3,558 additions and 14,524 deletions.
48 changes: 20 additions & 28 deletions docs/generated/devkit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,17 +868,14 @@ Callback to install dependencies only if necessary, no-op otherwise

Adds project configuration to the Nx workspace.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either files.

#### Parameters

| Name | Type | Description |
| :--------------------- | :-------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | the file system tree |
| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/index#projectconfiguration) | project configuration |
| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json |
| Name | Type | Default value | Description |
| :--------------------- | :-------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | `undefined` | the file system tree |
| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/index#projectconfiguration) | `undefined` | project configuration |
| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not |

#### Returns

Expand Down Expand Up @@ -1012,10 +1009,10 @@ Convert an Nx Generator into an Angular Devkit Schematic.

#### Parameters

| Name | Type | Default value | Description |
| :----------------------------- | :---------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------ |
| `generator` | [`Generator`](../../devkit/documents/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |
| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). |
| Name | Type | Default value | Description |
| :----------------------------- | :---------------------------------------------------------- | :------------ | :---------------------------------------------------------- |
| `generator` | [`Generator`](../../devkit/documents/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |
| `skipWritingConfigInOldFormat` | `boolean` | `false` | - |

#### Returns

Expand Down Expand Up @@ -1489,7 +1486,9 @@ Example:

### getWorkspacePath

**getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null`
**getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"`

**`deprecated`** all projects are configured using project.json

#### Parameters

Expand All @@ -1499,7 +1498,7 @@ Example:

#### Returns

`"/angular.json"` \| `"/workspace.json"` \| `null`
`"angular.json"` \| `"workspace.json"`

---

Expand Down Expand Up @@ -1531,6 +1530,8 @@ Runs `npm install` or `yarn install`. It will skip running the install if

Returns if a project has a standalone configuration (project.json).

**`deprecated`** non-standalone projects were deprecated

#### Parameters

| Name | Type | Description |
Expand Down Expand Up @@ -1873,9 +1874,6 @@ Reads nx.json

Reads a project configuration.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will read from either file.

**`throws`** If supplied projectName cannot be found

#### Parameters
Expand Down Expand Up @@ -1992,15 +1990,12 @@ Callback to uninstall dependencies only if necessary. undefined is returned if c

Removes the configuration of an existing project.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either file.

#### Parameters

| Name | Type |
| :------------ | :------------------------------------------ |
| `tree` | [`Tree`](../../devkit/documents/index#tree) |
| `projectName` | `string` |
| Name | Type | Description |
| :------------ | :------------------------------------------ | :---------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | the file system tree |
| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |

#### Returns

Expand Down Expand Up @@ -2293,9 +2288,6 @@ Update nx.json

Updates the configuration of an existing project.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either files.

#### Parameters

| Name | Type | Description |
Expand Down
3 changes: 2 additions & 1 deletion docs/generated/packages/angular/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean",
"x-priority": "internal"
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"port": {
"type": "number",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/angular/generators/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
3 changes: 2 additions & 1 deletion docs/generated/packages/angular/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean",
"x-priority": "internal"
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"compilationMode": {
"description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/angular/generators/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside workspace.json.",
"type": "boolean",
"x-priority": "internal"
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"skipPackageJson": {
"type": "boolean",
Expand Down
48 changes: 20 additions & 28 deletions docs/generated/packages/devkit/documents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,17 +868,14 @@ Callback to install dependencies only if necessary, no-op otherwise

Adds project configuration to the Nx workspace.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either files.

#### Parameters

| Name | Type | Description |
| :--------------------- | :-------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | the file system tree |
| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/index#projectconfiguration) | project configuration |
| `standalone?` | `boolean` | should the project use package.json? If false, the project config is inside workspace.json |
| Name | Type | Default value | Description |
| :--------------------- | :-------------------------------------------------------------------------- | :------------ | :---------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | `undefined` | the file system tree |
| `projectName` | `string` | `undefined` | unique name. Often directories are part of the name (e.g., mydir-mylib) |
| `projectConfiguration` | [`ProjectConfiguration`](../../devkit/documents/index#projectconfiguration) | `undefined` | project configuration |
| `standalone` | `boolean` | `true` | whether the project is configured in workspace.json or not |

#### Returns

Expand Down Expand Up @@ -1012,10 +1009,10 @@ Convert an Nx Generator into an Angular Devkit Schematic.

#### Parameters

| Name | Type | Default value | Description |
| :----------------------------- | :---------------------------------------------------------- | :------------ | :------------------------------------------------------------------------------------------------ |
| `generator` | [`Generator`](../../devkit/documents/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |
| `skipWritingConfigInOldFormat` | `boolean` | `false` | Whether to skip writing the configuration in the old format (the one used by the Angular DevKit). |
| Name | Type | Default value | Description |
| :----------------------------- | :---------------------------------------------------------- | :------------ | :---------------------------------------------------------- |
| `generator` | [`Generator`](../../devkit/documents/index#generator)<`T`\> | `undefined` | The Nx generator to convert to an Angular Devkit Schematic. |
| `skipWritingConfigInOldFormat` | `boolean` | `false` | - |

#### Returns

Expand Down Expand Up @@ -1489,7 +1486,9 @@ Example:

### getWorkspacePath

**getWorkspacePath**(`tree`): `"/angular.json"` \| `"/workspace.json"` \| `null`
**getWorkspacePath**(`tree`): `"angular.json"` \| `"workspace.json"`

**`deprecated`** all projects are configured using project.json

#### Parameters

Expand All @@ -1499,7 +1498,7 @@ Example:

#### Returns

`"/angular.json"` \| `"/workspace.json"` \| `null`
`"angular.json"` \| `"workspace.json"`

---

Expand Down Expand Up @@ -1531,6 +1530,8 @@ Runs `npm install` or `yarn install`. It will skip running the install if

Returns if a project has a standalone configuration (project.json).

**`deprecated`** non-standalone projects were deprecated

#### Parameters

| Name | Type | Description |
Expand Down Expand Up @@ -1873,9 +1874,6 @@ Reads nx.json

Reads a project configuration.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will read from either file.

**`throws`** If supplied projectName cannot be found

#### Parameters
Expand Down Expand Up @@ -1992,15 +1990,12 @@ Callback to uninstall dependencies only if necessary. undefined is returned if c

Removes the configuration of an existing project.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either file.

#### Parameters

| Name | Type |
| :------------ | :------------------------------------------ |
| `tree` | [`Tree`](../../devkit/documents/index#tree) |
| `projectName` | `string` |
| Name | Type | Description |
| :------------ | :------------------------------------------ | :---------------------------------------------------------------------- |
| `tree` | [`Tree`](../../devkit/documents/index#tree) | the file system tree |
| `projectName` | `string` | unique name. Often directories are part of the name (e.g., mydir-mylib) |

#### Returns

Expand Down Expand Up @@ -2293,9 +2288,6 @@ Update nx.json

Updates the configuration of an existing project.

The project configuration is stored in workspace.json or the associated project.json file.
The utility will update either files.

#### Parameters

| Name | Type | Description |
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/expo/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
}
},
"required": ["name"],
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/express/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/nest/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
3 changes: 2 additions & 1 deletion docs/generated/packages/nest/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"standaloneConfig": {
"description": "Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json",
"type": "boolean",
"default": true
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/next/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"swc": {
"description": "Enable the Rust-based compiler SWC to compile JS/TS files.",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/next/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
}
},
"required": ["name"],
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/node/generators/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"bundler": {
"description": "Bundler which is used to package the application",
Expand Down
4 changes: 3 additions & 1 deletion docs/generated/packages/node/generators/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@
},
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean"
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"setParserOptionsProject": {
"type": "boolean",
Expand Down
6 changes: 6 additions & 0 deletions docs/generated/packages/nx-plugin/generators/e2e-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
"x-priority": "important"
},
"jestConfig": { "type": "string", "description": "Jest config file." },
"standaloneConfig": {
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"minimal": {
"type": "boolean",
"description": "Generate the e2e project with a minimal setup. This would involve not generating tests for a default executor and generator.",
Expand Down
Loading

1 comment on commit d7536aa

@vercel
Copy link

@vercel vercel bot commented on d7536aa Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.