Skip to content

Commit

Permalink
feat: add context to npx cache package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Feb 26, 2025
1 parent 3d8b257 commit d18d422
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workspaces/libnpmexec/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
'use strict'

const { dirname, resolve } = require('node:path')
const crypto = require('node:crypto')
const { mkdir } = require('node:fs/promises')
const Arborist = require('@npmcli/arborist')
const ciInfo = require('ci-info')
const crypto = require('node:crypto')
const { log, input } = require('proc-log')
const npa = require('npm-package-arg')
const pacote = require('pacote')
const { read } = require('read')
const semver = require('semver')
const PackageJson = require('@npmcli/package-json')
const { fileExists, localFileExists } = require('./file-exists.js')
const getBinFromManifest = require('./get-bin-from-manifest.js')
const noTTY = require('./no-tty.js')
const runScript = require('./run-script.js')
const isWindows = require('./is-windows.js')
const { dirname, resolve } = require('node:path')

const binPaths = []

Expand Down Expand Up @@ -293,6 +294,9 @@ const exec = async (opts) => {
})
}
binPaths.push(resolve(installDir, 'node_modules/.bin'))
const pkgJson = await PackageJson.load(installDir)
pkgJson.update({ _npx: { packages } })
await pkgJson.save()
}

return await run()
Expand Down

0 comments on commit d18d422

Please sign in to comment.