Isaacs/update libnpmetc stuff#968
Conversation
|
Note: this closes #935 as well. |
c6d224f to
924d85b
Compare
| const readUserInfo = require('./read-user-info.js') | ||
|
|
||
| const isOtpError = err => | ||
| err.code === 'EOTP' || err.code === 'E401' && /one-time pass/.test(err.body) |
There was a problem hiding this comment.
Silly question, does this need brackets to evaluate correctly?
| err.code === 'EOTP' || err.code === 'E401' && /one-time pass/.test(err.body) | |
| err.code === 'EOTP' || (err.code === 'E401' && /one-time pass/.test(err.body)) |
There was a problem hiding this comment.
It does not. && has higher priority than ||. In most expressions of boolean calculus, you can think of and (or any intersection operator) like multiplication or division, and or (or any union operator) like addition or subtraction. So a || b && c || d is like a + b * c + d, so it's like a + (b * c) + d and thus a || (b && c) || d.
| strictSSL: npm.config.get('strict-ssl'), | ||
| defaultTag: npm.config.get('tag'), | ||
| get tag () { | ||
| log.warn('FIXME', 'using tag option, should be defaultTag') |
There was a problem hiding this comment.
nit: I thought we wanted this? At least until we have more stability in npm@7?
There was a problem hiding this comment.
The problem is that it warns every time we do ...npm.flatOptions, which we do a lot of times. And we can't make the option non-enumerable, or else it won't be carried over in those cases. We'd have to do a custom clone function that does Object.getOwnPropertyDescriptors and turns the setter into a setter on the resulting object, and then use that everywhere, but then our deps also do ...opts all over the place, so actually making that change would be almost as bad as figgy-pudding.
It was a reasonable idea, but doesn't actually work, turns out.
There was a problem hiding this comment.
Totally makes sense, I hadn't realised that. Completely agree we should just pull this out for now. Might be worth just commenting it, so we remember where our warnings were?
There was a problem hiding this comment.
Sure, if you wanna, go for it. I was just gonna leave it as a pre-v7 todo item to remove the getters from here and grep for any usage of those field names.
|
Fixed the nits, replaced the read-json util with parse-json-even-better-errors, found 2 more bluebird |
| opts = TeamConfig(opts).concat({description: null}) | ||
| // XXX: "description" option to libnpmteam is used as a description of the | ||
| // team, but in npm's options, this is a boolean meaning "show the | ||
| // description in npm search output". Hence its being set to null here. |
There was a problem hiding this comment.
Not important, but eventually we can remove this.
PR-URL: #968 Credit: @isaacs and @mikemimik Close: #968
PR-URL: #968 Credit: @isaacs and @mikemimik Close: #968
53b67a1 to
bf3370b
Compare
PR-URL: #968 Credit: @isaacs and @mikemimik Close: #968
Refactor of
mikemimik/update-libnpmhookbranch from pairing earlier today. Removes a lot of figgy-pudding and blue birds.Commands updated with a new lib:
Other random stuff:
Utils:
Still todo: