Skip to content

Commit ba8d14c

Browse files
devversionzarend
authored andcommitted
build: add exports entries for Sass module resolution
Adds the `exports` field for module resolution of `@angular/cdk` and `@angular/material` when Sass is requested. Since these packages use the `exports` field already, to prevent deep imports, we also need to expose the Sass entry-points and prebuilt files. The webpack loader requires the `sass` conditional to be set when the CDK or Material modules are loaded without the `includePaths` option. It is worth noting that the Sass webpack loader does not seem to respect the exports field when `@import` is used. Still for consistency and other potential bundlers/loaders, we will expose the `.css` extension subpaths. Also as a side-note: the `.css` extension imports do not work with `@use`, so the non-extension variants are helpful there for backwards compatibility & convenient access.
1 parent 0f24ceb commit ba8d14c

File tree

8 files changed

+114
-61
lines changed

8 files changed

+114
-61
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
},
5151
"version": "13.0.0-next.7",
5252
"dependencies": {
53-
"@angular/animations": "13.0.0-next.12",
54-
"@angular/common": "13.0.0-next.12",
55-
"@angular/compiler": "13.0.0-next.12",
56-
"@angular/core": "13.0.0-next.12",
57-
"@angular/forms": "13.0.0-next.12",
58-
"@angular/platform-browser": "13.0.0-next.12",
53+
"@angular/animations": "13.0.0-next.15",
54+
"@angular/common": "13.0.0-next.15",
55+
"@angular/compiler": "13.0.0-next.15",
56+
"@angular/core": "13.0.0-next.15",
57+
"@angular/forms": "13.0.0-next.15",
58+
"@angular/platform-browser": "13.0.0-next.15",
5959
"@types/google.maps": "^3.45.6",
6060
"@types/youtube": "^0.0.42",
6161
"core-js-bundle": "^3.8.2",
@@ -69,13 +69,13 @@
6969
"@angular-devkit/build-optimizer": "0.1300.0-next.7",
7070
"@angular-devkit/core": "13.0.0-next.7",
7171
"@angular-devkit/schematics": "13.0.0-next.7",
72-
"@angular/bazel": "13.0.0-next.12",
73-
"@angular/compiler-cli": "13.0.0-next.12",
72+
"@angular/bazel": "13.0.0-next.15",
73+
"@angular/compiler-cli": "13.0.0-next.15",
7474
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#e674228281ff6ac4d21779070b090e8a8bde9e69",
75-
"@angular/localize": "13.0.0-next.12",
76-
"@angular/platform-browser-dynamic": "13.0.0-next.12",
77-
"@angular/platform-server": "13.0.0-next.12",
78-
"@angular/router": "13.0.0-next.12",
75+
"@angular/localize": "13.0.0-next.15",
76+
"@angular/platform-browser-dynamic": "13.0.0-next.15",
77+
"@angular/platform-server": "13.0.0-next.15",
78+
"@angular/router": "13.0.0-next.15",
7979
"@axe-core/webdriverjs": "^4.1.0",
8080
"@babel/core": "^7.13.10",
8181
"@babel/traverse": "^7.13.0",

src/cdk/config.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ CDK_TARGETS = ["//src/cdk"] + ["//src/cdk/%s" % ep for ep in CDK_ENTRYPOINTS]
3030
# Within the CDK, only a few targets have sass libraries which need to be
3131
# part of the release package. This list declares all CDK targets with sass
3232
# libraries that need to be included and re-exported at the package root.
33+
# **Note**: When updating the list of CDK entry-points with styles, also update
34+
# the `exports` field in the `cdk/package.json` file.
3335
CDK_ENTRYPOINTS_WITH_STYLES = [
3436
"a11y",
3537
"overlay",

src/cdk/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
"url": "https://github.com/angular/components/issues"
1919
},
2020
"homepage": "https://github.com/angular/components#readme",
21+
"exports": {
22+
".": {
23+
"sass": "./_index.scss"
24+
},
25+
"./a11y-prebuilt.css": {"style": "./a11y-prebuilt.css"},
26+
"./a11y-prebuilt": {"style": "./a11y-prebuilt.css"},
27+
"./overlay-prebuilt.css": {"style": "./overlay-prebuilt.css"},
28+
"./overlay-prebuilt": {"style": "./overlay-prebuilt.css"},
29+
"./text-field-prebuilt.css": {"style": "./text-field-prebuilt.css"},
30+
"./text-field-prebuilt": {"style": "./text-field-prebuilt.css"}
31+
},
2132
"peerDependencies": {
2233
"@angular/core": "0.0.0-NG",
2334
"@angular/common": "0.0.0-NG",

src/material-experimental/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
"url": "https://github.com/angular/components/issues"
1212
},
1313
"homepage": "https://github.com/angular/components#readme",
14+
"exports": {
15+
".": {
16+
"sass": "./_index.scss"
17+
},
18+
"./mdc-theming/prebuilt/indigo-pink.css": {
19+
"style": "./mdc-theming/prebuilt/indigo-pink.css"
20+
},
21+
"./mdc-theming/prebuilt/*": {
22+
"style": "./mdc-theming/prebuilt/*.css"
23+
}
24+
},
1425
"peerDependencies": {
1526
"@angular/core": "0.0.0-NG",
1627
"@angular/material": "0.0.0-PLACEHOLDER",

src/material/package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@
1717
"url": "https://github.com/angular/components/issues"
1818
},
1919
"homepage": "https://github.com/angular/components#readme",
20+
"exports": {
21+
".": {
22+
"sass": "./_index.scss"
23+
},
24+
"./theming": {
25+
"sass": "./_theming.scss"
26+
},
27+
"./_theming": {
28+
"sass": "./_theming.scss"
29+
},
30+
"./prebuilt-themes/indigo-pink.css": {
31+
"style": "./prebuilt-themes/indigo-pink.css"
32+
},
33+
"./prebuilt-themes/deeppurple-amber.css": {
34+
"style": "./prebuilt-themes/deeppurple-amber.css"
35+
},
36+
"./prebuilt-themes/pink-bluegrey.css": {
37+
"style": "./prebuilt-themes/pink-bluegrey.css"
38+
},
39+
"./prebuilt-themes/purple-green.css": {
40+
"style": "./prebuilt-themes/purple-green.css"
41+
},
42+
"./prebuilt-themes/*": {
43+
"style": "./prebuilt-themes/*.css"
44+
}
45+
},
2046
"peerDependencies": {
2147
"@angular/animations": "0.0.0-NG",
2248
"@angular/cdk": "0.0.0-PLACEHOLDER",

src/material/prebuilt-themes/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ package(default_visibility = ["//visibility:public"])
44
# package in the right spot. The *right* thing to do would be to move them, but
55
# we would need to update references for Google apps.
66

7+
## **NOTE**: When adding/removing prebuilt themes from here, make sure to update
8+
# the `material/package.json` exports field.
9+
710
genrule(
811
name = "indigo-pink",
912
srcs = ["//src/material/core:theming/prebuilt/indigo-pink.css"],

tools/postinstall/apply-patches.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const chalk = require('chalk');
1414
* Version of the post install patch. Needs to be incremented when
1515
* existing patches or edits have been modified.
1616
*/
17-
const PATCH_VERSION = 11;
17+
const PATCH_VERSION = 13;
1818

1919
/** Path to the project directory. */
2020
const projectDir = path.join(__dirname, '../..');

yarn.lock

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@
6565
ora "5.4.1"
6666
rxjs "6.6.7"
6767

68-
"@angular/animations@13.0.0-next.12":
69-
version "13.0.0-next.12"
70-
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-13.0.0-next.12.tgz#ca1e40fa4f8e6b7514673931303b0257b2e8ccbd"
71-
integrity sha512-cWa7bE/0HAXmMZQEYUi9GGD1qH7q3gTkdiWMuKiB1c8po/GPR/2ibNfusqijTv9k0VjRgEYCWaW61KCQFSvKfw==
68+
"@angular/animations@13.0.0-next.15":
69+
version "13.0.0-next.15"
70+
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-13.0.0-next.15.tgz#28a716223439e136b03f1944d0c407fcf1847b4a"
71+
integrity sha512-MZUlSyMSdW5eqpvDy5nGWg3hUQnoQwbYIqiDigFLyjaWcaQ0mkXA1M4Kidmo6D/aT0YInRBugSnGUS4RJ4la+w==
7272
dependencies:
7373
tslib "^2.3.0"
7474

75-
"@angular/bazel@13.0.0-next.12":
76-
version "13.0.0-next.12"
77-
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-13.0.0-next.12.tgz#efe7ddae7ab423b7774837d2f5ae8255bf33ebc7"
78-
integrity sha512-kDJs8q+S8j2AFsI8GIaufcjRZF+Qs3T5Xq075v/5iGtvhha9UbyrYXtcioINUIcdhLs6seIl6dG1NBpK+QM2UQ==
75+
"@angular/bazel@13.0.0-next.15":
76+
version "13.0.0-next.15"
77+
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-13.0.0-next.15.tgz#fe35f7728c71687f52e51f2d6d258bc1c8db133b"
78+
integrity sha512-hR1X42UmM2L3FSaj0cIlLSDopkqgMvw7nAREeDSaoMr2qk3BqfvpUx4P71KXMSKSJ1h+moKyPas07mRoLBGGyw==
7979
dependencies:
8080
"@microsoft/api-extractor" "7.18.11"
8181
shelljs "0.8.4"
@@ -90,17 +90,17 @@
9090
"@angular/core" "^10.0.0-0 || ^11.0.0"
9191
reflect-metadata "^0.1.13"
9292

93-
"@angular/common@13.0.0-next.12":
94-
version "13.0.0-next.12"
95-
resolved "https://registry.yarnpkg.com/@angular/common/-/common-13.0.0-next.12.tgz#8d01448aca2a961524f0599d1adecda2e0188289"
96-
integrity sha512-wzFY5a3VVUTw0t14UST695tIALOGv1E6I2pUuHoP1WBLl5XBt3SafYuWmnpUj8yF0/40zaePUEv25bGl5W3QUg==
93+
"@angular/common@13.0.0-next.15":
94+
version "13.0.0-next.15"
95+
resolved "https://registry.yarnpkg.com/@angular/common/-/common-13.0.0-next.15.tgz#9d55f51fbda235bea9510ca30a2f6389b22a19c2"
96+
integrity sha512-T0LPfZ4kKbcoT0QVluyT1Jo7J5ZK3vVSKSYMEHxqE21pFqlI5MMGdqn9X+SDlIEvEikARXG4w10Q3uJuAaaS5Q==
9797
dependencies:
9898
tslib "^2.3.0"
9999

100-
"@angular/compiler-cli@13.0.0-next.12":
101-
version "13.0.0-next.12"
102-
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-13.0.0-next.12.tgz#4a7eaeea3d83afdf6083876516ec14bb447e26bb"
103-
integrity sha512-kkUEsoykKWqaexFzGiZyqb55I8o69h74hBYw5a4iTtqy4wx2xQWoStR9bCqXsCteUSsfV5QVq72mtP3I5ublbg==
100+
"@angular/compiler-cli@13.0.0-next.15":
101+
version "13.0.0-next.15"
102+
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-13.0.0-next.15.tgz#4f25b6d3feb1dbb0a6dd0f7d5445f24d20b49709"
103+
integrity sha512-15w0fFrqFfHNbQ7nrzTB4rrObsIpmsbGAlrKoFPdWN2LbAYUEauUhRIPi1Et+4A1eh9beIUHpofwb+VRrUhuLw==
104104
dependencies:
105105
"@babel/core" "^7.8.6"
106106
canonical-path "1.0.0"
@@ -114,10 +114,10 @@
114114
tslib "^2.3.0"
115115
yargs "^17.2.1"
116116

117-
"@angular/compiler@13.0.0-next.12":
118-
version "13.0.0-next.12"
119-
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-13.0.0-next.12.tgz#49dafd3e97936d99246d80be5f482322c5b75663"
120-
integrity sha512-mOMkhICjonQAOoX2BEqwTdTFPPtLNsH7+92MJwB2KkBJfSuxfGKwfkMVOsXjq63zRplDTWxzxdj0wp2fD2iQIg==
117+
"@angular/compiler@13.0.0-next.15":
118+
version "13.0.0-next.15"
119+
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-13.0.0-next.15.tgz#bd9eaf5edc017112cf0c43de584f4167c6a3008f"
120+
integrity sha512-R2rKkSvONDuSW7D7WsN4nBH1fmZ9YagSiAb4F7cch5408DOMT6OlEgJDWAp69eWXiVDagd8R3e6K8j8StoZ6PQ==
121121
dependencies:
122122
tslib "^2.3.0"
123123

@@ -126,10 +126,10 @@
126126
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-9.0.0.tgz#87e0bef4c369b6cadae07e3a4295778fc93799d5"
127127
integrity sha512-ctjwuntPfZZT2mNj2NDIVu51t9cvbhl/16epc5xEwyzyDt76pX9UgwvY+MbXrf/C/FWwdtmNtfP698BKI+9leQ==
128128

129-
"@angular/core@13.0.0-next.12":
130-
version "13.0.0-next.12"
131-
resolved "https://registry.yarnpkg.com/@angular/core/-/core-13.0.0-next.12.tgz#5efe275d3558f4816b6b53a6a4f27dc6a80c00aa"
132-
integrity sha512-0x/N4qHOG+P2WdRXgS17sUMOyG/e5wKfT3DV5BF3Tc9BNh2ETIcE7n/VKAIwWGW6npd1xktyMGnblSUrte0/VA==
129+
"@angular/core@13.0.0-next.15":
130+
version "13.0.0-next.15"
131+
resolved "https://registry.yarnpkg.com/@angular/core/-/core-13.0.0-next.15.tgz#0d6083c7154bedf9a825e6270f41b83bacb325b3"
132+
integrity sha512-lBjH+dUWCj+Ki4najMRF4yoXq0p6MF+4hEQEwimlvUo3BFRMRTl9CMv82oSBeSYJkZlov1w5zhaA1PQO6zjyKQ==
133133
dependencies:
134134
tslib "^2.3.0"
135135

@@ -200,49 +200,49 @@
200200
yaml "^1.10.0"
201201
yargs "^17.0.0"
202202

203-
"@angular/forms@13.0.0-next.12":
204-
version "13.0.0-next.12"
205-
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-13.0.0-next.12.tgz#031a5952c46010ea6eb02b8670add2b5f96de24d"
206-
integrity sha512-fJpjHJI/IDXrCY/gGbDJ1VaTJ3hwtx9qB7og4yeIldAMTJRvWTK7gJbIWHyyIs1awBZtjUaOIVcqRF+tVhi3Vw==
203+
"@angular/forms@13.0.0-next.15":
204+
version "13.0.0-next.15"
205+
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-13.0.0-next.15.tgz#2959885bfe32b146b9065ae155fd1b52c73e51bf"
206+
integrity sha512-SvO818CJnxxiNSEGtWyJ+kpEtQoWtyIWXWHNkXUmjob6glGQatSDUlrkjx8oHNkqHnYyy7FMQXwRpzk/PWjBKw==
207207
dependencies:
208208
tslib "^2.3.0"
209209

210-
"@angular/localize@13.0.0-next.12":
211-
version "13.0.0-next.12"
212-
resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-13.0.0-next.12.tgz#7ceba63d4d1ae6801e5aa3ec412bc0359418ad55"
213-
integrity sha512-Gi0H/0LAT6n6WrXS/OEyhNGZZOxyQGwU/Pk1bufgd/j8FmjoSGhoM/3HRe9s84RMWh58qr/cCSoGO2s6QkCzZQ==
210+
"@angular/localize@13.0.0-next.15":
211+
version "13.0.0-next.15"
212+
resolved "https://registry.yarnpkg.com/@angular/localize/-/localize-13.0.0-next.15.tgz#28cadbddaf09986441d8bda091e23486d6fa6633"
213+
integrity sha512-FABnmk1QQ3oEdIeTF/pXaNQ6sWMo99imTBigIV8o6xrHymAy/qKMFSlbDDYFbYJTcqUFlVwt2CShHNfjXJkv5Q==
214214
dependencies:
215215
"@babel/core" "7.8.6"
216216
glob "7.2.0"
217217
yargs "^17.2.1"
218218

219-
"@angular/platform-browser-dynamic@13.0.0-next.12":
220-
version "13.0.0-next.12"
221-
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-13.0.0-next.12.tgz#965841f9d8a3ddc79775842f6ece9bde3c485657"
222-
integrity sha512-x0ZSn3irHOA3JSJjNPl2VguU+Dwuvd4Yb3q0QqNbS1BHJwzVODUaP3W6FbWqD6p0SPWBvvwcBONvbHa1XH6PxA==
219+
"@angular/platform-browser-dynamic@13.0.0-next.15":
220+
version "13.0.0-next.15"
221+
resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-13.0.0-next.15.tgz#f65308bb815a777134b5dcc89c2bb3ad09b3e563"
222+
integrity sha512-RanfSIIQBDy4QIK4hlCdlQUPch4BGW5J7uf1sgCUdOIQFkrkteEQ6wak1Bz6DL3ZXS5rz6XDepzI7aPuKkycMQ==
223223
dependencies:
224224
tslib "^2.3.0"
225225

226-
"@angular/platform-browser@13.0.0-next.12":
227-
version "13.0.0-next.12"
228-
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-13.0.0-next.12.tgz#0b9fa7ac7351b6ae17110ed2be1603775b7819d0"
229-
integrity sha512-rNZVaQNdJ56gWi8U56JkPqRRip0NDqfLcvFJYs8H7bo52z0BC54V6oQkMt3/7lBVXAm7sgwsHxqmpaxI98FHCA==
226+
"@angular/platform-browser@13.0.0-next.15":
227+
version "13.0.0-next.15"
228+
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-13.0.0-next.15.tgz#188c4c10f89f327fa4c759c4761246849dc5c1ea"
229+
integrity sha512-eVReO/qM7VpOW6mT3OB7LvVK0Fyd4yRmab2IOKYbrxXSkw4gzMmCrBbZqmE5nmR0mWEFP+swejrBGcp6A9duVg==
230230
dependencies:
231231
tslib "^2.3.0"
232232

233-
"@angular/platform-server@13.0.0-next.12":
234-
version "13.0.0-next.12"
235-
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-13.0.0-next.12.tgz#2517a75c6148e495a8a21a66efefd00c8f2d4335"
236-
integrity sha512-SzrmW72sE/Dbm0P4VqLCGkaGzvNz8sZjBCd+ECzY4lbZ9naQsxUWf9qunU3387bOsQ3oCiQTKA732pGQT+OOyA==
233+
"@angular/platform-server@13.0.0-next.15":
234+
version "13.0.0-next.15"
235+
resolved "https://registry.yarnpkg.com/@angular/platform-server/-/platform-server-13.0.0-next.15.tgz#a734183f48856cb19c6170bf4519912d3c2c1085"
236+
integrity sha512-5hObrIfGGVLKBENTcrhMzb7cAXsljViElvTrD6PVMeWJV15yMOUtYUVBNUF3s+T8An/hxEWFTNay2P+E+mFRAA==
237237
dependencies:
238238
domino "^2.1.2"
239239
tslib "^2.3.0"
240240
xhr2 "^0.2.0"
241241

242-
"@angular/router@13.0.0-next.12":
243-
version "13.0.0-next.12"
244-
resolved "https://registry.yarnpkg.com/@angular/router/-/router-13.0.0-next.12.tgz#c8189da8207e54c2b1bdaadb9d8e4a535122ecdb"
245-
integrity sha512-UkOXJvzTHaddX2883C7QMuUzfsHFdXeiohB376PsHM5N/9EPdWddQfqjded0es1YLhK1jSx8VOFYP3wYaCVk5A==
242+
"@angular/router@13.0.0-next.15":
243+
version "13.0.0-next.15"
244+
resolved "https://registry.yarnpkg.com/@angular/router/-/router-13.0.0-next.15.tgz#056f4adbed9ca6ccb98d19660421eadb5f6c22a4"
245+
integrity sha512-sYcSKnVv+/Sh9IivyUYmbPCACFVsoBLv/ZxhaRWR5dcjCunTsO65fhxtP3W75AOTkteyzVAmze3wXh3wM4TbrA==
246246
dependencies:
247247
tslib "^2.3.0"
248248

0 commit comments

Comments
 (0)