Skip to content

Commit 0f88bcd

Browse files
committed
feat(config): add --allow-git
1 parent ebe5abd commit 0f88bcd

File tree

26 files changed

+181
-55
lines changed

26 files changed

+181
-55
lines changed

lib/commands/cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ class Cache extends BaseCommand {
181181
await pacote.tarball.stream(spec, stream => {
182182
stream.resume()
183183
return stream.promise()
184-
}, { ...this.npm.flatOptions })
184+
}, { ...this.npm.flatOptions, _isRoot: true })
185185

186186
await pacote.manifest(spec, {
187187
...this.npm.flatOptions,
188188
fullMetadata: true,
189+
_isRoot: true,
189190
})
190191
}))
191192
}

lib/commands/ci.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class CI extends ArboristWorkspaceCmd {
2121
'strict-peer-deps',
2222
'foreground-scripts',
2323
'ignore-scripts',
24+
'allow-git',
2425
'audit',
2526
'bin-links',
2627
'fund',

lib/commands/dedupe.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Dedupe extends ArboristWorkspaceCmd {
1414
'omit',
1515
'include',
1616
'ignore-scripts',
17+
'allow-git',
1718
'audit',
1819
'bin-links',
1920
'fund',

lib/commands/diff.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class Diff extends BaseCommand {
198198
const packument = await pacote.packument(spec, {
199199
...this.npm.flatOptions,
200200
preferOnline: true,
201+
_isRoot: true,
201202
})
202203
bSpec = pickManifest(
203204
packument,

lib/commands/install.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Install extends ArboristWorkspaceCmd {
2828
'package-lock-only',
2929
'foreground-scripts',
3030
'ignore-scripts',
31+
'allow-git',
3132
'audit',
3233
'before',
3334
'bin-links',

lib/commands/link.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Link extends ArboristWorkspaceCmd {
2525
'omit',
2626
'include',
2727
'ignore-scripts',
28+
'allow-git',
2829
'audit',
2930
'bin-links',
3031
'fund',

lib/commands/owner.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Owner extends BaseCommand {
6363
const data = await pacote.packument(spec, {
6464
...npm.flatOptions,
6565
fullMetadata: true,
66+
_isRoot: true,
6667
})
6768
if (data && data.maintainers && data.maintainers.length) {
6869
return data.maintainers.map(m => m.name)
@@ -112,7 +113,13 @@ class Owner extends BaseCommand {
112113
const spec = npa(pkg)
113114

114115
try {
115-
const packumentOpts = { ...this.npm.flatOptions, fullMetadata: true, preferOnline: true }
116+
const packumentOpts = {
117+
...this.npm.flatOptions,
118+
fullMetadata:
119+
true,
120+
preferOnline: true,
121+
_isRoot: true,
122+
}
116123
const { maintainers } = await pacote.packument(spec, packumentOpts)
117124
if (!maintainers || !maintainers.length) {
118125
output.standard('no admin found')
@@ -166,6 +173,7 @@ class Owner extends BaseCommand {
166173
...this.npm.flatOptions,
167174
fullMetadata: true,
168175
preferOnline: true,
176+
_isRoot: true,
169177
})
170178

171179
const owners = data.maintainers || []

lib/commands/pack.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ class Pack extends BaseCommand {
3636
const manifests = []
3737
for (const arg of args) {
3838
const spec = npa(arg)
39-
const manifest = await pacote.manifest(spec, { ...this.npm.flatOptions, Arborist })
39+
const manifest = await pacote.manifest(spec, {
40+
...this.npm.flatOptions,
41+
Arborist,
42+
_isRoot: true,
43+
})
4044
if (!manifest._id) {
4145
throw new Error('Invalid package, must have name and version')
4246
}

lib/commands/publish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class Publish extends BaseCommand {
221221
...this.npm.flatOptions,
222222
preferOnline: true,
223223
registry,
224+
_isRoot: true,
224225
})
225226
if (typeof packument?.versions === 'undefined') {
226227
return { versions: [], highestVersion: null }

lib/commands/unpublish.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Unpublish extends BaseCommand {
2626
...opts,
2727
spec: name,
2828
query: { write: true },
29+
_isRoot: true,
2930
})
3031
return Object.keys(packument.versions)
3132
}

0 commit comments

Comments
 (0)