From d3d3532f56be300419e306499cba0bdfe663d243 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 18 Apr 2023 18:33:52 -0400 Subject: [PATCH] chore(misc): remove new references to @nrwl packages --- .../workspace-generator/workspace-generator.ts | 2 +- ...e-workspace-generators-to-local-plugin.spec.ts | 8 ++++---- .../move-workspace-generators-to-local-plugin.ts | 15 +++++++-------- scripts/depcheck/missing.ts | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts index fe6e3a6e60228e..da0f9c888b7473 100644 --- a/packages/workspace/src/generators/workspace-generator/workspace-generator.ts +++ b/packages/workspace/src/generators/workspace-generator/workspace-generator.ts @@ -4,7 +4,7 @@ import { Tree, stripIndents } from '@nx/devkit'; export default async function (host: Tree, schema: Schema) { const message = stripIndents`Workspace Generators are no longer supported. Instead, Nx now supports executing generators or executors from local plugins. To get - started, install @nrwl/nx-plugin and run \`nx g plugin\`. + started, install @nx/nx-plugin and run \`nx g plugin\`. Afterwards, or if you already have an Nx plugin, you can run \`nx g generator --project {my-plugin}\` to add a new generator. diff --git a/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.spec.ts b/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.spec.ts index 20887e513fc3e1..8c4ad9120b166e 100644 --- a/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.spec.ts +++ b/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.spec.ts @@ -1,4 +1,4 @@ -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree, readProjectConfiguration, @@ -7,7 +7,7 @@ import { GeneratorsJson, ProjectConfiguration, stripIndents, -} from '@nrwl/devkit'; +} from '@nx/devkit'; import generator from './move-workspace-generators-to-local-plugin'; @@ -136,8 +136,8 @@ async function workspaceGeneratorGenerator( host.write( joinPathFragments(outputDirectory, 'index.ts'), - stripIndents`import { Tree, formatFiles, installPackagesTask } from '@nrwl/devkit'; - import { libraryGenerator } from '@nrwl/workspace/generators'; + stripIndents`import { Tree, formatFiles, installPackagesTask } from '@nx/devkit'; + import { libraryGenerator } from '@nx/workspace/generators'; export default async function(tree: Tree, schema: any) { await libraryGenerator(tree, {name: schema.name}); diff --git a/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.ts b/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.ts index bf213ebc6d9363..2d208472a5bb8e 100644 --- a/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.ts +++ b/packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.ts @@ -9,9 +9,8 @@ import { readJson, readProjectConfiguration, Tree, - updateJson, writeJson, -} from '@nrwl/devkit'; +} from '@nx/devkit'; // nx-ignore-next-line import * as path from 'path'; import { @@ -39,7 +38,7 @@ export default async function (tree: Tree) { tree, {}, { - '@nrwl/nx-plugin': nxVersion, + '@nx/nx-plugin': nxVersion, } ) ); @@ -80,19 +79,19 @@ function collectAndMoveGenerators(tree: Tree, destinationProjectRoot: string) { } async function createNewPlugin(tree: Tree) { - ensurePackage('@nrwl/nx-plugin', nxVersion); + ensurePackage('@nx/nx-plugin', nxVersion); const { pluginGenerator } = // nx-ignore-next-line - require('@nrwl/nx-plugin/src/generators/plugin/plugin'); + require('@nx/nx-plugin/src/generators/plugin/plugin'); const { createExecutorsJson } = // nx-ignore-next-line - require('@nrwl/nx-plugin/src/generators/executor/executor'); + require('@nx/nx-plugin/src/generators/executor/executor'); const { createGeneratorsJson } = // nx-ignore-next-line - require('@nrwl/nx-plugin/src/generators/generator/generator'); + require('@nx/nx-plugin/src/generators/generator/generator'); // nx-ignore-next-line - const { Linter } = ensurePackage('@nrwl/linter', nxVersion); + const { Linter } = ensurePackage('@nx/linter', nxVersion); const { npmScope } = getWorkspaceLayout(tree); const importPath = npmScope ? `${npmScope}/${PROJECT_NAME}` : PROJECT_NAME; diff --git a/scripts/depcheck/missing.ts b/scripts/depcheck/missing.ts index ff5cc4a85fb45b..a0dbcdb40e615d 100644 --- a/scripts/depcheck/missing.ts +++ b/scripts/depcheck/missing.ts @@ -192,7 +192,7 @@ const IGNORE_MATCHES_BY_FILE: Record = { '../../packages/angular/src/migrations/update-12-3-0/update-storybook.ts' ), ], - '@nrwl/nx-plugin': [ + '@nx/nx-plugin': [ join( __dirname, '../../packages/workspace/src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin.spec.ts'