Skip to content

Commit de12f01

Browse files
kyliaujbedard
authored andcommitted
Make material work without building from source
1 parent 7fe780f commit de12f01

File tree

7 files changed

+102
-67
lines changed

7 files changed

+102
-67
lines changed

BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

22
exports_files([
3+
"package.json",
34
"tsconfig.json",
4-
])
5+
])

WORKSPACE

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
55
# Fetch rules_nodejs so we can install our npm dependencies
66
http_archive(
77
name = "build_bazel_rules_nodejs",
8-
sha256 = "a69c5bd317beef982298ea7b5ed8b5c5275d1b55ee199e98a0ca088f8e0c6cce",
9-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.18.7/rules_nodejs-0.18.7.tar.gz"],
8+
sha256 = "5c86b055c57e15bf32d9009a15bcd6d8e190c41b1ff2fb18037b75e0012e4e7c",
9+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.26.0/rules_nodejs-0.26.0.tar.gz"],
1010
)
1111

1212
http_archive(
@@ -83,11 +83,3 @@ ts_setup_workspace()
8383
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
8484

8585
sass_repositories()
86-
87-
# Setup the angular toolchain. This integration test no longer builds Angular from source,
88-
# but we still need to set up the "angular" workspace since some Bazel rules depend on
89-
# the "ngdeps" repository. This can be fixed if we switched the Angular repository to the
90-
# "npm" repository for the bazel managed dependencies.
91-
load("@npm_angular_bazel//:index.bzl", "ng_setup_workspace")
92-
93-
ng_setup_workspace()

angular-metadata.tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"exclude": [
1717
"node_modules/@angular/bazel/**",
1818
"node_modules/@angular/compiler-cli/**",
19-
"node_modules/@angular/**/testing/**"
19+
"node_modules/@angular/**/testing/**",
20+
"node_modules/@angular/material/**/schematics",
21+
"node_modules/@angular/cdk/**/schematics"
2022
]
2123
}

package.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,29 @@
44
"license": "UNLICENSED",
55
"private": true,
66
"dependencies": {
7-
"@angular/animations": "7.2.7",
8-
"@angular/cdk": "^7.3.3",
9-
"@angular/common": "7.2.7",
10-
"@angular/core": "7.2.7",
11-
"@angular/material": "^7.3.3",
7+
"@angular/animations": "7.2.9",
8+
"@angular/cdk": "^7.3.4",
9+
"@angular/common": "7.2.9",
10+
"@angular/core": "7.2.9",
11+
"@angular/forms": "7.2.9",
12+
"@angular/platform-browser": "7.2.9",
13+
"@angular/material": "7.3.4",
1214
"tslib": "1.9.3"
1315
},
1416
"devDependencies": {
15-
"@angular/bazel": "7.2.7",
16-
"@angular/compiler": "7.2.7",
17-
"@angular/compiler-cli": "7.2.7",
17+
"@angular/bazel": "7.2.9",
18+
"@angular/compiler": "7.2.9",
19+
"@angular/compiler-cli": "7.2.9",
1820
"@bazel/karma": "^0.25.1",
19-
"@bazel/typescript": "^0.25.1",
21+
"@bazel/typescript": "^0.27.4",
2022
"@types/node": "^11.9.5",
2123
"rxjs": "^6.4.0",
2224
"typescript": ">=3.1.1 <3.3",
2325
"zone.js": "~0.8.26"
2426
},
27+
"scripts": {
28+
"postinstall": "ngc -p ./angular-metadata.tsconfig.json"
29+
},
2530
"engines": {
2631
"node": ">=10.13.0",
2732
"yarn": ">=1.12.1"

ui/BUILD

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ load("@npm_angular_bazel//:index.bzl", "ng_module", "ng_package")
88
UI_COMPONENTS = [
99
"banner",
1010
"injected",
11+
"simple-injected",
1112
]
1213

1314
UI_COMPONENT_PACKAGES = ["//ui/%s" % p for p in UI_COMPONENTS]
@@ -16,20 +17,28 @@ ng_module(
1617
name = "ui",
1718
srcs = glob(["*.ts"]),
1819
module_name = "@npmscope/ui",
19-
deps = ["@npm//@types", "@npm//@angular/core"] + UI_COMPONENT_PACKAGES,
20+
deps = [
21+
"@npm//@types",
22+
"@npm//@angular/common",
23+
"@npm//@angular/core",
24+
"@npm//@angular/material",
25+
"@npm//@angular/platform-browser",
26+
] + UI_COMPONENT_PACKAGES,
2027
)
2128

2229
# BROKEN!!
2330
ng_package(
24-
name = "npm",
25-
srcs = ["package.json"],
26-
entry_point = "ui/index.js",
27-
deps = [":ui"] + UI_COMPONENT_PACKAGES,
28-
globals = {
29-
'@angular/material/button': 'ng.material.button',
30-
'@angular/material/icon': 'ng.material.icon',
31+
name = "npm",
32+
srcs = ["//:package.json"],
33+
entry_point = "ui/index.js",
34+
deps = [
35+
":ui",
36+
] + UI_COMPONENT_PACKAGES,
37+
globals = {
38+
'@angular/material/button': 'ng.material.button',
39+
'@angular/material/icon': 'ng.material.icon',
3140

32-
'@angular/cdk/overlay': 'ng.cdk.overlay',
33-
'@angular/cdk/scrolling': 'ng.cdk.scrolling', #<-- indirect dep of @angular/cdk/overlay, containing ngfactory which is missing
34-
}
35-
)
41+
'@angular/cdk/overlay': 'ng.cdk.overlay',
42+
'@angular/cdk/scrolling': 'ng.cdk.scrolling', #<-- indirect dep of @angular/cdk/overlay, containing ngfactory which is missing
43+
}
44+
)

ui/banner/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ ng_module(
1515
"@npm//@angular/common",
1616
"@npm//@angular/core",
1717
"@npm//@angular/material",
18+
"@npm//@angular/platform-browser",
1819
],
19-
)
20+
)

yarn.lock

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,48 +40,48 @@
4040
"@angular-devkit/core" "7.3.3"
4141
rxjs "6.3.3"
4242

43-
"@angular/animations@^7.2.7":
44-
version "7.2.7"
45-
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-7.2.7.tgz#14aa9b4006dbffb08bd705842cdcc1d0b502ae90"
46-
integrity sha512-eU/wSkBmukZXCCe/epUl02xsKPauF+deMbncxBE+w/NmmWjJ77Q09iZAcgzM92RVXj2LsVYQXsNEBGT3X0hRZw==
43+
"@angular/animations@7.2.9":
44+
version "7.2.9"
45+
resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-7.2.9.tgz#1bfacb76dfd80656e28edb4efdfd3154e56f1c29"
46+
integrity sha512-cdIf/UWwhNlw6Ep3pRxRk12F8q/GyTbcHDF4qbgg7lZEDPYS32KS1lpHY1pgSuSOIPZUT+iLPOxAZ6cu7Am1vA==
4747
dependencies:
4848
tslib "^1.9.0"
4949

50-
"@angular/bazel@7.2.7":
51-
version "7.2.7"
52-
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-7.2.7.tgz#902a37107302ea2c57f840b568c009bbefbcff4c"
53-
integrity sha512-IOCbMx/AGfXKST8wwBs9bNqkM0Pu8VqKPpFQOIovQI9iQdDAQ0ihD7USCA2bqyvgLbh85/LpXklADEgj69ywmw==
50+
"@angular/bazel@7.2.9":
51+
version "7.2.9"
52+
resolved "https://registry.yarnpkg.com/@angular/bazel/-/bazel-7.2.9.tgz#9d06f1a0f23f4d0175e866660b2bb0d307190611"
53+
integrity sha512-hEGFj4vdV36FskUsd+bpvoMdRaS+nAIORYWqai5R2NAAs9MtWiLfoEL9q7wR87wO+qhS1X/c8p/Ia7tL5PAOkQ==
5454
dependencies:
5555
"@angular-devkit/architect" "^0.10.6"
5656
"@angular-devkit/core" "^7.0.4"
5757
"@angular-devkit/schematics" "^7.3.0-rc.0"
58-
"@bazel/typescript" "^0.25.1"
58+
"@bazel/typescript" "^0.26.0"
5959
"@schematics/angular" "^7.0.4"
6060
"@types/node" "6.0.84"
6161
semver "^5.6.0"
6262
shelljs "0.8.2"
6363
tsickle "0.34.0"
6464

65-
"@angular/cdk@^7.3.3":
66-
version "7.3.3"
67-
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.3.3.tgz#02a2ad248141cd9968a5950ce0602da3fcf5445b"
68-
integrity sha512-0M3nwq+c9+d+p0XeU12I9djutlsajRrxcu7AvHQXUs/5grYFsXsX0f468qXDiKmcgqGUBNtN2fBOUhGNlispuQ==
65+
"@angular/cdk@^7.3.4":
66+
version "7.3.4"
67+
resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-7.3.4.tgz#b9d8c62cdd24fa6517dd3ae68c78632b1525d35f"
68+
integrity sha512-cHl1o7obogCO3Nxf9n8MrXpfHa7AH1QNX2BY+bftYBTHW++YJe+qAwkwWLVqnJD9TQE2OpiR058zoJU20khM/g==
6969
dependencies:
7070
tslib "^1.7.1"
7171
optionalDependencies:
7272
parse5 "^5.0.0"
7373

74-
"@angular/common@^7.2.7":
75-
version "7.2.7"
76-
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.2.7.tgz#d0078a1cabc5e5c34ceb7691c2a31440ce7630fb"
77-
integrity sha512-U1l2CIcmpTAJMWcyTXI9qt1E8CxwKNW1vr6XWZo4X5ziCIzf7RvClzK7Ci5KZKkoPJrJqBJu661Q75Yt22dJsg==
74+
"@angular/common@7.2.9":
75+
version "7.2.9"
76+
resolved "https://registry.yarnpkg.com/@angular/common/-/common-7.2.9.tgz#eeb3d0332e14f737bfb9a63b8347b3dd625e57fe"
77+
integrity sha512-SBIinZi/R0mKWjbKvcBhwRpAVIY/7/AnzIEkMb5JnGExersYhDD02otW3ZwPStpl7HrhgWk8ueWnxVFFXRz5gA==
7878
dependencies:
7979
tslib "^1.9.0"
8080

81-
"@angular/compiler-cli@7.2.7":
82-
version "7.2.7"
83-
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-7.2.7.tgz#01adbb176075d2d02959a92053409dd0af343e2f"
84-
integrity sha512-UPWROJzBLejgNf+aqgEUXYts8UiFOl2IavDhS/olA9irszv2lNFj9Yqr8OKdy0jK/lKaipZog3VZEx8g5dNeBA==
81+
"@angular/compiler-cli@7.2.9":
82+
version "7.2.9"
83+
resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-7.2.9.tgz#2c1c970969a956fe148a96fe402704626568d3bc"
84+
integrity sha512-3itdcfszdyXTHYEsO4eBu4WEx10hU8JpOgUcZyw+OYgwLQLyjEXOD9dfYZZpE/+2F0omoMLseCTHTP//uux+Iw==
8585
dependencies:
8686
canonical-path "1.0.0"
8787
chokidar "^2.1.1"
@@ -95,27 +95,41 @@
9595
tslib "^1.9.0"
9696
yargs "9.0.1"
9797

98-
"@angular/compiler@7.2.7":
99-
version "7.2.7"
100-
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-7.2.7.tgz#3f3deb851634db871e92acde2f1ee56362d8c47f"
101-
integrity sha512-e61YVxW5x4w+X4yjGaptYoJIja7HwH0+8FFEaH6VuPl/DrK8wP4HDMhLo4NzdgeZKLR2jBIQSqLmoM8W7UXcqw==
98+
"@angular/compiler@7.2.9":
99+
version "7.2.9"
100+
resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-7.2.9.tgz#92dd0d9fd26fa7cfdbc8c75d0be0d96bd6432fbb"
101+
integrity sha512-jAKV4C5BW2pnke10fiDZNbLCQOs2QK37mUJWe5jnZqCAM4Y3edXlfifOkbi0hvA4WJMDXKmUdydY6Xo/Z+cWbA==
102102
dependencies:
103103
tslib "^1.9.0"
104104

105-
"@angular/core@7.2.7":
106-
version "7.2.7"
107-
resolved "https://registry.yarnpkg.com/@angular/core/-/core-7.2.7.tgz#4311028181a98aa844572ea4b6cb9e87fc58d9ba"
108-
integrity sha512-E7qjMQdS77SbRROKu13VsfL+MJN52eTlrU0SzEAFGUOgdvbmDYJOaEwjqrouKpYZ0pul8KOoalvlPB7oVflC7A==
105+
"@angular/core@7.2.9":
106+
version "7.2.9"
107+
resolved "https://registry.yarnpkg.com/@angular/core/-/core-7.2.9.tgz#43ca94adf74fd8ad9ba0b015b3b979a5d04fb3a6"
108+
integrity sha512-tW1jHjCnvtquJ3XEnmqRNMoV7MXAZ2yfnCXE25+odRZjNVMiTcKWvRLd/XjBzjCg2OvwREXcQpB7/s+Av10uAQ==
109109
dependencies:
110110
tslib "^1.9.0"
111111

112-
"@angular/material@^7.3.3":
113-
version "7.3.3"
114-
resolved "https://registry.yarnpkg.com/@angular/material/-/material-7.3.3.tgz#f3f87fa90c685cfad0b6974489c69d2676199052"
115-
integrity sha512-DZdJaVpXsd5QlfpN5P871llw8AKh5QvRiyro3QRmEajYN85Xiawqpbt7O60TrwcFM6DzYLI3UeyWq8LFdmi/+Q==
112+
"@angular/forms@7.2.9":
113+
version "7.2.9"
114+
resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-7.2.9.tgz#1cc46542b422654ac87a6ead84cb4d9a7e73b0e8"
115+
integrity sha512-2hpu2Gl8suwG5FmOczk/oBBE1x7QypM58XE1ms0V6uYlL+g/JIg0AWMMOldI5KYUnxwoCikgsdGzzt8XPbvRkQ==
116+
dependencies:
117+
tslib "^1.9.0"
118+
119+
"@angular/material@7.3.4":
120+
version "7.3.4"
121+
resolved "https://registry.yarnpkg.com/@angular/material/-/material-7.3.4.tgz#a0d3fc14bf4c165944e3f1ddc71f7c685b8d4ef3"
122+
integrity sha512-UWS4Kd3AqJBtAJRds4hhPNez9k1rkWhd6/E17pfcH6KWxP3Pi7tcubaSqoDRGHVbr/QegDn1SOoRokJxLYDn2g==
116123
dependencies:
117124
tslib "^1.7.1"
118125

126+
"@angular/platform-browser@7.2.9":
127+
version "7.2.9"
128+
resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-7.2.9.tgz#4259eb9c41d152c580ab283b858a938fc0058421"
129+
integrity sha512-h7RaXllauFLa1SPcje/cK7IbwCqV6ViyeHEUAAWljrM2OWRU1zRYtDk/gcphRj4tWhhHVfQsJ9+0p3NoPP5LZw==
130+
dependencies:
131+
tslib "^1.9.0"
132+
119133
"@bazel/karma@^0.25.1":
120134
version "0.25.1"
121135
resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.25.1.tgz#246286299b6e96fa4a91d240d3c3d7386164adaf"
@@ -144,6 +158,17 @@
144158
source-map-support "0.5.9"
145159
tsutils "2.27.2"
146160

161+
"@bazel/typescript@^0.26.0":
162+
version "0.26.0"
163+
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.26.0.tgz#c06139d76c8b9d3a3ed98a721b776fedb4b11c82"
164+
integrity sha512-dh/Y/SZzmeChsLap8FVHYl0FuaeLh/6t9WBVhm5nOgyVrqfEyVpNzy4W20E4NqnmJY2/PqmD5qncf+Oo1q9h1A==
165+
dependencies:
166+
jasmine-core "2.8.0"
167+
protobufjs "5.0.3"
168+
semver "5.6.0"
169+
source-map-support "0.5.9"
170+
tsutils "2.27.2"
171+
147172
"@schematics/angular@^7.0.4":
148173
version "7.3.3"
149174
resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-7.3.3.tgz#aaa63331365bf67b1b908cc18cfc5d7097ec8377"

0 commit comments

Comments
 (0)