Skip to content

Commit

Permalink
fix: read workspace manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed Jul 31, 2024
1 parent 2d90395 commit 7a0a6bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pnpm/meta-updater",
"version": "2.0.2",
"version": "2.0.3",
"description": "Keeps meta files up-to-date in a monorepo",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -34,6 +34,7 @@
"@pnpm/logger": "^5.0.0",
"@pnpm/types": "^11.0.0",
"@pnpm/workspace.find-packages": "^4.0.0",
"@pnpm/workspace.read-manifest": "^2.2.0",
"load-json-file": "^7.0.1",
"meow": "^11.0.0",
"print-diff": "^2.0.0",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resolve } from 'path'
import { unlink, stat } from 'fs/promises'
import { findWorkspaceDir } from '@pnpm/find-workspace-dir'
import { readWorkspaceManifest } from '@pnpm/workspace.read-manifest'
import { printUnifiedDiff } from 'print-diff'
import { findWorkspacePackagesNoCheck } from '@pnpm/workspace.find-packages'
import { UpdateOptions, UpdateOptionsLegacy, UpdateOptionsWithFormats } from './updater/updateOptions.js'
Expand Down Expand Up @@ -67,7 +68,10 @@ export async function performUpdates<
opts?: { test?: boolean }
): Promise<null | UpdateError[]> {
const update = 'files' in updateParam ? updateParam : { files: updateParam }
let pkgs = await findWorkspacePackagesNoCheck(workspaceDir)
const workspaceManifest = await readWorkspaceManifest(workspaceDir)
let pkgs = await findWorkspacePackagesNoCheck(workspaceDir, {
patterns: workspaceManifest?.packages,
})

const { files } = update
const formats = 'formats' in update ? { ...builtInFormatPlugins, ...update.formats } : builtInFormatPlugins
Expand Down

0 comments on commit 7a0a6bc

Please sign in to comment.