Repository navigation
fix(schematics): require only exported devkit paths from the shipped schematics - #3793
Open
armando-navarro wants to merge 1 commit into
Open
armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
Conversation
…schematics @angular-devkit/schematics 22.3 adds an exports map that allows ./tasks but not ./tasks/index.js. The shipped setup, deploy builder and v21 migration bundles required tasks/index.js, so `ng update` crashed after installing whenever it ran a 22.3 CLI, and the v21 migration never ran. The source keeps the index.js spelling, which the ESM spec run needs while the repo's devkit 21 has no exports map. An esbuild alias rewrites it in the bundles, and the build now fails when a bundle requires a package subpath that is not in exportedSubpaths, naming the importers. typescript stays external so the v21 migration uses the compiler from the user's workspace at ng update time, rather than adding about 3.5 MB to the package.
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.
Fixes #3789
The shipped schematics now require
@angular-devkit/schematics/tasks, which every devkit version accepts, instead of@angular-devkit/schematics/tasks/index.js, which theexportsmap in devkit 22.3 rejects.Changes
All in
compileSchematicsintools/build.ts.aliasrewrites@angular-devkit/schematics/tasks/index.jsto@angular-devkit/schematics/tasksin the bundles.index.jsspelling, because the ESM spec run cannot import the baretasksfolder from the repo's devkit 21, which has noexportsmap.exportedSubpaths, and names the files that import it. The list holds@angular-devkit/schematics/tasks,@schematics/angular/utilityandrxjs/operators, each of which is in its package'sexportsmap.externalPackagesconstant, which the check reads.Behavior to know
When the repo's own devkit reaches 22.3 or later, the two source imports can switch to
@angular-devkit/schematics/tasksand the alias can go.Verification
@angular-devkit/schematics21.2.25 and 22.3.0-next.0. With the current canary,setup/index.js,deploy/builder.jsandupdate/v21/index.jsfail under 22.3.0-next.0.npm run test:node: 342 specs, 0 failures.