From eedec7da345cb66086f25d9999e939ab80380ef3 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Tue, 30 Nov 2021 18:45:02 +0530 Subject: [PATCH] implement librejs compliance --- Makefile | 1 + docs/openapi/yarn.lock | 6 +++--- scripts/librejs.sh | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100755 scripts/librejs.sh diff --git a/Makefile b/Makefile index fd3c331c..3d3991b7 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/docs/openapi/yarn.lock b/docs/openapi/yarn.lock index 85ddec50..79976bd6 100644 --- a/docs/openapi/yarn.lock +++ b/docs/openapi/yarn.lock @@ -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" diff --git a/scripts/librejs.sh b/scripts/librejs.sh new file mode 100755 index 00000000..c0f6cd33 --- /dev/null +++ b/scripts/librejs.sh @@ -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