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 4, 2024
1 parent 534ad77 commit d79c6de
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 @@ -4,6 +4,7 @@ const npa = require('npm-package-arg')
const { log, output } = require('proc-log')
const { getContents, logTar } = require('../utils/tar.js')
const BaseCommand = require('../base-cmd.js')
const Arborist = require('@npmcli/arborist')

class Pack extends BaseCommand {
static description = 'Create a tarball from a package'
Expand Down Expand Up @@ -34,7 +35,7 @@ class Pack extends BaseCommand {
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 d79c6de

Please sign in to comment.