Skip to content

Commit 5705974

Browse files
committed
build: simplify bazel dependencies
1 parent 78576bd commit 5705974

File tree

14 files changed

+116
-75
lines changed

14 files changed

+116
-75
lines changed

WORKSPACE

Lines changed: 39 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,63 @@
11
workspace(name = "angular_devkit")
22

3-
BAZEL_SKYLIB_VERSION = "0.3.1"
3+
# We get Buildifier from here.
44
http_archive(
5-
name = "bazel_skylib",
6-
url = "https://github.com/bazelbuild/bazel-skylib/archive/%s.zip" % BAZEL_SKYLIB_VERSION,
7-
strip_prefix = "bazel-skylib-%s" % BAZEL_SKYLIB_VERSION,
8-
sha256 = "95518adafc9a2b656667bbf517a952e54ce7f350779d0dd95133db4eb5c27fb1",
5+
name = "com_github_bazelbuild_buildtools",
6+
url = "https://github.com/bazelbuild/buildtools/archive/0.15.0.zip",
7+
strip_prefix = "buildtools-0.15.0",
8+
sha256 = "76d1837a86fa6ef5b4a07438f8489f00bfa1b841e5643b618e01232ba884b1fe",
99
)
1010

11-
RULES_NODEJS_VERSION = "caae26b8cfc29838969e0614ebcb551a0e39ba26"
11+
load("@com_github_bazelbuild_buildtools//buildifier:deps.bzl", "buildifier_dependencies")
12+
buildifier_dependencies()
13+
14+
# The Go toolchain is used for Buildifier.
15+
# rules_typescript_dependencies() also tries to load it but we add it explicitely so we
16+
# don't have hidden dependencies.
17+
# This also means we need to load it before rules_typescript_dependencies().
18+
http_archive(
19+
name = "io_bazel_rules_go",
20+
url = "https://github.com/bazelbuild/rules_go/archive/0.14.0.zip",
21+
strip_prefix = "rules_go-0.14.0",
22+
sha256 = "9bd7c2743f014e4e112b671098ba1da6aec036fe07093b10ca39a9f81ec5cc33",
23+
)
24+
25+
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
26+
go_rules_dependencies()
27+
go_register_toolchains()
28+
29+
# Load the NodeJS rules, check minimum Bazel version, and define the local node_modules.
1230
http_archive(
1331
name = "build_bazel_rules_nodejs",
14-
url = "https://github.com/bazelbuild/rules_nodejs/archive/%s.zip" % RULES_NODEJS_VERSION,
15-
strip_prefix = "rules_nodejs-%s" % RULES_NODEJS_VERSION,
16-
sha256 = "8b6978d03f58e9ce8e3c0034afd879d621f9387f693f5a8e1888241b0538a61f",
32+
url = "https://github.com/bazelbuild/rules_nodejs/archive/0.11.5.zip",
33+
strip_prefix = "rules_nodejs-0.11.5",
34+
sha256 = "985bf908faa72cc4638c356a99d19ccac223e5dcd8dae695e3157e5c00f53489",
1735
)
1836

19-
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
37+
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
38+
rules_nodejs_dependencies()
2039

40+
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories")
2141
check_bazel_version("0.15.0")
22-
2342
node_repositories(package_json = ["//:package.json"])
2443

2544
local_repository(
2645
name = "rxjs",
2746
path = "node_modules/rxjs/src",
2847
)
2948

30-
RULES_WEBTESTING_VERSION = "0.2.1"
31-
http_archive(
32-
name = "io_bazel_rules_webtesting",
33-
url = "https://github.com/bazelbuild/rules_webtesting/archive/%s.zip" % RULES_WEBTESTING_VERSION,
34-
strip_prefix = "rules_webtesting-%s" % RULES_WEBTESTING_VERSION,
35-
sha256 = "7d490aadff9b5262e5251fa69427ab2ffd1548422467cb9f9e1d110e2c36f0fa",
36-
)
37-
38-
RULES_TYPESCRIPT_VERSION = "0.15.3"
49+
# Load the TypeScript rules, its dependencies, and setup the workspace.
3950
http_archive(
4051
name = "build_bazel_rules_typescript",
41-
url = "https://github.com/bazelbuild/rules_typescript/archive/%s.zip" % RULES_TYPESCRIPT_VERSION,
42-
strip_prefix = "rules_typescript-%s" % RULES_TYPESCRIPT_VERSION,
43-
sha256 = "a2b26ac3fc13036011196063db1bf7f1eae81334449201dc28087ebfa3708c99",
52+
url = "https://github.com/bazelbuild/rules_typescript/archive/0.16.1.zip",
53+
strip_prefix = "rules_typescript-0.16.1",
54+
sha256 = "5b2b0bc63cfcffe7bf97cad2dad3b26a73362f806de66207051f66c87956a995",
4455
)
4556

46-
load("@build_bazel_rules_typescript//:defs.bzl", "ts_setup_workspace")
57+
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
58+
rules_typescript_dependencies()
4759

60+
load("@build_bazel_rules_typescript//:defs.bzl", "check_rules_typescript_version",
61+
"ts_setup_workspace")
62+
check_rules_typescript_version("0.16.1")
4863
ts_setup_workspace()
49-
50-
# We get tools like Buildifier from here
51-
BAZEL_BUILDTOOLS_VERSION = "0.15.0"
52-
http_archive(
53-
name = "com_github_bazelbuild_buildtools",
54-
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
55-
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
56-
sha256 = "76d1837a86fa6ef5b4a07438f8489f00bfa1b841e5643b618e01232ba884b1fe",
57-
)
58-
59-
# The Go toolchain is used for Buildifier and some TypeScript tooling.
60-
# We need to use this commit to include Windows path fixes.
61-
RULES_GO_VERSION = "0.14.0"
62-
http_archive(
63-
name = "io_bazel_rules_go",
64-
url = "https://github.com/bazelbuild/rules_go/archive/%s.zip" % RULES_GO_VERSION,
65-
strip_prefix = "rules_go-%s" % RULES_GO_VERSION,
66-
sha256 = "9bd7c2743f014e4e112b671098ba1da6aec036fe07093b10ca39a9f81ec5cc33",
67-
)
68-
69-
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")
70-
71-
go_rules_dependencies()
72-
73-
go_register_toolchains()

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"typescript": "~2.9.2"
6363
},
6464
"devDependencies": {
65+
"@bazel/typescript": "0.16.1",
6566
"@ngtools/json-schema": "^1.1.0",
6667
"@types/copy-webpack-plugin": "^4.4.1",
6768
"@types/express": "^4.16.0",

packages/angular/cli/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99

1010
package(default_visibility = ["//visibility:public"])
1111

packages/angular/pwa/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99

1010
package(default_visibility = ["//visibility:public"])
1111

packages/angular_devkit/architect/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99

1010
package(default_visibility = ["//visibility:public"])
1111

packages/angular_devkit/architect_cli/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# found in the LICENSE file at https://angular.io/license
55
package(default_visibility = ["//visibility:public"])
66

7-
load("//tools:defaults.bzl", "ts_library")
7+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
88

99
licenses(["notice"]) # MIT
1010

packages/angular_devkit/build_optimizer/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
1010

1111
package(default_visibility = ["//visibility:public"])

packages/angular_devkit/core/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# found in the LICENSE file at https://angular.io/license
55
package(default_visibility = ["//visibility:public"])
66

7-
load("//tools:defaults.bzl", "ts_library")
7+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
88
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
99

1010
licenses(["notice"]) # MIT License

packages/angular_devkit/schematics/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# found in the LICENSE file at https://angular.io/license
55
package(default_visibility = ["//visibility:public"])
66

7-
load("//tools:defaults.bzl", "ts_library")
7+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
88
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
99

1010
licenses(["notice"]) # MIT License

packages/angular_devkit/schematics_cli/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# found in the LICENSE file at https://angular.io/license
55
package(default_visibility = ["//visibility:public"])
66

7-
load("//tools:defaults.bzl", "ts_library")
7+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
88

99
licenses(["notice"]) # MIT License
1010

packages/schematics/angular/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
1010

1111
package(default_visibility = ["//visibility:public"])

packages/schematics/update/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
licenses(["notice"]) # MIT
77

8-
load("//tools:defaults.bzl", "ts_library")
8+
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
99
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
1010

1111
package(default_visibility = ["//visibility:public"])

tools/defaults.bzl

Lines changed: 0 additions & 10 deletions
This file was deleted.

yarn.lock

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@
8787
dependencies:
8888
tslib "^1.9.0"
8989

90+
"@bazel/typescript@0.16.1":
91+
version "0.16.1"
92+
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.16.1.tgz#5a5d145a17898bfadae8268cf942815424119412"
93+
dependencies:
94+
protobufjs "5.0.0"
95+
tsickle "0.32.1"
96+
tsutils "2.20.0"
97+
9098
"@ngtools/json-schema@^1.1.0":
9199
version "1.1.0"
92100
resolved "https://registry.yarnpkg.com/@ngtools/json-schema/-/json-schema-1.1.0.tgz#c3a0c544d62392acc2813a42c8a0dc6f58f86922"
@@ -700,6 +708,13 @@ asap@^2.0.0, asap@~2.0.3:
700708
version "2.0.6"
701709
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
702710

711+
ascli@~1:
712+
version "1.0.1"
713+
resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc"
714+
dependencies:
715+
colour "~0.7.1"
716+
optjs "~3.2.2"
717+
703718
asn1.js@^4.0.0:
704719
version "4.10.1"
705720
resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0"
@@ -1217,6 +1232,12 @@ builtins@^1.0.3:
12171232
version "1.0.3"
12181233
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
12191234

1235+
bytebuffer@~5:
1236+
version "5.0.1"
1237+
resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd"
1238+
dependencies:
1239+
long "~3"
1240+
12201241
bytes@3.0.0:
12211242
version "3.0.0"
12221243
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
@@ -1295,7 +1316,7 @@ camelcase@^1.0.2:
12951316
version "1.2.1"
12961317
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
12971318

1298-
camelcase@^2.0.0:
1319+
camelcase@^2.0.0, camelcase@^2.0.1:
12991320
version "2.1.1"
13001321
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
13011322

@@ -1444,7 +1465,7 @@ cliui@^2.1.0:
14441465
right-align "^0.1.1"
14451466
wordwrap "0.0.2"
14461467

1447-
cliui@^3.2.0:
1468+
cliui@^3.0.3, cliui@^3.2.0:
14481469
version "3.2.0"
14491470
resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"
14501471
dependencies:
@@ -1552,6 +1573,10 @@ colorspace@1.1.x:
15521573
color "3.0.x"
15531574
text-hex "1.0.x"
15541575

1576+
colour@~0.7.1:
1577+
version "0.7.1"
1578+
resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778"
1579+
15551580
combine-lists@^1.0.0:
15561581
version "1.0.1"
15571582
resolved "https://registry.yarnpkg.com/combine-lists/-/combine-lists-1.0.1.tgz#458c07e09e0d900fc28b70a3fec2dacd1d2cb7f6"
@@ -3190,7 +3215,7 @@ glob@7.0.x:
31903215
once "^1.3.0"
31913216
path-is-absolute "^1.0.0"
31923217

3193-
glob@^5.0.15:
3218+
glob@^5.0.10, glob@^5.0.15:
31943219
version "5.0.15"
31953220
resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
31963221
dependencies:
@@ -4703,7 +4728,7 @@ long@4.0.0:
47034728
version "4.0.0"
47044729
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
47054730

4706-
long@^3.2.0:
4731+
long@^3.2.0, long@~3:
47074732
version "3.2.0"
47084733
resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b"
47094734

@@ -5526,6 +5551,10 @@ optionator@^0.8.1:
55265551
type-check "~0.3.2"
55275552
wordwrap "~1.0.0"
55285553

5554+
optjs@~3.2.2:
5555+
version "3.2.2"
5556+
resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee"
5557+
55295558
original@>=0.0.5:
55305559
version "1.0.1"
55315560
resolved "https://registry.yarnpkg.com/original/-/original-1.0.1.tgz#b0a53ff42ba997a8c9cd1fb5daaeb42b9d693190"
@@ -5955,6 +5984,15 @@ promisify-call@^2.0.2:
59555984
dependencies:
59565985
with-callback "^1.0.2"
59575986

5987+
protobufjs@5.0.0:
5988+
version "5.0.0"
5989+
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.0.tgz#4223063233ea96ac063ca2b554035204db524fa1"
5990+
dependencies:
5991+
ascli "~1"
5992+
bytebuffer "~5"
5993+
glob "^5.0.10"
5994+
yargs "^3.10.0"
5995+
59585996
protractor@~5.4.0:
59595997
version "5.4.0"
59605998
resolved "https://registry.yarnpkg.com/protractor/-/protractor-5.4.0.tgz#e71c9c1f5cf6c5e9bdbcdb71e7f31b17ffd2878f"
@@ -7581,7 +7619,7 @@ ts-node@^5.0.0:
75817619
source-map-support "^0.5.3"
75827620
yn "^2.0.0"
75837621

7584-
tsickle@>=0.27.3, tsickle@^0.32.1:
7622+
tsickle@0.32.1, tsickle@>=0.27.3, tsickle@^0.32.1:
75857623
version "0.32.1"
75867624
resolved "https://registry.yarnpkg.com/tsickle/-/tsickle-0.32.1.tgz#f16e94ba80b32fc9ebe320dc94fbc2ca7f3521a5"
75877625
dependencies:
@@ -7626,6 +7664,12 @@ tsscmp@~1.0.0:
76267664
version "1.0.6"
76277665
resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb"
76287666

7667+
tsutils@2.20.0:
7668+
version "2.20.0"
7669+
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.20.0.tgz#303394064bc80be8ee04e10b8609ae852e9312d3"
7670+
dependencies:
7671+
tslib "^1.8.1"
7672+
76297673
tsutils@^2.27.2:
76307674
version "2.29.0"
76317675
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
@@ -8143,6 +8187,10 @@ window-size@0.1.0:
81438187
version "0.1.0"
81448188
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
81458189

8190+
window-size@^0.1.4:
8191+
version "0.1.4"
8192+
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876"
8193+
81468194
winston-transport@^4.2.0:
81478195
version "4.2.0"
81488196
resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.2.0.tgz#a20be89edf2ea2ca39ba25f3e50344d73e6520e5"
@@ -8250,7 +8298,7 @@ xxhashjs@^0.2.1:
82508298
dependencies:
82518299
cuint "^0.2.2"
82528300

8253-
y18n@^3.2.1:
8301+
y18n@^3.2.0, y18n@^3.2.1:
82548302
version "3.2.1"
82558303
resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41"
82568304

@@ -8301,6 +8349,18 @@ yargs@11.0.0:
83018349
y18n "^3.2.1"
83028350
yargs-parser "^9.0.2"
83038351

8352+
yargs@^3.10.0:
8353+
version "3.32.0"
8354+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"
8355+
dependencies:
8356+
camelcase "^2.0.1"
8357+
cliui "^3.0.3"
8358+
decamelize "^1.1.1"
8359+
os-locale "^1.4.0"
8360+
string-width "^1.0.1"
8361+
window-size "^0.1.4"
8362+
y18n "^3.2.0"
8363+
83048364
yargs@^7.0.0:
83058365
version "7.1.0"
83068366
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"

0 commit comments

Comments
 (0)