mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-30 10:38:13 -05:00
7
.changeset/great-groups-fry.md
Normal file
7
.changeset/great-groups-fry.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": patch
|
||||
"@pnpm/plugin-commands-script-runners": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fix `pnpm dlx` with `--allow-build` flag [#9263](https://github.com/pnpm/pnpm/issues/9263).
|
||||
@@ -75,7 +75,7 @@ export type DlxCommandOptions = {
|
||||
package?: string[]
|
||||
shellMode?: boolean
|
||||
allowBuild?: string[]
|
||||
} & Pick<Config, 'extraBinPaths' | 'registries' | 'reporter' | 'userAgent' | 'cacheDir' | 'dlxCacheMaxAge' | 'useNodeVersion' | 'symlink'> & add.AddCommandOptions & PnpmSettings
|
||||
} & Pick<Config, 'extraBinPaths' | 'registries' | 'reporter' | 'userAgent' | 'cacheDir' | 'dlxCacheMaxAge' | 'useNodeVersion' | 'symlink'> & Omit<add.AddCommandOptions, 'rootProjectManifestDir'> & PnpmSettings
|
||||
|
||||
export async function handler (
|
||||
opts: DlxCommandOptions,
|
||||
@@ -113,6 +113,7 @@ export async function handler (
|
||||
dir: cachedDir,
|
||||
lockfileDir: cachedDir,
|
||||
onlyBuiltDependencies: [...resolvedPkgAliases, ...(opts.allowBuild ?? [])],
|
||||
rootProjectManifestDir: cachedDir,
|
||||
saveProd: true, // dlx will be looking for the package in the "dependencies" field!
|
||||
saveDev: false,
|
||||
saveOptional: false,
|
||||
|
||||
@@ -88,7 +88,6 @@ export const DLX_DEFAULT_OPTS = {
|
||||
registries: {
|
||||
default: REGISTRY_URL,
|
||||
},
|
||||
rootProjectManifestDir: '',
|
||||
sort: true,
|
||||
storeDir: path.join(tmp, 'store'),
|
||||
symlink: true,
|
||||
|
||||
@@ -231,11 +231,13 @@ export async function handler (
|
||||
...(opts.onlyBuiltDependencies ?? []),
|
||||
...opts.allowBuild,
|
||||
])).sort((a, b) => a.localeCompare(b))
|
||||
opts.rootProjectManifest = opts.rootProjectManifest ?? {}
|
||||
opts.rootProjectManifest.pnpm = opts.rootProjectManifest.pnpm ?? {}
|
||||
opts.rootProjectManifest.pnpm.onlyBuiltDependencies = opts.onlyBuiltDependencies
|
||||
const writeProjectManifest = await createProjectManifestWriter(opts.rootProjectManifestDir)
|
||||
await writeProjectManifest(opts.rootProjectManifest)
|
||||
if (opts.rootProjectManifestDir) {
|
||||
opts.rootProjectManifest = opts.rootProjectManifest ?? {}
|
||||
opts.rootProjectManifest.pnpm = opts.rootProjectManifest.pnpm ?? {}
|
||||
opts.rootProjectManifest.pnpm.onlyBuiltDependencies = opts.onlyBuiltDependencies
|
||||
const writeProjectManifest = await createProjectManifestWriter(opts.rootProjectManifestDir)
|
||||
await writeProjectManifest(opts.rootProjectManifest)
|
||||
}
|
||||
}
|
||||
return installDeps({
|
||||
...opts,
|
||||
|
||||
Reference in New Issue
Block a user