-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup(angular): add warning to schematic usage of generators (#15815)
- Loading branch information
Showing
27 changed files
with
85 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/application/application.compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/component-cypress-spec/compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
3 changes: 2 additions & 1 deletion
3
packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/cypress-component-configuration/compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/library-secondary-entry-point/compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
3 changes: 2 additions & 1 deletion
3
packages/angular/src/generators/scam-directive/scam-directive.compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/setup-tailwind/setup-tailwind.compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
5 changes: 4 additions & 1 deletion
5
packages/angular/src/generators/storybook-configuration/compat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
); |
7 changes: 7 additions & 0 deletions
7
packages/angular/src/generators/utils/warn-for-schematic-usage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export function warnForSchematicUsage<T>(convertedGenerator: T): T { | ||
console.warn( | ||
'Running generators as schematics is deprecated and will be removed in v17.' | ||
); | ||
|
||
return convertedGenerator; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); |