@pob/root 13.0.0 → 13.2.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,21 @@
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
+ ## [13.2.0](https://github.com/christophehurpeau/pob/compare/@pob/root@13.1.0...@pob/root@13.2.0) (2024-08-15)
7
+
8
+ ### Features
9
+
10
+ * improve git hooks ([6e8cc6b](https://github.com/christophehurpeau/pob/commit/6e8cc6bdddf155f5b0651201990e358c87af6d18))
11
+
12
+ ## [13.1.0](https://github.com/christophehurpeau/pob/compare/@pob/root@13.0.0...@pob/root@13.1.0) (2024-08-14)
13
+
14
+ ### Bug Fixes
15
+
16
+ * **deps:** update dependency lint-staged to v15.2.9 ([#2169](https://github.com/christophehurpeau/pob/issues/2169)) ([6f347be](https://github.com/christophehurpeau/pob/commit/6f347be446b386e13ecddbd500061ab3ced1635a))
17
+
18
+ Version bump for dependency: yarn-version
19
+
20
+
6
21
  ## [13.0.0](https://github.com/christophehurpeau/pob/compare/@pob/root@12.4.0...@pob/root@13.0.0) (2024-08-11)
7
22
 
8
23
  ### ⚠ BREAKING CHANGES
package/README.md CHANGED
@@ -21,10 +21,8 @@ npm install --save @pob/root
21
21
 
22
22
  ## Usage
23
23
 
24
- ```js
25
- import pobRoot from "@pob/root";
26
-
27
- console.log(pobRoot);
24
+ ```bash
25
+ npx pob
28
26
  ```
29
27
 
30
28
  ## Latest forced update for pob
@@ -69,7 +69,13 @@ export default function installHusky({ pkg, pm }) {
69
69
  fs.mkdirSync(path.resolve(".husky"));
70
70
  } catch {}
71
71
 
72
- const { lockfile, pmExec, installOnDiffCommand } = (() => {
72
+ const {
73
+ lockfile,
74
+ pmExec,
75
+ installOnDiffCommand,
76
+ beforeDiffCommand = "",
77
+ afterDiffCommand = "",
78
+ } = (() => {
73
79
  if (pm.name === "yarn") {
74
80
  return {
75
81
  lockfile: "yarn.lock",
@@ -79,6 +85,20 @@ export default function installHusky({ pkg, pm }) {
79
85
  ? "--immutable"
80
86
  : "--prefer-offline --pure-lockfile --ignore-optional"
81
87
  }`,
88
+ beforeDiffCommand: isYarnBerry
89
+ ? `yarn config set logFilters --json '[
90
+ {"code": "YN0002","level": "discard"},
91
+ {"code": "YN0007","level": "discard"},
92
+ {"code": "YN0008","level": "discard"},
93
+ {"code": "YN0013","level": "discard"},
94
+ {"code": "YN0018","level": "discard"},
95
+ {"code": "YN0060","level": "discard"},
96
+ {"code": "YN0061","level": "discard"}
97
+ ]' > /dev/null`
98
+ : "",
99
+ afterDiffCommand: isYarnBerry
100
+ ? "yarn config unset logFilters > /dev/null"
101
+ : "",
82
102
  };
83
103
  }
84
104
  if (pm.name === "npm") {
@@ -105,21 +125,21 @@ export default function installHusky({ pkg, pm }) {
105
125
  writeHook("pre-commit", `${pmExec} pob-root-lint-staged`);
106
126
 
107
127
  if (isYarnPnp) {
128
+ // https://yarnpkg.com/features/zero-installs
108
129
  ensureHookDeleted("post-checkout");
109
130
  ensureHookDeleted("post-merge");
110
131
  ensureHookDeleted("post-rewrite");
111
132
  } else {
112
- const runInstallOnDiff = (() => {
133
+ const runInstallOnDiff = (additionalConditionInstall = "") => {
113
134
  return `
114
- if [ -n "$(git diff HEAD@{1}..HEAD@{0} -- ${lockfile})" ]; then
115
- ${installOnDiffCommand} || true
135
+ if [ -n "$(git diff HEAD@{1}..HEAD@{0} -- ${lockfile})" ]${additionalConditionInstall}; then
136
+ ${beforeDiffCommand ? `${beforeDiffCommand}\n ` : ""}${installOnDiffCommand} || true${afterDiffCommand ? `\n ${afterDiffCommand}` : ""}
116
137
  fi`;
117
- })();
138
+ };
118
139
 
119
- // https://yarnpkg.com/features/zero-installs
120
- writeHook("post-checkout", runInstallOnDiff);
121
- writeHook("post-merge", runInstallOnDiff);
122
- writeHook("post-rewrite", runInstallOnDiff);
140
+ writeHook("post-checkout", runInstallOnDiff());
141
+ writeHook("post-merge", runInstallOnDiff());
142
+ writeHook("post-rewrite", runInstallOnDiff(' | [ "$1" = "rebase" ]'));
123
143
  }
124
144
 
125
145
  const prePushHook = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/root",
3
- "version": "13.0.0",
3
+ "version": "13.2.0",
4
4
  "description": "root package",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
@@ -76,12 +76,12 @@
76
76
  "cosmiconfig": "^9.0.0",
77
77
  "husky": "~9.1.0",
78
78
  "json5": "^2.2.2",
79
- "lint-staged": "15.2.8",
80
- "pob-dependencies": "14.0.0",
79
+ "lint-staged": "15.2.9",
80
+ "pob-dependencies": "14.1.0",
81
81
  "prettier": "3.3.3",
82
82
  "repository-check-dirty": "8.0.0",
83
83
  "semver": "^7.3.7",
84
84
  "which-pm-runs": "1.1.0",
85
- "yarn-version": "3.0.0"
85
+ "yarn-version": "3.1.0"
86
86
  }
87
87
  }