Skip to content

Commit b2c3f26

Browse files
devversionandrewseguin
authored andcommitted
refactor: support PnP for experimental package and MDC deps
Yarn PnP requires explicit listing of dependencies used. Since our Sass files/compilations do not use `material-components-web` but rather use the individual `@material/<..>` packages, we need to switch away from the kitchen-sink package. As part of this, we have two options long-term: * Add all individual deps as peer dependencies * Add all individual deps as _direct_ dependencies. The latter seems more convenient for users and we also cannot make any guarantees that a more recent "build" of the `@material/<..>` packages is still compatible. If users would intend to force a more recent MDC version, they could still use a Yarn resolution, or we could also bump our `dependencies` using a `caret` or `tilde` (once we are relying on a rather stable version of MDC -- that is a potential option then)
1 parent 2210c13 commit b2c3f26

File tree

10 files changed

+259
-389
lines changed

10 files changed

+259
-389
lines changed

integration/yarn-pnp-compat/BUILD.bazel

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
load("@bazel_skylib//lib:dicts.bzl", "dicts")
12
load("//tools:defaults.bzl", "node_integration_test")
3+
load("//tools:integration.bzl", "CLI_PROJECT_MAPPINGS")
4+
5+
npmPackageMappings = dicts.add(
6+
CLI_PROJECT_MAPPINGS,
7+
{
8+
"//src/cdk:npm_package_archive": "@angular/cdk",
9+
"//src/material:npm_package_archive": "@angular/material",
10+
"//src/material-experimental:npm_package_archive": "@angular/material-experimental",
11+
},
12+
)
213

314
node_integration_test(
415
name = "test",
@@ -14,10 +25,7 @@ node_integration_test(
1425
# Set `CI` to silence `yarn berry` and make the output readable.
1526
"CI": "true",
1627
},
17-
npm_packages = {
18-
"//src/cdk:npm_package_archive": "@angular/cdk",
19-
"//src/material:npm_package_archive": "@angular/material",
20-
},
28+
npm_packages = npmPackageMappings,
2129
tags = [
2230
# This test relies on `yarn` so there needs to be internet access.
2331
"requires-network",

0 commit comments

Comments
 (0)