From 5af181f13ffa421382641e92e56f0daba0de4218 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 15 May 2021 08:43:05 -0700 Subject: [PATCH] [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+ --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ba95f459..42411d097 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,8 @@ "test": "npm run tests-only", "test-compiled": "npm run prepublish && BABEL_ENV=testCompiled mocha --compilers js:babel-register tests/src", "test-all": "node --require babel-register ./scripts/testAll", - "prepublish": "not-in-publish || npm run build", + "prepublishOnly": "safe-publish-latest && npm run build", + "prepublish": "not-in-publish || npm run prepublishOnly", "coveralls": "nyc report --reporter lcovonly && coveralls < ./coverage/lcov.info" }, "repository": { @@ -88,6 +89,7 @@ "nyc": "^11.9.0", "redux": "^3.7.2", "rimraf": "^2.7.1", + "safe-publish-latest": "^1.1.4", "semver": "^6.3.0", "sinon": "^2.4.1", "typescript": "^2.8.1 || ~3.9.5",