@@ -175,40 +175,6 @@ function mergeWithRootTsLint(parentHost: Tree) {
175175 } ;
176176}
177177
178- function addPostInstallScript ( ) {
179- return ( host : Tree ) => {
180- const pkgJsonPath = '/package.json' ;
181- const buffer = host . read ( pkgJsonPath ) ;
182- if ( ! buffer ) {
183- throw new SchematicsException ( 'Could not read package.json.' ) ;
184- }
185-
186- const packageJsonAst = parseJsonAst ( buffer . toString ( ) , JsonParseMode . Strict ) ;
187- if ( packageJsonAst . kind !== 'object' ) {
188- throw new SchematicsException ( 'Invalid package.json. Was expecting an object.' ) ;
189- }
190-
191- const scriptsNode = findPropertyInAstObject ( packageJsonAst , 'scripts' ) ;
192- if ( scriptsNode && scriptsNode . kind === 'object' ) {
193- const recorder = host . beginUpdate ( pkgJsonPath ) ;
194- const postInstall = findPropertyInAstObject ( scriptsNode , 'postinstall' ) ;
195-
196- if ( ! postInstall ) {
197- // postinstall script not found, add it.
198- insertPropertyInAstObjectInOrder (
199- recorder ,
200- scriptsNode ,
201- 'postinstall' ,
202- 'ivy-ngcc' ,
203- 4 ,
204- ) ;
205- }
206-
207- host . commitUpdate ( recorder ) ;
208- }
209- } ;
210- }
211-
212178function addAppToWorkspaceFile ( options : ApplicationOptions , workspace : WorkspaceSchema ) : Rule {
213179 // TODO: use JsonAST
214180 // const workspacePath = '/angular.json';
@@ -453,7 +419,6 @@ export default function (options: ApplicationOptions): Rule {
453419 move ( sourceDir ) ,
454420 ] ) , MergeStrategy . Overwrite ) ,
455421 options . minimal ? noop ( ) : schematic ( 'e2e' , e2eOptions ) ,
456- options . enableIvy ? addPostInstallScript ( ) : noop ( ) ,
457422 options . skipPackageJson ? noop ( ) : addDependenciesToPackageJson ( options ) ,
458423 options . lintFix ? applyLintFix ( appDir ) : noop ( ) ,
459424 ] ) ;
0 commit comments