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
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![CI](https://github.com/split/lockfile-affected/actions/workflows/ci.yml/badge.svg)](https://github.com/split/lockfile-affected/actions/workflows/ci.yml)
[![npm version](https://img.shields.io/npm/v/lockfile-affected)](https://www.npmjs.com/package/lockfile-affected)

> **Warning:** This tool is still in early development. The API may change, and some features are incomplete or not yet fully tested. Use in production at your own risk.

Find which workspace packages are affected by lockfile changes.

## Installation
Expand All @@ -29,7 +31,7 @@ Pass the before and after lockfile snapshots as arguments:
lockfile-affected pnpm-lock.yaml.old pnpm-lock.yaml
```

Works with pnpm, npm, yarn (classic v1 and berry v2+), and Bun text lockfiles (`bun.lock`).
Works with pnpm, npm, Yarn Berry (v2+), and Bun text lockfiles (`bun.lock`).

For full Git and CI usage patterns, see the CLI guide:
[`packages/cli/README.md`](packages/cli/README.md).
Expand All @@ -40,5 +42,9 @@ For full Git and CI usage patterns, see the CLI guide:
- [`@lockfile-affected/core`](packages/core) — pure diff and resolution engine
- [`@lockfile-affected/lockfile-pnpm`](packages/lockfile-pnpm) — pnpm-lock.yaml parser
- [`@lockfile-affected/lockfile-npm`](packages/lockfile-npm) — package-lock.json parser
- [`@lockfile-affected/lockfile-yarn`](packages/lockfile-yarn) — yarn.lock parser
- [`@lockfile-affected/lockfile-yarn`](packages/lockfile-yarn) — yarn.lock parser (Yarn Berry v2+)
- [`@lockfile-affected/lockfile-bun`](packages/lockfile-bun) — bun.lock parser

## Development

This project was developed with AI assistance.
44 changes: 44 additions & 0 deletions packages/cli/e2e/fixtures/bun-deep-chain/after-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "deep-chain-test",
"dependencies": {
"express": "^4.18.0"
}
},
"packages/pkg-leaf": {
"name": "pkg-leaf",
"version": "1.0.0",
"dependencies": {
"express": "^4.18.0"
}
},
"packages/pkg-base": {
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"pkg-leaf": "workspace:*"
}
},
"packages/pkg-middle": {
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "workspace:*"
}
},
"packages/pkg-top": {
"name": "pkg-top",
"version": "1.0.0",
"dependencies": {
"pkg-middle": "workspace:*"
}
}
},
"packages": {
"express": ["express@4.18.5", "", {}, "sha512-express-4-18-5"],
"express@4.18.5": ["express@4.18.5", "", {}, "sha512-express-4-18-5"]
}
}
44 changes: 44 additions & 0 deletions packages/cli/e2e/fixtures/bun-deep-chain/before-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "deep-chain-test",
"dependencies": {
"express": "^4.18.0"
}
},
"packages/pkg-leaf": {
"name": "pkg-leaf",
"version": "1.0.0",
"dependencies": {
"express": "^4.18.0"
}
},
"packages/pkg-base": {
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"pkg-leaf": "workspace:*"
}
},
"packages/pkg-middle": {
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "workspace:*"
}
},
"packages/pkg-top": {
"name": "pkg-top",
"version": "1.0.0",
"dependencies": {
"pkg-middle": "workspace:*"
}
}
},
"packages": {
"express": ["express@4.18.0", "", {}, "sha512-express-4-18-0"],
"express@4.18.0": ["express@4.18.0", "", {}, "sha512-express-4-18-0"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "deep-chain-test",
"private": true,
"workspaces": [
"packages/*"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"pkg-leaf": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-leaf",
"version": "1.0.0",
"dependencies": {
"express": "^4.18.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-top",
"version": "1.0.0",
"dependencies": {
"pkg-middle": "workspace:*"
}
}
42 changes: 42 additions & 0 deletions packages/cli/e2e/fixtures/bun-diamond/after-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "diamond-test"
},
"packages/lib-c": {
"name": "lib-c",
"version": "1.0.0",
"dependencies": {
"shared-dep": "^1.0.0"
}
},
"packages/lib-a": {
"name": "lib-a",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
},
"packages/lib-b": {
"name": "lib-b",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
},
"packages/app": {
"name": "app",
"version": "1.0.0",
"dependencies": {
"lib-a": "workspace:*",
"lib-b": "workspace:*"
}
}
},
"packages": {
"shared-dep": ["shared-dep@2.0.0", "", {}, "sha512-shared-dep-2-0-0"],
"shared-dep@2.0.0": ["shared-dep@2.0.0", "", {}, "sha512-shared-dep-2-0-0"]
}
}
42 changes: 42 additions & 0 deletions packages/cli/e2e/fixtures/bun-diamond/before-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "diamond-test"
},
"packages/lib-c": {
"name": "lib-c",
"version": "1.0.0",
"dependencies": {
"shared-dep": "^1.0.0"
}
},
"packages/lib-a": {
"name": "lib-a",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
},
"packages/lib-b": {
"name": "lib-b",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
},
"packages/app": {
"name": "app",
"version": "1.0.0",
"dependencies": {
"lib-a": "workspace:*",
"lib-b": "workspace:*"
}
}
},
"packages": {
"shared-dep": ["shared-dep@1.0.0", "", {}, "sha512-shared-dep-1-0-0"],
"shared-dep@1.0.0": ["shared-dep@1.0.0", "", {}, "sha512-shared-dep-1-0-0"]
}
}
7 changes: 7 additions & 0 deletions packages/cli/e2e/fixtures/bun-diamond/workspace/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "diamond-test",
"private": true,
"workspaces": [
"packages/*"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "app",
"version": "1.0.0",
"dependencies": {
"lib-a": "workspace:*",
"lib-b": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "lib-a",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "lib-b",
"version": "1.0.0",
"dependencies": {
"lib-c": "workspace:*"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "lib-c",
"version": "1.0.0",
"dependencies": {
"shared-dep": "^1.0.0"
}
}
31 changes: 31 additions & 0 deletions packages/cli/e2e/fixtures/bun-transitive/after-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "test-monorepo",
"dependencies": {
"lodash": "^4.17.0"
}
},
"packages/pkg-base": {
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"lodash": "^4.17.23"
}
},
"packages/pkg-middle": {
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "1.0.0"
}
}
},
"packages": {
"lodash": ["lodash@4.17.23", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="],
"lodash@4.17.21": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZbet2yk9dzQ1uFR5/0w=="],
"lodash@4.17.23": ["lodash@4.17.23", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="]
}
}
30 changes: 30 additions & 0 deletions packages/cli/e2e/fixtures/bun-transitive/before-bun.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "test-monorepo",
"dependencies": {
"lodash": "^4.17.0"
}
},
"packages/pkg-base": {
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"lodash": "^4.17.0"
}
},
"packages/pkg-middle": {
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "1.0.0"
}
}
},
"packages": {
"lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZbet2yk9dzQ1uFR5/0w=="],
"lodash@4.17.21": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZbet2yk9dzQ1uFR5/0w=="]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "test-monorepo",
"private": true,
"workspaces": [
"packages/*"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-base",
"version": "1.0.0",
"dependencies": {
"lodash": "^4.17.23"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "pkg-middle",
"version": "1.0.0",
"dependencies": {
"pkg-base": "1.0.0"
}
}
Loading
Loading