@osdlc/repo-cleaner 0.17.2 → 0.19.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +691 -305
  3. package/dist/branches.d.ts +37 -36
  4. package/dist/branches.js +199 -196
  5. package/dist/clean.d.ts +179 -0
  6. package/dist/clean.js +824 -0
  7. package/dist/cli.d.ts +12 -16
  8. package/dist/cli.js +367 -478
  9. package/dist/hooks.d.ts +8 -12
  10. package/dist/hooks.js +2 -2
  11. package/dist/index.d.ts +18 -25
  12. package/dist/index.js +16 -23
  13. package/dist/landing.d.ts +3 -3
  14. package/dist/landing.js +7 -7
  15. package/dist/plan.d.ts +76 -70
  16. package/dist/plan.js +82 -77
  17. package/dist/providers/github.d.ts +2 -1
  18. package/dist/providers/github.js +2 -1
  19. package/dist/providers/gitlab.d.ts +3 -2
  20. package/dist/providers/gitlab.js +14 -8
  21. package/dist/providers/index.d.ts +5 -4
  22. package/dist/providers/index.js +8 -5
  23. package/dist/providers/types.d.ts +8 -2
  24. package/dist/prs.d.ts +35 -7
  25. package/dist/prs.js +45 -12
  26. package/dist/receipt.d.ts +46 -57
  27. package/dist/receipt.js +52 -28
  28. package/dist/reference.d.ts +12 -0
  29. package/dist/reference.js +152 -0
  30. package/dist/remote-mirror.d.ts +9 -1
  31. package/dist/remote-mirror.js +19 -1
  32. package/dist/render.d.ts +66 -61
  33. package/dist/render.js +206 -255
  34. package/dist/resolve.d.ts +3 -3
  35. package/dist/resolve.js +4 -12
  36. package/dist/status-line.d.ts +1 -1
  37. package/dist/status-line.js +5 -5
  38. package/dist/step-board.d.ts +1 -1
  39. package/dist/step-board.js +2 -5
  40. package/dist/submodules.d.ts +120 -0
  41. package/dist/submodules.js +292 -0
  42. package/dist/sweep.d.ts +107 -64
  43. package/dist/sweep.js +333 -119
  44. package/dist/types.d.ts +294 -105
  45. package/dist/types.js +106 -54
  46. package/dist/util.d.ts +13 -0
  47. package/dist/util.js +36 -0
  48. package/dist/version.generated.d.ts +1 -1
  49. package/dist/version.generated.js +1 -1
  50. package/dist/worktrees.d.ts +21 -37
  51. package/dist/worktrees.js +198 -165
  52. package/package.json +5 -5
  53. package/dist/apply.d.ts +0 -131
  54. package/dist/apply.js +0 -541
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @osdlc/repo-cleaner
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b1c3209: A lookup that fails now costs its evidence, not the repository. See "When a lookup fails" in the README.
8
+
9
+ - A pull request listing that fails, such as `gh pr list` for a repository the account cannot see, no longer turns the repository into an error with no rows. Its rows are judged on git evidence, `RepoInfo.provider.listError` says why, and the repository carries a note.
10
+ - While open pull requests cannot be checked (the listing failed, or `gh`/`glab` is missing or signed out), deleting a remote branch with no known PR needs `confirm-open-pr`, since deleting an open PR's head branch closes it. `--provider none` asks nothing and gates nothing.
11
+ - `--offline` reads remote branches from the remote-tracking refs on disk, as documented, instead of calling `git ls-remote`. After a fetch, an `ls-remote` that fails falls back to those refs. A failed fetch still fails the repository.
12
+ - `clean`'s re-check, and its preview, read the remote's tips with `ls-remote`, so an offline plan's stale tracking refs never decide a delete: a branch the remote already deleted, or pushed past, is skipped, and a spared one refuses the run. If that `ls-remote` fails, the run is refused before anything runs. A branch deleted between the re-check and the push is reported gone, not a failure (`Step.gone`, `RunSummary.gone`).
13
+ - `--provider auto` asks no provider for a remote that names no host, such as a local path, which can have no pull requests.
14
+ - New in the library: `RepoSweep.notes`, `Preview.notes`, `RunOptions.onNotes` and the `RepoNote` type. A `PrProvider` reports a failure by returning null or by throwing.
15
+
16
+ ## 0.18.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 25ccd9e: **Breaking:** a new command line and library, with no aliases for the old names, and worktrees with submodules can now be cleaned up.
21
+
22
+ Command line. `repo-cleaner [target...]` is the report (`status` is gone; a directory named `status` is now a target). `apply` is `clean`. `summary` and `--commands` are `--format summary` and `--format commands`; `--output json` is `--format json`; the report's `--keep` is `--all`. `--row` is `--pick`, and `--keep` is `--spare`, which now takes a row of any kind (a spared remote branch is still tip-checked, and sparing a worktree spares its branch). `--remotes` is `--remote`, `--no-fetch` is `--offline`, `--measure-remote` is `--against`, and `--remote-url <url>` is a remote URL given as a target (a local bare repository as `file:///…`). `--repo-root` is gone: sweep or plan only the repository a row is in. `--only` takes `worktree`, `branch`, `remote`. Rows are named `worktree:<path>`, `branch:<name>`, `remote:<remote>/<name>`, or by a bare name when only one row has it. Verdicts are `delete`, `review`, `keep` and the new `blocked` (shown as `review` before). Every command takes `--help --extended` for the full reference. Combinations that contradict themselves, or with an option that would have no effect (`--yes --dry-run`, `--offline` or `--provider` without `--remote`, the same row picked and spared, and the rest in the README's "Refused combinations"), are refused with exit 2 before anything is deleted, most of them before anything is swept.
23
+
24
+ Library. The exports are `sweep(targets, opts)`, `plan(sweep)`, `check(plan, { pick, spare, allow })`, `run(preview)`, `inspectWorktree(path)`, `readPlan`, `writePlan`, `render`, `defaultProcessProbe`, `providers` and `RepoCleanerError` (with a `code`), and their types. `sweepRepo`, `sweepRepos`, `applyPlan`, `planRepo`, `holdFreedBranches`, the gather and classify functions, the command builders and the other helpers are no longer exported. A row is a `WorktreeRow`, `BranchRow` or `RemoteRow` with `verdict`, `action` (null when it can never be deleted), `why`, `risks`, `blockers`, `commands`, `notes`, and typed camelCase `evidence` in place of the `facts` bag. `annotate` is a `sweep`, `check` and `run` option, and the sweep holds a held-back worktree's branch itself. Plans are version 2 and receipts version 2, both camelCase; a version 1 plan is refused.
25
+
26
+ Submodules. Plain `git worktree remove` refuses any worktree with a checked-out submodule, or with a submodule git dir a `git submodule deinit` left behind, so the old `apply` failed on every such worktree. The sweep now reads each submodule, nested ones included, and each left-over submodule git dir. A worktree whose submodules are clean and pushed is `delete`, with a `git worktree remove --force` command (`evidence.forcedForSubmodules`), and just before that remove `clean` checks the worktree's own files and every submodule again, since `--force` skips git's own check. A linked worktree's submodules keep their history in the worktree's own git dir, so a submodule's commits and stashes that no remote has carry `abandon-unmerged`, and its modified files carry `discard-changes`: one `--allow` on the worktree row covers its submodules. A submodule that cannot be read is the new `submodule-unreadable` blocker. A worktree whose directory is gone is now removed by its own record (`git worktree remove <path>`) rather than by a repository-wide `git worktree prune`; one whose directory is left without its `.git` still needs that prune, so it runs last and only while every other gone worktree the prune would drop goes in the same run (otherwise it is dropped as `blocked`). A run no longer ends with a repository-wide prune, so it never drops the record of a gone worktree it did not select, a spared one included. Submodule state is part of the plan fingerprint.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [25ccd9e]
31
+ - @osdlc/typed-git@0.13.0
32
+ - @osdlc/typed-gh@0.16.1
33
+
3
34
  ## 0.17.2
4
35
 
5
36
  ### Patch Changes