build: fix yarn install error if rules_nodejs
linked local packages
#22595
Conversation
Currently if a package like `@angular/cdk` is used locally within a Bazel NodeJS action (e.g. when using with `rollup_bundle`), the Bazel NodeJS rules link the build output into the local `node_modules/` folder. This is problematic because later if `yarn` is executed, the linked packages are incorrectly included in the `angular-tsconfig.json` project (which is used for summary generation to allow for Bazel View Engine tests) We fix this by explicitly excluding our local packages to avoid errors such as: ``` info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. (warning Resolution field "typescript@4.2.3" is incompatible with requested version "typescript@^3.2.2" node_modules/@angular/components-examples/material/chips/chips-harness/chips-harness-example.d.ts:8:13 - error TS2503: Cannot find namespace 'jasmine'. ```
LGTM |
LGTM |
annieyw
added a commit
that referenced
this pull request
May 4, 2021
…#22595) Currently if a package like `@angular/cdk` is used locally within a Bazel NodeJS action (e.g. when using with `rollup_bundle`), the Bazel NodeJS rules link the build output into the local `node_modules/` folder. This is problematic because later if `yarn` is executed, the linked packages are incorrectly included in the `angular-tsconfig.json` project (which is used for summary generation to allow for Bazel View Engine tests) We fix this by explicitly excluding our local packages to avoid errors such as: ``` info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. (warning Resolution field "typescript@4.2.3" is incompatible with requested version "typescript@^3.2.2" node_modules/@angular/components-examples/material/chips/chips-harness/chips-harness-example.d.ts:8:13 - error TS2503: Cannot find namespace 'jasmine'. ``` (cherry picked from commit 58a7421)
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.
Currently if a package like
@angular/cdk
is used locally within aBazel NodeJS action (e.g. when using with
rollup_bundle
), the BazelNodeJS rules link the build output into the local
node_modules/
folder.This is problematic because later if
yarn
is executed, the linkedpackages are incorrectly included in the
angular-tsconfig.json
project(which is used for summary generation to allow for Bazel View Engine tests)
We fix this by explicitly excluding our local packages to avoid errors
such as: