-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(builtin): renamed npm_package to pkg_npm to match naming con…
…vention It also frees up the name `npm_package` which may be useful in the future as a non-packaging representation of an npm package as an alternative to promoting js_library to the public API. BREAKING CHANGE: `npm_package` renamed to `pkg_npm`. This is to match the naming convention for package rules https://docs.bazel.build/versions/master/be/pkg.html.
- Loading branch information
1 parent
e04b268
commit 7df4109
Showing
44 changed files
with
260 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
diff --git a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
index ccda5a5..00f1624 100755 | ||
--- a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
+++ b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
@@ -15,9 +15,9 @@ specification of this format at https://goo.gl/jB3GVv | ||
|
||
load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo", "JSNamedModuleInfo", "NpmPackageInfo", "node_modules_aspect") | ||
load( | ||
- "@build_bazel_rules_nodejs//internal/npm_package:npm_package.bzl", | ||
- "NPM_PACKAGE_ATTRS", | ||
- "NPM_PACKAGE_OUTPUTS", | ||
+ "@build_bazel_rules_nodejs//internal/pkg_npm:pkg_npm.bzl", | ||
+ "PKG_NPM_ATTRS", | ||
+ "PKG_NPM_OUTPUTS", | ||
"create_package", | ||
) | ||
load("//src:external.bzl", "FLAT_DTS_FILE_SUFFIX") | ||
@@ -619,7 +619,7 @@ def _ng_package_impl(ctx): | ||
if JSNamedModuleInfo in dep: | ||
devfiles = depset(transitive = [devfiles, dep[JSNamedModuleInfo].sources]) | ||
|
||
- # Re-use the create_package function from the nodejs npm_package rule. | ||
+ # Re-use the create_package function from the nodejs pkg_npm rule. | ||
package_dir = create_package( | ||
ctx, | ||
devfiles.to_list(), | ||
@@ -631,7 +631,7 @@ def _ng_package_impl(ctx): | ||
|
||
_NG_PACKAGE_DEPS_ASPECTS = [esm5_outputs_aspect, ng_package_module_mappings_aspect, node_modules_aspect] | ||
|
||
-_NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **{ | ||
+_NG_PACKAGE_ATTRS = dict(PKG_NPM_ATTRS, **{ | ||
"srcs": attr.label_list( | ||
doc = """JavaScript source files from the workspace. | ||
These can use ES2015 syntax and ES Modules (import/export)""", | ||
@@ -807,12 +807,12 @@ def _ng_package_outputs(name, entry_point, entry_point_name): | ||
"umd": "%s.umd.js" % basename, | ||
"umd_min": "%s.umd.min.js" % basename, | ||
} | ||
- for key in NPM_PACKAGE_OUTPUTS: | ||
- # NPM_PACKAGE_OUTPUTS is a "normal" dict-valued outputs so it looks like | ||
+ for key in PKG_NPM_OUTPUTS: | ||
+ # PKG_NPM_OUTPUTS is a "normal" dict-valued outputs so it looks like | ||
# "pack": "%{name}.pack", | ||
# But this is a function-valued outputs. | ||
# Bazel won't replace the %{name} token so we have to do it. | ||
- outputs[key] = NPM_PACKAGE_OUTPUTS[key].replace("%{name}", name) | ||
+ outputs[key] = PKG_NPM_OUTPUTS[key].replace("%{name}", name) | ||
return outputs | ||
|
||
ng_package = rule( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1079,7 +1079,7 @@ | |
resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-3.0.16.tgz#50a4755f8e33edacd9c406729e9b930d2451902a" | ||
integrity sha512-lMC2G0ItF2xv4UCiwbJGbnJlIuUixHrioOhNGHSCsYCJ8l4t9hMCUimCytvFv7qy6AfSzRxhRHoGa+UqaqwyeA== | ||
|
||
"@yarnpkg/[email protected]": | ||
"@yarnpkg/[email protected]", "@yarnpkg/lockfile@^1.1.0": | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" | ||
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== | ||
|
@@ -1820,6 +1820,11 @@ ci-info@^1.5.0: | |
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" | ||
integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== | ||
|
||
ci-info@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" | ||
integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== | ||
|
||
cjson@^0.3.1: | ||
version "0.3.3" | ||
resolved "https://registry.yarnpkg.com/cjson/-/cjson-0.3.3.tgz#a92d9c786e5bf9b930806329ee05d5d3261b4afa" | ||
|
@@ -2941,6 +2946,14 @@ find-up@^3.0.0: | |
dependencies: | ||
locate-path "^3.0.0" | ||
|
||
find-yarn-workspace-root@^1.2.1: | ||
version "1.2.1" | ||
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-1.2.1.tgz#40eb8e6e7c2502ddfaa2577c176f221422f860db" | ||
integrity sha512-dVtfb0WuQG+8Ag2uWkbG79hOUzEsRrhBzgfn86g2sJPkzmcpGdghbNTfUKGTxymFrY/tLIodDzLoW9nOJ4FY8Q== | ||
dependencies: | ||
fs-extra "^4.0.3" | ||
micromatch "^3.1.4" | ||
|
||
[email protected]: | ||
version "7.1.0" | ||
resolved "https://registry.yarnpkg.com/firebase-tools/-/firebase-tools-7.1.0.tgz#dcde117e70d021d163616e8bcd02abead5d5c1e1" | ||
|
@@ -3091,6 +3104,15 @@ fs-extra@^0.30.0: | |
path-is-absolute "^1.0.0" | ||
rimraf "^2.2.8" | ||
|
||
fs-extra@^4.0.3: | ||
version "4.0.3" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" | ||
integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== | ||
dependencies: | ||
graceful-fs "^4.1.2" | ||
jsonfile "^4.0.0" | ||
universalify "^0.1.0" | ||
|
||
fs-extra@^7.0.1, fs-extra@~7.0.1: | ||
version "7.0.1" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" | ||
|
@@ -3703,6 +3725,13 @@ is-ci@^1.0.10: | |
dependencies: | ||
ci-info "^1.5.0" | ||
|
||
is-ci@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" | ||
integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== | ||
dependencies: | ||
ci-info "^2.0.0" | ||
|
||
is-data-descriptor@^0.1.4: | ||
version "0.1.4" | ||
resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" | ||
|
@@ -4217,6 +4246,13 @@ kind-of@^6.0.0, kind-of@^6.0.2: | |
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" | ||
integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== | ||
|
||
klaw-sync@^6.0.0: | ||
version "6.0.0" | ||
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" | ||
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== | ||
dependencies: | ||
graceful-fs "^4.1.11" | ||
|
||
klaw@^1.0.0: | ||
version "1.3.1" | ||
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" | ||
|
@@ -5252,6 +5288,25 @@ pascalcase@^0.1.1: | |
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" | ||
integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= | ||
|
||
patch-package@^6.2.0: | ||
version "6.2.0" | ||
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.2.0.tgz#677de858e352b6ca4e6cb48a6efde2cec9fde566" | ||
integrity sha512-HWlQflaBBMjLBfOWomfolF8aqsFDeNbSNro1JDUgYqnVvPM5OILJ9DQdwIRiKmGaOsmHvhkl1FYkvv1I9r2ZJw== | ||
dependencies: | ||
"@yarnpkg/lockfile" "^1.1.0" | ||
chalk "^2.4.2" | ||
cross-spawn "^6.0.5" | ||
find-yarn-workspace-root "^1.2.1" | ||
fs-extra "^7.0.1" | ||
is-ci "^2.0.0" | ||
klaw-sync "^6.0.0" | ||
minimist "^1.2.0" | ||
rimraf "^2.6.3" | ||
semver "^5.6.0" | ||
slash "^2.0.0" | ||
tmp "^0.0.33" | ||
update-notifier "^2.5.0" | ||
|
||
path-dirname@^1.0.0: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" | ||
|
51 changes: 51 additions & 0 deletions
51
examples/angular_view_engine/patches/@angular+bazel+9.0.0-rc.2.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
diff --git a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
index ccda5a5..00f1624 100755 | ||
--- a/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
+++ b/node_modules/@angular/bazel/src/ng_package/ng_package.bzl | ||
@@ -15,9 +15,9 @@ specification of this format at https://goo.gl/jB3GVv | ||
|
||
load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo", "JSNamedModuleInfo", "NpmPackageInfo", "node_modules_aspect") | ||
load( | ||
- "@build_bazel_rules_nodejs//internal/npm_package:npm_package.bzl", | ||
- "NPM_PACKAGE_ATTRS", | ||
- "NPM_PACKAGE_OUTPUTS", | ||
+ "@build_bazel_rules_nodejs//internal/pkg_npm:pkg_npm.bzl", | ||
+ "PKG_NPM_ATTRS", | ||
+ "PKG_NPM_OUTPUTS", | ||
"create_package", | ||
) | ||
load("//src:external.bzl", "FLAT_DTS_FILE_SUFFIX") | ||
@@ -619,7 +619,7 @@ def _ng_package_impl(ctx): | ||
if JSNamedModuleInfo in dep: | ||
devfiles = depset(transitive = [devfiles, dep[JSNamedModuleInfo].sources]) | ||
|
||
- # Re-use the create_package function from the nodejs npm_package rule. | ||
+ # Re-use the create_package function from the nodejs pkg_npm rule. | ||
package_dir = create_package( | ||
ctx, | ||
devfiles.to_list(), | ||
@@ -631,7 +631,7 @@ def _ng_package_impl(ctx): | ||
|
||
_NG_PACKAGE_DEPS_ASPECTS = [esm5_outputs_aspect, ng_package_module_mappings_aspect, node_modules_aspect] | ||
|
||
-_NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **{ | ||
+_NG_PACKAGE_ATTRS = dict(PKG_NPM_ATTRS, **{ | ||
"srcs": attr.label_list( | ||
doc = """JavaScript source files from the workspace. | ||
These can use ES2015 syntax and ES Modules (import/export)""", | ||
@@ -807,12 +807,12 @@ def _ng_package_outputs(name, entry_point, entry_point_name): | ||
"umd": "%s.umd.js" % basename, | ||
"umd_min": "%s.umd.min.js" % basename, | ||
} | ||
- for key in NPM_PACKAGE_OUTPUTS: | ||
- # NPM_PACKAGE_OUTPUTS is a "normal" dict-valued outputs so it looks like | ||
+ for key in PKG_NPM_OUTPUTS: | ||
+ # PKG_NPM_OUTPUTS is a "normal" dict-valued outputs so it looks like | ||
# "pack": "%{name}.pack", | ||
# But this is a function-valued outputs. | ||
# Bazel won't replace the %{name} token so we have to do it. | ||
- outputs[key] = NPM_PACKAGE_OUTPUTS[key].replace("%{name}", name) | ||
+ outputs[key] = PKG_NPM_OUTPUTS[key].replace("%{name}", name) | ||
return outputs | ||
|
||
ng_package = rule( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.