@tractorcow/beefup 0.0.0 → 1.0.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.
- package/LICENSE +15 -0
- package/README.md +108 -0
- package/dist/__tests__/with-safe-chain-stubs.d.ts +5 -0
- package/dist/__tests__/with-safe-chain-stubs.js +25 -0
- package/dist/__tests__/with-safe-chain-stubs.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +6 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli/args.d.ts +18 -0
- package/dist/cli/args.js +88 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.js +81 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/commands/accept.d.ts +16 -0
- package/dist/commands/accept.js +47 -0
- package/dist/commands/accept.js.map +1 -0
- package/dist/commands/report.d.ts +19 -0
- package/dist/commands/report.js +151 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/stage.d.ts +16 -0
- package/dist/commands/stage.js +60 -0
- package/dist/commands/stage.js.map +1 -0
- package/dist/config/load.d.ts +6 -0
- package/dist/config/load.js +103 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/types.d.ts +75 -0
- package/dist/config/types.js +68 -0
- package/dist/config/types.js.map +1 -0
- package/dist/diff/diff.d.ts +21 -0
- package/dist/diff/diff.js +132 -0
- package/dist/diff/diff.js.map +1 -0
- package/dist/diff/group.d.ts +5 -0
- package/dist/diff/group.js +24 -0
- package/dist/diff/group.js.map +1 -0
- package/dist/diff/types.d.ts +37 -0
- package/dist/diff/types.js +7 -0
- package/dist/diff/types.js.map +1 -0
- package/dist/errors.d.ts +10 -0
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -0
- package/dist/fsutil.d.ts +20 -0
- package/dist/fsutil.js +43 -0
- package/dist/fsutil.js.map +1 -0
- package/dist/lockfile/locked.d.ts +9 -0
- package/dist/lockfile/locked.js +15 -0
- package/dist/lockfile/locked.js.map +1 -0
- package/dist/lockfile/npm.d.ts +15 -0
- package/dist/lockfile/npm.js +152 -0
- package/dist/lockfile/npm.js.map +1 -0
- package/dist/lockfile/pnpm.d.ts +27 -0
- package/dist/lockfile/pnpm.js +155 -0
- package/dist/lockfile/pnpm.js.map +1 -0
- package/dist/lockfile/resolve.d.ts +10 -0
- package/dist/lockfile/resolve.js +20 -0
- package/dist/lockfile/resolve.js.map +1 -0
- package/dist/lockfile/types.d.ts +49 -0
- package/dist/lockfile/types.js +2 -0
- package/dist/lockfile/types.js.map +1 -0
- package/dist/pm/cve-lite-bin.d.ts +5 -0
- package/dist/pm/cve-lite-bin.js +36 -0
- package/dist/pm/cve-lite-bin.js.map +1 -0
- package/dist/pm/install.d.ts +24 -0
- package/dist/pm/install.js +30 -0
- package/dist/pm/install.js.map +1 -0
- package/dist/pm/runner.d.ts +17 -0
- package/dist/pm/runner.js +27 -0
- package/dist/pm/runner.js.map +1 -0
- package/dist/pm/safe-chain.d.ts +17 -0
- package/dist/pm/safe-chain.js +65 -0
- package/dist/pm/safe-chain.js.map +1 -0
- package/dist/pm/update.d.ts +16 -0
- package/dist/pm/update.js +25 -0
- package/dist/pm/update.js.map +1 -0
- package/dist/policy/alignment.d.ts +13 -0
- package/dist/policy/alignment.js +171 -0
- package/dist/policy/alignment.js.map +1 -0
- package/dist/policy/evaluate.d.ts +19 -0
- package/dist/policy/evaluate.js +75 -0
- package/dist/policy/evaluate.js.map +1 -0
- package/dist/policy/overrides.d.ts +42 -0
- package/dist/policy/overrides.js +358 -0
- package/dist/policy/overrides.js.map +1 -0
- package/dist/policy/ranges.d.ts +13 -0
- package/dist/policy/ranges.js +58 -0
- package/dist/policy/ranges.js.map +1 -0
- package/dist/project/collect.d.ts +15 -0
- package/dist/project/collect.js +60 -0
- package/dist/project/collect.js.map +1 -0
- package/dist/project/detect.d.ts +5 -0
- package/dist/project/detect.js +76 -0
- package/dist/project/detect.js.map +1 -0
- package/dist/project/direct-deps.d.ts +7 -0
- package/dist/project/direct-deps.js +28 -0
- package/dist/project/direct-deps.js.map +1 -0
- package/dist/project/package-json.d.ts +20 -0
- package/dist/project/package-json.js +6 -0
- package/dist/project/package-json.js.map +1 -0
- package/dist/project/paths.d.ts +31 -0
- package/dist/project/paths.js +45 -0
- package/dist/project/paths.js.map +1 -0
- package/dist/project/types.d.ts +13 -0
- package/dist/project/types.js +6 -0
- package/dist/project/types.js.map +1 -0
- package/dist/project/workspace.d.ts +14 -0
- package/dist/project/workspace.js +80 -0
- package/dist/project/workspace.js.map +1 -0
- package/dist/report/ansi.d.ts +31 -0
- package/dist/report/ansi.js +59 -0
- package/dist/report/ansi.js.map +1 -0
- package/dist/report/html.d.ts +6 -0
- package/dist/report/html.js +260 -0
- package/dist/report/html.js.map +1 -0
- package/dist/report/markdown.d.ts +6 -0
- package/dist/report/markdown.js +234 -0
- package/dist/report/markdown.js.map +1 -0
- package/dist/report/shared.d.ts +25 -0
- package/dist/report/shared.js +32 -0
- package/dist/report/shared.js.map +1 -0
- package/dist/report/text.d.ts +10 -0
- package/dist/report/text.js +156 -0
- package/dist/report/text.js.map +1 -0
- package/dist/report/types.d.ts +20 -0
- package/dist/report/types.js +2 -0
- package/dist/report/types.js.map +1 -0
- package/dist/rewrite/constraints.d.ts +20 -0
- package/dist/rewrite/constraints.js +64 -0
- package/dist/rewrite/constraints.js.map +1 -0
- package/dist/rewrite/repin.d.ts +8 -0
- package/dist/rewrite/repin.js +28 -0
- package/dist/rewrite/repin.js.map +1 -0
- package/dist/rewrite/workspace.d.ts +14 -0
- package/dist/rewrite/workspace.js +40 -0
- package/dist/rewrite/workspace.js.map +1 -0
- package/dist/security/classify.d.ts +48 -0
- package/dist/security/classify.js +86 -0
- package/dist/security/classify.js.map +1 -0
- package/dist/security/cve-lite.d.ts +7 -0
- package/dist/security/cve-lite.js +78 -0
- package/dist/security/cve-lite.js.map +1 -0
- package/dist/security/npm-audit.d.ts +10 -0
- package/dist/security/npm-audit.js +65 -0
- package/dist/security/npm-audit.js.map +1 -0
- package/dist/security/refs.d.ts +63 -0
- package/dist/security/refs.js +218 -0
- package/dist/security/refs.js.map +1 -0
- package/dist/security/scan.d.ts +13 -0
- package/dist/security/scan.js +32 -0
- package/dist/security/scan.js.map +1 -0
- package/dist/strategy/git.d.ts +16 -0
- package/dist/strategy/git.js +92 -0
- package/dist/strategy/git.js.map +1 -0
- package/dist/strategy/index.d.ts +7 -0
- package/dist/strategy/index.js +13 -0
- package/dist/strategy/index.js.map +1 -0
- package/dist/strategy/inplace.d.ts +30 -0
- package/dist/strategy/inplace.js +77 -0
- package/dist/strategy/inplace.js.map +1 -0
- package/dist/strategy/types.d.ts +13 -0
- package/dist/strategy/types.js +2 -0
- package/dist/strategy/types.js.map +1 -0
- package/dist/strategy/worktree.d.ts +26 -0
- package/dist/strategy/worktree.js +74 -0
- package/dist/strategy/worktree.js.map +1 -0
- package/package.json +60 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ProcessRunner } from "../pm/runner.js";
|
|
2
|
+
import { type PackageManager } from "../project/types.js";
|
|
3
|
+
import type { SecurityFinding } from "./classify.js";
|
|
4
|
+
/**
|
|
5
|
+
* Runs npm/pnpm audit and cve-lite against a project root and merges findings.
|
|
6
|
+
*/
|
|
7
|
+
export declare function scanProject(options: {
|
|
8
|
+
root: string;
|
|
9
|
+
packageManager: PackageManager;
|
|
10
|
+
pmBin: string;
|
|
11
|
+
prefixArgs: string[];
|
|
12
|
+
runner: ProcessRunner;
|
|
13
|
+
}): Promise<SecurityFinding[]>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BeefupError } from "../errors.js";
|
|
2
|
+
import { resolveCveLiteBin } from "../pm/cve-lite-bin.js";
|
|
3
|
+
import { PackageManagers } from "../project/types.js";
|
|
4
|
+
import { parseCveLiteJson } from "./cve-lite.js";
|
|
5
|
+
import { parseNpmAuditJson } from "./npm-audit.js";
|
|
6
|
+
/**
|
|
7
|
+
* Runs npm/pnpm audit and cve-lite against a project root and merges findings.
|
|
8
|
+
*/
|
|
9
|
+
export async function scanProject(options) {
|
|
10
|
+
const auditArgs = [
|
|
11
|
+
...options.prefixArgs,
|
|
12
|
+
...(options.packageManager === PackageManagers.Npm
|
|
13
|
+
? ["audit", "--json", "--package-lock-only"]
|
|
14
|
+
: ["audit", "--json"]),
|
|
15
|
+
];
|
|
16
|
+
const audit = await options.runner.run(options.pmBin, auditArgs, options.root);
|
|
17
|
+
const auditFindings = parseNpmAuditJson(audit.stdout || audit.stderr);
|
|
18
|
+
let cveFindings = [];
|
|
19
|
+
try {
|
|
20
|
+
const cveBin = await resolveCveLiteBin();
|
|
21
|
+
const cve = await options.runner.run(cveBin, [options.root, "--json"], options.root);
|
|
22
|
+
cveFindings = parseCveLiteJson(cve.stdout || cve.stderr);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (error instanceof BeefupError) {
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
throw new BeefupError(`cve-lite scan failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
29
|
+
}
|
|
30
|
+
return [...auditFindings, ...cveFindings];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/security/scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAuB,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAMjC;IACC,MAAM,SAAS,GAAG;QAChB,GAAG,OAAO,CAAC,UAAU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|
+
export declare function runGit(args: string[], cwd: string): Promise<{
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Returns whether cwd is inside a git working tree.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isGitRepo(cwd: string): Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns true when `git status --porcelain` lists any path outside `.beefup`.
|
|
14
|
+
* Beefup's own staged/report artefacts must not block a worktree re-stage.
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasNonBeefupWorkingTreeChanges(porcelain: string): boolean;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
import { BEEFUP_DIR } from "../project/paths.js";
|
|
4
|
+
const execFile = promisify(execFileCallback);
|
|
5
|
+
/** Git porcelain v1 separator between rename/copy source and destination. */
|
|
6
|
+
const PorcelainRenameSeparator = " -> ";
|
|
7
|
+
/**
|
|
8
|
+
* Runs a git command in cwd and returns trimmed stdout/stderr.
|
|
9
|
+
*/
|
|
10
|
+
export async function runGit(args, cwd) {
|
|
11
|
+
const { stdout, stderr } = await execFile("git", args, {
|
|
12
|
+
cwd,
|
|
13
|
+
encoding: "utf8",
|
|
14
|
+
});
|
|
15
|
+
return { stdout: stdout.trim(), stderr: stderr.trim() };
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns whether cwd is inside a git working tree.
|
|
19
|
+
*/
|
|
20
|
+
export async function isGitRepo(cwd) {
|
|
21
|
+
try {
|
|
22
|
+
await runGit(["rev-parse", "--is-inside-work-tree"], cwd);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns true when `git status --porcelain` lists any path outside `.beefup`.
|
|
31
|
+
* Beefup's own staged/report artefacts must not block a worktree re-stage.
|
|
32
|
+
*/
|
|
33
|
+
export function hasNonBeefupWorkingTreeChanges(porcelain) {
|
|
34
|
+
for (const line of porcelain.split("\n")) {
|
|
35
|
+
if (line.length < 4) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
for (const raw of splitPorcelainPaths(line.slice(3))) {
|
|
39
|
+
const normalized = normalizePorcelainPath(raw);
|
|
40
|
+
if (normalized.length > 0 && !isBeefupStatusPath(normalized)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Splits a porcelain path field into one path, or source and destination for renames.
|
|
49
|
+
*/
|
|
50
|
+
function splitPorcelainPaths(pathPart) {
|
|
51
|
+
let inQuotes = false;
|
|
52
|
+
let escaped = false;
|
|
53
|
+
for (let i = 0; i < pathPart.length; i += 1) {
|
|
54
|
+
const ch = pathPart[i];
|
|
55
|
+
if (escaped) {
|
|
56
|
+
escaped = false;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (inQuotes && ch === "\\") {
|
|
60
|
+
escaped = true;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (ch === '"') {
|
|
64
|
+
inQuotes = !inQuotes;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (!inQuotes && pathPart.startsWith(PorcelainRenameSeparator, i)) {
|
|
68
|
+
return [
|
|
69
|
+
pathPart.slice(0, i),
|
|
70
|
+
pathPart.slice(i + PorcelainRenameSeparator.length),
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return [pathPart];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Unquotes a git C-style porcelain path and normalizes slashes and trailing slashes.
|
|
78
|
+
*/
|
|
79
|
+
function normalizePorcelainPath(raw) {
|
|
80
|
+
let value = raw.trim();
|
|
81
|
+
if (value.startsWith('"') && value.endsWith('"') && value.length >= 2) {
|
|
82
|
+
value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\");
|
|
83
|
+
}
|
|
84
|
+
return value.replaceAll("\\", "/").replace(/\/+$/, "");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Returns true when a normalized porcelain path is `.beefup` or a file under it.
|
|
88
|
+
*/
|
|
89
|
+
function isBeefupStatusPath(normalized) {
|
|
90
|
+
return (normalized === BEEFUP_DIR || normalized.startsWith(`${BEEFUP_DIR}/`));
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/strategy/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,QAAQ,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE7C,6EAA6E;AAC7E,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAc,EACd,GAAW;IAEX,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;QACrD,GAAG;QACH,QAAQ,EAAE,MAAM;KACjB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,CAAC,WAAW,EAAE,uBA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AC;YACrB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,UAAU,CAAC,wBAAwB,EAAE,CAAC,CAAC,EAAE,CAAC;YAClE,OAAO;gBACL,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACpB,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,wBAAwB,CAAC,MAAM,CAAC;aACpD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,CAAC,QAAQ,CAAC,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAAC,GAAW;IACzC,IAAI,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACvB,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACtE,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,OAAO,CACL,UAAU,KAAK,UAAU,IAAI,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,CACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type StageStrategyName } from "../config/types.js";
|
|
2
|
+
import type { StageStrategy } from "./types.js";
|
|
3
|
+
export type { StageStrategy, StageWorkspace } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates the isolation strategy used while staging an upgrade.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createStageStrategy(name: StageStrategyName, projectRoot: string, lockfileName: string): StageStrategy;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StageStrategies } from "../config/types.js";
|
|
2
|
+
import { InPlaceStrategy } from "./inplace.js";
|
|
3
|
+
import { WorktreeStrategy } from "./worktree.js";
|
|
4
|
+
/**
|
|
5
|
+
* Creates the isolation strategy used while staging an upgrade.
|
|
6
|
+
*/
|
|
7
|
+
export function createStageStrategy(name, projectRoot, lockfileName) {
|
|
8
|
+
if (name === StageStrategies.Inplace) {
|
|
9
|
+
return new InPlaceStrategy(projectRoot, lockfileName);
|
|
10
|
+
}
|
|
11
|
+
return new WorktreeStrategy(projectRoot);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA0B,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIjD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAuB,EACvB,WAAmB,EACnB,YAAoB;IAEpB,IAAI,IAAI,KAAK,eAAe,CAAC,OAAO,EAAE,CAAC;QACrC,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { StageStrategy, StageWorkspace } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Stages upgrades in the live project tree using a backup for rollback.
|
|
4
|
+
*/
|
|
5
|
+
export declare class InPlaceStrategy implements StageStrategy {
|
|
6
|
+
private readonly projectRoot;
|
|
7
|
+
private readonly lockfileName;
|
|
8
|
+
readonly name: "inplace";
|
|
9
|
+
private backedUp;
|
|
10
|
+
/**
|
|
11
|
+
* Creates an in-place strategy for the given project root and lockfile name.
|
|
12
|
+
*/
|
|
13
|
+
constructor(projectRoot: string, lockfileName: string);
|
|
14
|
+
/**
|
|
15
|
+
* Backs up writable project files and marks staging as in progress.
|
|
16
|
+
*/
|
|
17
|
+
prepare(): Promise<StageWorkspace>;
|
|
18
|
+
/**
|
|
19
|
+
* Restores the live tree from backup when an in-place stage was started.
|
|
20
|
+
*/
|
|
21
|
+
cleanup(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Copies writable project files into the backup directory before mutation.
|
|
24
|
+
*/
|
|
25
|
+
private backup;
|
|
26
|
+
/**
|
|
27
|
+
* Restores writable files from backup and clears the in-progress marker.
|
|
28
|
+
*/
|
|
29
|
+
private restoreFromBackup;
|
|
30
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { StageStrategies } from "../config/types.js";
|
|
4
|
+
import { copyFileTo, pathExists, removePath } from "../fsutil.js";
|
|
5
|
+
import { backupDir, inProgressPath } from "../project/paths.js";
|
|
6
|
+
import { listWritableRelativePaths } from "../project/workspace.js";
|
|
7
|
+
/**
|
|
8
|
+
* Stages upgrades in the live project tree using a backup for rollback.
|
|
9
|
+
*/
|
|
10
|
+
export class InPlaceStrategy {
|
|
11
|
+
projectRoot;
|
|
12
|
+
lockfileName;
|
|
13
|
+
name = StageStrategies.Inplace;
|
|
14
|
+
backedUp = false;
|
|
15
|
+
/**
|
|
16
|
+
* Creates an in-place strategy for the given project root and lockfile name.
|
|
17
|
+
*/
|
|
18
|
+
constructor(projectRoot, lockfileName) {
|
|
19
|
+
this.projectRoot = projectRoot;
|
|
20
|
+
this.lockfileName = lockfileName;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Backs up writable project files and marks staging as in progress.
|
|
24
|
+
*/
|
|
25
|
+
async prepare() {
|
|
26
|
+
if (await pathExists(inProgressPath(this.projectRoot))) {
|
|
27
|
+
await this.restoreFromBackup();
|
|
28
|
+
}
|
|
29
|
+
await this.backup();
|
|
30
|
+
await writeFile(inProgressPath(this.projectRoot), `${StageStrategies.Inplace}\n`, "utf8");
|
|
31
|
+
this.backedUp = true;
|
|
32
|
+
return { root: this.projectRoot };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Restores the live tree from backup when an in-place stage was started.
|
|
36
|
+
*/
|
|
37
|
+
async cleanup() {
|
|
38
|
+
if (this.backedUp || (await pathExists(inProgressPath(this.projectRoot)))) {
|
|
39
|
+
await this.restoreFromBackup();
|
|
40
|
+
}
|
|
41
|
+
this.backedUp = false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Copies writable project files into the backup directory before mutation.
|
|
45
|
+
*/
|
|
46
|
+
async backup() {
|
|
47
|
+
const dest = backupDir(this.projectRoot);
|
|
48
|
+
await removePath(dest);
|
|
49
|
+
await mkdir(dest, { recursive: true });
|
|
50
|
+
const rels = await listWritableRelativePaths(this.projectRoot, this.lockfileName);
|
|
51
|
+
for (const rel of rels) {
|
|
52
|
+
const from = path.join(this.projectRoot, rel);
|
|
53
|
+
if (await pathExists(from)) {
|
|
54
|
+
await copyFileTo(from, path.join(dest, rel));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Restores writable files from backup and clears the in-progress marker.
|
|
60
|
+
*/
|
|
61
|
+
async restoreFromBackup() {
|
|
62
|
+
const dest = backupDir(this.projectRoot);
|
|
63
|
+
if (!(await pathExists(dest))) {
|
|
64
|
+
await removePath(inProgressPath(this.projectRoot));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const rels = await listWritableRelativePaths(this.projectRoot, this.lockfileName);
|
|
68
|
+
for (const rel of rels) {
|
|
69
|
+
const from = path.join(dest, rel);
|
|
70
|
+
if (await pathExists(from)) {
|
|
71
|
+
await copyFileTo(from, path.join(this.projectRoot, rel));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
await removePath(inProgressPath(this.projectRoot));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=inplace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inplace.js","sourceRoot":"","sources":["../../src/strategy/inplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGpE;;GAEG;AACH,MAAM,OAAO,eAAe;IAQP;IACA;IARV,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC;IAChC,QAAQ,GAAG,KAAK,CAAC;IAEzB;;OAEG;IACH,YACmB,WAAmB,EACnB,YAAoB;QADpB,gBAAW,GAAX,WAAW,CAAQ;QACnB,iBAAY,GAAZ,YAAY,CAAQ;IACpC,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,MAAM,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACjC,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,SAAS,CACb,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,EAChC,GAAG,eAAe,CAAC,OAAO,IAAI,EAC9B,M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M,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;YACnD,OAAO;QACT,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,yBAAyB,CAC1C,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,YAAY,CAClB,CAAC;QACF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAClC,IAAI,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3B,MAAM,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;QACD,MAAM,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StageStrategyName } from "../config/types.js";
|
|
2
|
+
/** Workspace root used while a staging strategy is active. */
|
|
3
|
+
export interface StageWorkspace {
|
|
4
|
+
root: string;
|
|
5
|
+
}
|
|
6
|
+
/** Isolation strategy that prepares and cleans up a staging workspace. */
|
|
7
|
+
export interface StageStrategy {
|
|
8
|
+
readonly name: StageStrategyName;
|
|
9
|
+
/** Creates an isolated workspace ready for rewrite and lockfile regeneration. */
|
|
10
|
+
prepare(): Promise<StageWorkspace>;
|
|
11
|
+
/** Discards or restores the isolated workspace after staging finishes. */
|
|
12
|
+
cleanup(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/strategy/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StageStrategy, StageWorkspace } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Stages upgrades in a detached git worktree so the live tree stays untouched.
|
|
4
|
+
*/
|
|
5
|
+
export declare class WorktreeStrategy implements StageStrategy {
|
|
6
|
+
private readonly projectRoot;
|
|
7
|
+
readonly name: "worktree";
|
|
8
|
+
private workRoot;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a worktree strategy for the given project root.
|
|
11
|
+
*/
|
|
12
|
+
constructor(projectRoot: string);
|
|
13
|
+
/**
|
|
14
|
+
* Requires a git repo whose working tree is clean except for `.beefup/`,
|
|
15
|
+
* then creates a detached worktree for staging.
|
|
16
|
+
*/
|
|
17
|
+
prepare(): Promise<StageWorkspace>;
|
|
18
|
+
/**
|
|
19
|
+
* Removes the staging worktree created by prepare, including leftovers.
|
|
20
|
+
*/
|
|
21
|
+
cleanup(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Force-removes a worktree path via git, falling back to deleting the directory.
|
|
24
|
+
*/
|
|
25
|
+
private removeLeftoverWorktree;
|
|
26
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { mkdir } from "node:fs/promises";
|
|
2
|
+
import { StageStrategies } from "../config/types.js";
|
|
3
|
+
import { BeefupError } from "../errors.js";
|
|
4
|
+
import { pathExists, removePath } from "../fsutil.js";
|
|
5
|
+
import { beefupDir, worktreeDir } from "../project/paths.js";
|
|
6
|
+
import { hasNonBeefupWorkingTreeChanges, isGitRepo, runGit } from "./git.js";
|
|
7
|
+
/**
|
|
8
|
+
* Stages upgrades in a detached git worktree so the live tree stays untouched.
|
|
9
|
+
*/
|
|
10
|
+
export class WorktreeStrategy {
|
|
11
|
+
projectRoot;
|
|
12
|
+
name = StageStrategies.Worktree;
|
|
13
|
+
workRoot;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a worktree strategy for the given project root.
|
|
16
|
+
*/
|
|
17
|
+
constructor(projectRoot) {
|
|
18
|
+
this.projectRoot = projectRoot;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Requires a git repo whose working tree is clean except for `.beefup/`,
|
|
22
|
+
* then creates a detached worktree for staging.
|
|
23
|
+
*/
|
|
24
|
+
async prepare() {
|
|
25
|
+
if (!(await isGitRepo(this.projectRoot))) {
|
|
26
|
+
throw new BeefupError(`strategy ${StageStrategies.Worktree} requires a git repository; commit the project or use --strategy ${StageStrategies.Inplace}`);
|
|
27
|
+
}
|
|
28
|
+
const { stdout: status } = await runGit(["status", "--porcelain"], this.projectRoot);
|
|
29
|
+
if (hasNonBeefupWorkingTreeChanges(status)) {
|
|
30
|
+
throw new BeefupError(`strategy ${StageStrategies.Worktree} requires a clean working tree (no staged, unstaged, or untracked files); commit or stash changes, or use --strategy ${StageStrategies.Inplace}`);
|
|
31
|
+
}
|
|
32
|
+
const workRoot = worktreeDir(this.projectRoot);
|
|
33
|
+
await this.removeLeftoverWorktree(workRoot);
|
|
34
|
+
await mkdir(beefupDir(this.projectRoot), { recursive: true });
|
|
35
|
+
await runGit(["worktree", "add", "--detach", workRoot, "HEAD"], this.projectRoot);
|
|
36
|
+
this.workRoot = workRoot;
|
|
37
|
+
return { root: workRoot };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Removes the staging worktree created by prepare, including leftovers.
|
|
41
|
+
*/
|
|
42
|
+
async cleanup() {
|
|
43
|
+
if (!this.workRoot) {
|
|
44
|
+
const leftover = worktreeDir(this.projectRoot);
|
|
45
|
+
if (await pathExists(leftover)) {
|
|
46
|
+
await this.removeLeftoverWorktree(leftover);
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
await this.removeLeftoverWorktree(this.workRoot);
|
|
51
|
+
this.workRoot = undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Force-removes a worktree path via git, falling back to deleting the directory.
|
|
55
|
+
*/
|
|
56
|
+
async removeLeftoverWorktree(workRoot) {
|
|
57
|
+
if (!(await pathExists(workRoot))) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
await runGit(["worktree", "remove", "--force", workRoot], this.projectRoot);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
await removePath(workRoot);
|
|
65
|
+
try {
|
|
66
|
+
await runGit(["worktree", "prune"], this.projectRoot);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Ignore prune failures after a forced directory removal.
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=worktree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/strategy/worktree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG7E;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAOE;IANpB,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC;IACjC,QAAQ,CAAqB;IAErC;;OAEG;IACH,YAA6B,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;IAEpD;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,WAAW,CACnB,YAAY,eAAe,CAAC,QAAQ,oEAAoE,eAAe,CAAC,OAAO,EAAE,CAClI,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MA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,CAAC,CAAC,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QACD,IAAI,CAAC;YACH,MAAM,MAAM,CACV,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAC3C,IAAI,CAAC,WAAW,CACjB,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;YAC3B,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YACxD,CAAC;YAAC,MAAM,CAAC;gBACP,0DAA0D;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tractorcow/beefup",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Staged, pinned, audited dependency upgrades for npm and pnpm.",
|
|
6
|
+
"packageManager": "pnpm@11.22.0",
|
|
7
|
+
"bin": {
|
|
8
|
+
"beefup": "./dist/bin.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"package.json"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=22"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"postbuild": "chmod +x dist/bin.js",
|
|
20
|
+
"clean": "rm -rf dist",
|
|
21
|
+
"prepublishOnly": "pnpm run clean && pnpm run build",
|
|
22
|
+
"lint:commits": "commitlint --from HEAD~1 --to HEAD --verbose",
|
|
23
|
+
"test": "tsx --test --test-reporter spec $(find src -name '*.test.ts')"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"dependencies",
|
|
27
|
+
"upgrade",
|
|
28
|
+
"npm",
|
|
29
|
+
"pnpm",
|
|
30
|
+
"lockfile",
|
|
31
|
+
"security",
|
|
32
|
+
"cve",
|
|
33
|
+
"semver"
|
|
34
|
+
],
|
|
35
|
+
"author": "Damian Mooyman",
|
|
5
36
|
"license": "ISC",
|
|
6
|
-
"
|
|
7
|
-
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/tractorcow/beefup.git"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"provenance": true
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"cve-lite-cli": "1.29.0",
|
|
47
|
+
"semver": "7.8.5",
|
|
48
|
+
"yaml": "2.9.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@commitlint/cli": "^20.1.0",
|
|
52
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
53
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
54
|
+
"@semantic-release/git": "^10.0.1",
|
|
55
|
+
"@semantic-release/github": "^12.0.2",
|
|
56
|
+
"@semantic-release/npm": "^13.1.2",
|
|
57
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
58
|
+
"@types/node": "24.10.1",
|
|
59
|
+
"@types/semver": "7.7.1",
|
|
60
|
+
"semantic-release": "^25.0.2",
|
|
61
|
+
"tsx": "4.23.12",
|
|
62
|
+
"typescript": "5.9.3"
|
|
63
|
+
}
|
|
8
64
|
}
|