@devrouter/cli 0.1.3 → 0.3.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/README.md +12 -0
- package/dist/devrouter-lifecycle-worker.js +278 -192
- package/dist/devrouter.js +3380 -893
- package/package.json +2 -1
- package/upgrade-prompts/0.2.0.md +81 -0
- package/upgrade-prompts/0.3.0.md +59 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrouter/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Local dev routing CLI with shared Traefik reverse proxy",
|
|
5
5
|
"author": "Roland Schlaefli",
|
|
6
6
|
"homepage": "https://github.com/rschlaefli/devrouter#readme",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"qualify:profiles": "node --import tsx scripts/qualify-profile-alternation.ts",
|
|
62
62
|
"qualify:host-suspend": "node --import tsx scripts/qualify-host-suspend.ts",
|
|
63
63
|
"test:process": "bash scripts/test-devrouter-process.sh",
|
|
64
|
+
"test:skills": "bash tests/worktree-reclaim/run-corpus.sh && bash tests/worktree-reclaim/test-reclaim.sh && bash tests/worktree-reclaim/test-manifest.sh",
|
|
64
65
|
"check": "biome check .",
|
|
65
66
|
"check:fix": "biome check --write .",
|
|
66
67
|
"check:docs-policy": "./scripts/check-docs-policy.sh",
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Upgrade to devrouter 0.2.0
|
|
2
|
+
|
|
3
|
+
This minor release adds worktree lifecycle tooling.
|
|
4
|
+
|
|
5
|
+
- `workspace down` is safer.
|
|
6
|
+
- A Git-safety verdict covers every linked worktree, managed or not.
|
|
7
|
+
- Reclaim and trim commands apply only an approved, hash-bound manifest.
|
|
8
|
+
- Two installable skills ship with the release: `worktree-reclaim` and
|
|
9
|
+
`devrouter-setup`.
|
|
10
|
+
|
|
11
|
+
It adds one optional `.devrouter.yml` key, `worktrees`. Earlier versions reject
|
|
12
|
+
unknown keys. A repository that declares `worktrees` therefore needs 0.2.0 or
|
|
13
|
+
later on every machine that loads its configuration.
|
|
14
|
+
|
|
15
|
+
## What changed for a consumer
|
|
16
|
+
|
|
17
|
+
- `workspace down` refuses to remove a worktree that holds local state the
|
|
18
|
+
earlier check missed. That state covers:
|
|
19
|
+
- unrecognised ignored files;
|
|
20
|
+
- a detached HEAD;
|
|
21
|
+
- an index lock;
|
|
22
|
+
- an unfinished merge, rebase, cherry-pick, revert or bisect;
|
|
23
|
+
- initialized submodules.
|
|
24
|
+
|
|
25
|
+
The error names each reason. `--keep-worktree` still removes only the
|
|
26
|
+
runtime and routes.
|
|
27
|
+
- `workspace cleanup --all-worktrees --check-merged` reports `RECLAIM`, `KEEP`
|
|
28
|
+
or `PRUNE` with stable reason codes for every linked worktree. This report
|
|
29
|
+
uses schema version 3. Without the flag, the report stays at schema version
|
|
30
|
+
2.
|
|
31
|
+
- `workspace reclaim` removes the worktrees in an approved manifest. It removes
|
|
32
|
+
their runtime, ownership record and branch along with each worktree.
|
|
33
|
+
- `workspace trim` removes only the ignored paths declared in
|
|
34
|
+
`worktrees.trim` and leaves the worktree, branch and runtime in place.
|
|
35
|
+
- Both commands follow the same manifest rules:
|
|
36
|
+
- Both are dry runs until `--yes` is passed.
|
|
37
|
+
- Both re-check each target inside its lifecycle lock.
|
|
38
|
+
- Both write receipts, so a rerun reports `already-done`.
|
|
39
|
+
- `cleanup --manifest` emits the manifest, and `workspace manifest hash|select`
|
|
40
|
+
hashes or narrows it. Manifests are interchangeable with the
|
|
41
|
+
`worktree-reclaim` skill.
|
|
42
|
+
- `npx skills add rschlaefli/devrouter` installs the `devrouter`,
|
|
43
|
+
`worktree-reclaim` and `devrouter-setup` skills.
|
|
44
|
+
|
|
45
|
+
## Task
|
|
46
|
+
|
|
47
|
+
Install the published 0.2.0 CLI. No migration or runtime-state change is
|
|
48
|
+
needed.
|
|
49
|
+
|
|
50
|
+
Optionally declare reproducible ignored paths in `.devrouter.yml`. Do this only
|
|
51
|
+
when consumer source changes are authorized. When you add the key, raise the
|
|
52
|
+
documented minimum devrouter version to 0.2.0 in the same change:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
worktrees:
|
|
56
|
+
disposable: ["**/playwright-report"]
|
|
57
|
+
trim: ["**/node_modules", "**/.next"]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Validation
|
|
61
|
+
|
|
62
|
+
1. Run `devrouter -V` from the consumer checkout. A repository Volta pin can
|
|
63
|
+
change which install resolves.
|
|
64
|
+
2. Run `devrouter doctor --repo <checkout>`.
|
|
65
|
+
3. Run `devrouter workspace cleanup --repo <checkout> --all-worktrees
|
|
66
|
+
--check-merged` and confirm the report lists every linked worktree with a
|
|
67
|
+
verdict.
|
|
68
|
+
4. Run every reclaim or trim as a dry run first. Run with `--yes` only after a
|
|
69
|
+
person has approved the manifest's printed SHA-256.
|
|
70
|
+
|
|
71
|
+
## Report
|
|
72
|
+
|
|
73
|
+
Report:
|
|
74
|
+
|
|
75
|
+
- the release revision;
|
|
76
|
+
- the resolved executable and its installed version;
|
|
77
|
+
- the verdict counts from the cleanup report;
|
|
78
|
+
- for any authorized reclaim or trim, the manifest hash and the per-target
|
|
79
|
+
outcomes.
|
|
80
|
+
|
|
81
|
+
Report kept trees with their reason codes, never as failures.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Upgrade to devrouter 0.3.0
|
|
2
|
+
|
|
3
|
+
This minor release finishes worktree cleanup after deleted checkouts and adds
|
|
4
|
+
a team guide.
|
|
5
|
+
|
|
6
|
+
- `workspace gc` can now remove a Devsy workspace whose checkout folder was
|
|
7
|
+
already deleted.
|
|
8
|
+
- `workspace cleanup --all-worktrees` lists Docker leftovers: the Compose
|
|
9
|
+
stacks of deleted worktrees.
|
|
10
|
+
- `workspace leftover` removes approved leftovers from a hash-bound manifest.
|
|
11
|
+
- `docs/WORKTREE_CLEANUP.md` explains the whole cleanup flow for engineers.
|
|
12
|
+
|
|
13
|
+
There is no configuration change and no migration.
|
|
14
|
+
|
|
15
|
+
## What changed for a consumer
|
|
16
|
+
|
|
17
|
+
- When the ordinary Devsy delete fails, `gc` forces it only when the recorded
|
|
18
|
+
folder no longer exists and the runtime is stopped or not found. A failed
|
|
19
|
+
delete of a folder that still exists is reported, never forced.
|
|
20
|
+
- The cleanup report gains a `dockerLeftovers` section with schema version 3.
|
|
21
|
+
A stack counts as a leftover only when all of its containers name the same
|
|
22
|
+
folder below `<repo>/trees/`, at least one container was created by DevPod
|
|
23
|
+
or Devsy, the folder no longer exists, it is not inside another existing
|
|
24
|
+
worktree, no registration still names it, and every container is stopped.
|
|
25
|
+
Blocked stacks name the next step (`workspace gc` or `git worktree prune`).
|
|
26
|
+
- `workspace cleanup --manifest --action leftover --output <file>` writes a
|
|
27
|
+
`docker-leftover-manifest`. `workspace leftover --manifest <file> --sha256
|
|
28
|
+
<hash>` is a dry run until `--yes`. It removes the listed containers, then
|
|
29
|
+
the listed volumes (project and anonymous volumes no other container uses),
|
|
30
|
+
then networks, and skips any stack that changed.
|
|
31
|
+
- Volumes that no container ties to a deleted worktree are reported and never
|
|
32
|
+
removed. Worktree `reclaim` and `trim` reject leftover manifests.
|
|
33
|
+
|
|
34
|
+
## Task
|
|
35
|
+
|
|
36
|
+
Install the published 0.3.0 CLI. No migration or runtime-state change is
|
|
37
|
+
needed. Raise a repository's documented minimum devrouter version to 0.3.0
|
|
38
|
+
only when consumer source changes are authorized and the team should use the
|
|
39
|
+
leftover commands.
|
|
40
|
+
|
|
41
|
+
## Validation
|
|
42
|
+
|
|
43
|
+
1. Run `devrouter -V` from the consumer checkout. A repository Volta pin can
|
|
44
|
+
change which install resolves.
|
|
45
|
+
2. Run `devrouter workspace cleanup --repo <checkout> --all-worktrees` and
|
|
46
|
+
confirm the report includes the Docker leftovers section.
|
|
47
|
+
3. Run `devrouter workspace gc` and every leftover removal as a dry run first.
|
|
48
|
+
Run with `--yes` only after a person has approved the exact targets or the
|
|
49
|
+
manifest's printed SHA-256.
|
|
50
|
+
|
|
51
|
+
## Report
|
|
52
|
+
|
|
53
|
+
Report:
|
|
54
|
+
|
|
55
|
+
- the release revision;
|
|
56
|
+
- the resolved executable and its installed version;
|
|
57
|
+
- the leftover and blocked counts from the cleanup report;
|
|
58
|
+
- for any authorized gc or leftover removal, the targets or manifest hash and
|
|
59
|
+
the per-target outcomes.
|