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 workspace generator command #19541

Merged
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
66 changes: 0 additions & 66 deletions docs/generated/cli/workspace-generator.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -7582,14 +7582,6 @@
"children": [],
"disableCollapsible": false
},
{
"name": "workspace-generator",
"path": "/nx-api/nx/documents/workspace-generator",
"id": "workspace-generator",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "connect-to-nx-cloud",
"path": "/nx-api/nx/documents/connect-to-nx-cloud",
Expand Down Expand Up @@ -8782,14 +8774,6 @@
"isExternal": false,
"disableCollapsible": false
},
{
"id": "workspace-generator",
"path": "/nx-api/workspace/generators/workspace-generator",
"name": "workspace-generator",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "run-commands",
"path": "/nx-api/workspace/generators/run-commands",
Expand Down
20 changes: 0 additions & 20 deletions docs/generated/manifests/nx-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1686,17 +1686,6 @@
"tags": ["enforce-module-boundaries"],
"originalFilePath": "generated/cli/workspace-lint"
},
"/nx-api/nx/documents/workspace-generator": {
"id": "workspace-generator",
"name": "workspace-generator",
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/workspace-generator",
"itemList": [],
"isExternal": false,
"path": "/nx-api/nx/documents/workspace-generator",
"tags": [],
"originalFilePath": "generated/cli/workspace-generator"
},
"/nx-api/nx/documents/connect-to-nx-cloud": {
"id": "connect-to-nx-cloud",
"name": "connect-to-nx-cloud",
Expand Down Expand Up @@ -2830,15 +2819,6 @@
"path": "/nx-api/workspace/generators/new",
"type": "generator"
},
"/nx-api/workspace/generators/workspace-generator": {
"description": "Generates a workspace generator.",
"file": "generated/packages/workspace/generators/workspace-generator.json",
"hidden": false,
"name": "workspace-generator",
"originalFilePath": "/packages/workspace/src/generators/workspace-generator/schema.json",
"path": "/nx-api/workspace/generators/workspace-generator",
"type": "generator"
},
"/nx-api/workspace/generators/run-commands": {
"description": "Generates a target to run any command in the terminal.",
"file": "generated/packages/workspace/generators/run-commands.json",
Expand Down
20 changes: 0 additions & 20 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1667,17 +1667,6 @@
"tags": ["enforce-module-boundaries"],
"originalFilePath": "generated/cli/workspace-lint"
},
{
"id": "workspace-generator",
"name": "workspace-generator",
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
"file": "generated/packages/nx/documents/workspace-generator",
"itemList": [],
"isExternal": false,
"path": "nx/documents/workspace-generator",
"tags": [],
"originalFilePath": "generated/cli/workspace-generator"
},
{
"id": "connect-to-nx-cloud",
"name": "connect-to-nx-cloud",
Expand Down Expand Up @@ -2798,15 +2787,6 @@
"path": "workspace/generators/new",
"type": "generator"
},
{
"description": "Generates a workspace generator.",
"file": "generated/packages/workspace/generators/workspace-generator.json",
"hidden": false,
"name": "workspace-generator",
"originalFilePath": "/packages/workspace/src/generators/workspace-generator/schema.json",
"path": "workspace/generators/workspace-generator",
"type": "generator"
},
{
"description": "Generates a target to run any command in the terminal.",
"file": "generated/packages/workspace/generators/run-commands.json",
Expand Down
66 changes: 0 additions & 66 deletions docs/generated/packages/nx/documents/workspace-generator.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions docs/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1868,11 +1868,6 @@
"tags": ["enforce-module-boundaries"],
"file": "generated/cli/workspace-lint"
},
{
"name": "workspace-generator",
"id": "workspace-generator",
"file": "generated/cli/workspace-generator"
},
{
"name": "connect-to-nx-cloud",
"id": "connect-to-nx-cloud",
Expand Down
2 changes: 0 additions & 2 deletions docs/shared/reference/sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@
- [report](/nx-api/nx/documents/report)
- [list](/nx-api/nx/documents/list)
- [workspace-lint](/nx-api/nx/documents/workspace-lint)
- [workspace-generator](/nx-api/nx/documents/workspace-generator)
- [connect-to-nx-cloud](/nx-api/nx/documents/connect-to-nx-cloud)
- [reset](/nx-api/nx/documents/reset)
- [repair](/nx-api/nx/documents/repair)
Expand Down Expand Up @@ -644,7 +643,6 @@
- [remove](/nx-api/workspace/generators/remove)
- [convert-to-monorepo](/nx-api/workspace/generators/convert-to-monorepo)
- [new](/nx-api/workspace/generators/new)
- [workspace-generator](/nx-api/workspace/generators/workspace-generator)
- [run-commands](/nx-api/workspace/generators/run-commands)
- [fix-configuration](/nx-api/workspace/generators/fix-configuration)
- [npm-package](/nx-api/workspace/generators/npm-package)
Expand Down
22 changes: 0 additions & 22 deletions e2e/plugin/src/nx-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,28 +358,6 @@ describe('Nx Plugin', () => {
});
});

describe('workspace-generator', () => {
let custom: string;

it('should work with generate wrapper', () => {
custom = uniq('custom');
const project = uniq('generated-project');
runCLI(`g @nx/plugin:plugin workspace-plugin --no-interactive`);
runCLI(
`g @nx/plugin:generator ${custom} --project workspace-plugin --no-interactive`
);
runCLI(
`workspace-generator ${custom} --name ${project} --no-interactive`
);
expect(() => {
checkFilesExist(
`libs/${project}/src/index.ts`,
`libs/${project}/project.json`
);
});
});
});

describe('--directory', () => {
it('should create a plugin in the specified directory', async () => {
const plugin = uniq('plugin');
Expand Down
1 change: 0 additions & 1 deletion nx-dev/nx-dev-e2e/src/additional-api-references.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const pages: Array<{ title: string; path: string }> = [
{ title: 'report', path: '/cli/report' },
{ title: 'list', path: '/cli/list' },
{ title: 'workspace-lint', path: '/cli/workspace-lint' },
{ title: 'workspace-generator', path: '/cli/workspace-generator' },
{ title: 'connect', path: '/cli/connect-to-nx-cloud' },
{ title: 'reset', path: '/cli/reset' },
{ title: 'Storybook', path: '/storybook/overview-react' },
Expand Down
4 changes: 0 additions & 4 deletions nx-dev/nx-dev-e2e/src/packages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,6 @@ const pages: Array<{ title: string; path: string }> = [
title: '@nx/workspace:new',
path: '/packages/workspace/generators/new',
},
{
title: '@nx/workspace:workspace-generator',
path: '/packages/workspace/generators/workspace-generator',
},
{
title: '@nx/workspace:run-command',
path: '/packages/workspace/generators/run-commands',
Expand Down
3 changes: 0 additions & 3 deletions nx-dev/nx-dev/redirect-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const schemaUrls = {
'/workspace/remove': '/packages/workspace/generators/remove',
'/workspace/run-commands-generator':
'/packages/workspace/generators/run-commands',
'/workspace/workspace-generator':
'/packages/workspace/generators/workspace-generator',
'/workspace/convert-to-nx-project-generator':
'/packages/workspace/generators/convert-to-nx-project',

Expand Down Expand Up @@ -340,7 +338,6 @@ const cliUrls = {
'/cli/report': '/nx/report',
'/cli/list': '/nx/list',
'/cli/workspace-lint': '/nx/workspace-lint',
'/cli/workspace-generator': '/nx/workspace-generator',
'/cli/connect-to-nx-cloud': '/nx/connect-to-nx-cloud',
'/cli/reset': '/nx/reset',
};
Expand Down
1 change: 0 additions & 1 deletion packages/nx/src/command-line/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ export const examples: Record<string, Example[]> = {
'Open the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two',
},
],
'workspace-generator': [],
list: [
{
command: 'list',
Expand Down
17 changes: 0 additions & 17 deletions packages/nx/src/command-line/generate/command-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ export const yargsGenerateCommand: CommandModule = {
},
};

/**
* @deprecated(v17): Remove `workspace-generator in v17. Use local plugins.
*/
export const yargsWorkspaceGeneratorCommand: CommandModule = {
command: 'workspace-generator [generator]',
describe: 'Runs a workspace generator from the tools/generators directory',
deprecated:
'Use a local plugin instead. See: https://nx.dev/deprecated/workspace-generators',
aliases: ['workspace-schematic [schematic]'],
builder: async (yargs) =>
linkToNxDevAndExamples(withGenerateOptions(yargs), 'workspace-generator'),
handler: async (args) => {
await (await import('./generate')).workspaceGenerators(args);
process.exit(0);
},
};

function withGenerateOptions(yargs: Argv) {
const generatorWillShowHelp =
process.argv[3] && !process.argv[3].startsWith('-');
Expand Down
Loading