Skip to content

Commit c1a5684

Browse files
devversionjelbourn
authored andcommitted
build: fix ngcc compatibility jobs not running against packages (#19161)
Ngcc changed how entry points are detected. In the current state, they store a manifest of discovered packages and entry-points in the node modules. This means that ngcc won't run for packages we manually copy into the `node_modules` while a manifest exists. To fix this for our job, we delete the manifest file. Also it looks like MDC now has support for path mapping. This means that it will use the tsconfig from the project root. This causes the release packages to be resolved to the actual sources. We fix this by disabling tsconfig parsing. Also it seems like we need to pass a flag now so that ngcc will fail if compilation of an entry-point did not complete successfully.
1 parent 86b220e commit c1a5684

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.circleci/config.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,15 @@ jobs:
405405
- *attach_release_output
406406
- *yarn_install
407407

408+
# Copy the release packages into the node modules so that ngcc can process them.
408409
- run: cp -R dist/releases/* node_modules/@angular/
409-
- run: yarn ngcc
410+
# Delete existing ngcc manifests that would prevent the copied packages
411+
# from being discovered.
412+
- run: rm -f node_modules/__ngcc_entry_points__.json
413+
# Ensure that the job fails if an entry-point cannot be compiled. Also disable
414+
# tsconfig parsing as that causes the release packages to be incorrectly resolved
415+
# to the sources due to path mapping.
416+
- run: yarn ngcc --error-on-failed-entry-point --no-tsconfig
410417

411418
# -----------------------------------------------------------------
412419
# Job that ensures that the release output is compatible with the
@@ -422,8 +429,15 @@ jobs:
422429
- *setup_snapshot_builds
423430
- *yarn_install_loose_lockfile
424431

432+
# Copy the release packages into the node modules so that ngcc can process them.
425433
- run: cp -R dist/releases/* node_modules/@angular/
426-
- run: yarn ngcc
434+
# Delete existing ngcc manifests that would prevent the copied packages
435+
# from being discovered.
436+
- run: rm -f node_modules/__ngcc_entry_points__.json
437+
# Ensure that the job fails if an entry-point cannot be compiled. Also disable
438+
# tsconfig parsing as that causes the release packages to be incorrectly resolved
439+
# to the sources due to path mapping.
440+
- run: yarn ngcc --error-on-failed-entry-point --no-tsconfig
427441

428442
# ----------------------------------------------------------------------------
429443
# Job that runs the local browser tests against the Angular Github snapshots

0 commit comments

Comments
 (0)