@zukhruf/git-hooks 0.3.41 → 0.3.43

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.
Files changed (66) hide show
  1. package/README.md +157 -3
  2. package/dist/build.d.ts +15 -0
  3. package/dist/build.d.ts.map +1 -0
  4. package/dist/build.js +163 -0
  5. package/dist/build.js.map +1 -0
  6. package/dist/codegen.d.ts +1 -1
  7. package/dist/codegen.d.ts.map +1 -1
  8. package/dist/codegen.js.map +1 -1
  9. package/dist/commit.d.ts.map +1 -1
  10. package/dist/commit.js +2 -1
  11. package/dist/commit.js.map +1 -1
  12. package/dist/format.d.ts +1 -1
  13. package/dist/format.d.ts.map +1 -1
  14. package/dist/format.js +5 -2
  15. package/dist/format.js.map +1 -1
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/push.d.ts +29 -0
  21. package/dist/push.d.ts.map +1 -0
  22. package/dist/push.js +108 -0
  23. package/dist/push.js.map +1 -0
  24. package/dist/ref-update.d.ts +17 -0
  25. package/dist/ref-update.d.ts.map +1 -0
  26. package/dist/ref-update.js +43 -0
  27. package/dist/ref-update.js.map +1 -0
  28. package/dist/scripts/pre-commit.d.ts +2 -1
  29. package/dist/scripts/pre-commit.d.ts.map +1 -1
  30. package/dist/scripts/pre-commit.js.map +1 -1
  31. package/dist/scripts/pre-push.d.ts +4 -0
  32. package/dist/scripts/pre-push.d.ts.map +1 -0
  33. package/dist/scripts/pre-push.js +35 -0
  34. package/dist/scripts/pre-push.js.map +1 -0
  35. package/dist/snapshot/commit-files.d.ts +5 -0
  36. package/dist/snapshot/commit-files.d.ts.map +1 -0
  37. package/dist/snapshot/commit-files.js +101 -0
  38. package/dist/snapshot/commit-files.js.map +1 -0
  39. package/dist/snapshot/drift.d.ts +3 -0
  40. package/dist/snapshot/drift.d.ts.map +1 -0
  41. package/dist/snapshot/drift.js +72 -0
  42. package/dist/snapshot/drift.js.map +1 -0
  43. package/dist/snapshot/installs.d.ts +2 -0
  44. package/dist/snapshot/installs.d.ts.map +1 -0
  45. package/dist/snapshot/installs.js +83 -0
  46. package/dist/snapshot/installs.js.map +1 -0
  47. package/dist/snapshot/nx.d.ts +7 -0
  48. package/dist/snapshot/nx.d.ts.map +1 -0
  49. package/dist/snapshot/nx.js +20 -0
  50. package/dist/snapshot/nx.js.map +1 -0
  51. package/dist/snapshot/packages.d.ts +2 -0
  52. package/dist/snapshot/packages.d.ts.map +1 -0
  53. package/dist/snapshot/packages.js +72 -0
  54. package/dist/snapshot/packages.js.map +1 -0
  55. package/dist/snapshot/workspaces.d.ts +2 -0
  56. package/dist/snapshot/workspaces.d.ts.map +1 -0
  57. package/dist/snapshot/workspaces.js +26 -0
  58. package/dist/snapshot/workspaces.js.map +1 -0
  59. package/dist/step.d.ts +2 -3
  60. package/dist/step.d.ts.map +1 -1
  61. package/dist/step.js +2 -2
  62. package/dist/step.js.map +1 -1
  63. package/dist/sync.d.ts +1 -1
  64. package/dist/sync.d.ts.map +1 -1
  65. package/dist/sync.js.map +1 -1
  66. package/package.json +4 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @zukhruf/git-hooks
2
2
 
3
- Git hooks written in TypeScript. A pre-commit hook runs steps in order against the staged commit. The steps check the staged copy of each file with Prettier and change nothing, run `nx sync` and stage only the files that sync wrote, and build generated files when nx says that their projects are affected. A repo adds a step of its own as a class.
3
+ Git hooks written in TypeScript. A pre-commit hook runs steps in order against the staged commit. The steps check the staged copy of each file with Prettier and change nothing, run `nx sync` and stage only the files that sync wrote, and build generated files when nx says that their projects are affected. A pre-push hook runs steps in order against the push. Its build step builds each pushed commit in a snapshot, never the working tree. A repo adds a step of its own as a class.
4
4
 
5
5
  The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md).
6
6
 
@@ -28,6 +28,8 @@ chmod +x .husky/pre-commit.ts
28
28
  ln -s pre-commit.ts .husky/pre-commit
29
29
  ```
30
30
 
31
+ The hook uses `await` at the top level, so Node must read it as a module. When `package.json` has no `"type": "module"`, name the file `pre-commit.mts`, and link `.husky/pre-commit` to that name.
32
+
31
33
  Tell git where the hooks are, in the `prepare` script of `package.json`:
32
34
 
33
35
  ```json
@@ -85,12 +87,12 @@ The targets run in the order that `run` gives. When a target fails, the commit s
85
87
 
86
88
  ## Add a step of your own
87
89
 
88
- A step is a subclass of `Step`. It names itself and gives an outcome: `this.pass()`, `this.skip(why)` or `this.fail(why)`. A fail stops the commit. `Commit` reads the staged commit: `staged()`, `files()` (the staged paths that hold file content, without links and submodules), `blob(path)`, `touches(globs)`, and `inSnapshot(work)`, which runs `work` on a copy of the staged tree in a temporary folder:
90
+ A pre-commit step is a subclass of `Step<Commit>`. It names itself and gives an outcome: `this.pass()`, `this.skip(why)` or `this.fail(why)`. A fail stops the commit. `Commit` reads the staged commit: `staged()`, `files()` (the staged paths that hold file content, without links and submodules), `blob(path)`, `touches(globs)`, and `inSnapshot(work)`, which runs `work` on a copy of the staged tree in a temporary folder:
89
91
 
90
92
  ```ts
91
93
  import { type Commit, Step } from '@zukhruf/git-hooks';
92
94
 
93
- export class DesignCheck extends Step {
95
+ export class DesignCheck extends Step<Commit> {
94
96
  readonly name = 'design';
95
97
 
96
98
  async run(commit: Commit) {
@@ -103,3 +105,155 @@ export class DesignCheck extends Step {
103
105
  }
104
106
  }
105
107
  ```
108
+
109
+ ## Install the pre-push hook
110
+
111
+ Git runs the pre-push hook before `git push` sends commits to a remote. Write the hook in `.husky/pre-push.ts`:
112
+
113
+ ```ts
114
+ #!/usr/bin/env node
115
+ import { Build, prePush } from '@zukhruf/git-hooks';
116
+
117
+ await prePush([new Build()]);
118
+ ```
119
+
120
+ Make it executable, and commit a link to it, as for the pre-commit hook:
121
+
122
+ ```sh
123
+ chmod +x .husky/pre-push.ts
124
+ ln -s pre-push.ts .husky/pre-push
125
+ ```
126
+
127
+ The hook uses `await` at the top level, so Node must read it as a module. When `package.json` has no `"type": "module"`, name the file `pre-push.mts`, and link to that name. The `prepare` script in [Install the hook](#install-the-hook) tells git where both hooks are.
128
+
129
+ Git gives the hook the name and the URL of the remote, and one line for each ref that the push changes. `prePush` reads them into a `Push`. It runs the steps in order and prints the outcome of each step. At the first fail, the push stops.
130
+
131
+ ## Build the pushed commits
132
+
133
+ `Build` builds each pushed commit with the production configuration of nx. It does not build the working tree. Another session can edit the working tree while you push. An edit that is not committed is not in the push, so it cannot stop a good push, and it cannot hide a broken one.
134
+
135
+ ```ts
136
+ import { Build, prePush } from '@zukhruf/git-hooks';
137
+
138
+ await prePush([
139
+ new Build({
140
+ targets: ['lint', 'build'],
141
+ parallel: 1,
142
+ env: { NODE_ENV: 'production' },
143
+ }),
144
+ ]);
145
+ ```
146
+
147
+ - `targets` are the nx targets to run on all projects. The default is `['build']`.
148
+ - `parallel` is the number of tasks that nx runs at the same time. Without it, nx uses its own default.
149
+ - `env` holds more environment variables for nx.
150
+
151
+ Build runs `nx run-many` with `--configuration=production` and with `NX_DAEMON=false`. `env` goes to nx only, never to `npm ci`: with `NODE_ENV=production`, npm does not install the devDependencies. Build builds each pushed commit one time, also when the push sends it to more than one ref. Build gives one line for each pushed commit: built, skipped or failed. Each line names the commit:
152
+
153
+ ```text
154
+ build a1b2c3d: built 19 projects, 17 of 20 tasks from cache
155
+ d4e5f6a: built 19 projects, 20 of 20 tasks from cache
156
+ skipped: the remote already has 0b1c2d3
157
+ ```
158
+
159
+ When a task fails, the push stops. The hook names the failed tasks and shows up to 20 lines of the error output of each failed task. When the output has more lines, the last line gives their number, such as `… 12 more lines`:
160
+
161
+ ```text
162
+ build a1b2c3d: 1 of 20 tasks failed: elements:build
163
+ packages/elements/src/lib/define.ts(34,14): error TS2322: Type 'string' is not assignable to type 'number'.
164
+ ✖ push stopped by the pre-push hook
165
+ ```
166
+
167
+ A push that only deletes refs has no commit to build:
168
+
169
+ ```text
170
+ build skipped: the push only deletes refs
171
+ ```
172
+
173
+ Build builds a pushed commit only when the push sends at least one commit that the remote does not have. A push of a commit that the remote has already, for example to a new branch, has nothing new to build:
174
+
175
+ ```text
176
+ build skipped: the remote already has a1b2c3d
177
+ ```
178
+
179
+ Build works with npm workspaces. A pushed commit without `package-lock.json` stops the push at once. This is a setup error, so the first push shows it:
180
+
181
+ ```text
182
+ build a1b2c3d has no package-lock.json; Build works with npm workspaces
183
+ ✖ push stopped by the pre-push hook
184
+ ```
185
+
186
+ In one repo, one pre-push build runs at a time. A second push waits for the first build to end, and does not fail:
187
+
188
+ ```text
189
+ build waiting for another pre-push build in this repo
190
+ ```
191
+
192
+ ## Where a pre-push build runs
193
+
194
+ Each pushed commit is built in a snapshot: a copy of the files of that commit in a temporary folder outside the repo. The files come from the object store of git, so the snapshot holds what the commit holds, and nothing that is only in the working tree. A file that `.gitignore` names, such as `.env`, is not in the snapshot.
195
+
196
+ nx runs in the snapshot, and git commands in nx work there. The hook sets `GIT_DIR` to the git folder of the repo, `GIT_WORK_TREE` to the snapshot, and `GIT_INDEX_FILE` to a temporary index that it makes from the pushed commit. Thus git sees the snapshot as a clean checkout of that commit, with no changed and no untracked files, and `nx affected --base --head` works.
197
+
198
+ The snapshot uses the packages that the repo installed when they match the `package-lock.json` of the commit. Then the setup takes about 1 s. A workspace package resolves to its folder in the snapshot, not in the working tree.
199
+
200
+ When the installed packages do not match the `package-lock.json` of the commit, the hook installs that lockfile in a folder of its own, and the snapshot uses that install. This is install drift: a package that the lockfile names is missing or has a different version, or a package is installed that the lockfile does not name. An extra package is drift too, because code that imports it builds here and fails in CI. Install drift occurs when a peer changed the dependencies but did not commit the change, or when the push sends a commit with other dependencies. The hook prints a line before the install, because a full install takes some time:
201
+
202
+ ```text
203
+ build a1b2c3d: the installed packages differ from package-lock.json; installing it with npm ci (first time for this lockfile)
204
+ ```
205
+
206
+ The install runs `npm ci --ignore-scripts`, and then `npm rebuild` with the names of the dependencies that have install scripts. The lockfile marks these dependencies with `hasInstallScript`. Thus the install scripts of the dependencies run, such as those of esbuild and prisma. The scripts of the repo and of its workspace packages, such as `prepare`, do not run. The first push with a new lockfile waits for a full install. The next pushes with that lockfile use the same install. The hook keeps the two installs that it used last. A repo with no `node_modules` gets its install the same way.
207
+
208
+ The hook keeps the installs and the nx cache of the pre-push builds in its state folder: `git-hooks` in the common git folder of the repo (`git rev-parse --git-common-dir`). Linked worktrees use the same state folder. The nx cache of the working tree (`.nx`) is not used, and the hook does not write to it. A file lock in the state folder lets one pre-push build run at a time. The hook deletes each snapshot after its build.
209
+
210
+ On Windows, the snapshot links to folders with junctions, which need no administrator rights.
211
+
212
+ ## Add a pre-push step of your own
213
+
214
+ A pre-push step is a subclass of `Step<Push>`. A step of `Step<Commit>`, such as `Format`, cannot go into `prePush`: at push time there is no staged commit.
215
+
216
+ `Push` has the `remote` (`name` and `url`) and the `updates`. Each ref update has `localRef`, `localSha`, `remoteRef`, `remoteSha` and a `kind`:
217
+
218
+ - `create`: the remote does not have the ref.
219
+ - `update`: the remote has the ref, and the push changes it.
220
+ - `delete`: the push deletes the ref from the remote.
221
+
222
+ A create or an update also has a `head` and a `base`. The `head` is the local commit. The `base` is the newest commit that the remote has:
223
+
224
+ - For an update, the `base` is the remote sha.
225
+ - For a create, the `base` is the parent of the first commit that no ref of the remote has. An update gets its `base` in the same way when the remote sha is not in the local repo, for example in a force push over commits that were never fetched.
226
+ - When the remote has the `head` already, the `base` is the `head`, and the range is empty.
227
+ - When the remote has no commit of that history, there is no `base`, and the step must check the whole history.
228
+
229
+ `push.inSnapshot(sha, work)` runs `work` on the snapshot of one commit. `work` gets the folder of the snapshot and an environment for the tools that it runs there: the git environment above, `NX_DAEMON=false`, and the nx cache of the state folder. `push.nx(sha, ...args)` runs nx in the snapshot of one commit, with the git environment above, and gives its standard output. When nx exits with a code other than 0, it throws.
230
+
231
+ This step runs the tests of the projects that each pushed range affects:
232
+
233
+ ```ts
234
+ import { type Push, Step } from '@zukhruf/git-hooks';
235
+
236
+ export class AffectedTest extends Step<Push> {
237
+ readonly name = 'test';
238
+
239
+ async run(push: Push) {
240
+ const updates = push.updates.filter((update) => update.kind !== 'delete');
241
+ if (updates.length === 0) return this.skip('the push only deletes refs');
242
+ try {
243
+ for (const { base, head } of updates)
244
+ await push.nx(
245
+ head,
246
+ ...(base === undefined
247
+ ? ['run-many', '-t', 'test']
248
+ : ['affected', '-t', 'test', `--base=${base}`, `--head=${head}`]),
249
+ );
250
+ } catch (error) {
251
+ if (!(error instanceof Error)) throw error;
252
+ return this.fail(error.message.trimEnd());
253
+ }
254
+ return this.pass();
255
+ }
256
+ }
257
+ ```
258
+
259
+ Use the `base` and the `head` of each update, not `--base=origin/main --head=HEAD`. That pair checks the branch that is checked out, and a push can send other refs.
@@ -0,0 +1,15 @@
1
+ import { type Push } from './push.ts';
2
+ import { type Outcome, Step } from './step.ts';
3
+ interface BuildOptions {
4
+ readonly targets?: readonly string[];
5
+ readonly parallel?: number;
6
+ readonly env?: Readonly<Record<string, string>>;
7
+ }
8
+ export declare class Build extends Step<Push> {
9
+ #private;
10
+ readonly name = "build";
11
+ constructor({ targets, parallel, env }?: BuildOptions);
12
+ run(push: Push): Promise<Outcome>;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAIA,OAAO,EAAwB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,UAAU,YAAY;IAEpB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAErC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAuBD,qBAAa,KAAM,SAAQ,IAAI,CAAC,IAAI,CAAC;;IACnC,QAAQ,CAAC,IAAI,WAAW;gBAKZ,EAAE,OAAmB,EAAE,QAAQ,EAAE,GAAQ,EAAE,GAAE,YAAiB;IAOpE,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;CAgGxC"}
package/dist/build.js ADDED
@@ -0,0 +1,163 @@
1
+ import { readFile, rm } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { stripVTControlCharacters } from 'node:util';
4
+ import { MissingLockfileError } from "./push.js";
5
+ import { runNx } from "./snapshot/nx.js";
6
+ import { Step } from "./step.js";
7
+ // The lines of error output that a fail shows for each failed task.
8
+ const shownLines = 20;
9
+ // Builds each pushed commit with the production configuration of nx, in a
10
+ // snapshot of the commit, never in the working tree: an edit that is not
11
+ // committed is not in the push, so it cannot stop a good push or hide a
12
+ // broken one. A commit is built one time, also when the push sends it to more
13
+ // than one ref, and only when the remote does not have it.
14
+ export class Build extends Step {
15
+ name = 'build';
16
+ #targets;
17
+ #parallel;
18
+ #env;
19
+ constructor({ targets = ['build'], parallel, env = {} } = {}) {
20
+ super();
21
+ this.#targets = targets;
22
+ this.#parallel = parallel;
23
+ this.#env = env;
24
+ }
25
+ async run(push) {
26
+ const fresh = new Map();
27
+ for (const update of push.updates)
28
+ if (update.kind !== 'delete')
29
+ fresh.set(update.head, (fresh.get(update.head) ?? false) || update.base !== update.head);
30
+ if (fresh.size === 0)
31
+ return this.skip('skipped: the push only deletes refs');
32
+ const lines = [];
33
+ let built = false;
34
+ for (const [head, isNew] of fresh) {
35
+ if (!isNew) {
36
+ lines.push(`skipped: the remote already has ${head.slice(0, 7)}`);
37
+ continue;
38
+ }
39
+ const result = await this.#build(push, head);
40
+ if (result.kind === 'failed')
41
+ return this.fail([...lines, ...result.lines].join('\n'));
42
+ lines.push(result.line);
43
+ built = true;
44
+ }
45
+ return built ? this.pass(lines.join('\n')) : this.skip(lines.join('\n'));
46
+ }
47
+ async #build(push, head) {
48
+ const short = head.slice(0, 7);
49
+ try {
50
+ return await push.inSnapshot(head, async (folder, environment) => {
51
+ const cache = environment.NX_CACHE_DIRECTORY ?? '';
52
+ // A run that ends before its tasks writes no summary, so the summary
53
+ // of an older run must not stay.
54
+ await rm(join(cache, 'run.json'), { force: true });
55
+ const { code, stdout, stderr } = await runNx(folder, { ...environment, ...this.#env }, [
56
+ 'run-many',
57
+ `--targets=${this.#targets.join(',')}`,
58
+ '--configuration=production',
59
+ ...(this.#parallel === undefined
60
+ ? []
61
+ : [`--parallel=${this.#parallel}`]),
62
+ ]);
63
+ const tasks = await lastRun(cache);
64
+ if (code === 0) {
65
+ const projects = new Set(tasks.map((task) => task.projectName));
66
+ const cached = tasks.filter((task) => task.cacheStatus !== 'cache-miss');
67
+ return {
68
+ kind: 'built',
69
+ line: `${short}: built ${projects.size} projects, ${cached.length} of ${tasks.length} tasks from cache`,
70
+ };
71
+ }
72
+ // nx exits with 130 when a task fails, so each code other than 0 is a
73
+ // fail.
74
+ const failed = tasks.filter((task) => task.status !== 0);
75
+ if (failed.length === 0)
76
+ return {
77
+ kind: 'failed',
78
+ lines: [
79
+ `${short}: nx exited with ${code}`,
80
+ ...shown(`${stdout}\n${stderr}`),
81
+ ],
82
+ };
83
+ const lines = [
84
+ `${short}: ${failed.length} of ${tasks.length} tasks failed: ${failed.map(taskName).join(', ')}`,
85
+ ];
86
+ for (const task of failed) {
87
+ if (failed.length > 1)
88
+ lines.push(` ${taskName(task)}`);
89
+ const output = await readFile(join(cache, 'terminalOutputs', task.hash), 'utf8').catch(() => '');
90
+ lines.push(...shown(output, true));
91
+ }
92
+ return { kind: 'failed', lines };
93
+ });
94
+ }
95
+ catch (error) {
96
+ if (error instanceof MissingLockfileError)
97
+ return {
98
+ kind: 'failed',
99
+ lines: [
100
+ `${short} has no package-lock.json; Build works with npm workspaces`,
101
+ ],
102
+ };
103
+ if (!(error instanceof Error))
104
+ throw error;
105
+ return {
106
+ kind: 'failed',
107
+ lines: [`${short}: ${error.message.trimEnd()}`],
108
+ };
109
+ }
110
+ }
111
+ }
112
+ // Up to 20 lines of output, indented, and the number of the other lines. The
113
+ // first line of a task's output is the command that nx echoes.
114
+ function shown(output, echoed = false) {
115
+ const lines = stripVTControlCharacters(output)
116
+ .split(/\r?\n/)
117
+ .filter((line, index) => line.trim() !== '' && !(echoed && index === 0 && line.startsWith('> ')));
118
+ const more = lines.length - shownLines;
119
+ return [
120
+ ...lines.slice(0, shownLines).map((line) => ` ${line}`),
121
+ ...(more > 0 ? [` … ${more} more lines`] : []),
122
+ ];
123
+ }
124
+ async function lastRun(cache) {
125
+ let summary;
126
+ try {
127
+ summary = JSON.parse(await readFile(join(cache, 'run.json'), 'utf8'));
128
+ }
129
+ catch (error) {
130
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
131
+ return [];
132
+ throw error;
133
+ }
134
+ const tasks = typeof summary === 'object' && summary !== null && 'tasks' in summary
135
+ ? summary.tasks
136
+ : undefined;
137
+ if (!Array.isArray(tasks))
138
+ throw new TypeError(`nx wrote a run.json without tasks: ${JSON.stringify(summary)}`);
139
+ return tasks.map((task) => {
140
+ if (!isTask(task))
141
+ throw new TypeError(`nx wrote a task that is not known: ${JSON.stringify(task)}`);
142
+ return task;
143
+ });
144
+ }
145
+ function isTask(value) {
146
+ return (typeof value === 'object' &&
147
+ value !== null &&
148
+ 'projectName' in value &&
149
+ typeof value.projectName === 'string' &&
150
+ 'target' in value &&
151
+ typeof value.target === 'string' &&
152
+ 'hash' in value &&
153
+ typeof value.hash === 'string' &&
154
+ 'cacheStatus' in value &&
155
+ typeof value.cacheStatus === 'string' &&
156
+ 'status' in value &&
157
+ typeof value.status === 'number');
158
+ }
159
+ // The task as a person runs it: nx's task id also holds the configuration.
160
+ function taskName(task) {
161
+ return `${task.projectName}:${task.target}`;
162
+ }
163
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.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 interface CodegenOptions {
5
5
  readonly run: readonly string[];
6
6
  readonly stage: readonly string[];
7
7
  }
8
- export declare class Codegen extends Step {
8
+ export declare class Codegen extends Step<Commit> {
9
9
  #private;
10
10
  readonly name = "codegen";
11
11
  constructor({ when, run, stage }: CodegenOptions);
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,UAAU,cAAc;IAGtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAElC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAEhC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAMD,qBAAa,OAAQ,SAAQ,IAAI;;IAC/B,QAAQ,CAAC,IAAI,aAAa;gBAKd,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,cAAc;IAO1C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAmB5C"}
1
+ {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,UAAU,cAAc;IAGtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAElC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAEhC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAMD,qBAAa,OAAQ,SAAQ,IAAI,CAAC,MAAM,CAAC;;I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C,MAAM,CAAC;IAgBtC,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAiCpC"}
package/dist/commit.js CHANGED
@@ -46,7 +46,8 @@ export class Commit {
46
46
  async inSnapshot(work) {
47
47
  await using snapshot = await mkdtempDisposable(join(tmpdir(), 'git-hooks-'));
48
48
  await this.#git('checkout-index', '--all', `--prefix=${snapshot.path}/`);
49
- return work(snapshot.path);
49
+ // Awaited here, so the folder stays until `work` ends.
50
+ return await work(snapshot.path);
50
51
  }
51
52
  // The tracked files whose working-tree copy differs from the staged copy.
52
53
  async modified() {
@@ -1 +1 @@
1
- {"version":3,"file":"commit.js","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,sEAAsE;AACtE,kBAAkB;AAClB,MAAM,OAAO,MAAM;IACR,IAAI,CAAS;IACb,YAAY,CAAoB;IAEzC,YAAY,IAAY,EAAE,WAA8B;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,+DAA+D;IAC/D,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAC5B,MAAM,EACN,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,IAAI,CACL,CAAC;QACF,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAA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;YAClD,GAAG,EAAE,IAAI,CAAC,IAAI;YACd,GAAG,EAAE,IAAI,CAAC,YAAY;YACtB,QAAQ,EAAE,MAAM;YAChB,0DAA0D;YAC1D,SAAS,EAAE,CAAC,IAAI,EAAE;SACnB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
package/dist/format.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Commit } from './commit.ts';
2
2
  import { type Outcome, Step } from './step.ts';
3
- export declare class Format extends Step {
3
+ export declare class Format extends Step<Commit> {
4
4
  readonly name = "format";
5
5
  run(commit: Commit): Promise<Outcome>;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAK/C,qBAAa,MAAO,SAAQ,IAAI;IAC9B,QAAQ,CAAC,IAAI,YAAY;IAEnB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAgC5C"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAK/C,qBAAa,MAAO,SAAQ,IAAI,CAAC,MAAM,CAAC;IACtC,QAAQ,CAAC,IAAI,YAAY;IAEnB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAmC5C"}
package/dist/format.js CHANGED
@@ -31,10 +31,13 @@ export class Format extends Step {
31
31
  if (unformatted.length === 0)
32
32
  return this.pass('the staged files are formatted');
33
33
  const paths = unformatted.map(({ path }) => path);
34
+ const one = unformatted.length === 1;
34
35
  return this.fail([
35
- `${unformatted.length} staged files are not formatted:`,
36
+ one
37
+ ? '1 staged file is not formatted:'
38
+ : `${unformatted.length} staged files are not formatted:`,
36
39
  ...unformatted.map(({ path, reason }) => reason === undefined ? ` ${path}` : ` ${path} (${reason})`),
37
- `Run \`npx prettier --write ${paths.join(' ')}\`, stage them, and commit again.`,
40
+ `Run \`npx prettier --write ${paths.join(' ')}\`, stage ${one ? 'it' : 'them'}, and commit again.`,
38
41
  ].join('\n'));
39
42
  }
40
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAE/C,8EAA8E;AAC9E,+EAA+E;AAC/E,kEAAkE;AAClE,MAAM,OAAO,MAAO,SAAQ,IAAI;IACrB,IAAI,GAAG,QAAQ,CAAC;IAEzB,KAAK,CAAC,GAAG,CAAC,MAAc;QACtB,MAAM,WAAW,GAAwC,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QACxD,KAAK,MAAM,IAAI,IAAI,MAAM,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YACxC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACrC,yEAAyE;YACzE,mDAAmD;YACnD,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;YACnE,IAAI,cAAc,KAAK,IAAI;gBAAE,SAAS;YACtC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;YAC1C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,CAAC;gBAChD,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;QACD,IAAI,WAAW,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/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
+ export { Build } from './build.ts';
1
2
  export { Codegen } from './codegen.ts';
2
3
  export { Commit } from './commit.ts';
3
4
  export { Format } from './format.ts';
5
+ export { Push } from './push.ts';
6
+ export type { RefUpdate } from './ref-update.ts';
4
7
  export { preCommit } from './scripts/pre-commit.ts';
8
+ export { prePush } from './scripts/pre-push.ts';
5
9
  export { type Outcome, Step } from './step.ts';
6
10
  export { Sync } from './sync.ts';
7
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
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,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,10 @@
1
+ export { Build } from "./build.js";
1
2
  export { Codegen } from "./codegen.js";
2
3
  export { Commit } from "./commit.js";
3
4
  export { Format } from "./format.js";
5
+ export { Push } from "./push.js";
4
6
  export { preCommit } from "./scripts/pre-commit.js";
7
+ export { prePush } from "./scripts/pre-push.js";
5
8
  export { Step } from "./step.js";
6
9
  export { Sync } from "./sync.js";
7
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,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;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAgB,IAAI,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
package/dist/push.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { type RefUpdate } from './ref-update.ts';
2
+ export declare class MissingLockfileError extends Error {
3
+ readonly sha: string;
4
+ constructor(sha: string);
5
+ }
6
+ interface PushOptions {
7
+ readonly root: string;
8
+ readonly environment: NodeJS.ProcessEnv;
9
+ readonly remote: {
10
+ readonly name: string;
11
+ readonly url: string;
12
+ };
13
+ readonly input: string;
14
+ readonly notice: (message: string) => void;
15
+ }
16
+ export declare class Push {
17
+ #private;
18
+ readonly remote: {
19
+ readonly name: string;
20
+ readonly url: string;
21
+ };
22
+ readonly updates: readonly RefUpdate[];
23
+ private constructor();
24
+ static read(options: PushOptions): Promise<Push>;
25
+ inSnapshot<T>(sha: string, work: (folder: string, environment: NodeJS.ProcessEnv) => Promise<T>): Promise<T>;
26
+ nx(sha: string, ...args: string[]): Promise<string>;
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=push.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,iBAAiB,CAAC;AASjE,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,GAAG,EAAE,MAAM;CAKxB;AAED,UAAU,WAAW;IAEnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC;IAExC,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAEjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAKD,qBAAa,IAAI;;IACf,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;IAKvC,OAAO;WAWM,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAchD,UAAU,CAAC,CAAC,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,MAAM,EAAE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