diff --git a/packages/angular/src/generators/add-linting/compat.ts b/packages/angular/src/generators/add-linting/compat.ts index de50b010701e0..ec253ec541140 100644 --- a/packages/angular/src/generators/add-linting/compat.ts +++ b/packages/angular/src/generators/add-linting/compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { addLintingGenerator } from './add-linting'; -export default convertNxGenerator(addLintingGenerator); +export default warnForSchematicUsage(convertNxGenerator(addLintingGenerator)); diff --git a/packages/angular/src/generators/application/application.compat.ts b/packages/angular/src/generators/application/application.compat.ts index 991fe623994f8..9c7c57629f70e 100644 --- a/packages/angular/src/generators/application/application.compat.ts +++ b/packages/angular/src/generators/application/application.compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import application from './application'; -export const applicationSchematic = convertNxGenerator(application); +export const applicationSchematic = warnForSchematicUsage( + convertNxGenerator(application) +); diff --git a/packages/angular/src/generators/component-cypress-spec/compat.ts b/packages/angular/src/generators/component-cypress-spec/compat.ts index 3047bda8bb9ad..8600d16d5b59a 100644 --- a/packages/angular/src/generators/component-cypress-spec/compat.ts +++ b/packages/angular/src/generators/component-cypress-spec/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentCypressSpecGenerator } from './component-cypress-spec'; -export default convertNxGenerator(componentCypressSpecGenerator); +export default warnForSchematicUsage( + convertNxGenerator(componentCypressSpecGenerator) +); diff --git a/packages/angular/src/generators/component-story/compat.ts b/packages/angular/src/generators/component-story/compat.ts index 64866f0a57582..ec8b2ef9cd8aa 100644 --- a/packages/angular/src/generators/component-story/compat.ts +++ b/packages/angular/src/generators/component-story/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentStoryGenerator } from './component-story'; -export default convertNxGenerator(componentStoryGenerator); +export default warnForSchematicUsage( + convertNxGenerator(componentStoryGenerator) +); diff --git a/packages/angular/src/generators/component-test/compat.ts b/packages/angular/src/generators/component-test/compat.ts index 8245c03054ec4..fb99057e38340 100644 --- a/packages/angular/src/generators/component-test/compat.ts +++ b/packages/angular/src/generators/component-test/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { componentTestGenerator } from './component-test'; -export default convertNxGenerator(componentTestGenerator); +export default warnForSchematicUsage( + convertNxGenerator(componentTestGenerator) +); diff --git a/packages/angular/src/generators/component/component.compat.ts b/packages/angular/src/generators/component/component.compat.ts index f73c31c33528b..85d23ed319946 100644 --- a/packages/angular/src/generators/component/component.compat.ts +++ b/packages/angular/src/generators/component/component.compat.ts @@ -1,4 +1,5 @@ import componentGenerator from './component'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { convertNxGenerator } from '@nrwl/devkit'; -export default convertNxGenerator(componentGenerator); +export default warnForSchematicUsage(convertNxGenerator(componentGenerator)); diff --git a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts index 1389226105582..e544ee4920a5d 100644 --- a/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts +++ b/packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import convertToWithMF from './convert-to-with-mf'; -export default convertNxGenerator(convertToWithMF); +export default warnForSchematicUsage(convertNxGenerator(convertToWithMF)); diff --git a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts index cbbde4fcdf398..1601dcd1fe06b 100755 --- a/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts +++ b/packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts @@ -6,6 +6,7 @@ import { logger, Tree, } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { ConvertTSLintToESLintSchema, ProjectConverter } from '@nrwl/linter'; import type { Linter } from 'eslint'; import { addLintingGenerator } from '../add-linting/add-linting'; @@ -137,7 +138,9 @@ export async function conversionGenerator( }; } -export const conversionSchematic = convertNxGenerator(conversionGenerator); +export const conversionSchematic = warnForSchematicUsage( + convertNxGenerator(conversionGenerator) +); /** * In the case of Angular lint rules, we need to apply them to correct override depending upon whether diff --git a/packages/angular/src/generators/cypress-component-configuration/compat.ts b/packages/angular/src/generators/cypress-component-configuration/compat.ts index c6857c6aa1749..7e76a1967b7ce 100644 --- a/packages/angular/src/generators/cypress-component-configuration/compat.ts +++ b/packages/angular/src/generators/cypress-component-configuration/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { cypressComponentConfiguration } from './cypress-component-configuration'; -export default convertNxGenerator(cypressComponentConfiguration); +export default warnForSchematicUsage( + convertNxGenerator(cypressComponentConfiguration) +); diff --git a/packages/angular/src/generators/host/host.compat.ts b/packages/angular/src/generators/host/host.compat.ts index e9d6e3f165b03..b976df1330fb2 100644 --- a/packages/angular/src/generators/host/host.compat.ts +++ b/packages/angular/src/generators/host/host.compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import host from './host'; -export default convertNxGenerator(host); +export default warnForSchematicUsage(convertNxGenerator(host)); diff --git a/packages/angular/src/generators/init/init.compat.ts b/packages/angular/src/generators/init/init.compat.ts index 377fa17212dc0..2796b24e1f31b 100644 --- a/packages/angular/src/generators/init/init.compat.ts +++ b/packages/angular/src/generators/init/init.compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { angularInitGenerator } from './init'; -export const initSchematic = convertNxGenerator(angularInitGenerator); +export const initSchematic = warnForSchematicUsage( + convertNxGenerator(angularInitGenerator) +); diff --git a/packages/angular/src/generators/library-secondary-entry-point/compat.ts b/packages/angular/src/generators/library-secondary-entry-point/compat.ts index e7395c5aca8fc..7b645dccab51b 100644 --- a/packages/angular/src/generators/library-secondary-entry-point/compat.ts +++ b/packages/angular/src/generators/library-secondary-entry-point/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { librarySecondaryEntryPointGenerator } from './library-secondary-entry-point'; -export default convertNxGenerator(librarySecondaryEntryPointGenerator); +export default warnForSchematicUsage( + convertNxGenerator(librarySecondaryEntryPointGenerator) +); diff --git a/packages/angular/src/generators/library/library.compat.ts b/packages/angular/src/generators/library/library.compat.ts index f6dc564067e15..be5e842a54815 100644 --- a/packages/angular/src/generators/library/library.compat.ts +++ b/packages/angular/src/generators/library/library.compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import library from './library'; -export const librarySchematic = convertNxGenerator(library); +export const librarySchematic = warnForSchematicUsage( + convertNxGenerator(library) +); diff --git a/packages/angular/src/generators/move/move.ts b/packages/angular/src/generators/move/move.ts index ed3a50c8b70f4..6f84ee20eb04d 100644 --- a/packages/angular/src/generators/move/move.ts +++ b/packages/angular/src/generators/move/move.ts @@ -1,4 +1,5 @@ import { convertNxGenerator, formatFiles, Tree } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { moveGenerator } from '@nrwl/workspace/generators'; import { updateModuleName } from './lib/update-module-name'; import { updateNgPackage } from './lib/update-ng-package'; @@ -24,4 +25,6 @@ export async function angularMoveGenerator( } } -export const angularMoveSchematic = convertNxGenerator(angularMoveGenerator); +export const angularMoveSchematic = warnForSchematicUsage( + convertNxGenerator(angularMoveGenerator) +); diff --git a/packages/angular/src/generators/ngrx/compat.ts b/packages/angular/src/generators/ngrx/compat.ts index 7e7ba07137204..9b7d2baed2585 100644 --- a/packages/angular/src/generators/ngrx/compat.ts +++ b/packages/angular/src/generators/ngrx/compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { ngrxGenerator } from './ngrx'; -export default convertNxGenerator(ngrxGenerator); +export default warnForSchematicUsage(convertNxGenerator(ngrxGenerator)); diff --git a/packages/angular/src/generators/remote/remote.compat.ts b/packages/angular/src/generators/remote/remote.compat.ts index 4bc9f1fc8c0c1..586cb509857e2 100644 --- a/packages/angular/src/generators/remote/remote.compat.ts +++ b/packages/angular/src/generators/remote/remote.compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import remote from './remote'; -export default convertNxGenerator(remote); +export default warnForSchematicUsage(convertNxGenerator(remote)); diff --git a/packages/angular/src/generators/scam-directive/scam-directive.compat.ts b/packages/angular/src/generators/scam-directive/scam-directive.compat.ts index 94e4962f95c43..b64e34a2b7906 100644 --- a/packages/angular/src/generators/scam-directive/scam-directive.compat.ts +++ b/packages/angular/src/generators/scam-directive/scam-directive.compat.ts @@ -1,4 +1,5 @@ import scamGenerator from './scam-directive'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { convertNxGenerator } from '@nrwl/devkit'; -export default convertNxGenerator(scamGenerator); +export default warnForSchematicUsage(convertNxGenerator(scamGenerator)); diff --git a/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts b/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts index e166791d619cf..e11c6a66c0336 100644 --- a/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts +++ b/packages/angular/src/generators/scam-pipe/scam-pipe.compat.ts @@ -1,4 +1,5 @@ import scamPipeGenerator from './scam-pipe'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { convertNxGenerator } from '@nrwl/devkit'; -export default convertNxGenerator(scamPipeGenerator); +export default warnForSchematicUsage(convertNxGenerator(scamPipeGenerator)); diff --git a/packages/angular/src/generators/scam-to-standalone/compat.ts b/packages/angular/src/generators/scam-to-standalone/compat.ts index 8189a3206f120..c1293ae5189e5 100644 --- a/packages/angular/src/generators/scam-to-standalone/compat.ts +++ b/packages/angular/src/generators/scam-to-standalone/compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { scamToStandalone } from './scam-to-standalone'; -export default convertNxGenerator(scamToStandalone); +export default warnForSchematicUsage(convertNxGenerator(scamToStandalone)); diff --git a/packages/angular/src/generators/scam/scam.compat.ts b/packages/angular/src/generators/scam/scam.compat.ts index 0eb7743a7425f..4e92fad1225b9 100644 --- a/packages/angular/src/generators/scam/scam.compat.ts +++ b/packages/angular/src/generators/scam/scam.compat.ts @@ -1,4 +1,5 @@ import scamGenerator from './scam'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { convertNxGenerator } from '@nrwl/devkit'; -export default convertNxGenerator(scamGenerator); +export default warnForSchematicUsage(convertNxGenerator(scamGenerator)); diff --git a/packages/angular/src/generators/setup-mf/setup-mf.compat.ts b/packages/angular/src/generators/setup-mf/setup-mf.compat.ts index 1daf80fb4e9a5..d70619038adfd 100644 --- a/packages/angular/src/generators/setup-mf/setup-mf.compat.ts +++ b/packages/angular/src/generators/setup-mf/setup-mf.compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupMf } from './setup-mf'; -export default convertNxGenerator(setupMf); +export default warnForSchematicUsage(convertNxGenerator(setupMf)); diff --git a/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts b/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts index 40911dfdc13ff..be052ea0f8c59 100644 --- a/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts +++ b/packages/angular/src/generators/setup-ssr/setup-ssr.compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupSsr } from './setup-ssr'; -export default convertNxGenerator(setupSsr); +export default warnForSchematicUsage(convertNxGenerator(setupSsr)); diff --git a/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts b/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts index 03de034928f8c..fe4cd06277445 100644 --- a/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts +++ b/packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { setupTailwindGenerator } from './setup-tailwind'; -export default convertNxGenerator(setupTailwindGenerator); +export default warnForSchematicUsage( + convertNxGenerator(setupTailwindGenerator) +); diff --git a/packages/angular/src/generators/stories/compat.ts b/packages/angular/src/generators/stories/compat.ts index 800b2b57dfeac..effdd2f3928b1 100644 --- a/packages/angular/src/generators/stories/compat.ts +++ b/packages/angular/src/generators/stories/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { angularStoriesGenerator } from './stories'; -export default convertNxGenerator(angularStoriesGenerator); +export default warnForSchematicUsage( + convertNxGenerator(angularStoriesGenerator) +); diff --git a/packages/angular/src/generators/storybook-configuration/compat.ts b/packages/angular/src/generators/storybook-configuration/compat.ts index 10d4a018f85d6..d0e08eab2cc56 100644 --- a/packages/angular/src/generators/storybook-configuration/compat.ts +++ b/packages/angular/src/generators/storybook-configuration/compat.ts @@ -1,4 +1,7 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { storybookConfigurationGenerator } from './storybook-configuration'; -export default convertNxGenerator(storybookConfigurationGenerator); +export default warnForSchematicUsage( + convertNxGenerator(storybookConfigurationGenerator) +); diff --git a/packages/angular/src/generators/utils/warn-for-schematic-usage.ts b/packages/angular/src/generators/utils/warn-for-schematic-usage.ts new file mode 100644 index 0000000000000..2d10ec100f0de --- /dev/null +++ b/packages/angular/src/generators/utils/warn-for-schematic-usage.ts @@ -0,0 +1,7 @@ +export function warnForSchematicUsage(convertedGenerator: T): T { + console.warn( + 'Running generators as schematics is deprecated and will be removed in v17.' + ); + + return convertedGenerator; +} diff --git a/packages/angular/src/generators/web-worker/compat.ts b/packages/angular/src/generators/web-worker/compat.ts index 37ae7d4113016..6e74e6361f49f 100644 --- a/packages/angular/src/generators/web-worker/compat.ts +++ b/packages/angular/src/generators/web-worker/compat.ts @@ -1,4 +1,5 @@ import { convertNxGenerator } from '@nrwl/devkit'; +import { warnForSchematicUsage } from '../utils/warn-for-schematic-usage'; import { webWorkerGenerator } from './web-worker'; -export default convertNxGenerator(webWorkerGenerator); +export default warnForSchematicUsage(convertNxGenerator(webWorkerGenerator));