Skip to content

Commit d6f6cd0

Browse files
wagnermacielAndrewKushnir
authored andcommitted
build(dev-infra): update package.json and :npm_package (angular#36434)
* Set up dev-infra's :npm_package to also contain benchmarking suite * Add benchmarking deps to dev-infra's package.json * Add a bazel workspace to dev-infra's package.json. This is so that when a project wants to use dev-infra's code and macros, they can just import the macros from their node_modules instead of loading it separately PR Close angular#36434
1 parent b7f2a03 commit d6f6cd0

File tree

3 files changed

+49
-13
lines changed

3 files changed

+49
-13
lines changed

dev-infra/BUILD.bazel

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,30 @@ genrule(
3434

3535
pkg_npm(
3636
name = "npm_package",
37+
srcs = [
38+
"BUILD.bazel",
39+
"//dev-infra/benchmark:files",
40+
],
41+
substitutions = {
42+
# angular/angular should not consume it's own packages, so we use
43+
# substitutions to replace these in the deployed version of dev-infra.
44+
"//dev-infra/": "@npm_dev_infra//",
45+
"//packages/benchpress": "@npm//@angular/benchpress",
46+
"//packages/bazel/src:esm5.bzl": "@npm_angular_bazel//src:esm5.bzl",
47+
"//packages/zone.js/dist:zone.js": "@npm//:node_modules/zone.js/dist/zone.js",
48+
"//packages/core": "@npm//@angular/core",
49+
"//packages/platform-browser": "@npm//@angular/platform-browser",
50+
51+
# This substitution is particularly verbose because we need to make sure
52+
# that only things available via Angular Bazel are imported from
53+
# tools/defaults.bzl.
54+
"load\(\"//tools:defaults.bzl\", \"ng_module\"\)": "load(\"@npm_angular_bazel//:index.bzl\", \"ng_module\")",
55+
},
3756
visibility = ["//visibility:public"],
3857
deps = [
3958
":cli",
4059
":package-json",
60+
"//dev-infra/benchmark/driver-utilities",
4161
"//dev-infra/commit-message",
4262
"//dev-infra/ts-circular-dependencies",
4363
],

dev-infra/tmpl-package.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,42 @@
88
"ng-dev": "./cli.js",
99
"ts-circular-deps": "./ts-circular-dependencies/index.js"
1010
},
11+
"dependencies": {
12+
"fs-extra": "<from-root>",
13+
"node-uuid": "<from-root>"
14+
},
1115
"peerDependencies": {
16+
"@angular/bazel": "^9.0.0",
17+
"@angular/core": "^9.0.0",
18+
"@angular/platform-browser": "^9.0.0",
19+
"@angular/benchpress": "^0.1.0",
20+
"@angular-devkit/build-optimizer": "<from-root>",
21+
"@bazel/protractor": "<from-root>",
22+
"@bazel/terser": "<from-root>",
23+
"@bazel/typescript": "<from-root>",
24+
"brotli": "<from-root>",
1225
"chalk": "<from-root>",
1326
"glob": "<from-root>",
27+
"json5": "<from-root>",
1428
"minimatch": "<from-root>",
29+
"node-uuid": "<from-root>",
30+
"protractor": "<from-root>",
31+
"rollup": "<from-root>",
32+
"rollup-plugin-commonjs": "<from-root>",
33+
"rollup-plugin-node-resolve": "<from-root>",
34+
"rollup-plugin-sourcemaps": "<from-root>",
35+
"selenium-webdriver": "<from-root>",
1536
"shelljs": "<from-root>",
1637
"typescript": "<from-root>",
1738
"yaml": "<from-root>",
1839
"yargs": "<from-root>",
19-
"tslib": "<from-root>"
40+
"tslib": "<from-root>",
41+
"zone.js": "^0.10.3"
42+
},
43+
"bazelWorkspaces": {
44+
"npm_dev_infra": {
45+
"version": "0.0.0-PLACEHOLDER",
46+
"rootPath": "."
47+
}
2048
}
2149
}

dev-infra/tools/BUILD.bazel

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

0 commit comments

Comments
 (0)