@zukhruf/git-hooks 0.3.54 → 0.3.56
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 +1 -1
- package/dist/snapshot/installs.js +2 -1
- package/dist/snapshot/installs.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -205,7 +205,7 @@ When the installed packages do not match the `package-lock.json` of the commit,
|
|
|
205
205
|
build a1b2c3d: the installed packages differ from package-lock.json; installing it with npm ci (first time for this lockfile)
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
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.
|
|
208
|
+
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. With npm 12, only the install scripts that the `allowScripts` of the repo's `package.json` approves run, as in the repo's own `npm install`. To approve a dependency, run `npm install-scripts approve <name>`. 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.
|
|
209
209
|
|
|
210
210
|
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.
|
|
211
211
|
|
|
@@ -36,7 +36,8 @@ export async function installFor(state, snapshot, environment, installing) {
|
|
|
36
36
|
// third-party packages that have install scripts, such as esbuild. The
|
|
37
37
|
// scripts of the repo and of its workspace packages, such as `prepare`,
|
|
38
38
|
// would act on the repo from the state folder, so they do not run. Without
|
|
39
|
-
// names, `npm rebuild` runs them too.
|
|
39
|
+
// names, `npm rebuild` runs them too. npm 12 runs only the dependency
|
|
40
|
+
// scripts that `allowScripts` in the copied package.json approves.
|
|
40
41
|
async function install(snapshot, folder, environment) {
|
|
41
42
|
await mkdir(folder, { recursive: true });
|
|
42
43
|
for (const file of ['package.json', 'package-lock.json', '.npmrc'])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installs.js","sourceRoot":"","sources":["../../src/snapshot/installs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,EAAE,EACF,IAAI,EACJ,MAAM,EACN,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,gEAAgE;AAChE,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,uEAAuE;AACvE,MAAM,MAAM,GAAG,WAAW,CAAC;AAE3B,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,gCAAgC;AAChC,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,KAAa,EACb,QAAgB,EAChB,WAA8B,EAC9B,UAAsB;IAEtB,MAAM,QAAQ,GAAG,M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IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAC/C,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,EACxB,GAAG,EAAE,CAAC,CAAC,CAAC,CACT;KACF,CAAC,CAAC,CACJ,CAAC;IACF,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/C,KAAK,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;QAChD,IAAI,KAAK,IAAI,IAAI,IAAI,EAAE,GAAG,CAAC;YACzB,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/git-hooks",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.56",
|
|
4
4
|
"description": "Git hooks in TypeScript. Pre-commit checks staged files with Prettier, runs nx sync and stages only what it wrote, and builds affected generated files. Pre-push builds each pushed commit in a snapshot, not the working tree. A repo adds a step as a class.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@zukhruf/fs": "^0.3.
|
|
49
|
+
"@zukhruf/fs": "^0.3.56"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"nx": ">=21.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@zukhruf/testing": "^0.3.
|
|
61
|
+
"@zukhruf/testing": "^0.3.56",
|
|
62
62
|
"prettier": "^3.9.9"
|
|
63
63
|
}
|
|
64
64
|
}
|