Add bazel recipe and update protobufjs to 6.10.2

This commit is contained in:
Henrik Giesel 2020-12-31 16:06:44 +01:00
parent 2e7213f8b0
commit 079ce6bdf0
3 changed files with 31 additions and 2 deletions

View file

@ -67,7 +67,7 @@
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"mathjax": "^3.1.2",
"protobufjs": "^6.10.1"
"protobufjs": "^6.10.2"
},
"files": [
"dist/*"

29
ts/protobufjs.bzl Normal file
View file

@ -0,0 +1,29 @@
load("//ts:copy.bzl", "copy_files")
"Rule to copy protobufjs subset from node_modules to vendor folder."
_include = [
"dist/protobuf.min.js",
]
_unwanted_prefix = "external/npm/node_modules/protobufjs/dist/"
def _copy_protobufjs_impl(ctx):
wanted = []
for f in ctx.attr.protobufjs.files.to_list():
path = f.path
want = True
for substr in _include:
if substr in path:
output = path.replace(_unwanted_prefix, "")
wanted.append((f, output))
return copy_files(ctx, wanted)
copy_protobufjs = rule(
implementation = _copy_protobufjs_impl,
attrs = {
"protobufjs": attr.label(default = "@npm//protobufjs:protobufjs__files"),
},
)

View file

@ -2200,7 +2200,7 @@ protobufjs@6.8.8:
"@types/node" "^10.1.0"
long "^4.0.0"
protobufjs@^6.10.1:
protobufjs@^6.10.2:
version "6.10.2"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.2.tgz#b9cb6bd8ec8f87514592ba3fdfd28e93f33a469b"
integrity sha512-27yj+04uF6ya9l+qfpH187aqEzfCF4+Uit0I9ZBQVqK09hk/SQzKa2MUqUpXaVa7LOFRg1TSSr3lVxGOk6c0SQ==