Skip to content

Releases: cruzzed/wtbs

0.5.1 — issue sweep: env strap double-run, valet parked-path symlinks

Choose a tag to compare

@cruzzed cruzzed released this 07 Oct 07:35
f2a4d4f

Fixes from v0.5.0 dogfooding. Suite: 165/165 bats green.

Fixed

  • #18 — declaring the project env strap in straps: ran it twice per lifecycle (and fataled dry-run on fresh projects). The core-managed env strap is now filtered from the declared-strap resolution with a warning; run_env_strap remains its single runner.
  • #19 — the valet strap's short-name symlink landed in dirname(worktree), which valet never scans when repos are reached through a symlink in a parked dir. valet-site now discovers the parked path that serves the main repo from the valet config's paths[] and places/removes the symlink there (falling back to the worktree parent; unsecure cleans both locations).

Verified / closed

  • #17 — destroy already removes the per-branch state file and registry row; a regression test pins it. Residue on the reporter's synced tree came from their sync setup (deletions resurrected) — closed as an environment quirk.
  • #13 — long valet names taking nginx down was fixed in 0.4.0 by valet-site's deterministic short-name truncation; closing as completed.

0.5 — straps own env writing; copy becomes a residue mirror

Choose a tag to compare

@cruzzed cruzzed released this 06 Oct 06:20
f2a4d4f

Breaking clean break from the 0.4 config surface (ADRs 0007–0008). Suite: 159 bats tests green.

Env writing moves to straps (ADR-0007)

  • The env: block is deleted from the core config. Straps own every .env write, via the new core-lent helpers (source "$WTBS_LIB_DIR/strap-lib.sh"): wtbs_env_set, wtbs_state_set, wtbs_state_get — all dry-run aware.
  • Bundled db straps write DB_DATABASE directly; the project's own keys belong to the project env strap (.wtbs/straps/env/, scaffolded automatically).
  • On activation, activated bundled straps are published into the project's .wtbs/straps/ — the project owns its copies; bundled becomes seed material. Skip with --no-publish / publish: false.

Copy becomes a git-aware residue mirror (ADR-0008)

  • copy: [file, …] lists are gone. All untracked files (including gitignored ones like .env) mirror from the main repo into the worktree, seed-only (never overwrites).
  • Exclusions via copy.ignore: in the yml and/or a .wtbsignore file (gitignore-style, both honored). .git and .wtbs/ always skipped.

Migrating from 0.4: env: entries become wtbs_env_set lines in .wtbs/straps/env/create; drop your copy: list and add copy.ignore: for node_modules/vendor/… instead. Legacy keys fail fast with pointers.

0.4 — straps are self-contained directories

Choose a tag to compare

@cruzzed cruzzed released this 06 Oct 06:19
f2a4d4f

Clean-break rewrite around the strap model (ADRs 0001–0006):

  • Technology-blind core: the core owns nouns (worktree, branch, names, state), never verbs — anything stack-specific lives in straps.
  • Straps are self-contained directories (scripts + private strap.yml), activated by name with optional params: straps: [valet, "auto-ports(serve:8000)"].
  • Ports de-cored into the auto-ports strap; the offset column left the core registry.
  • One-directional attachment: the boot attaches to the project, never vice versa.
  • Renamed worktree-bootstrap → wtbs (transitional shim installed).

Note: tagged retroactively — 0.4 shipped on the v0.4 branch without a release.

0.3

0.3

Choose a tag to compare

@cruzzed cruzzed released this 06 Sep 05:20
f2a4d4f

What's new

exec: run commands inside a worktree from the main repo

worktree-bootstrap feature/x test              # shorthand
worktree-bootstrap exec feature/x runserver    # explicit form
worktree-bootstrap exec feature/x              # list presets + aliases

Commands run with the worktree as cwd, its .env exported, and its .venv/bin / vendor/bin / node_modules/.bin on PATH. Exit codes propagate — composes with scripts, CI, and coding agents driving many worktrees in parallel.

Resolution order:

  1. .wtbs/<name> preset script (Django-management-command style; worktree checkout shadows the main repo's). Extra args arrive as "$@"; the template context is exported as WTBS_* env vars (WTBS_PORT_SERVE, WTBS_DB_NAME, WTBS_SITE, …) instead of template rendering, and trailing CR is stripped so core.autocrlf=true checkouts can't corrupt presets.
  2. aliases: one-liners in .worktree-bootstrap.yml, rendered with the same template tokens as commands.*; extra args appended.
  3. Raw command run verbatim (still template-rendered).

Other changes

  • For exec/shorthand, global flags (--dry-run, --main-repo, --config) must come before the worktree name; everything after passes through verbatim.
  • README: project vision ("make worktrees as convenient as working in the parent project") and the agentic parallel-development use case.
  • Examples and built-in defaults scrubbed of project-specific details: examples/pixalink.yml → generic laravel.yml, archive/ removed, copy_from_main defaults to just .env, name_prefix default changed explore_ → wt_.
  • 15 new bats tests; full suite green (94/94).

Full Changelog: v0.2.0...v0.3.0

0.2

0.2

Choose a tag to compare

@cruzzed cruzzed released this 22 Aug 06:36
e4f2fcd

Summary

Release 0.2 — resolves all nine open issues.

  • #1 — create creates the branch when it doesn't exist yet (git worktree add -b), with optional --base <ref> and a clear info message
  • #2 — scriptable DB lifecycle: database.create/database.drop commands (rendered with the full template context) replace driver dispatch when present; first-class driver: none disables DB handling silently; unknown drivers fail cleanly instead of command not found
  • #3 — create --dry-run renders the full plan: resolved driver, db name, rendered env_updates, allocated offset/ports, and every install/build/serve/destroy command — with no side effects (registry untouched)
  • #4 — global flags accepted in any position (create --dry-run feature/x works)
  • #5 — report reflects what actually happened: skipped DB steps shown as skipped (<reason>), unreferenced ports grouped as allocated-but-unused; name_prefix default documented
  • #6 — no unconditional Laravel env keys: APP_PORT/FORWARD_DB_PORT/VITE_PORT only apply as defaults when no env_updates are defined; DB_DATABASE only written for real drivers
  • #7 — template context expanded: {db_name}, {worktree_root}, {main_repo}, and {env.KEY} references to existing env values (dry-run resolves them against the main repo's .env)
  • #8 — preflight fails fast when hook scripts referenced in commands.*/database.* are missing from the worktree checkout
  • #9 — destroy runs git worktree prune so branches are deletable immediately; new --delete-branch flag

Tests

  • 11 new bats tests (78 total, all passing): flags-in-any-position, full dry-run plan, preflight fail-fast, prune/delete-branch, command-based DB lifecycle, driver: none, unknown-driver handling, template context, {env.KEY} refs
  • README and --help updated for all new behavior

Closes #1, closes #2, closes #3, closes #4, closes #5, closes #6, closes #7, closes #8, closes #9