Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): remove deprecated defaultCollection and npmScope nx.json … #19708

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions docs/generated/devkit/NxJsonConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Nx.json configuration
- [implicitDependencies](../../devkit/documents/NxJsonConfiguration#implicitdependencies): ImplicitDependencyEntry<T>
- [installation](../../devkit/documents/NxJsonConfiguration#installation): NxInstallationConfiguration
- [namedInputs](../../devkit/documents/NxJsonConfiguration#namedinputs): Object
- [npmScope](../../devkit/documents/NxJsonConfiguration#npmscope): string
- [nxCloudAccessToken](../../devkit/documents/NxJsonConfiguration#nxcloudaccesstoken): string
- [nxCloudEncryptionKey](../../devkit/documents/NxJsonConfiguration#nxcloudencryptionkey): string
- [nxCloudUrl](../../devkit/documents/NxJsonConfiguration#nxcloudurl): string
Expand Down Expand Up @@ -66,11 +65,10 @@ Default generator collection. It is used when no collection is provided.

#### Type declaration

| Name | Type | Description |
| :-------------------- | :-------------------------------------------------------- | :--------------------------------------------------------------------- |
| `defaultCollection?` | `string` | **`Deprecated`** - defaultCollection is deprecated and will be removed |
| `defaultProjectName?` | `string` | - |
| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) | - |
| Name | Type |
| :-------------------- | :-------------------------------------------------------- |
| `defaultProjectName?` | `string` |
| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) |

---

Expand Down Expand Up @@ -151,17 +149,6 @@ Named inputs targets can refer to reduce duplication

---

### npmScope

• `Optional` **npmScope**: `string`

**`Deprecated`**

This is inferred from the package.json in the workspace root. Please use getNpmScope instead.
NPM Scope that the workspace uses

---

### nxCloudAccessToken

• `Optional` **nxCloudAccessToken**: `string`
Expand Down
5 changes: 0 additions & 5 deletions docs/generated/devkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ It only uses language primitives and immutable objects
- [StringChange](../../devkit/documents/StringChange)
- [TargetDefaults](../../devkit/documents/TargetDefaults)
- [TaskGraphExecutor](../../devkit/documents/TaskGraphExecutor)
- [WorkspaceConfiguration](../../devkit/documents/WorkspaceConfiguration)
- [WorkspaceJsonConfiguration](../../devkit/documents/WorkspaceJsonConfiguration)

### Variables
Expand Down Expand Up @@ -118,11 +117,9 @@ It only uses language primitives and immutable objects
- [getPackageManagerVersion](../../devkit/documents/getPackageManagerVersion)
- [getProjects](../../devkit/documents/getProjects)
- [getWorkspaceLayout](../../devkit/documents/getWorkspaceLayout)
- [getWorkspacePath](../../devkit/documents/getWorkspacePath)
- [glob](../../devkit/documents/glob)
- [hashArray](../../devkit/documents/hashArray)
- [installPackagesTask](../../devkit/documents/installPackagesTask)
- [isStandaloneProject](../../devkit/documents/isStandaloneProject)
- [joinPathFragments](../../devkit/documents/joinPathFragments)
- [moveFilesToNewDirectory](../../devkit/documents/moveFilesToNewDirectory)
- [names](../../devkit/documents/names)
Expand All @@ -137,7 +134,6 @@ It only uses language primitives and immutable objects
- [readProjectConfiguration](../../devkit/documents/readProjectConfiguration)
- [readProjectsConfigurationFromProjectGraph](../../devkit/documents/readProjectsConfigurationFromProjectGraph)
- [readTargetOptions](../../devkit/documents/readTargetOptions)
- [readWorkspaceConfiguration](../../devkit/documents/readWorkspaceConfiguration)
- [removeDependenciesFromPackageJson](../../devkit/documents/removeDependenciesFromPackageJson)
- [removeProjectConfiguration](../../devkit/documents/removeProjectConfiguration)
- [reverse](../../devkit/documents/reverse)
Expand All @@ -152,7 +148,6 @@ It only uses language primitives and immutable objects
- [updateNxJson](../../devkit/documents/updateNxJson)
- [updateProjectConfiguration](../../devkit/documents/updateProjectConfiguration)
- [updateTsConfigsToJs](../../devkit/documents/updateTsConfigsToJs)
- [updateWorkspaceConfiguration](../../devkit/documents/updateWorkspaceConfiguration)
- [validateDependency](../../devkit/documents/validateDependency)
- [visitNotIgnoredFiles](../../devkit/documents/visitNotIgnoredFiles)
- [workspaceLayout](../../devkit/documents/workspaceLayout)
Expand Down
25 changes: 4 additions & 21 deletions docs/generated/devkit/Workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use ProjectsConfigurations or NxJsonConfiguration
- [implicitDependencies](../../devkit/documents/Workspace#implicitdependencies): ImplicitDependencyEntry<string[] | "\*">
- [installation](../../devkit/documents/Workspace#installation): NxInstallationConfiguration
- [namedInputs](../../devkit/documents/Workspace#namedinputs): Object
- [npmScope](../../devkit/documents/Workspace#npmscope): string
- [nxCloudAccessToken](../../devkit/documents/Workspace#nxcloudaccesstoken): string
- [nxCloudEncryptionKey](../../devkit/documents/Workspace#nxcloudencryptionkey): string
- [nxCloudUrl](../../devkit/documents/Workspace#nxcloudurl): string
Expand Down Expand Up @@ -74,11 +73,10 @@ Default generator collection. It is used when no collection is provided.

#### Type declaration

| Name | Type | Description |
| :-------------------- | :-------------------------------------------------------- | :--------------------------------------------------------------------- |
| `defaultCollection?` | `string` | **`Deprecated`** - defaultCollection is deprecated and will be removed |
| `defaultProjectName?` | `string` | - |
| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) | - |
| Name | Type |
| :-------------------- | :-------------------------------------------------------- |
| `defaultProjectName?` | `string` |
| `packageManager?` | [`PackageManager`](../../devkit/documents/PackageManager) |

#### Inherited from

Expand Down Expand Up @@ -187,21 +185,6 @@ Named inputs targets can refer to reduce duplication

---

### npmScope

• `Optional` **npmScope**: `string`

**`Deprecated`**

This is inferred from the package.json in the workspace root. Please use getNpmScope instead.
NPM Scope that the workspace uses

#### Inherited from

[NxJsonConfiguration](../../devkit/documents/NxJsonConfiguration).[npmScope](../../devkit/documents/NxJsonConfiguration#npmscope)

---

### nxCloudAccessToken

• `Optional` **nxCloudAccessToken**: `string`
Expand Down
7 changes: 0 additions & 7 deletions docs/generated/devkit/WorkspaceConfiguration.md

This file was deleted.

13 changes: 6 additions & 7 deletions docs/generated/devkit/getWorkspaceLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and the default scope.
Example:

```typescript
{ appsDir: 'apps', libsDir: 'libs', npmScope: 'myorg' }
{ appsDir: 'apps', libsDir: 'libs' }
```

#### Parameters
Expand All @@ -21,9 +21,8 @@ Example:

`Object`

| Name | Type | Description |
| :-------------------- | :-------- | :----------------------------------------------------------------------- |
| `appsDir` | `string` | - |
| `libsDir` | `string` | - |
| `npmScope` | `string` | **`Deprecated`** This will be removed in Nx 17. Use getNpmScope instead. |
| `standaloneAsDefault` | `boolean` | - |
| Name | Type |
| :-------------------- | :-------- |
| `appsDir` | `string` |
| `libsDir` | `string` |
| `standaloneAsDefault` | `boolean` |
17 changes: 0 additions & 17 deletions docs/generated/devkit/getWorkspacePath.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/generated/devkit/isStandaloneProject.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/generated/devkit/readWorkspaceConfiguration.md

This file was deleted.

22 changes: 0 additions & 22 deletions docs/generated/devkit/updateWorkspaceConfiguration.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/generated/packages/angular/generators/ng-add.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"description": "Migrates an Angular CLI workspace to Nx or adds the Angular plugin to an Nx workspace. NOTE: Does not work in the `--dry-run` mode.",
"type": "object",
"properties": {
"npmScope": {
"type": "string",
"description": "Npm scope for importing libs. NOTE: only used if running the generator in an Angular CLI workspace.",
"x-deprecated": "This will be inferred from your root package.json"
},
"defaultBase": {
"type": "string",
"description": "Default base branch for affected. NOTE: only used if running the generator in an Angular CLI workspace.",
Expand Down
5 changes: 0 additions & 5 deletions docs/generated/packages/devkit/documents/nx_devkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ It only uses language primitives and immutable objects
- [StringChange](../../devkit/documents/StringChange)
- [TargetDefaults](../../devkit/documents/TargetDefaults)
- [TaskGraphExecutor](../../devkit/documents/TaskGraphExecutor)
- [WorkspaceConfiguration](../../devkit/documents/WorkspaceConfiguration)
- [WorkspaceJsonConfiguration](../../devkit/documents/WorkspaceJsonConfiguration)

### Variables
Expand Down Expand Up @@ -118,11 +117,9 @@ It only uses language primitives and immutable objects
- [getPackageManagerVersion](../../devkit/documents/getPackageManagerVersion)
- [getProjects](../../devkit/documents/getProjects)
- [getWorkspaceLayout](../../devkit/documents/getWorkspaceLayout)
- [getWorkspacePath](../../devkit/documents/getWorkspacePath)
- [glob](../../devkit/documents/glob)
- [hashArray](../../devkit/documents/hashArray)
- [installPackagesTask](../../devkit/documents/installPackagesTask)
- [isStandaloneProject](../../devkit/documents/isStandaloneProject)
- [joinPathFragments](../../devkit/documents/joinPathFragments)
- [moveFilesToNewDirectory](../../devkit/documents/moveFilesToNewDirectory)
- [names](../../devkit/documents/names)
Expand All @@ -137,7 +134,6 @@ It only uses language primitives and immutable objects
- [readProjectConfiguration](../../devkit/documents/readProjectConfiguration)
- [readProjectsConfigurationFromProjectGraph](../../devkit/documents/readProjectsConfigurationFromProjectGraph)
- [readTargetOptions](../../devkit/documents/readTargetOptions)
- [readWorkspaceConfiguration](../../devkit/documents/readWorkspaceConfiguration)
- [removeDependenciesFromPackageJson](../../devkit/documents/removeDependenciesFromPackageJson)
- [removeProjectConfiguration](../../devkit/documents/removeProjectConfiguration)
- [reverse](../../devkit/documents/reverse)
Expand All @@ -152,7 +148,6 @@ It only uses language primitives and immutable objects
- [updateNxJson](../../devkit/documents/updateNxJson)
- [updateProjectConfiguration](../../devkit/documents/updateProjectConfiguration)
- [updateTsConfigsToJs](../../devkit/documents/updateTsConfigsToJs)
- [updateWorkspaceConfiguration](../../devkit/documents/updateWorkspaceConfiguration)
- [validateDependency](../../devkit/documents/validateDependency)
- [visitNotIgnoredFiles](../../devkit/documents/visitNotIgnoredFiles)
- [workspaceLayout](../../devkit/documents/workspaceLayout)
Expand Down
4 changes: 4 additions & 0 deletions docs/shared/deprecated/default-collection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# defaultCollection

{% callout type="caution" title="Experimental" %}
Configuring `defaultCollection` will no longer have any effect in Nx 17+
{% /callout %}

In the `nx.json` you can set a `defaultCollection` property like this:

```jsonc
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/reference/nx-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The `npmScope` property of the `nx.json` file is deprecated as of version 16.2.0

In Nx 16, if the `npmScope` property is present, it will be used as a prefix. If the `npmScope` property is not present, the `name` property of the root `package.json` file will be used to infer the prefix.

In Nx 17, the `npmScope` property will be ignored.
In Nx 17, the `npmScope` property is ignored.

### Affected

Expand Down
10 changes: 5 additions & 5 deletions e2e/angular-core/src/ng-add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
expect(packageJson.devDependencies['@nx/workspace']).not.toBeDefined();

// run ng add
runCLI('g @nx/angular:ng-add --npm-scope projscope --default-base main');
runCLI('g @nx/angular:ng-add --default-base main');

// check that prettier config exits and that files have been moved
checkFilesExist(
Expand Down Expand Up @@ -264,7 +264,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
it('should handle a workspace with cypress v9', () => {
addCypress9();

runCLI('g @nx/angular:ng-add --npm-scope projscope --skip-install');
runCLI('g @nx/angular:ng-add --skip-install');

const e2eProject = `${project}-e2e`;
//check e2e project files
Expand Down Expand Up @@ -331,7 +331,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
it('should handle a workspace with cypress v10', () => {
addCypress10();

runCLI('g @nx/angular:ng-add --npm-scope projscope --skip-install');
runCLI('g @nx/angular:ng-add --skip-install');

const e2eProject = `${project}-e2e`;
//check e2e project files
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
it.skip('should handle a workspace with ESLint', () => {
addEsLint();

runCLI('g @nx/angular:ng-add --npm-scope projscope');
runCLI('g @nx/angular:ng-add');

checkFilesExist(`apps/${project}/.eslintrc.json`, `.eslintrc.json`);

Expand Down Expand Up @@ -438,7 +438,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
runCommand(`ng g @schematics/angular:application ${app1} --no-interactive`);
runCommand(`ng g @schematics/angular:library ${lib1} --no-interactive`);

runCLI('g @nx/angular:ng-add --npm-scope projscope');
runCLI('g @nx/angular:ng-add');

// check angular.json does not exist
checkFilesDoNotExist('angular.json');
Expand Down
Loading