Skip to content

Commit

Permalink
fix: pass arborist constructor to manifest call
Browse files Browse the repository at this point in the history
  • Loading branch information
milaninfy committed Oct 7, 2024
1 parent 534ad77 commit c629c52
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ class Pack extends BaseCommand {
const unicode = this.npm.config.get('unicode')
const json = this.npm.config.get('json')

const Arborist = require('@npmcli/arborist')
// Get the manifests and filenames first so we can bail early on manifest
// errors before making any tarballs
const manifests = []
for (const arg of args) {
const spec = npa(arg)
const manifest = await pacote.manifest(spec, this.npm.flatOptions)
const manifest = await pacote.manifest(spec, { ...this.npm.flatOptions, Arborist })
if (!manifest._id) {
throw new Error('Invalid package, must have name and version')
}
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmexec/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const manifests = new Map()

const getManifest = async (spec, flatOptions) => {
if (!manifests.has(spec.raw)) {
const manifest = await pacote.manifest(spec, { ...flatOptions, preferOnline: true })
const manifest = await pacote.manifest(spec, { ...flatOptions, preferOnline: true, Arborist })
manifests.set(spec.raw, manifest)
}
return manifests.get(spec.raw)
Expand Down
2 changes: 1 addition & 1 deletion workspaces/libnpmpack/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function pack (spec = 'file:.', opts = {}) {
// gets spec
spec = npa(spec)

const manifest = await pacote.manifest(spec, opts)
const manifest = await pacote.manifest(spec, { ...opts, Arborist })

const stdio = opts.foregroundScripts ? 'inherit' : 'pipe'

Expand Down

0 comments on commit c629c52

Please sign in to comment.