@lockfile-affected/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ import type { DependencyFilter, LockfileDiff, WorkspaceGraph } from '../types/lockfile.js';
2
+ /**
3
+ * Resolves which workspace packages are affected by lockfile changes.
4
+ *
5
+ * A package is considered affected if any dependency — within the groups
6
+ * selected by `filter` — appears in the lockfile diff (added, removed, or changed).
7
+ *
8
+ * Pure function: no side effects.
9
+ */
10
+ export declare function resolveAffectedPackages(diff: LockfileDiff, workspace: WorkspaceGraph, filter: DependencyFilter): ReadonlySet<string>;
11
+ //# sourceMappingURL=resolve-affected-packages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-affected-packages.d.ts","sourceRoot":"","sources":["../../src/affected/resolve-affected-packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,YAAY,EACZ,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,gBAAgB,GACvB,WAAW,CAAC,MAAM,CAAC,CAgBrB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Resolves which workspace packages are affected by lockfile changes.
3
+ *
4
+ * A package is considered affected if any dependency — within the groups
5
+ * selected by `filter` — appears in the lockfile diff (added, removed, or changed).
6
+ *
7
+ * Pure function: no side effects.
8
+ */
9
+ export function resolveAffectedPackages(diff, workspace, filter) {
10
+ const changedNames = collectChangedDependencyNames(diff);
11
+ if (changedNames.size === 0) {
12
+ return new Set();
13
+ }
14
+ const affected = new Set();
15
+ for (const [packageName, pkg] of workspace) {
16
+ if (isAffected(pkg.dependencyGroups, changedNames, filter)) {
17
+ affected.add(packageName);
18
+ }
19
+ }
20
+ return affected;
21
+ }
22
+ function collectChangedDependencyNames(diff) {
23
+ const names = new Set();
24
+ for (const name of diff.added.keys())
25
+ names.add(name);
26
+ for (const name of diff.removed.keys())
27
+ names.add(name);
28
+ for (const name of diff.changed.keys())
29
+ names.add(name);
30
+ return names;
31
+ }
32
+ function isAffected(groups, changedNames, filter) {
33
+ if (filter.dependencies && hasOverlap(groups.dependencies, changedNames))
34
+ return true;
35
+ if (filter.devDependencies && hasOverlap(groups.devDependencies, changedNames))
36
+ return true;
37
+ if (filter.peerDependencies && hasOverlap(groups.peerDependencies, changedNames))
38
+ return true;
39
+ if (filter.optionalDependencies && hasOverlap(groups.optionalDependencies, changedNames))
40
+ return true;
41
+ return false;
42
+ }
43
+ function hasOverlap(deps, changedNames) {
44
+ for (const dep of deps) {
45
+ if (changedNames.has(dep))
46
+ return true;
47
+ }
48
+ return false;
49
+ }
50
+ //# sourceMappingURL=resolve-affected-packages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-affected-packages.js","sourceRoot":"","sources":["../../src/affected/resolve-affected-packages.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAkB,EAClB,SAAyB,EACzB,MAAwB;IAExB,MAAM,YAAY,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAEzD,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,KAAK,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC;QAC3C,IAAI,UAAU,CAAC,GAAG,CAAC,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC;YAC3D,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,6BAA6B,CAAC,IAA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/lockfile.js';
2
+ /**
3
+ * Computes the difference between two lockfile snapshots.
4
+ * Pure function: no side effects, same input always produces same output.
5
+ */
6
+ export declare function diffLockfileSnapshots(before: LockfileSnapshot, after: LockfileSnapshot): LockfileDiff;
7
+ //# sourceMappingURL=diff-lockfile-snapshots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-lockfile-snapshots.d.ts","sourceRoot":"","sources":["../../src/diff/diff-lockfile-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,gBAAgB,GACtB,YAAY,CAqBd"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Computes the difference between two lockfile snapshots.
3
+ * Pure function: no side effects, same input always produces same output.
4
+ */
5
+ export function diffLockfileSnapshots(before, after) {
6
+ const added = new Map();
7
+ const removed = new Map();
8
+ const changed = new Map();
9
+ for (const [name, version] of after) {
10
+ const previousVersion = before.get(name);
11
+ if (previousVersion === undefined) {
12
+ added.set(name, version);
13
+ }
14
+ else if (previousVersion !== version) {
15
+ changed.set(name, { from: previousVersion, to: version });
16
+ }
17
+ }
18
+ for (const [name, version] of before) {
19
+ if (!after.has(name)) {
20
+ removed.set(name, version);
21
+ }
22
+ }
23
+ return { added, removed, changed };
24
+ }
25
+ //# sourceMappingURL=diff-lockfile-snapshots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff-lockfile-snapshots.js","sourceRoot":"","sources":["../../src/diff/diff-lockfile-snapshots.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAwB,EACxB,KAAuB;IAEvB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwC,CAAC;IAEhE,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC;QACpC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC;aAAM,IAAI,eAAe,KAAK,OAAO,EAAE,CAAC;YACvC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type { DependencyFilter, DependencyGroups, LockfileDiff, LockfileParser, LockfileSnapshot, WorkspaceGraph, WorkspacePackage, } from './types/lockfile.js';
2
+ export { ALL_DEPENDENCY_TYPES } from './types/lockfile.js';
3
+ export { diffLockfileSnapshots } from './diff/diff-lockfile-snapshots.js';
4
+ export { resolveAffectedPackages } from './affected/resolve-affected-packages.js';
5
+ export { buildWorkspaceGraph } from './workspace/build-workspace-graph.js';
6
+ export type { PackageManifest } from './workspace/build-workspace-graph.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,YAAY,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { ALL_DEPENDENCY_TYPES } from './types/lockfile.js';
2
+ export { diffLockfileSnapshots } from './diff/diff-lockfile-snapshots.js';
3
+ export { resolveAffectedPackages } from './affected/resolve-affected-packages.js';
4
+ export { buildWorkspaceGraph } from './workspace/build-workspace-graph.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * A normalized snapshot of a lockfile: maps each package name to its resolved version.
3
+ * This is the common representation all lockfile adapters produce.
4
+ */
5
+ export type LockfileSnapshot = ReadonlyMap<string, string>;
6
+ /**
7
+ * The result of comparing two lockfile snapshots.
8
+ */
9
+ export type LockfileDiff = {
10
+ /** Packages added in the new snapshot. key = name, value = new version */
11
+ readonly added: ReadonlyMap<string, string>;
12
+ /** Packages removed from the new snapshot. key = name, value = old version */
13
+ readonly removed: ReadonlyMap<string, string>;
14
+ /** Packages whose resolved version changed. key = name, value = { from, to } */
15
+ readonly changed: ReadonlyMap<string, {
16
+ readonly from: string;
17
+ readonly to: string;
18
+ }>;
19
+ };
20
+ /**
21
+ * The dependency types tracked per workspace package.
22
+ * Mirrors the fields in package.json.
23
+ */
24
+ export type DependencyGroups = {
25
+ readonly dependencies: ReadonlySet<string>;
26
+ readonly devDependencies: ReadonlySet<string>;
27
+ readonly peerDependencies: ReadonlySet<string>;
28
+ readonly optionalDependencies: ReadonlySet<string>;
29
+ };
30
+ /**
31
+ * Controls which dependency types are considered when resolving affected packages.
32
+ * Omitting a field (or setting it to false) excludes that type.
33
+ */
34
+ export type DependencyFilter = {
35
+ readonly dependencies?: boolean;
36
+ readonly devDependencies?: boolean;
37
+ readonly peerDependencies?: boolean;
38
+ readonly optionalDependencies?: boolean;
39
+ };
40
+ /** A DependencyFilter that includes all dependency types. */
41
+ export declare const ALL_DEPENDENCY_TYPES: DependencyFilter;
42
+ /**
43
+ * Represents a single package in the workspace (monorepo member).
44
+ */
45
+ export type WorkspacePackage = {
46
+ /** The package name from its package.json */
47
+ readonly name: string;
48
+ /** Dependencies grouped by type, as declared in package.json */
49
+ readonly dependencyGroups: DependencyGroups;
50
+ };
51
+ /**
52
+ * The full workspace graph: all packages in the monorepo.
53
+ */
54
+ export type WorkspaceGraph = ReadonlyMap<string, WorkspacePackage>;
55
+ /**
56
+ * Contract for lockfile adapters. Each lockfile format provides one of these.
57
+ */
58
+ export type LockfileParser = {
59
+ /** Human-readable name for this format, e.g. "pnpm" */
60
+ readonly format: string;
61
+ /** Filenames this parser handles, e.g. ["pnpm-lock.yaml"] */
62
+ readonly lockfileNames: readonly string[];
63
+ /** Parse raw lockfile content into a normalized snapshot */
64
+ readonly parse: (content: string) => Promise<LockfileSnapshot>;
65
+ };
66
+ //# sourceMappingURL=lockfile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../src/types/lockfile.ts"],"names":[],"mappings":"A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CAAC;IACtB,gEAAgE;IAChE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** A DependencyFilter that includes all dependency types. */
2
+ export const ALL_DEPENDENCY_TYPES = {
3
+ dependencies: true,
4
+ devDependencies: true,
5
+ peerDependencies: true,
6
+ optionalDependencies: true,
7
+ };
8
+ //# sourceMappingURL=lockfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../../src/types/lockfile.ts"],"names":[],"mappings":"AAwCA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAqB;IACpD,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,IAAI;CAC3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { WorkspaceGraph } from '../types/lockfile.js';
2
+ /**
3
+ * Shape of a package.json relevant to building the workspace graph.
4
+ */
5
+ export type PackageManifest = {
6
+ readonly name?: string;
7
+ readonly dependencies?: Readonly<Record<string, string>>;
8
+ readonly devDependencies?: Readonly<Record<string, string>>;
9
+ readonly peerDependencies?: Readonly<Record<string, string>>;
10
+ readonly optionalDependencies?: Readonly<Record<string, string>>;
11
+ };
12
+ /**
13
+ * Builds a workspace graph from a list of package.json manifests.
14
+ * Packages without a name field are ignored.
15
+ * Each dependency type is kept in its own group to allow fine-grained filtering.
16
+ */
17
+ export declare function buildWorkspaceGraph(manifests: readonly PackageManifest[]): WorkspaceGraph;
18
+ //# sourceMappingURL=build-workspace-graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-workspace-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/build-workspace-graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAoB,MAAM,sBAAsB,CAAC;AAE/F;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAClE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,GAAG,cAAc,CAazF"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Builds a workspace graph from a list of package.json manifests.
3
+ * Packages without a name field are ignored.
4
+ * Each dependency type is kept in its own group to allow fine-grained filtering.
5
+ */
6
+ export function buildWorkspaceGraph(manifests) {
7
+ const graph = new Map();
8
+ for (const manifest of manifests) {
9
+ if (!manifest.name)
10
+ continue;
11
+ graph.set(manifest.name, {
12
+ name: manifest.name,
13
+ dependencyGroups: toDependencyGroups(manifest),
14
+ });
15
+ }
16
+ return graph;
17
+ }
18
+ function toDependencyGroups(manifest) {
19
+ return {
20
+ dependencies: toNameSet(manifest.dependencies),
21
+ devDependencies: toNameSet(manifest.devDependencies),
22
+ peerDependencies: toNameSet(manifest.peerDependencies),
23
+ optionalDependencies: toNameSet(manifest.optionalDependencies),
24
+ };
25
+ }
26
+ function toNameSet(deps) {
27
+ return deps ? new Set(Object.keys(deps)) : new Set();
28
+ }
29
+ //# sourceMappingURL=build-workspace-graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-workspace-graph.js","sourceRoot":"","sources":["../../src/workspace/build-workspace-graph.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAqC;IACvE,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;IAElD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI;YAAE,SAAS;QAE7B,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE;YACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,gBAAgB,EAAE,kBAAkB,CAAC,QAAQ,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,kBAAkB,CAAC,QAAyB;IACnD,OAAO;QACL,YAAY,EAAE,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC9C,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC;QACpD,gBAAgB,EAAE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACtD,oBAAoB,EAAE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,IAAkD;IACnE,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;AACvD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@lockfile-affected/core",
3
+ "version": "0.1.0",
4
+ "description": "Core diff engine and affected package resolver",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=18"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/index.js",
20
+ "types": "./dist/index.d.ts"
21
+ }
22
+ },
23
+ "devDependencies": {
24
+ "vitest": "*",
25
+ "@vitest/coverage-v8": "*",
26
+ "typescript": "*"
27
+ },
28
+ "scripts": {
29
+ "build": "tsc",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "test:coverage": "vitest run --coverage",
33
+ "typecheck": "tsc --noEmit"
34
+ }
35
+ }