Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const filename = await resolveFile("README.md", {

### `resolveLockFile`

Find path to the lock file (`yarn.lock`, `package-lock.json`, `pnpm-lock.yaml`, `npm-shrinkwrap.json`) or throws an error.
Find path to the lock file (`yarn.lock`, `package-lock.json`, `pnpm-lock.yaml`, `npm-shrinkwrap.json`, `bun.lockb`, `bun.lock`) or throws an error.

```js
import { resolveLockFile } from "pkg-types";
Expand All @@ -114,9 +114,10 @@ const lockfile = await resolveLockFile(".");

Try to detect workspace dir by in order:

1. Nearest `.git` directory
2. Farthest lockfile
3. Farthest `package.json` file
1. Farthest workspace file (`pnpm-workspace.yaml`, `lerna.json`, `turbo.json`, `rush.json`)
2. Closest `.git/config` file
3. Farthest lockfile
4. Farthest `package.json` file

If fails, throws an error.

Expand Down
3 changes: 1 addition & 2 deletions src/packagejson/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ export async function findWorkspaceDir(
continue;
}
const direction =
options[testName] ||
(testName === "packageJson" ? "closest" : "furthest");
options[testName] || (testName === "gitConfig" ? "closest" : "furthest");
const detected = await test({
...options,
startingFrom,
Expand Down