Skip to content

Commit 44ca1e3

Browse files
committed
fix: allow npm publish dry-run without proxy env
Make prepublishOnly skip proxy-dependent tests unless PROXY_URL/HTTPS_PROXY is set. Made-with: Cursor
1 parent 0403910 commit 44ca1e3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"test": "node test/test_proxy_headers.js core axios node-fetch got undici superagent",
4343
"test:verbose": "node test/test_proxy_headers.js -v",
4444
"lint": "eslint lib test",
45-
"prepublishOnly": "npm test"
45+
"prepublishOnly": "node -e \"const p=process.env.PROXY_URL||process.env.HTTPS_PROXY||process.env.https_proxy; if(!p){console.log('prepublishOnly: skipping proxy tests (set PROXY_URL/HTTPS_PROXY to enable)'); process.exit(0);} require('child_process').execSync('npm test',{stdio:'inherit'});\""
4646
},
4747
"keywords": [
4848
"proxy",
@@ -96,6 +96,7 @@
9696
},
9797
"devDependencies": {
9898
"axios": "^1.7.0",
99+
"eslint": "^9.0.0",
99100
"got": "^14.4.0",
100101
"node-fetch": "^3.3.0",
101102
"superagent": "^10.1.0",

0 commit comments

Comments
 (0)