-
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): remove remaining angular cli helpers and set versio…
…n target for existing deprecations helpers (#10791)
- Loading branch information
1 parent
6bca146
commit e507d7b
Showing
4 changed files
with
29 additions
and
89 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
28 changes: 13 additions & 15 deletions
28
packages/angular/src/migrations/update-12-0-0/update-ngcc-postinstall.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,24 +1,22 @@ | ||
import { chain, SchematicContext, Tree } from '@angular-devkit/schematics'; | ||
import { updateJsonInTree } from '@nrwl/workspace'; | ||
import { formatFiles } from '@nrwl/workspace'; | ||
import type { Tree } from '@nrwl/devkit'; | ||
import { formatFiles, updateJson } from '@nrwl/devkit'; | ||
|
||
const udpateNgccPostinstallScript = (host: Tree, context: SchematicContext) => { | ||
updateJsonInTree('package.json', (json) => { | ||
if ( | ||
json.scripts && | ||
json.scripts.postinstall && | ||
json.scripts.postinstall.includes('ngcc') | ||
) { | ||
// if exists, add execution of this script | ||
export default async function (tree: Tree) { | ||
let shouldFormat = false; | ||
|
||
updateJson(tree, 'package.json', (json) => { | ||
if (json.scripts?.postinstall?.includes('ngcc')) { | ||
json.scripts.postinstall = json.scripts.postinstall.replace( | ||
/(.*)(ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points)(.*)/, | ||
'$1ngcc --properties es2015 browser module main$3' | ||
); | ||
shouldFormat = true; | ||
} | ||
|
||
return json; | ||
})(host, context); | ||
}; | ||
}); | ||
|
||
export default function () { | ||
return chain([udpateNgccPostinstallScript, formatFiles()]); | ||
if (shouldFormat) { | ||
await formatFiles(tree); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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