turbo
c58ee799 - feat: Add `packagesFromLockfile()` NAPI binding to `@turbo/repository` (#12454)

Commit
2 days ago
feat: Add `packagesFromLockfile()` NAPI binding to `@turbo/repository` (#12454) ## Summary - Adds `workspace.packagesFromLockfile()` to `@turbo/repository`, returning all transitive external dependencies as `npm/<name>@<version>` strings - Leverages the already-computed `transitive_dependencies` from `PackageGraph` and each lockfile's `human_name()` formatter -- no new Rust public API or lockfile parser changes ## Usage ```typescript import { Workspace } from "@turbo/repository"; const workspace = await Workspace.find(); const packages: string[] = await workspace.packagesFromLockfile(); // ["npm/@types/react@18.2.0", "npm/react@18.2.0", ...] ``` Works with all supported lockfile formats (npm, pnpm, yarn classic, yarn berry, bun). ## Testing New test file `__tests__/lockfile-packages.test.ts` covers: - pnpm fixture returns expected `npm/microdiff@1.4.0` - npm fixture with no external deps returns `[]` - All entries match `npm/<name>@<version>` format - Output is sorted and deduplicated
Author
Parents
Loading