Merge pull request #877 from hgiesel/jquery-ui

Update Jquery UI and include in Bazel deps
This commit is contained in:
Damien Elmes 2020-12-31 12:07:53 +10:00 committed by GitHub
commit 4e363505f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2370 additions and 2275 deletions

View file

@ -1,13 +1,20 @@
load("//ts:jquery.bzl", "copy_jquery")
load("//ts:jquery-ui.bzl", "copy_jquery_ui")
copy_jquery(
name = "jquery",
visibility = ["//visibility:public"],
)
copy_jquery_ui(
name = "jquery-ui",
visibility = ["//visibility:public"],
)
files = [
"jquery",
"jquery-ui",
]
directories = [

File diff suppressed because one or more lines are too long

View file

@ -125,7 +125,7 @@ class DeckBrowser:
css=["css/deckbrowser.css"],
js=[
"js/vendor/jquery.min.js",
"js/vendor/jquery-ui.js",
"js/vendor/jquery-ui.min.js",
"js/deckbrowser.js",
],
context=self,

View file

@ -197,6 +197,10 @@ def _redirectWebExports(path):
base = "jquery.min"
addprefix = "js/vendor/"
elif base == "jquery-ui":
base = "jquery-ui.min"
addprefix = "js/vendor/"
if addprefix:
oldpath = path
path = f"{targetPath}{addprefix}{base}{ext}"

29
ts/jquery-ui.bzl Normal file
View file

@ -0,0 +1,29 @@
load("//ts:copy.bzl", "copy_files")
"Rule to copy jquery-ui subset from node_modules to vendor folder."
_include = [
"jquery-ui.min.js",
]
_unwanted_prefix = "external/npm/node_modules/jquery-ui-dist/"
def _copy_jquery_ui_impl(ctx):
wanted = []
for f in ctx.attr.jquery_ui.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_jquery_ui = rule(
implementation = _copy_jquery_ui_impl,
attrs = {
"jquery_ui": attr.label(default = "@npm//jquery-ui-dist:jquery-ui-dist__files"),
},
)

View file

@ -62,9 +62,10 @@
"d3-time": "^1.1.0",
"d3-transition": "^1.3.2",
"intl-pluralrules": "^1.2.2",
"jquery": "^3.5.1",
"jquery-ui-dist": "^1.12.1",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"jquery": "^3.5.1",
"mathjax": "^3.1.2",
"protobufjs": "^6.10.1"
},

File diff suppressed because it is too large Load diff