Skip to content

build: fix yarn install error if rules_nodejs linked local packages #22595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

devversion
Copy link
Member

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 "[email protected]" 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'.

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 "[email protected]" 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'.
```
@devversion devversion added merge safe area: build & ci Related the build and CI infrastructure of the project labels Apr 29, 2021
@devversion devversion requested a review from a team as a code owner April 29, 2021 16:05
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 29, 2021
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Apr 29, 2021
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@annieyw annieyw added the target: rc This PR is targeted for the next release-candidate label May 3, 2021
@annieyw annieyw merged commit 58a7421 into angular:master May 4, 2021
annieyw pushed 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 "[email protected]" 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)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project cla: yes PR author has agreed to Google's Contributor License Agreement target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants