-
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): migrate downgrade-module and upgrade-module generat…
…ors to nx devkit (#6083)
- Loading branch information
1 parent
fdb54b3
commit 122f7ec
Showing
44 changed files
with
948 additions
and
713 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
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
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
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
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
30 changes: 30 additions & 0 deletions
30
packages/angular/src/generators/downgrade-module/__snapshots__/downgrade-module.spec.ts.snap
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,30 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`downgradeModule generator should update main.ts 1`] = ` | ||
"import { enableProdMode, StaticProvider } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import * as angular from 'angular'; | ||
import { downgradeComponent, downgradeModule, setAngularJSGlobal } from '@angular/upgrade/static'; | ||
import { AppModule } from './app/app.module'; | ||
import { environment } from './environments/environment'; | ||
import 'legacy'; | ||
import { AppComponent } from './app/app.component'; | ||
export function bootstrapAngular(extra: StaticProvider[]): any { | ||
setAngularJSGlobal(angular); | ||
if (environment.production) { | ||
enableProdMode(); | ||
} | ||
return platformBrowserDynamic(extra) | ||
.bootstrapModule(AppModule) | ||
.catch(err => console.log(err)); | ||
} | ||
const downgraded = angular | ||
.module('downgraded', [downgradeModule(bootstrapAngular)]) | ||
.directive('appRoot', downgradeComponent({ component: AppComponent, propagateDigest: false })); | ||
angular.bootstrap(document, ['legacy', downgraded.name]);" | ||
`; |
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,4 @@ | ||
import { convertNxGenerator } from '@nrwl/devkit'; | ||
import { downgradeModuleGenerator } from './downgrade-module'; | ||
|
||
export default convertNxGenerator(downgradeModuleGenerator); |
Oops, something went wrong.
122f7ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: