Skip to content

Commit 8e1d54e

Browse files
authored
fix(config): remove isFromCI and npm-is-ci
BREAKING CHANGE: config items are being removed
1 parent cc11cc1 commit 8e1d54e

File tree

6 files changed

+102
-45
lines changed

6 files changed

+102
-45
lines changed

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,6 @@ previously-generated integrity hash for the saved request information, so
309309
`EINTEGRITY` errors can happen if [`opts.cache`](#opts-cache) is used, even if
310310
`opts.integrity` is not passed in.
311311

312-
##### <a name='opts-isFromCI'></a> `opts.isFromCI`
313-
314-
* Type: Boolean
315-
* Default: Based on environment variables
316-
317-
This is used to populate the `npm-in-ci` request header sent to the registry.
318-
319312
##### <a name="opts-key"></a> `opts.key`
320313

321314
* Type: String

default-opts.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const pkg = require('./package.json')
2-
const ciDetect = require('@npmcli/ci-detect')
32
module.exports = {
4-
isFromCI: ciDetect(),
53
log: require('./silentlog.js'),
64
maxSockets: 12,
75
method: 'GET',

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function getCacheMode (opts) {
177177

178178
function getHeaders (uri, auth, opts) {
179179
const headers = Object.assign({
180-
'npm-in-ci': !!opts.isFromCI,
181180
'user-agent': opts.userAgent,
182181
}, opts.headers || {})
183182

package-lock.json

Lines changed: 102 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
},
3030
"license": "ISC",
3131
"dependencies": {
32-
"@npmcli/ci-detect": "^1.0.0",
3332
"lru-cache": "^6.0.0",
3433
"make-fetch-happen": "^8.0.9",
3534
"minipass": "^3.1.3",

test/index.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ const fetch = require('../index.js')
1919

2020
npmlog.level = process.env.LOGLEVEL || 'silent'
2121
const OPTS = {
22-
// just to make sure we hit the second branch when
23-
// we are ACTUALLY in CI
24-
isFromCI: false,
2522
log: npmlog,
2623
timeout: 0,
2724
retry: {
@@ -487,21 +484,6 @@ t.test('log warning header info', t => {
487484
.then(res => t.equal(res.status, 200, 'got successful response'))
488485
})
489486

490-
t.test('npm-in-ci header with forced CI=false', t => {
491-
const CI = process.env.CI
492-
process.env.CI = false
493-
t.teardown(t => {
494-
process.env.CI = CI
495-
})
496-
tnock(t, defaultOpts.registry)
497-
.get('/hello')
498-
.reply(200, { hello: 'world' })
499-
return fetch('/hello', OPTS)
500-
.then(res => {
501-
t.equal(res.status, 200, 'got successful response')
502-
})
503-
})
504-
505487
t.test('miscellaneous headers', t => {
506488
tnock(t, defaultOpts.registry)
507489
.matchHeader('npm-session', session =>
@@ -510,8 +492,6 @@ t.test('miscellaneous headers', t => {
510492
t.strictSame(scope, ['@foo'], 'scope set from options'))
511493
.matchHeader('user-agent', ua =>
512494
t.strictSame(ua, ['agent of use'], 'UA set from options'))
513-
.matchHeader('npm-in-ci', ci =>
514-
t.strictSame(ci, ['false'], 'CI set from options'))
515495
.matchHeader('npm-command', cmd =>
516496
t.strictSame(cmd, ['hello-world'], 'command set from options'))
517497
.get('/hello')

0 commit comments

Comments
 (0)