From df956294c0653f91abe8a6ded7d413fd18ba2732 Mon Sep 17 00:00:00 2001 From: Kris Zyp Date: Wed, 21 Feb 2024 10:35:03 -0700 Subject: [PATCH] Remove optional dependencies after publish --- package.json | 2 +- util/remove-optional-deps.cjs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 util/remove-optional-deps.cjs diff --git a/package.json b/package.json index 7db8acfda..1a1e6a64d 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "prebuild-win32": "prebuildify-platform-packages --debug --target 20.0.0 && prebuildify-platform-packages --debug --target 18.17.1 && set ENABLE_V8_FUNCTIONS=false&& prebuildify-platform-packages --debug --napi --platform-packages --target 18.17.1", "prebuild-libc-arm7": "ENABLE_V8_FUNCTIONS=false prebuildify-platform-packages --debug --napi --platform-packages --tag-libc --target 18.17.1", "prebuildify": "prebuildify-platform-packages --debug --napi --target 18.17.1", - "full-publish": "cd prebuilds/win32-x64 && npm publish --tag next --access public && cd ../darwin-x64 && npm publish --tag next --access public && cd ../darwin-arm64 && npm publish --tag next --access public && cd ../linux-x64 && npm publish --tag next --access public && cd ../linux-arm64 && npm publish --tag next --access public && cd ../linux-arm && npm publish --tag next --access public && cd ../.. && npm publish --tag next", + "full-publish": "cd prebuilds/win32-x64 && npm publish --tag next --access public && cd ../darwin-x64 && npm publish --tag next --access public && cd ../darwin-arm64 && npm publish --tag next --access public && cd ../linux-x64 && npm publish --tag next --access public && cd ../linux-arm64 && npm publish --tag next --access public && cd ../linux-arm && npm publish --tag next --access public && cd ../.. && npm publish --tag next && node util/remove-optional-deps.cjs", "recompile": "node-gyp clean && node-gyp configure && node-gyp build", "test": "mocha test/**.test.js --expose-gc --recursive", "deno-test": "deno run --allow-ffi --allow-write --allow-read --allow-env --allow-net --unstable test/deno.ts", diff --git a/util/remove-optional-deps.cjs b/util/remove-optional-deps.cjs new file mode 100644 index 000000000..58dc87cfd --- /dev/null +++ b/util/remove-optional-deps.cjs @@ -0,0 +1,4 @@ +let fs = require('fs'); +packageData = JSON.parse(fs.readFileSync('package.json')); +packageData.optionalDependencies = {}; // clear optionalDependencies +fs.writeFileSync('package.json', JSON.stringify(packageData, null, 2));