From 9b9495d2f95f35f60da9f7f8bdcbd5f1b9f20d58 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 2 Aug 2023 12:40:10 -0700 Subject: [PATCH] chore: enable NODE_ENV=production for prepublishOnly Use cross-env for cross-platform compat. This does not mean other scripts work across platforms, but we should move in that direction. --- package-lock.json | 52 +++++++++++++++++------------------------------ package.json | 3 ++- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5ad83e08fb..2cec5e3f47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@metamask/eslint-config-nodejs": "^11.0.1", "ava": "^5.2.0", "conventional-changelog-conventionalcommits": "^6.1.0", + "cross-env": "^7.0.3", "depcheck": "^1.4.0", "eslint": "^8.40.0", "eslint-plugin-ava": "^13.2.0", @@ -5078,18 +5079,6 @@ "node": ">=14.16" } }, - "node_modules/ava/node_modules/write-file-atomic": { - "version": "5.0.0", - "dev": true, - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/ava/node_modules/yargs": { "version": "17.7.2", "dev": true, @@ -5288,24 +5277,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/bin-links/node_modules/cmd-shim": { - "version": "6.0.0", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/bin-links/node_modules/write-file-atomic": { - "version": "5.0.0", - "license": "ISC", - "dependencies": { - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.7" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "dev": true, @@ -6482,7 +6453,6 @@ }, "node_modules/cmd-shim": { "version": "6.0.1", - "dev": true, "license": "ISC", "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -7097,6 +7067,24 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -20070,7 +20058,6 @@ }, "node_modules/write-file-atomic": { "version": "5.0.1", - "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4", @@ -20082,7 +20069,6 @@ }, "node_modules/write-file-atomic/node_modules/signal-exit": { "version": "4.1.0", - "dev": true, "license": "ISC", "engines": { "node": ">=14" diff --git a/package.json b/package.json index 503233ea39..f39aade2c2 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@metamask/eslint-config-nodejs": "^11.0.1", "ava": "^5.2.0", "conventional-changelog-conventionalcommits": "^6.1.0", + "cross-env": "^7.0.3", "depcheck": "^1.4.0", "eslint": "^8.40.0", "eslint-plugin-ava": "^13.2.0", @@ -32,7 +33,7 @@ "lint:staged": "lint-staged", "lint:commit": "commitlint", "postinstall": "husky install", - "prepublishOnly": "npm run rebuild && npm run test:prep && npm run test", + "prepublishOnly": "cross-env NODE_ENV=production npm run rebuild && npm run test:prep && npm run test", "publish": "lerna publish", "setup": "allow-scripts" },