From bfd9c93e617886d6c1b2f3fb12c1d81564fcead4 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 31 Dec 2020 16:27:52 +0100 Subject: [PATCH] Add css-browser-selector as bazel rule, and update from 0.4.0 to 0.6.5 --- ts/css-browser-selector.bzl | 29 +++++++++++++++++++++++++++++ ts/licenses.json | 7 +++++++ ts/package.json | 1 + ts/yarn.lock | 5 +++++ 4 files changed, 42 insertions(+) create mode 100644 ts/css-browser-selector.bzl diff --git a/ts/css-browser-selector.bzl b/ts/css-browser-selector.bzl new file mode 100644 index 000000000..7db733d56 --- /dev/null +++ b/ts/css-browser-selector.bzl @@ -0,0 +1,29 @@ +load("//ts:copy.bzl", "copy_files") + +"Rule to copy css-browser-selector subset from node_modules to vendor folder." + +_include = [ + "css-browser-selector.min.js", +] + +_unwanted_prefix = "external/npm/node_modules/css-browser-selector/" + +def _copy_browsersel(ctx): + wanted = [] + for f in ctx.attr.browsersel.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_browsersel = rule( + implementation = _copy_browsersel_impl, + attrs = { + "browsersel": attr.label(default = "@npm//css-browser-selector:css_browser-selector__files"), + }, +) diff --git a/ts/licenses.json b/ts/licenses.json index 5a37fd249..a78ecf1a0 100644 --- a/ts/licenses.json +++ b/ts/licenses.json @@ -99,6 +99,13 @@ "path": "node_modules/protobufjs/node_modules/@types/node", "licenseFile": "node_modules/protobufjs/node_modules/@types/node/LICENSE" }, + "css-browser-selector@0.6.5": { + "licenses": "CC-BY-SA-2.5", + "repository": "https://github.com/verbatim/css_browser_selector", + "publisher": "Rafael Lima", + "path": "node_modules/css-browser-selector", + "licenseFile": "node_modules/css-browser-selector/README.mkdn" + }, "d3-array@2.9.1": { "licenses": "BSD-3-Clause", "repository": "https://github.com/d3/d3-array", diff --git a/ts/package.json b/ts/package.json index 3f7bdd6d8..d04226ca7 100644 --- a/ts/package.json +++ b/ts/package.json @@ -52,6 +52,7 @@ }, "dependencies": { "@fluent/bundle": "^0.15.1", + "css-browser-selector": "^0.6.5", "d3-array": "^2.8.0", "d3-axis": "^1.0.12", "d3-interpolate": "^1.4.0", diff --git a/ts/yarn.lock b/ts/yarn.lock index db681fd30..89b22551e 100644 --- a/ts/yarn.lock +++ b/ts/yarn.lock @@ -756,6 +756,11 @@ cross-spawn@^7.0.1: shebang-command "^2.0.0" which "^2.0.1" +css-browser-selector@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/css-browser-selector/-/css-browser-selector-0.6.5.tgz#d2b06c01ff7d7cb455e2006b6b6558d39372ca60" + integrity sha1-0rBsAf99fLRV4gBra2VY05NyymA= + csstype@^3.0.2: version "3.0.5" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.5.tgz#7fdec6a28a67ae18647c51668a9ff95bb2fa7bb8"