mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
fix: filter on pnpm-workspace.yaml (#10127)
* fix: `filter` on `pnpm-workspace.yaml` * docs: changeset * fix: actual fix * fix: don't set default on config
This commit is contained in:
6
.changeset/strong-readers-think.md
Normal file
6
.changeset/strong-readers-think.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/config": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fix a bug in which specifying `filter` on `pnpm-workspace.yaml` would cause pnpm to not detect any projects.
|
||||
@@ -376,7 +376,7 @@ export async function getConfig (opts: {
|
||||
if (pnpmConfig.workspaceDir != null) {
|
||||
const workspaceManifest = await readWorkspaceManifest(pnpmConfig.workspaceDir)
|
||||
|
||||
pnpmConfig.workspacePackagePatterns = cliOptions['workspace-packages'] as string[] ?? workspaceManifest?.packages ?? ['.']
|
||||
pnpmConfig.workspacePackagePatterns = cliOptions['workspace-packages'] as string[] ?? workspaceManifest?.packages
|
||||
if (workspaceManifest) {
|
||||
const newSettings = Object.assign(getOptionsFromPnpmSettings(pnpmConfig.workspaceDir, workspaceManifest, pnpmConfig.rootProjectManifest), configFromCliOpts)
|
||||
for (const [key, value] of Object.entries(newSettings)) {
|
||||
|
||||
@@ -314,7 +314,9 @@ test('recursive command with filter from config', async () => {
|
||||
])
|
||||
|
||||
fs.writeFileSync('package.json', '{}', 'utf8')
|
||||
fs.writeFileSync('.npmrc', 'filter=project-1 project-2', 'utf8')
|
||||
writeYamlFile('pnpm-workspace.yaml', {
|
||||
filter: ['project-1', 'project-2'],
|
||||
})
|
||||
await execPnpm(['recursive', 'install'])
|
||||
|
||||
projects['project-1'].has('is-positive')
|
||||
|
||||
Reference in New Issue
Block a user