@zukhruf/git-hooks 0.8.20 → 0.8.22
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/README.md +275 -37
- package/dist/build.d.ts +1 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +44 -46
- package/dist/build.js.map +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +41 -8
- package/dist/codegen.js.map +1 -1
- package/dist/commit.d.ts +29 -10
- package/dist/commit.d.ts.map +1 -1
- package/dist/commit.js +244 -85
- package/dist/commit.js.map +1 -1
- package/dist/dependency-checks.d.ts.map +1 -1
- package/dist/dependency-checks.js +49 -44
- package/dist/dependency-checks.js.map +1 -1
- package/dist/dockerfile-installs.d.ts +7 -0
- package/dist/dockerfile-installs.d.ts.map +1 -0
- package/dist/dockerfile-installs.js +132 -0
- package/dist/dockerfile-installs.js.map +1 -0
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +33 -24
- package/dist/format.js.map +1 -1
- package/dist/git.d.ts +3 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +20 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/lockfile-sync.d.ts +8 -0
- package/dist/lockfile-sync.d.ts.map +1 -0
- package/dist/lockfile-sync.js +82 -0
- package/dist/lockfile-sync.js.map +1 -0
- package/dist/no-numeric-pins.d.ts.map +1 -1
- package/dist/no-numeric-pins.js +12 -3
- package/dist/no-numeric-pins.js.map +1 -1
- package/dist/npm/lockfile.d.ts +18 -0
- package/dist/npm/lockfile.d.ts.map +1 -0
- package/dist/npm/lockfile.js +108 -0
- package/dist/npm/lockfile.js.map +1 -0
- package/dist/npmrc-policy.d.ts +7 -0
- package/dist/npmrc-policy.d.ts.map +1 -0
- package/dist/npmrc-policy.js +93 -0
- package/dist/npmrc-policy.js.map +1 -0
- package/dist/push.d.ts +14 -9
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +20 -93
- package/dist/push.js.map +1 -1
- package/dist/ref-update.d.ts +1 -1
- package/dist/ref-update.d.ts.map +1 -1
- package/dist/run/commit-msg.d.ts +9 -0
- package/dist/run/commit-msg.d.ts.map +1 -0
- package/dist/run/commit-msg.js +8 -0
- package/dist/run/commit-msg.js.map +1 -0
- package/dist/run/pre-commit.d.ts +14 -0
- package/dist/run/pre-commit.d.ts.map +1 -0
- package/dist/run/pre-commit.js +41 -0
- package/dist/run/pre-commit.js.map +1 -0
- package/dist/run/pre-push.d.ts +14 -0
- package/dist/run/pre-push.d.ts.map +1 -0
- package/dist/run/pre-push.js +27 -0
- package/dist/run/pre-push.js.map +1 -0
- package/dist/run/step-runner.d.ts +17 -0
- package/dist/run/step-runner.d.ts.map +1 -0
- package/dist/run/step-runner.js +27 -0
- package/dist/run/step-runner.js.map +1 -0
- package/dist/scripts/commit-msg.d.ts +1 -1
- package/dist/scripts/commit-msg.d.ts.map +1 -1
- package/dist/scripts/commit-msg.js +14 -19
- package/dist/scripts/commit-msg.js.map +1 -1
- package/dist/scripts/host.d.ts +10 -0
- package/dist/scripts/host.d.ts.map +1 -0
- package/dist/scripts/host.js +37 -0
- package/dist/scripts/host.js.map +1 -0
- package/dist/scripts/pre-commit.d.ts +1 -1
- package/dist/scripts/pre-commit.d.ts.map +1 -1
- package/dist/scripts/pre-commit.js +14 -17
- package/dist/scripts/pre-commit.js.map +1 -1
- package/dist/scripts/pre-push.d.ts +1 -1
- package/dist/scripts/pre-push.d.ts.map +1 -1
- package/dist/scripts/pre-push.js +16 -32
- package/dist/scripts/pre-push.js.map +1 -1
- package/dist/snapshot/drift.d.ts +0 -2
- package/dist/snapshot/drift.d.ts.map +1 -1
- package/dist/snapshot/drift.js +5 -57
- package/dist/snapshot/drift.js.map +1 -1
- package/dist/snapshot/installs.d.ts +1 -0
- package/dist/snapshot/installs.d.ts.map +1 -1
- package/dist/snapshot/installs.js +85 -29
- package/dist/snapshot/installs.js.map +1 -1
- package/dist/snapshot/snapshot.d.ts +21 -0
- package/dist/snapshot/snapshot.d.ts.map +1 -0
- package/dist/snapshot/snapshot.js +54 -0
- package/dist/snapshot/snapshot.js.map +1 -0
- package/dist/snapshot/snapshots.d.ts +30 -0
- package/dist/snapshot/snapshots.d.ts.map +1 -0
- package/dist/snapshot/snapshots.js +180 -0
- package/dist/snapshot/snapshots.js.map +1 -0
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +16 -16
- package/dist/sync.js.map +1 -1
- package/dist/testing.d.ts +23 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +41 -0
- package/dist/testing.js.map +1 -0
- package/dist/tree.d.ts +24 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +96 -0
- package/dist/tree.js.map +1 -0
- package/package.json +10 -4
- package/dist/snapshot/nx.d.ts +0 -7
- package/dist/snapshot/nx.d.ts.map +0 -1
- package/dist/snapshot/nx.js +0 -20
- package/dist/snapshot/nx.js.map +0 -1
|
@@ -1,73 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { posix, relative, sep } from 'node:path';
|
|
2
2
|
import { Step } from "./step.js";
|
|
3
|
-
// The package.json of the project that holds `path`: the nearest one up
|
|
4
|
-
// folders
|
|
5
|
-
|
|
3
|
+
// The package.json of the project that holds `path`: the nearest one up its
|
|
4
|
+
// folders among the manifests of the staged tree.
|
|
5
|
+
function manifestOf(path, manifests) {
|
|
6
6
|
let folder = posix.dirname(path);
|
|
7
|
-
const visited = [];
|
|
8
7
|
for (;;) {
|
|
9
|
-
const known = found.get(folder);
|
|
10
|
-
if (known !== undefined) {
|
|
11
|
-
for (const each of visited)
|
|
12
|
-
found.set(each, known);
|
|
13
|
-
return known;
|
|
14
|
-
}
|
|
15
|
-
visited.push(folder);
|
|
16
8
|
const candidate = folder === '.' ? 'package.json' : `${folder}/package.json`;
|
|
17
|
-
|
|
18
|
-
if (exists) {
|
|
19
|
-
for (const each of visited)
|
|
20
|
-
found.set(each, candidate);
|
|
9
|
+
if (manifests.has(candidate))
|
|
21
10
|
return candidate;
|
|
22
|
-
|
|
23
|
-
if (folder === '.') {
|
|
24
|
-
for (const each of visited)
|
|
25
|
-
found.set(each, null);
|
|
11
|
+
if (folder === '.')
|
|
26
12
|
return null;
|
|
27
|
-
}
|
|
28
13
|
folder = posix.dirname(folder);
|
|
29
14
|
}
|
|
30
15
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
function isLintResults(value) {
|
|
17
|
+
return (Array.isArray(value) &&
|
|
18
|
+
value.every((result) => typeof result === 'object' &&
|
|
19
|
+
result !== null &&
|
|
20
|
+
'filePath' in result &&
|
|
21
|
+
'messages' in result &&
|
|
22
|
+
Array.isArray(result.messages)));
|
|
23
|
+
}
|
|
24
|
+
// Lints the staged package.json of each project that the commit touches, a
|
|
25
|
+
// deletion included, with the commit's own ESLint and config in the snapshot
|
|
26
|
+
// of the staged commit, and changes nothing. A dependency rule such as
|
|
27
|
+
// dependency-checks reports on package.json, so linting only the staged
|
|
28
|
+
// source files never runs it; the commit stops here instead of CI after a
|
|
29
|
+
// push.
|
|
35
30
|
export class DependencyChecks extends Step {
|
|
36
31
|
name = 'dependencies';
|
|
37
32
|
async run(commit) {
|
|
38
|
-
const
|
|
33
|
+
const tree = await commit.tree();
|
|
34
|
+
const all = new Set(tree.entries(['**/package.json']).map(({ path }) => path));
|
|
39
35
|
const manifests = new Set();
|
|
40
|
-
for (const path of await commit.
|
|
41
|
-
const manifest =
|
|
36
|
+
for (const { path } of await commit.changes()) {
|
|
37
|
+
const manifest = manifestOf(path, all);
|
|
42
38
|
if (manifest !== null)
|
|
43
39
|
manifests.add(manifest);
|
|
44
40
|
}
|
|
45
41
|
if (manifests.size === 0)
|
|
46
42
|
return this.skip('no project is touched');
|
|
47
|
-
const
|
|
48
|
-
const
|
|
43
|
+
const snapshot = await commit.snapshot({ packages: true });
|
|
44
|
+
const sorted = [...manifests].sort();
|
|
45
|
+
const { status, stdout, stderr } = await snapshot.bin('eslint', [
|
|
46
|
+
'--format',
|
|
47
|
+
'json',
|
|
48
|
+
'--no-warn-ignored',
|
|
49
|
+
'--',
|
|
50
|
+
...sorted,
|
|
51
|
+
]);
|
|
52
|
+
// ESLint exits with 2 when it cannot run, such as a broken config.
|
|
53
|
+
if (status === 2 || status === null)
|
|
54
|
+
return this.fail(`eslint could not lint ${sorted.join(', ')}:\n${stderr.trimEnd()}`);
|
|
55
|
+
const results = JSON.parse(stdout);
|
|
56
|
+
if (!isLintResults(results))
|
|
57
|
+
throw new TypeError(`eslint gave ${stdout.slice(0, 200)}, not lint results`);
|
|
49
58
|
const problems = [];
|
|
50
59
|
const failing = new Set();
|
|
51
|
-
for (const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for (const message of messages)
|
|
60
|
-
if (message.severity === 2) {
|
|
61
|
-
failing.add(manifest);
|
|
62
|
-
problems.push(`${manifest}:${message.line} ${message.message}${message.ruleId === null ? '' : ` ${message.ruleId}`}`);
|
|
63
|
-
}
|
|
60
|
+
for (const { filePath, messages } of results) {
|
|
61
|
+
// ESLint gives a path of the platform: on Windows, with backslashes.
|
|
62
|
+
const manifest = relative(snapshot.folder, filePath).split(sep).join('/');
|
|
63
|
+
for (const message of messages)
|
|
64
|
+
if (message.severity === 2) {
|
|
65
|
+
failing.add(manifest);
|
|
66
|
+
problems.push(`${manifest}:${message.line ?? 0} ${message.message}${message.ruleId === null ? '' : ` ${message.ruleId}`}`);
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
if (problems.length === 0)
|
|
66
70
|
return this.pass(`the package.json of ${manifests.size} touched project${manifests.size === 1 ? '' : 's'} lints clean`);
|
|
71
|
+
const pronoun = failing.size === 1 ? 'it' : 'them';
|
|
67
72
|
return this.fail([
|
|
68
73
|
'The package.json of a touched project breaks the lint:',
|
|
69
74
|
...problems.map((problem) => ` ${problem}`),
|
|
70
|
-
`Run \`npx eslint ${[...failing].join(' ')}\`, fix ${
|
|
75
|
+
`Run \`npx eslint ${[...failing].join(' ')}\`, fix ${pronoun}, stage ${pronoun}, and commit again.`,
|
|
71
76
|
].join('\n'));
|
|
72
77
|
}
|
|
73
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-checks.js","sourceRoot":"","sources":["../src/dependency-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dependency-checks.js","sourceRoot":"","sources":["../src/dependency-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,4EAA4E;AAC5E,kDAAkD;AAClD,SAAS,UAAU,CACjB,IAAY,EACZ,SAA8B;IAE9B,IAAI,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,SAAS,CAAC;QACR,MAAM,SAAS,GACb,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,MAAM,eAAe,CAAC;QAC7D,IAAI,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QAC/C,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QAChC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAaD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,KAAK,CAAC,KAAK,CACT,CAAC,MAAM,EAAE,EAAE,CACT,OAAO,MAAM,KAAK,QAAQ;YAC1B,MAAM,KAAK,IAAI;YACf,UA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AC,MAAM,KAAK,CAAC;YACvB,OAAO,IAAI,CAAC,IAAI,CACd,uBAAuB,SAAS,CAAC,IAAI,mBAAmB,SAAS,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,cAAc,CACtG,CAAC;QACJ,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;QACnD,OAAO,IAAI,CAAC,IAAI,CACd;YACE,wDAAwD;YACxD,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;YAC5C,oBAAoB,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,OAAO,WAAW,OAAO,qBAAqB;SACpG,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Commit } from './commit.ts';
|
|
2
|
+
import { type Outcome, Step } from './step.ts';
|
|
3
|
+
export declare class DockerfileInstallsFromLockfile extends Step<Commit> {
|
|
4
|
+
readonly name = "docker";
|
|
5
|
+
run(commit: Commit): Promise<Outcome>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=dockerfile-installs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dockerfile-installs.d.ts","sourceRoot":"","sources":["../src/dockerfile-installs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA6G/C,qBAAa,8BAA+B,SAAQ,IAAI,CAAC,MAAM,CAAC;IAC9D,QAAQ,CAAC,IAAI,YAAY;IAEnB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAuB5C"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { Step } from "./step.js";
|
|
3
|
+
// A copy of `isDockerfile` in no-numeric-pins.ts (docs/copied-code.md).
|
|
4
|
+
function isDockerfile(path) {
|
|
5
|
+
return /(^|\.)Dockerfile(\.|$)/.test(basename(path));
|
|
6
|
+
}
|
|
7
|
+
// npm's names for `npm install` and for `npm install-test`, which installs
|
|
8
|
+
// first (npm 12, lib/utils/cmd-list.js aliases).
|
|
9
|
+
const NPM_INSTALL = new Set([
|
|
10
|
+
'install',
|
|
11
|
+
'install-test',
|
|
12
|
+
'it',
|
|
13
|
+
'i',
|
|
14
|
+
'in',
|
|
15
|
+
'ins',
|
|
16
|
+
'inst',
|
|
17
|
+
'insta',
|
|
18
|
+
'instal',
|
|
19
|
+
'isnt',
|
|
20
|
+
'isnta',
|
|
21
|
+
'isntal',
|
|
22
|
+
'isntall',
|
|
23
|
+
'add',
|
|
24
|
+
]);
|
|
25
|
+
// The script of each RUN instruction, with the line where it starts, as
|
|
26
|
+
// Docker reads it: continuation lines are joined, and a comment or an empty
|
|
27
|
+
// line inside them is dropped; flags such as --mount come before the script;
|
|
28
|
+
// the exec form is a JSON array; a heredoc holds the script in its body.
|
|
29
|
+
function runScripts(dockerfile) {
|
|
30
|
+
const lines = dockerfile.split(/\r?\n/);
|
|
31
|
+
const scripts = [];
|
|
32
|
+
for (let index = 0; index < lines.length; index++) {
|
|
33
|
+
const start = index;
|
|
34
|
+
let text = (lines[index] ?? '').trimEnd();
|
|
35
|
+
if (!/^\s*RUN\s/i.test(text))
|
|
36
|
+
continue;
|
|
37
|
+
while (text.endsWith('\\') && index + 1 < lines.length) {
|
|
38
|
+
index++;
|
|
39
|
+
const next = lines[index] ?? '';
|
|
40
|
+
text = /^\s*(#|$)/.test(next)
|
|
41
|
+
? text
|
|
42
|
+
: `${text.slice(0, -1)} ${next.trimEnd()}`;
|
|
43
|
+
}
|
|
44
|
+
const rest = text.replace(/^\s*RUN\s+(--\S+\s+)*/i, '');
|
|
45
|
+
const heredoc = /^<<(-?)["']?(\w+)["']?/.exec(rest);
|
|
46
|
+
if (heredoc !== null) {
|
|
47
|
+
const [, dash, delimiter] = heredoc;
|
|
48
|
+
const body = [];
|
|
49
|
+
while (index + 1 < lines.length) {
|
|
50
|
+
index++;
|
|
51
|
+
const line = lines[index] ?? '';
|
|
52
|
+
if ((dash === '-' ? line.trim() : line) === delimiter)
|
|
53
|
+
break;
|
|
54
|
+
body.push(line);
|
|
55
|
+
}
|
|
56
|
+
scripts.push({ line: start + 1, script: body.join('\n') });
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
scripts.push({ line: start + 1, script: execForm(rest) ?? rest });
|
|
60
|
+
}
|
|
61
|
+
return scripts;
|
|
62
|
+
}
|
|
63
|
+
// The words of an exec form, `["npm", "ci"]`, joined by spaces.
|
|
64
|
+
function execForm(rest) {
|
|
65
|
+
if (!rest.startsWith('['))
|
|
66
|
+
return undefined;
|
|
67
|
+
try {
|
|
68
|
+
const words = JSON.parse(rest);
|
|
69
|
+
return Array.isArray(words) ? words.join(' ') : undefined;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (error instanceof SyntaxError)
|
|
73
|
+
return undefined;
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Whether one simple command installs packages that no lockfile pins: an
|
|
78
|
+
// npm install, or an install or add of yarn, pnpm or bun. A global install
|
|
79
|
+
// of a tool installs no dependency of the project.
|
|
80
|
+
function installsWithoutLockfile(command) {
|
|
81
|
+
const words = command.split(/\s+/).filter((word) => word !== '');
|
|
82
|
+
while (/^\w+=/.test(words[0] ?? ''))
|
|
83
|
+
words.shift();
|
|
84
|
+
const [program = '', ...args] = words;
|
|
85
|
+
const subcommand = args.find((arg) => !arg.startsWith('-'));
|
|
86
|
+
const global = args.some((arg) => ['-g', '--global', '--location=global'].includes(arg));
|
|
87
|
+
switch (basename(program)) {
|
|
88
|
+
case 'npm':
|
|
89
|
+
return subcommand !== undefined && NPM_INSTALL.has(subcommand) && !global;
|
|
90
|
+
case 'yarn':
|
|
91
|
+
return (subcommand === undefined || ['install', 'add'].includes(subcommand));
|
|
92
|
+
case 'pnpm':
|
|
93
|
+
case 'bun':
|
|
94
|
+
return (subcommand !== undefined &&
|
|
95
|
+
['install', 'i', 'add'].includes(subcommand) &&
|
|
96
|
+
!global);
|
|
97
|
+
default:
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Refuses a staged Dockerfile that installs packages without the lockfile.
|
|
102
|
+
// `npm install` in an image resolves the ranges of package.json at build
|
|
103
|
+
// time, so the image runs versions that no commit names. `npm ci` installs
|
|
104
|
+
// what package-lock.json holds, or fails.
|
|
105
|
+
export class DockerfileInstallsFromLockfile extends Step {
|
|
106
|
+
name = 'docker';
|
|
107
|
+
async run(commit) {
|
|
108
|
+
const tree = await commit.tree();
|
|
109
|
+
const installs = [];
|
|
110
|
+
for (const entry of await commit.changes()) {
|
|
111
|
+
if (entry.change === 'deleted' || entry.kind !== 'file')
|
|
112
|
+
continue;
|
|
113
|
+
if (!isDockerfile(entry.path))
|
|
114
|
+
continue;
|
|
115
|
+
const dockerfile = await tree.read(entry.path);
|
|
116
|
+
if (dockerfile === undefined)
|
|
117
|
+
continue;
|
|
118
|
+
for (const { line, script } of runScripts(dockerfile))
|
|
119
|
+
for (const command of script.split(/&&|\|\||[;|\n]/))
|
|
120
|
+
if (installsWithoutLockfile(command))
|
|
121
|
+
installs.push(`${entry.path}:${line} ${command.trim()}`);
|
|
122
|
+
}
|
|
123
|
+
if (installs.length === 0)
|
|
124
|
+
return this.pass('no staged Dockerfile installs without the lockfile');
|
|
125
|
+
return this.fail([
|
|
126
|
+
'A Dockerfile installs packages from package-lock.json only:',
|
|
127
|
+
...installs.map((install) => ` ${install}`),
|
|
128
|
+
'COPY package.json and package-lock.json, then RUN npm ci (npm ci --omit=dev for a runtime image). A global tool may use npm install -g.',
|
|
129
|
+
].join('\n'));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=dockerfile-installs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dockerfile-installs.js","sourceRoot":"","sources":["../src/dockerfile-installs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,wEAAwE;AACxE,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,2EAA2E;AAC3E,iDAAiD;AACjD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,SAAS;IACT,cAAc;IACd,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,KAAK;CACN,CAAC,CAAC;AAEH,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,SAAS,UAAU,CAAC,UAAkB;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,OAAO,GAAuC,EAAE,CAAC;IACvD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,KAAK,GAAG,KAAK,CAAC;QACpB,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC1C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,S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K,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,UAAU,KAAK,SAAS;gBAAE,SAAS;YACvC,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,UAAU,CAAC,UAAU,CAAC;gBACnD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC;oBAClD,IAAI,uBAAuB,CAAC,OAAO,CAAC;wBAClC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAClE,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,IAAI,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC,IAAI,CACd;YACE,6DAA6D;YAC7D,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;YAC5C,yIAAyI;SAC1I,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;CACF"}
|
package/dist/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAM/C,qBAAa,MAAO,SAAQ,IAAI,CAAC,MAAM,CAAC;IACtC,QAAQ,CAAC,IAAI,YAAY;IAEnB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAiD5C"}
|
package/dist/format.js
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
import { check, getFileInfo, resolveConfig } from 'prettier';
|
|
3
1
|
import { Step } from "./step.js";
|
|
4
|
-
// Checks the staged copy of each staged file with the
|
|
5
|
-
// and
|
|
2
|
+
// Checks the staged copy of each staged file with the commit's own Prettier,
|
|
3
|
+
// config and .prettierignore, in the snapshot of the staged commit, and
|
|
4
|
+
// changes nothing. A step that formatted and staged files would also stage
|
|
6
5
|
// the edits that another session made to them at the same moment.
|
|
7
6
|
export class Format extends Step {
|
|
8
7
|
name = 'format';
|
|
9
8
|
async run(commit) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
// The staged copy of a link or a submodule is a path or a commit id, so
|
|
10
|
+
// only files are checked.
|
|
11
|
+
const files = (await commit.changes()).flatMap((entry) => entry.change !== 'deleted' && entry.kind === 'file' ? [entry.path] : []);
|
|
12
|
+
if (files.length === 0)
|
|
13
|
+
return this.pass('no staged file to check');
|
|
14
|
+
const snapshot = await commit.snapshot({ packages: true });
|
|
15
|
+
// --ignore-unknown skips a file that .prettierignore names or that
|
|
16
|
+
// Prettier cannot format, so no list of extensions here.
|
|
17
|
+
const { stdout, stderr } = await snapshot.bin('prettier', [
|
|
18
|
+
'--list-different',
|
|
19
|
+
'--ignore-unknown',
|
|
20
|
+
'--',
|
|
21
|
+
...files,
|
|
22
|
+
]);
|
|
23
|
+
// Prettier prints `[error] <path>: <reason>` for a file it cannot parse,
|
|
24
|
+
// and then the code frame on more [error] lines. A reason is read only
|
|
25
|
+
// by the path of a checked file, so a code frame line names no file.
|
|
26
|
+
const reasons = new Map();
|
|
27
|
+
for (const line of stderr.split('\n')) {
|
|
28
|
+
const [, path, reason] = /^\[error\] (.+?): (.+)$/.exec(line) ?? [];
|
|
29
|
+
if (path !== undefined && reason !== undefined)
|
|
30
|
+
reasons.set(path, reason);
|
|
30
31
|
}
|
|
32
|
+
const different = new Set(stdout.split('\n'));
|
|
33
|
+
// In the order of the staged files, as the command at the end lists them.
|
|
34
|
+
const unformatted = files.flatMap((path) => {
|
|
35
|
+
const reason = reasons.get(path);
|
|
36
|
+
if (reason !== undefined)
|
|
37
|
+
return [{ path, reason }];
|
|
38
|
+
return different.has(path) ? [{ path }] : [];
|
|
39
|
+
});
|
|
31
40
|
if (unformatted.length === 0)
|
|
32
41
|
return this.pass('the staged files are formatted');
|
|
33
42
|
const paths = unformatted.map(({ path }) => path);
|
package/dist/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,6EAA6E;AAC7E,wEAAwE;AACxE,2EAA2E;AAC3E,kEAAkE;AAClE,MAAM,OAAO,MAAO,SAAQ,IAAY;IAC7B,IAAI,GAAG,QAAQ,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,wEAAwE;QACxE,0BAA0B;QAC1B,MAAM,KAAK,GAAG,CAAC,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACvD,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CACxE,CAAC;QACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,IAAI,CAA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AAW,CAAC,MAAM,KAAK,CAAC;YAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QACrD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC,IAAI,CACd;YACE,GAAG;gBACD,CAAC,CAAC,iCAAiC;gBACnC,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,kCAAkC;YAC3D,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CACtC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,MAAM,GAAG,CAC7D;YACD,8BAA8B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,qBAAqB;SACnG,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;IACJ,CAAC;CACF"}
|
package/dist/git.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAKzD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,GAAG,CAYtE"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
const execFileAsync = promisify(execFile);
|
|
4
|
+
// git in `cwd` with `environment`. The standard input of git is closed, so a
|
|
5
|
+
// command that reads it, such as `git hash-object --stdin`, reads nothing and
|
|
6
|
+
// does not wait.
|
|
7
|
+
export function gitIn(cwd, environment) {
|
|
8
|
+
return async (...args) => {
|
|
9
|
+
const git = execFileAsync('git', args, {
|
|
10
|
+
cwd,
|
|
11
|
+
env: environment,
|
|
12
|
+
encoding: 'utf8',
|
|
13
|
+
// A file of any size, not Node's default of 1 MiB.
|
|
14
|
+
maxBuffer: 2 ** 30,
|
|
15
|
+
});
|
|
16
|
+
git.child.stdin?.end();
|
|
17
|
+
return (await git).stdout;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAK1C,6EAA6E;AAC7E,8EAA8E;AAC9E,iBAAiB;AACjB,MAAM,UAAU,KAAK,CAAC,GAAW,EAAE,WAA8B;IAC/D,OAAO,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE;QACvB,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE;YACrC,GAAG;YACH,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,MAAM;YAChB,mDAAmD;YACnD,SAAS,EAAE,CAAC,IAAI,EAAE;SACnB,CAAC,CAAC;QACH,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
export { Build } from './build.ts';
|
|
2
2
|
export { Codegen } from './codegen.ts';
|
|
3
|
-
export { Commit } from './commit.ts';
|
|
4
|
-
export { CommitMessage } from './commit-message.ts';
|
|
3
|
+
export type { Commit, Generated } from './commit.ts';
|
|
4
|
+
export type { CommitMessage } from './commit-message.ts';
|
|
5
5
|
export { DependencyChecks } from './dependency-checks.ts';
|
|
6
|
+
export { DockerfileInstallsFromLockfile } from './dockerfile-installs.ts';
|
|
6
7
|
export { Format } from './format.ts';
|
|
8
|
+
export { LockfileSync } from './lockfile-sync.ts';
|
|
7
9
|
export { NoNumericPins } from './no-numeric-pins.ts';
|
|
10
|
+
export { NpmrcPolicy } from './npmrc-policy.ts';
|
|
8
11
|
export { NxReleaseScope } from './nx-release-scope.ts';
|
|
9
|
-
export { Push } from './push.ts';
|
|
12
|
+
export type { Push } from './push.ts';
|
|
10
13
|
export type { RefUpdate } from './ref-update.ts';
|
|
11
14
|
export { commitMsg } from './scripts/commit-msg.ts';
|
|
12
15
|
export { preCommit } from './scripts/pre-commit.ts';
|
|
13
16
|
export { prePush } from './scripts/pre-push.ts';
|
|
17
|
+
export type { PackagedSnapshot, ProcessResult, Snapshot, } from './snapshot/snapshot.ts';
|
|
14
18
|
export { type Outcome, Step } from './step.ts';
|
|
15
19
|
export { Sync } from './sync.ts';
|
|
20
|
+
export type { DiffEntry, Tree, TreeEntry } from './tree.ts';
|
|
16
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { Build } from "./build.js";
|
|
2
2
|
export { Codegen } from "./codegen.js";
|
|
3
|
-
export { Commit } from "./commit.js";
|
|
4
|
-
export { CommitMessage } from "./commit-message.js";
|
|
5
3
|
export { DependencyChecks } from "./dependency-checks.js";
|
|
4
|
+
export { DockerfileInstallsFromLockfile } from "./dockerfile-installs.js";
|
|
6
5
|
export { Format } from "./format.js";
|
|
6
|
+
export { LockfileSync } from "./lockfile-sync.js";
|
|
7
7
|
export { NoNumericPins } from "./no-numeric-pins.js";
|
|
8
|
+
export { NpmrcPolicy } from "./npmrc-policy.js";
|
|
8
9
|
export { NxReleaseScope } from "./nx-release-scope.js";
|
|
9
|
-
export { Push } from "./push.js";
|
|
10
10
|
export { commitMsg } from "./scripts/commit-msg.js";
|
|
11
11
|
export { preCommit } from "./scripts/pre-commit.js";
|
|
12
12
|
export { prePush } from "./scripts/pre-push.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMhD,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Commit } from './commit.ts';
|
|
2
|
+
import { type Outcome, Step } from './step.ts';
|
|
3
|
+
export declare class LockfileSync extends Step<Commit> {
|
|
4
|
+
#private;
|
|
5
|
+
readonly name = "lockfile";
|
|
6
|
+
run(commit: Commit): Promise<Outcome>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=lockfile-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-sync.d.ts","sourceRoot":"","sources":["../src/lockfile-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAW/C,qBAAa,YAAa,SAAQ,IAAI,CAAC,MAAM,CAAC;;IAC5C,QAAQ,CAAC,IAAI,cAAc;IAErB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA4E5C"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DEPENDENCY_SECTIONS, Lockfile, dependencySpecs, } from "./npm/lockfile.js";
|
|
2
|
+
import { Step } from "./step.js";
|
|
3
|
+
// Stops a commit whose package-lock.json does not record its package.json
|
|
4
|
+
// files, so the commit installs with `npm ci` as CI and each image install
|
|
5
|
+
// it. Two checks, each for what the other misses:
|
|
6
|
+
// - each dependency of a staged package.json has the spec that the lockfile
|
|
7
|
+
// recorded for that project. `npm ci` accepts a range edit that the locked
|
|
8
|
+
// version still satisfies, so the lockfile keeps the old range.
|
|
9
|
+
// - `npm ci --dry-run` in the snapshot of the staged commit: npm's own check
|
|
10
|
+
// that the lockfile holds each dependency of each package.json.
|
|
11
|
+
export class LockfileSync extends Step {
|
|
12
|
+
name = 'lockfile';
|
|
13
|
+
async run(commit) {
|
|
14
|
+
if (!(await commit.touches([
|
|
15
|
+
'**/package.json',
|
|
16
|
+
'package-lock.json',
|
|
17
|
+
'.npmrc',
|
|
18
|
+
])))
|
|
19
|
+
return this.skip('no package.json, package-lock.json or .npmrc');
|
|
20
|
+
const tree = await commit.tree();
|
|
21
|
+
if ((await tree.read('package.json')) === undefined)
|
|
22
|
+
return this.skip('the commit has no package.json');
|
|
23
|
+
const text = await tree.read('package-lock.json');
|
|
24
|
+
if (text === undefined)
|
|
25
|
+
return this.fail('the commit has a package.json but no package-lock.json. Run `npm install`, stage package-lock.json, and commit again.');
|
|
26
|
+
const differences = await this.#differences(Lockfile.parse(text), tree);
|
|
27
|
+
if (differences.length > 0)
|
|
28
|
+
return this.fail([
|
|
29
|
+
'package-lock.json records other specs than the staged package.json files:',
|
|
30
|
+
...differences.map((difference) => ` ${difference}`),
|
|
31
|
+
'Run `npm install`, stage package-lock.json, and commit again.',
|
|
32
|
+
].join('\n'));
|
|
33
|
+
const snapshot = await commit.snapshot();
|
|
34
|
+
const { status, stderr } = await snapshot.run('npm', [
|
|
35
|
+
'ci',
|
|
36
|
+
'--dry-run',
|
|
37
|
+
'--ignore-scripts',
|
|
38
|
+
'--no-audit',
|
|
39
|
+
'--no-fund',
|
|
40
|
+
'--prefer-offline',
|
|
41
|
+
]);
|
|
42
|
+
if (status !== 0)
|
|
43
|
+
return this.fail(`npm ci does not accept the staged package-lock.json:\n${stderr.trimEnd()}\nRun \`npm install\`, stage package-lock.json, and commit again.`);
|
|
44
|
+
return this.pass('package-lock.json records each staged package.json');
|
|
45
|
+
}
|
|
46
|
+
// Each dependency whose spec in a staged package.json differs from the spec
|
|
47
|
+
// that the lockfile recorded for its project. A project of the lockfile
|
|
48
|
+
// whose package.json is not in the commit is left to npm ci.
|
|
49
|
+
async #differences(lockfile, tree) {
|
|
50
|
+
const differences = [];
|
|
51
|
+
for (const project of lockfile.projects()) {
|
|
52
|
+
const path = project === '' ? 'package.json' : `${project}/package.json`;
|
|
53
|
+
const manifest = await tree.read(path);
|
|
54
|
+
const recorded = lockfile.specs(project);
|
|
55
|
+
if (manifest === undefined || recorded === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
let parsed;
|
|
58
|
+
try {
|
|
59
|
+
parsed = JSON.parse(manifest);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
if (!(error instanceof SyntaxError))
|
|
63
|
+
throw error;
|
|
64
|
+
differences.push(`${path} is not JSON: ${error.message}`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const staged = dependencySpecs(parsed);
|
|
68
|
+
for (const section of DEPENDENCY_SECTIONS) {
|
|
69
|
+
const inManifest = staged[section];
|
|
70
|
+
const inLockfile = recorded[section];
|
|
71
|
+
for (const name of new Set([
|
|
72
|
+
...inManifest.keys(),
|
|
73
|
+
...inLockfile.keys(),
|
|
74
|
+
]))
|
|
75
|
+
if (inManifest.get(name) !== inLockfile.get(name))
|
|
76
|
+
differences.push(`${path} ${section}.${name}: ${inManifest.get(name) ?? 'absent'} in package.json, ${inLockfile.get(name) ?? 'absent'} in package-lock.json`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return differences;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=lockfile-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfile-sync.js","sourceRoot":"","sources":["../src/lockfile-sync.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAG/C,0EAA0E;AAC1E,2EAA2E;AAC3E,kDAAkD;AAClD,4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AAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;gBACnC,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACrC,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC;oBACzB,GAAG,UAAU,CAAC,IAAI,EAAE;oBACpB,GAAG,UAAU,CAAC,IAAI,EAAE;iBACrB,CAAC;oBACA,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;wBAC/C,WAAW,CAAC,IAAI,CACd,GAAG,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,QAAQ,qBAAqB,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,QAAQ,uBAAuB,CAC7I,CAAC;YACR,CAAC;QACH,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-numeric-pins.d.ts","sourceRoot":"","sources":["../src/no-numeric-pins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAoE/C,qBAAa,aAAc,SAAQ,IAAI,CAAC,MAAM,CAAC;IAC7C,QAAQ,CAAC,IAAI,UAAU;IAEjB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"no-numeric-pins.d.ts","sourceRoot":"","sources":["../src/no-numeric-pins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAoE/C,qBAAa,aAAc,SAAQ,IAAI,CAAC,MAAM,CAAC;IAC7C,QAAQ,CAAC,IAAI,UAAU;IAEjB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA2B5C"}
|