fix(angular): keep ng generate working with angular-toolkit 13 - #1887
Merged
Conversation
Both Angular starters targeted @ionic/angular ^9.0.0 while pinning @ionic/angular-toolkit ^12.3.0, and ^12.3.0 cannot resolve to 13.0.0. Toolkit 12 generates Ionic 8 import paths, so `ng generate page` in a freshly started v9 app produced code that does not compile: it imports IonicModule from '@ionic/angular' and standalone components from '@ionic/angular/standalone', neither of which is correct in Ionic 9. Toolkit 12 also declares no peerDependencies, so npm installed it against Angular 22 without a warning. Toolkit 13 additionally flips the `standalone` default for the page and component schematics from false to true, which the NgModule starter was relying on. Left alone, `ng generate page` there takes the standalone path, looks for a *.routes.ts that an NgModule starter does not have, and fails with "Could not find your routes file". Both starters now state `standalone` explicitly rather than inheriting a default that can move again: false for angular, true for angular-standalone. Verified by building both blank starters with --current, installing, and running the schematics against the released toolkit 13.0.0: - angular: emits an NgModule page and registers it in app-routing.module.ts - angular-standalone: emits a standalone page importing from the '@ionic/angular' root and registers it in app.routes.ts - both: `npm run build` succeeds and 4/4 tests pass, generated specs included Both starters are zoneless, so the toolkit 13 spec template fix matters here too: toolkit 12 generated component specs using waitForAsync, which needs zone.js.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@ionic/angular-toolkit@13.0.0is out. Both Angular starters need it, and the NgModule starter needs one extra change to survive a default that moved.