From 13d261048bd8f51f04b83b66cb507c392d4a3725 Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Wed, 22 Jun 2022 01:01:33 +1000 Subject: [PATCH] Add more metadata to WASM package.json --- wasm/build | 6 +++--- wasm/package.merge.json | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 wasm/package.merge.json diff --git a/wasm/build b/wasm/build index 1e02ee3..d0dfc0d 100755 --- a/wasm/build +++ b/wasm/build @@ -11,9 +11,9 @@ wasm-pack build --target "$target" pushd pkg # `bundler` is for WASM/npm, `web` is for Deno. if [[ "$target" = "bundler" ]]; then - # Use -i.tmp to support macOS and Linux. - sed -i.tmp -E 's%"name": "index"%"name": "@minify-html/wasm"%' package.json - rm package.json.tmp .gitignore + jq -s '.[0] * .[1]' package.json ../package.merge.json > package.new.json + mv package.new.json package.json + rm .gitignore elif [[ "$target" = "web" ]]; then rm package.json .gitignore fi diff --git a/wasm/package.merge.json b/wasm/package.merge.json new file mode 100644 index 0000000..a8ea64c --- /dev/null +++ b/wasm/package.merge.json @@ -0,0 +1,26 @@ +{ + "name": "@minify-html/wasm", + "description": "Extremely fast and smart HTML + JS + CSS minifier", + "repository": { + "type": "git", + "url": "git+https://github.com/wilsonzlin/minify-html.git" + }, + "author": { + "email": "npm@wilsonl.in", + "name": "Wilson Lin", + "url": "https://wilsonl.in/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/wilsonzlin/minify-html/issues" + }, + "homepage": "https://github.com/wilsonzlin/minify-html#readme", + "keywords": [ + "compress", + "compressor", + "fast", + "html", + "minifier", + "minify" + ] +}