@pob/root 20.4.1 → 21.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/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [21.0.0](https://github.com/christophehurpeau/pob/compare/@pob/root@20.4.2...@pob/root@21.0.0) (2026-03-01)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * replace husky by small fast custom scripts
11
+
12
+ ### Features
13
+
14
+ * **deps:** update dependency prettier to v3.7.4 ([#2665](https://github.com/christophehurpeau/pob/issues/2665))
15
+ * replace husky by small fast custom scripts
16
+ * update commitlint
17
+ * update prettier
18
+
19
+ Version bump for dependency: @pob/pretty-pkg
20
+ Version bump for dependency: @pob/version
21
+ Version bump for dependency: pob-dependencies
22
+
23
+
24
+ ## [20.4.2](https://github.com/christophehurpeau/pob/compare/@pob/root@20.4.1...@pob/root@20.4.2) (2025-12-06)
25
+
26
+ Version bump for dependency: @pob/version
27
+
28
+
6
29
  ## [20.4.1](https://github.com/christophehurpeau/pob/compare/@pob/root@20.4.0...@pob/root@20.4.1) (2025-12-06)
7
30
 
8
31
  Version bump for dependency: @pob/version
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // eslint-disable-next-line import/no-unresolved
4
3
  import lintStaged from "lint-staged";
5
4
 
6
5
  lintStaged({
@@ -36,7 +36,7 @@ if (pm.name !== "yarn" && pm.name !== "npm" && pm.name !== "bun") {
36
36
  }
37
37
 
38
38
  (await import("./postinstall/update-yarn.js")).default({ pkg, pm });
39
- (await import("./postinstall/install-husky.js")).default({ pkg, pm });
39
+ (await import("./postinstall/install-githooks.js")).default({ pkg, pm });
40
40
  (await import("./postinstall/install-github-workflows.js")).default({
41
41
  pkg,
42
42
  pm,
@@ -1,6 +1,6 @@
1
+ import { spawnSync } from "node:child_process";
1
2
  import fs from "node:fs";
2
3
  import path from "node:path";
3
- import husky from "husky";
4
4
  import { assertYarnBerry } from "../../lib/assert-yarn-berry.js";
5
5
  import { getPackageManagerCommands } from "./packageManagerHelpers.js";
6
6
 
@@ -11,29 +11,37 @@ const ensureLegacyHuskyConfigDeleted = () => {
11
11
  try {
12
12
  fs.unlinkSync(path.resolve(".huskyrc"));
13
13
  } catch {}
14
+ try {
15
+ fs.rmSync(path.resolve(".husky"), { recursive: true });
16
+ } catch {}
14
17
  };
15
18
 
16
19
  const ensureHuskyNotInDevDependencies = (pkg) => {
17
20
  if (pkg.devDependencies && pkg.devDependencies.husky) {
18
21
  throw new Error(
19
- "Found husky in devDependencies. Husky is provided by @pob/root, please remove",
22
+ "Found husky in devDependencies. Husky is in conflict with @pob/root, please remove",
20
23
  );
21
24
  }
22
25
  };
23
26
 
24
27
  const writeHook = (hookName, hookContent) => {
25
28
  fs.writeFileSync(
26
- path.resolve(`.husky/${hookName}`),
27
- `${hookContent.trim()}\n`,
29
+ path.resolve(`.git-hooks/${hookName}`),
30
+ `#!/usr/bin/env sh
31
+ [ "$POB_GIT_HOOKS" = "2" ] && set -x
32
+ [ "$POB_GIT_HOOKS" = "0" ] && exit 0
33
+ [ "$HUSKY" = "0" ] && exit 0
34
+
35
+ ${hookContent.trim()}\n`,
28
36
  {
29
- mode: "755",
37
+ mode: 0o755,
30
38
  },
31
39
  );
32
40
  };
33
41
 
34
42
  const ensureHookDeleted = (hookName) => {
35
43
  try {
36
- fs.unlinkSync(path.resolve(`.husky/${hookName}`));
44
+ fs.unlinkSync(path.resolve(`.git-hooks/${hookName}`));
37
45
  } catch {}
38
46
  };
39
47
 
@@ -45,7 +53,16 @@ const readYarnConfigFile = () => {
45
53
  }
46
54
  };
47
55
 
48
- export default function installHusky({ pkg, pm }) {
56
+ export default function installGitHooks({ pkg, pm }) {
57
+ if (
58
+ process.env.POB_GIT_HOOKS === "0" ||
59
+ process.env.POB_GIT_HOOKS === "false"
60
+ ) {
61
+ console.log(
62
+ "Skipping git hooks installation due to POB_GIT_HOOKS environment variable",
63
+ );
64
+ return;
65
+ }
49
66
  assertYarnBerry(pm);
50
67
  const yarnConfig = readYarnConfigFile();
51
68
  const isYarnPnp = yarnConfig
@@ -67,7 +84,7 @@ export default function installHusky({ pkg, pm }) {
67
84
  fs.existsSync(path.resolve("scripts/transcrypt"));
68
85
 
69
86
  try {
70
- fs.mkdirSync(path.resolve(".husky"));
87
+ fs.mkdirSync(path.resolve(".git-hooks"));
71
88
  } catch {}
72
89
 
73
90
  const {
@@ -157,5 +174,18 @@ done
157
174
  ensureHookDeleted("pre-push");
158
175
  }
159
176
 
160
- process.stdout.write(husky(".husky"));
177
+ const { status, stderr } = spawnSync("git", [
178
+ "config",
179
+ "core.hooksPath",
180
+ ".git-hooks",
181
+ ]);
182
+ if (status == null) {
183
+ console.error(
184
+ "@pob/root postinstall: Failed to set git core.hooksPath: git command not found",
185
+ );
186
+ } else if (status) {
187
+ console.error(
188
+ `@pob/root postinstall: Failed to set git core.hooksPath: ${stderr.toString()}`,
189
+ );
190
+ }
161
191
  }
package/bin/prettier.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
  const path = require("node:path");
6
6
  const pkg = require("prettier/package.json");
7
7
 
8
- // eslint-disable-next-line import/no-dynamic-require
8
+ // eslint-disable-next-line import-x/no-dynamic-require
9
9
  require(
10
10
  path.join(
11
11
  "prettier",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/root",
3
- "version": "20.4.1",
3
+ "version": "21.0.0",
4
4
  "description": "root package",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
@@ -65,19 +65,18 @@
65
65
  "pob": {},
66
66
  "prettier": "@pob/root/prettier-config",
67
67
  "dependencies": {
68
- "@commitlint/format": "20.0.0",
69
- "@commitlint/lint": "20.0.0",
70
- "@commitlint/types": "20.0.0",
71
- "@pob/pretty-pkg": "13.2.1",
72
- "@pob/version": "1.4.1",
68
+ "@commitlint/format": "20.4.0",
69
+ "@commitlint/lint": "20.4.2",
70
+ "@commitlint/types": "20.4.0",
71
+ "@pob/pretty-pkg": "13.2.2",
72
+ "@pob/version": "1.4.3",
73
73
  "conventional-changelog-conventionalcommits": "^9.1.0",
74
74
  "conventional-changelog-writer": "^8.2.0",
75
75
  "conventional-commits-parser": "^6.2.1",
76
- "husky": "~9.1.7",
77
76
  "json5": "^2.2.3",
78
77
  "lint-staged": "16.2.7",
79
- "pob-dependencies": "21.0.2",
80
- "prettier": "3.6.2",
78
+ "pob-dependencies": "21.1.0",
79
+ "prettier": "3.8.1",
81
80
  "semver": "^7.7.3"
82
81
  }
83
82
  }