@pob/root 27.13.0 → 27.15.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.
@@ -25,6 +25,14 @@ const cwd = input.cwd;
25
25
  if (!file || !cwd) process.exit(0);
26
26
 
27
27
  const relFile = path.relative(cwd, file);
28
+ // Ignore files outside the project (e.g. ~/.claude, other repos).
29
+ if (
30
+ relFile === ".." ||
31
+ relFile.startsWith(`..${path.sep}`) ||
32
+ path.isAbsolute(relFile)
33
+ ) {
34
+ process.exit(0);
35
+ }
28
36
 
29
37
  // chdir before importing the config so path.resolve("package.json") and
30
38
  // whichPmRuns()'s lockfile detection both resolve against the project root.
@@ -34,7 +34,7 @@ jobs:
34
34
  run: $pmExec$ pob-root-postinstall
35
35
 
36
36
  - name: Run pob update
37
- run: npx pob update --force
37
+ run: $pmDlx$ pob update --force
38
38
  env:
39
39
  YARN_ENABLE_IMMUTABLE_INSTALLS: false
40
40
 
@@ -124,7 +124,20 @@ if [ -n "$(git diff HEAD@{1}..HEAD@{0} -- ${lockfile})" ]${additionalConditionIn
124
124
  fi`;
125
125
  };
126
126
 
127
- writeHook("post-checkout", runInstallOnDiff());
127
+ // git worktree add runs post-checkout with the null-ref as previous HEAD
128
+ writeHook(
129
+ "post-checkout",
130
+ `
131
+ if [ "$1" = "0000000000000000000000000000000000000000" ]; then
132
+ if [ -x scripts/setup-worktree.sh ]; then
133
+ ./scripts/setup-worktree.sh || true
134
+ else
135
+ ${installOnDiffCommand} || true
136
+ fi
137
+ exit 0
138
+ fi
139
+ ${runInstallOnDiff()}`,
140
+ );
128
141
  writeHook("post-merge", runInstallOnDiff());
129
142
  writeHook("post-rewrite", runInstallOnDiff(' || [ "$1" = "rebase" ]'));
130
143
  }
@@ -26,7 +26,14 @@ const ensureWorkflowUninstalled = (workflowName) => {
26
26
 
27
27
  const installWorkflow = (
28
28
  workflowName,
29
- { pmRun, pmExec, installOnCICommand, installMutableCommand, ciPreStep },
29
+ {
30
+ pmRun,
31
+ pmExec,
32
+ pmDlx,
33
+ installOnCICommand,
34
+ installMutableCommand,
35
+ ciPreStep,
36
+ },
30
37
  condition = true,
31
38
  ) => {
32
39
  if (condition) {
@@ -42,6 +49,7 @@ const installWorkflow = (
42
49
  )
43
50
  .replaceAll("$pmRun$", pmRun)
44
51
  .replaceAll("$pmExec$", pmExec)
52
+ .replaceAll("$pmDlx$", pmDlx)
45
53
  .replaceAll("$ciPreStep$", ciPreStep)
46
54
  .replaceAll("$installOnCICommand$", installOnCICommand)
47
55
  .replaceAll("$installMutableCommand$", installMutableCommand),
@@ -4,6 +4,7 @@ export const getPackageManagerCommands = (pm, isYarnBerry) => {
4
4
  lockfile: "yarn.lock",
5
5
  pmRun: "yarn run",
6
6
  pmExec: "yarn",
7
+ pmDlx: "npx",
7
8
  ciPreStep: `name: Enable Corepack
8
9
  run: corepack enable`,
9
10
  installOnCICommand: "yarn install --immutable",
@@ -34,6 +35,7 @@ export const getPackageManagerCommands = (pm, isYarnBerry) => {
34
35
  lockfile: "package-lock.json",
35
36
  pmRun: "npm run",
36
37
  pmExec: "npx --no-install",
38
+ pmDlx: "npx",
37
39
  ciPreStep: "",
38
40
  installOnCICommand: "npm i",
39
41
  installMutableCommand: "npm i",
@@ -45,6 +47,7 @@ export const getPackageManagerCommands = (pm, isYarnBerry) => {
45
47
  lockfile: "bun.lock",
46
48
  pmRun: "bun run",
47
49
  pmExec: "bun run",
50
+ pmDlx: "npx",
48
51
  ciPreStep: `name: Install bun
49
52
  uses: oven-sh/setup-bun@v2`,
50
53
  installOnCICommand: "bun i --frozen-lockfile",
@@ -57,10 +60,11 @@ export const getPackageManagerCommands = (pm, isYarnBerry) => {
57
60
  lockfile: "pnpm-lock.yaml",
58
61
  pmRun: "pnpm run",
59
62
  pmExec: "pnpm exec",
63
+ // npx fails when devEngines.packageManager is pnpm.
64
+ pmDlx: "pnpm dlx",
65
+ // the version is read from devEngines.packageManager in package.json
60
66
  ciPreStep: `name: Install pnpm
61
- uses: pnpm/action-setup@v6
62
- with:
63
- version: 12`,
67
+ uses: pnpm/action-setup@v6`,
64
68
  installOnCICommand: "pnpm install --frozen-lockfile",
65
69
  installMutableCommand: "pnpm install",
66
70
  installOnDiffCommand: "pnpm install --frozen-lockfile",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/root",
3
- "version": "27.13.0",
3
+ "version": "27.15.0",
4
4
  "description": "root package",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/christophehurpeau/pob",
@@ -66,17 +66,17 @@
66
66
  "@commitlint/format": "21.0.1",
67
67
  "@commitlint/lint": "21.0.2",
68
68
  "@commitlint/types": "21.0.1",
69
- "@pob/version": "6.5.0",
69
+ "@pob/version": "6.5.1",
70
70
  "conventional-changelog-conventionalcommits": "^9.1.0",
71
71
  "conventional-changelog-writer": "^8.2.0",
72
72
  "conventional-commits-parser": "^6.2.1",
73
73
  "json5": "^2.2.3",
74
74
  "lint-staged": "17.4.1",
75
- "oxfmt": "0.54.0",
75
+ "oxfmt": "0.72.0",
76
76
  "oxlint": "1.85.0",
77
77
  "oxlint-tsgolint": "7.0.2003",
78
78
  "picomatch": "^4.0.7",
79
- "pob-dependencies": "27.11.0",
79
+ "pob-dependencies": "27.12.0",
80
80
  "semver": "^7.7.3"
81
81
  },
82
82
  "engines": {