add add.sh helper for adding dependency and updating licenses

This commit is contained in:
Damien Elmes 2020-12-31 12:20:51 +10:00
parent ace834a21b
commit 29c2fa2317
5 changed files with 27 additions and 5 deletions

View File

@ -13,3 +13,8 @@ exports_files([
".eslintrc.js",
"licenses.json",
])
alias(
name = "yarn",
actual = "@nodejs//:yarn_bin",
)

View File

@ -1,6 +1,10 @@
Anki's TypeScript and Sass dependencies. Some TS/JS code is also
stored separately in ../qt/aqt/data/web/.
To update all dependencies:
./update.sh
To add a new dev dependency, use something like:
bazel run @nodejs//:yarn add @rollup/plugin-alias -- -D
./add.sh -D @rollup/plugin-alias

7
ts/add.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# Add a dependency (eg 'yarn add ...') and update licenses.
set -e
bazel run yarn -- add $*
./update-licenses.sh

8
ts/update-licenses.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# Dump runtime licenses to licenses.json
set -e
./node_modules/.bin/license-checker-rseidelsohn --production --json \
--excludePackages anki --relativeLicensePath \
--relativeModulePath > licenses.json

View File

@ -3,7 +3,5 @@
set -e
bazel run @nodejs//:yarn upgrade
./node_modules/.bin/license-checker-rseidelsohn --production --json \
--excludePackages anki --relativeLicensePath \
--relativeModulePath > licenses.json
bazel run yarn upgrade
./update-licenses.sh