From 9a9b934a08f92a2dad615201a93171f0de394817 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 17 Feb 2021 16:07:26 -0500 Subject: [PATCH] work around publishing issue with npm v7 (#5983) --- check_publish_env.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 check_publish_env.js diff --git a/check_publish_env.js b/check_publish_env.js new file mode 100644 index 0000000000..ce6f066cff --- /dev/null +++ b/check_publish_env.js @@ -0,0 +1,4 @@ +if (!process.env.PUBLISH) { + console.error('npm publish must be run with the PUBLISH environment variable set'); + process.exit(1); +} diff --git a/package.json b/package.json index 333838e69d..5b04c3e82e 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "dev": "rollup -cw", "pretest": "npm run build", "posttest": "agadoo internal/index.mjs", - "prepublishOnly": "npm run lint && PUBLISH=true npm test", + "prepublishOnly": "node check_publish_env.js && npm run lint && npm test", "tsd": "tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly", "lint": "eslint \"{src,test}/**/*.{ts,js}\"" },