@henryqw/pi-deps 0.3.5 → 0.3.7

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 (2) hide show
  1. package/README.md +33 -11
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # `@henryqw/pi-deps`
2
2
 
3
- Prepare locked Node and uv dependencies whenever Git creates a new worktree for an opted-in repository.
3
+ Prepare locked Node and uv dependencies when Git creates a new worktree for an opted-in repository.
4
4
 
5
5
  ## Why
6
6
 
7
- - **Created for**: Installing locked dependencies whenever Git creates a new worktree in an opted-in repository.
8
- - **Advantage**: Prepares each checkout regardless of which tool created it, without paying install cost at every Pi startup.
7
+ - **Created for**: Install locked dependencies whenever Git creates a new worktree in an opted-in repository.
8
+ - **Advantage**: Prepare each checkout regardless of which tool creates it. Do not pay install cost at every Pi startup.
9
9
 
10
10
  ## Install
11
11
 
@@ -17,21 +17,43 @@ Node 22.19 or newer, Git, and each selected package manager must be available on
17
17
 
18
18
  ## Use
19
19
 
20
- | Surface | Type | Purpose |
21
- | --- | --- | --- |
22
- | `/deps` | command | Toggle dependency preparation for future worktrees in current repository. |
20
+ Use `/deps` to toggle dependency preparation for future worktrees in the current repository.
21
+
22
+ ### Enable, disable, and update
23
+
24
+ - Run `/deps` once from any worktree to enable preparation through the repository's shared `post-checkout` hook.
25
+ - Run `/deps` again to disable it.
26
+ - Hooks without this package's marker are never overwritten or removed.
27
+ - After updating the package, run `/deps` twice in each opted-in repository. This replaces the copied hook with the current version.
28
+ - A configured `core.hooksPath` replaces the shared hooks directory. `/deps` refuses instead of installing where Git would ignore or share the hook.
29
+
30
+ ### What it prepares
31
+
32
+ - Only Git-root lockfiles are inspected.
33
+ - npm, pnpm, Yarn, and Bun use frozen installs. uv uses `uv sync --locked`.
34
+ - Node and uv both run when both lockfile types exist.
35
+ - Root npm and uv workspaces remain package-manager concerns. Nested independent projects are not scanned.
23
36
 
24
- Run `/deps` once from any worktree to enable preparation through repository's shared `post-checkout` hook. Run it again to disable. Hooks without this package's marker are never overwritten or removed. After updating the package, run `/deps` twice in each opted-in repository to replace the copied hook with the current version. A configured `core.hooksPath` replaces the shared hooks directory, so `/deps` refuses instead of installing where Git would ignore or share the hook.
37
+ ### Background install and status
25
38
 
26
- Only Git-root lockfiles are inspected. npm, pnpm, Yarn, and Bun use frozen installs; uv uses `uv sync --locked`. Node and uv both run when both lockfile types exist. Root npm and uv workspaces remain package-manager concerns; nested independent projects are not scanned.
39
+ - Worktree creation returns immediately.
40
+ - The hook validates lockfiles synchronously. Conflicting Node lockfiles, `packageManager` mismatches, and unsupported declarations still fail the worktree command fast.
41
+ - A detached installer runs frozen installs in the background.
42
+ - Its result is stored in `<worktree gitdir>/pi-deps/status.json`. Command output is in the adjacent `install.log`.
43
+ - The status file is removed once a Pi session reports it.
44
+ - A Pi session in the worktree shows an editor widget while installing. It auto-dismisses success after five seconds and keeps failures visible, including missing executables.
45
+ - Other tools that create worktrees get the same background install. They must consume the status file themselves.
27
46
 
28
- Creation returns immediately. The hook validates lockfiles synchronously — conflicting Node lockfiles, `packageManager` mismatches, and unsupported declarations still fail the worktree command fast — then a detached installer runs the frozen installs in the background. Its outcome lands in `<worktree gitdir>/pi-deps/status.json` with command output in the adjacent `install.log`; the file is removed once a Pi session reports it. A Pi session opened in the worktree shows an editor widget while installing, auto-dismisses success after five seconds, and keeps install failures visible (including missing executables). Other tools creating worktrees get the same background install but must consume the status file themselves. Already-present `node_modules`, `.pnp.cjs`, or `.venv` are skipped. Worktrees created with `git worktree add --no-checkout` never run `post-checkout`, so they are not prepared. Because installs finish after creation returns, a consumer may start using a worktree before dependencies are ready.
47
+ ### Limits and safety
29
48
 
30
- Dependency installation may execute repository-controlled build and install scripts. Enable only repositories you trust.
49
+ - Already-present `node_modules`, `.pnp.cjs`, or `.venv` are skipped.
50
+ - Worktrees created with `git worktree add --no-checkout` never run `post-checkout`, so they are not prepared.
51
+ - Installs finish after creation returns. A consumer may use a worktree before dependencies are ready.
52
+ - Dependency installation may execute repository-controlled build and install scripts. Enable only repositories you trust.
31
53
 
32
54
  ## Supported managers
33
55
 
34
- Only current major versions are supported; older majors are not handled and fall back to the lockfile default below.
56
+ Only current major versions are supported. Older majors are not handled and fall back to the lockfile default below.
35
57
 
36
58
  | Manager | Command | Lockfile |
37
59
  | --- | --- | --- |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-deps",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Prepare Node and uv dependencies when opted-in Git worktrees are created.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "license": "MIT",
17
17
  "files": [
18
+ "LICENSE",
18
19
  "extensions",
19
20
  "hooks",
20
- "README.md",
21
- "LICENSE"
21
+ "README.md"
22
22
  ],
23
23
  "scripts": {
24
24
  "test": "node --test test/*.test.ts",
@@ -26,8 +26,8 @@
26
26
  "pack:check": "npm pack --dry-run"
27
27
  },
28
28
  "peerDependencies": {
29
- "@earendil-works/pi-coding-agent": "*",
30
- "@earendil-works/pi-tui": "*"
29
+ "@earendil-works/pi-coding-agent": "^0.84.4",
30
+ "@earendil-works/pi-tui": "^0.84.4"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",