implement librejs compliance

This commit is contained in:
realaravinth 2021-11-30 18:45:02 +05:30
parent b5af9ee259
commit eedec7da34
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
3 changed files with 23 additions and 3 deletions

View file

@ -36,6 +36,7 @@ frontend: env ## Build frontend
cd browser && wasm-pack build --release
yarn install
yarn build
@./scripts/librejs.sh
frontend-test: ## Run frontend tests
cd browser && wasm-pack test --release --headless --chrome

View file

@ -2114,9 +2114,9 @@ pony-cause@^1.0.0:
integrity sha512-PxkIc/2ZpLiEzQXu5YRDOUgBlfGYBY8156HY5ZcRAwwonMk5W/MrJP2LLkG/hF7GEQzaHo2aS7ho6ZLCOvf+6g==
postcss-value-parser@^4.0.2:
version "4.1.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz#443f6a20ced6481a2bda4fa8532a6e55d789a2cb"
integrity sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==
version "4.2.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
prelude-ls@~1.1.2:
version "1.1.2"

19
scripts/librejs.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/bash
readonly DIST=static/cache/bundle/
readonly LICENSE_START="// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0"
readonly SOURCE="// @source https://github.com/mCaptcha/mCaptcha"
readonly LICENSE_END="// @license-end"
echo $LICENSE_START
echo $LICENSE_END
for file in $(find ./static/cache/bundle/ -type f -a -name "*.js")
do
contents=$(cat $file)
echo $LICENSE_START > $file
echo $SOURCE >> $file
echo $contents >> $file
echo $LICENSE_END >> $file
done