Skip to content
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

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

Merged

Conversation

@devversion
Copy link
Member

@devversion devversion commented Apr 29, 2021

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'.
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'.
```
@devversion devversion requested review from crisbeto and josephperrott Apr 29, 2021
@devversion devversion requested a review from angular/dev-infra-components as a code owner Apr 29, 2021
@google-cla google-cla bot added the cla: yes label Apr 29, 2021
Copy link
Member

@josephperrott josephperrott left a comment

LGTM

Copy link
Member

@crisbeto crisbeto left a comment

LGTM

@annieyw annieyw merged commit 58a7421 into angular:master May 4, 2021
16 checks passed
16 checks passed
@in-solidarity
Inclusive Language Check completed with success
Details
@ngbot
ci/angular: merge status All checks passed!
ci/circleci: api_golden_checks Your tests passed on CircleCI!
Details
ci/circleci: bazel_build Your tests passed on CircleCI!
Details
ci/circleci: build_release_packages Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests Your tests passed on CircleCI!
Details
ci/circleci: integration_tests Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: ngcc_compatibility Your tests passed on CircleCI!
Details
ci/circleci: tests_browserstack Your tests passed on CircleCI!
Details
ci/circleci: tests_local_browsers Your tests passed on CircleCI!
Details
ci/circleci: tests_saucelabs Your tests passed on CircleCI!
Details
ci/circleci: upload_release_packages Your tests passed on CircleCI!
Details
ci/circleci: view_engine_build Your tests passed on CircleCI!
Details
ci/circleci: view_engine_test Your tests passed on CircleCI!
Details
@google-cla
cla/google All necessary CLAs are signed
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants