Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions workspaces/config/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,9 @@ class Config {
if (problem.action === 'delete') {
this.delete(problem.key, problem.where)
} else if (problem.action === 'rename') {
const old = this.get(problem.from, problem.where)
this.set(problem.to, old, problem.where)
const raw = this.data.get(problem.where).raw?.[problem.from]
const calculated = this.get(problem.from, problem.where)
this.set(problem.to, raw || calculated, problem.where)
this.delete(problem.from, problem.where)
}
}
Expand Down
12 changes: 12 additions & 0 deletions workspaces/config/tap-snapshots/test/index.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ exports[`test/index.js TAP credentials management def_auth > other registry 1`]
Object {}
`

exports[`test/index.js TAP credentials management def_authEnv > default registry 1`] = `
Object {
"auth": "\${PATH}",
"password": "",
"username": "<\\u0004�",
}
`

exports[`test/index.js TAP credentials management def_authEnv > other registry 1`] = `
Object {}
`

exports[`test/index.js TAP credentials management def_passNoUser > default registry 1`] = `
Object {
"email": "i@izs.me",
Expand Down
3 changes: 3 additions & 0 deletions workspaces/config/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@ email = i@izs.me
'.npmrc': `_auth = ${Buffer.from('hello:world').toString('base64')}
always-auth = true`,
},
def_authEnv: {
'.npmrc': '_auth = ${PATH}',
},
none_authToken: { '.npmrc': '_authToken = 0bad1de4' },
none_lcAuthToken: { '.npmrc': '_authtoken = 0bad1de4' },
none_emptyConfig: { '.npmrc': '' },
Expand Down