rex-worktrees 0.4.0 → 0.4.4

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 CHANGED
@@ -1,173 +1,127 @@
1
1
  # Rex Worktrees
2
2
 
3
- Rex Worktrees opens Git worktrees or Jujutsu (JJ) workspaces in an exact [Rex](https://www.superlogical.com/rex/docs) session on this machine or an existing Rex host. Its keyboard-driven chooser runs in a floating Rex terminal. Rex manages hosts, connections, and sessions; this tool creates or selects a checkout and opens a shell there. When a selected logical project has no directory on the destination, the chooser can clone published history and open it there.
3
+ A keyboard-driven [Rex](https://www.superlogical.com/rex/docs) plugin for opening and creating **Git worktrees** and **Jujutsu (JJ) workspaces**. Pick a project, machine, checkout, and session; it opens a shell there. No agent or model required.
4
+
5
+ <img width="693" height="236" alt="image" src="https://github.com/user-attachments/assets/fadd8e3c-30fc-4f94-98ca-41132a23ff36" />
4
6
 
5
7
  ## Install
6
8
 
7
- Standalone binaries are built for Apple Silicon Macs running macOS 15 or later and Linux x64 (Ubuntu 24.04 CI runner). Git 2.42 or later, the Rex CLI, and a running local Rex server are required for interactive use; JJ projects additionally require Jujutsu 0.46 or later. Node.js and npm are needed only to install the macOS ARM64 npm package, not to run either standalone executable; Bun is not required.
9
+ Requires Rex and its CLI, a running Rex server, and Git 2.42+. JJ projects also need Jujutsu 0.46+. Standalone builds support Apple Silicon macOS 15+ and Linux x64; no Bun runtime is needed.
8
10
 
9
- ### npm
11
+ **Install or update on macOS (Apple Silicon):**
10
12
 
11
13
  ```sh
12
14
  npm install -g rex-worktrees
13
- rex-worktrees setup --bin "$(npm root -g)/rex-worktrees/dist/rex-worktrees"
15
+ rex-worktrees setup
14
16
  rex config reload
15
17
  ```
16
18
 
17
- `--bin` registers the executable in the global npm package rather than copying it, so the path continues to work after package upgrades under the same npm global prefix. After an upgrade, repeat setup and `rex config reload` to update the Rex integration.
18
-
19
- ### GitHub Releases
19
+ npm installs the CLI; `setup` registers the Lua plugin with Rex and copies its executable to `~/.local/bin/rex-worktrees` for the plugin to use. No executable path is needed. Run setup from a shell that can find `rex`, `git`, and optionally `jj`; unrelated Rex settings are preserved. Repeat all three commands to update.
20
20
 
21
- Download both `rex-worktrees-macos-arm64.tar.gz` and `rex-worktrees-linux-x64.tar.gz` plus `SHA256SUMS` from [the latest GitHub Release](https://github.com/samuelho-dev/rex-worktrees/releases/latest). Verify them with `shasum -a 256 -c SHA256SUMS` (or `sha256sum -c SHA256SUMS` on Linux), then extract the archive for your platform to a permanent location. Run setup with the absolute path to the extracted executable:
21
+ **Without npm / Linux:** download your platform's archive from [GitHub Releases](https://github.com/samuelho-dev/rex-worktrees/releases/latest), verify it against `SHA256SUMS`, and extract it. From the extracted directory:
22
22
 
23
23
  ```sh
24
- /absolute/path/to/rex-worktrees setup --bin /absolute/path/to/rex-worktrees
25
- rex config reload
24
+ ./rex-worktrees setup && rex config reload
26
25
  ```
27
26
 
28
- Keep the executable at that path when replacing it with a newer release, then repeat setup and `rex config reload`. Each platform archive contains the relinkable bundle and license notices described below. The stable asset names can be fetched through `releases/latest/download/` without pinning a release version.
27
+ Setup copies the executable to the same stable location, so the extracted directory is not needed afterward. `setup --bin /absolute/path/to/rex-worktrees` is only for keeping an executable at a custom or package-managed location.
29
28
 
30
- ### Build from source
29
+ ## Use
31
30
 
32
- Building requires Bun 1.3.13. From a source checkout, run:
31
+ Open **Open Worktree…** from the Rex palette, or run:
33
32
 
34
33
  ```sh
35
- bun install --frozen-lockfile
36
- bun run build
37
- ./dist/rex-worktrees setup
38
- rex config reload
34
+ rex do worktrees_open
39
35
  ```
40
36
 
41
- Source-build setup copies the executable to `~/.local/bin/rex-worktrees`; `setup --bin PATH` instead registers an existing executable without copying or modifying it. Add `~/.local/bin` to `PATH` for source-build CLI use.
37
+ 1. **Project:** select a discovered project or type an absolute repository path.
38
+ 2. **Machine:** choose this machine or an existing Rex host.
39
+ 3. **Checkout / Workspace:** select an existing checkout, or type a new Git branch or JJ workspace name. New JJ workspaces also need a **Start from** revision; a valid `trunk()` is selected automatically.
40
+ 4. **Session:** select an existing session, or type a name to create one.
41
+ 5. Choose **Open / Create / Clone** or press **Ctrl+S** from the form.
42
42
 
43
- All installation methods place the Lua module beside the active Rex config and add a managed registration without replacing unrelated config. Setup needs `rex` on `PATH`, or `REX_BIN_DIR` set to its absolute directory. Setup from uncompiled source is not supported. Setup records **this host's executable search `PATH`** for stored Rex actions, whose server-side process may otherwise lack shell-installed tools; run setup from a shell that can find Git and, for JJ projects, `jj`, then `rex config reload`. Repeat setup and reload after changing the tools' search path. Each execution machine needs its own helper installation and, for JJ projects, its own JJ and Git installations; setup does not pair or deploy to another host. The source machine also needs the helper to inspect clone sources.
43
+ **Mode** reuses a matching tab by default; choose a new tab or split instead. New Git checkouts can have a custom **Directory** name, separate from the branch.
44
44
 
45
- For a stopped Rex server or an image built before Rex starts, run `rex-worktrees setup --config /absolute/path/to/rex/init.lua --bin /absolute/path/to/rex-worktrees`. This uses that explicit config without calling `rex config check`, starting Rex, or reloading it; its managed action registration is loaded when Rex next starts. The file must be a regular file or absent (not a symlink), and the Rex CLI must still be installed in `PATH` or `REX_BIN_DIR` so its directory can be recorded. The managed registration preserves unrelated Lua settings and is safe to repeat.
45
+ Shells and interactive Git/JJ clones stay attached to the destination terminal. The shell comes from `$SHELL`, falling back to `/bin/sh`.
46
46
 
47
- To update a source build, rebuild and repeat setup and config reload. To uninstall, locate the active Rex config with `rex config check --json`, remove the section from `-- BEGIN rex-worktrees` through `-- END rex-worktrees`, and delete `rex-worktrees.lua` beside that config. Remove the executable with `npm uninstall -g rex-worktrees`, or delete the standalone executable or `~/.local/bin/rex-worktrees` for other installations, then run `rex config reload`. Git worktrees, JJ workspaces, and association state are retained.
47
+ | Key | Action |
48
+ | --- | --- |
49
+ | Tab / Shift+Tab | Move between fields and buttons |
50
+ | ↑ / ↓ | Navigate fields or choices |
51
+ | Enter | Edit a field, accept its value, or activate a focused button |
52
+ | Ctrl+S | Submit the form; inside an editor, only accept that field |
53
+ | Esc | Leave the editor, or close the form |
54
+ | PageUp / PageDown | Scroll long details |
48
55
 
49
- ## Open a worktree
50
-
51
- Choose **Open Worktree…** in the Rex palette or run:
52
-
53
- ```sh
54
- rex do worktrees_open
55
- ```
56
-
57
- No keyboard shortcut is installed by default. To add one, put an unused native binding outside the managed section of your Rex config:
56
+ Optional shortcut—add outside the managed section of your Rex config, then reload:
58
57
 
59
58
  ```lua
60
59
  rex.bind("ctrl+alt+w", "worktrees_open")
61
60
  ```
62
61
 
63
- For a manual Lua installation, supply an absolute executable path with `require("rex-worktrees").setup({ bin = "/absolute/path/to/rex-worktrees" })`.
64
-
65
- The chooser is one flat form: **Project**, **Machine**, **Checkout** (or **Workspace**), **Session**, and **Mode** for an ordinary open. Only applicable fields appear; there is no Options menu. Machine is always explicit:
66
-
67
- - **Project:** select a known Git or JJ project, type a project name, or enter an absolute repository path. Linked checkouts appear under their canonical project. After an explicit project selection, the inspected checkout on the chosen machine is selected by default when available; a same-named directory on another host is never assumed to be that checkout.
68
- - **Machine:** select this machine or an existing Rex host. Changing machines keeps the logical project choice but clears host-bound checkout, base, clone destination, and session bindings; select or enter an actual project directory on the destination. The selected machine appears immediately with a disabled loading form while its connection and project choices are fetched; previous-machine checkout and session choices are not available during the wait.
69
- - **Checkout / Workspace:** Git offers exact existing checkout paths and branches together. Selecting a checkout opens that path; typing a branch name attaches a free branch or creates that branch and its checkout, while an occupied branch opens its existing checkout. Typed branch text is never a directory name. For a new Git branch, the form also shows **Directory**, an independent optional checkout directory name; select **Use default** to clear a custom name. JJ offers registered workspaces, including unavailable locations (visible but not openable), or a name for a new workspace. New JJ workspaces show **Start from**; an existing JJ workspace opens unchanged without it.
70
- - **Clone to:** when cloning a project, the form displays the literal absolute destination path; editing it changes only that destination. **Branch** (Git) or **Start from** (JJ) and an optional separate **Directory** (Git) or **Workspace** (JJ) name are visible on the same form. A Git clone without a default branch requires a branch choice. Select **Use default** to clear the optional checkout name; typing `none` is a literal name, not a clearing command. A project name unsafe as a directory requires an absolute destination. Destination collisions and writability errors appear on submit without opening a task, and the destination remains editable.
71
- - **Session:** select an existing session by its exact ID, or type a name to create a new session on the selected machine. A typed name remains new even if an existing session has the same label; the form shows **New: NAME** before submission. An empty session list still permits typing a name. Names must be nonblank, at most 128 characters, and contain no ASCII control characters.
72
-
73
- **Mode** for an ordinary open reuses a matching live tab, opens another tab, or splits a matching task; a split without a matching task opens a new tab. Cloning always starts a new tab, so it has no Mode field. New JJ workspaces default **Start from** to the repository-configured `trunk()` mainline when it resolves to one valid commit; otherwise choose a source candidate or type a singular revision. A selected bookmark or revision overrides the default and pins its full commit ID without changing the entered workspace name. A JJ clone can use its native default or select/type a source revision resolved on the source machine. Bookmarks are optional and never created automatically. Source-only unpublished JJ changes and unpushed Git branches are unavailable to a destination clone.
74
-
75
- Use arrows or `j`/`k` to move, Tab/Shift+Tab to change fields, and Enter to edit or select the form action. In an editor, Enter or Ctrl+S **only accepts that field** and returns to the form; it never reviews or launches. Submit explicitly from the form: the first submit validates the current plan and opens or creates the selected checkout, JJ workspace, clone, or new session when there is no warning. A warning, display limitation, or reviewed path differing from an explicitly selected existing checkout shows the actual plan and requires another submit; if a previously reviewed plan changes, its updated destination or target is shown and must be submitted again. Clone validation includes the source URL and destination; only pushed history transfers. No agent or model is required; the task opens a shell.
76
-
77
- The form adds no extra spacing between its side borders and content; selection gutters remain visible.
62
+ ### Add projects
78
63
 
79
- ## Projects and checkout locations
80
-
81
- Configuration is optional and belongs in the **execution machine's Rex `init.lua`**, in the managed registration installed by setup:
64
+ Without configuration, the current pane's repository is suggested. To list more projects, edit the existing registration in your Rex `init.lua`, then run `rex config reload`:
82
65
 
83
66
  ```lua
84
- -- BEGIN rex-worktrees
85
67
  require("rex-worktrees").setup({
86
- projects = {
87
- "/absolute/path/to/project",
88
- { path = "/absolute/path/to/another-project", worktreeRoot = "/absolute/path/to/another-project-checkouts" },
89
- },
68
+ projects = { "/absolute/path/to/project" },
90
69
  roots = { "/absolute/path/to/projects" },
91
- worktreeRoot = "/absolute/path/to/checkouts",
92
70
  })
93
- -- END rex-worktrees
94
71
  ```
95
72
 
96
- `projects` explicitly registers paths; optional `roots` scans two directory levels for projects. Without either, the originating Rex pane's directory (or the CLI caller's directory) can suggest its Git or JJ project, but no parent directory is scanned. A local directory suggestion is not sent to another machine: paths typed in the form are interpreted on the selected destination. For a known project missing there, the proposed clone directory uses that machine's first configured root, otherwise the parent of its last successful clone, otherwise the one common parent of discovered projects, otherwise its home directory. This default never scans the home directory and can be changed in **Clone to**. A successful clone remembers its destination parent; editing or reviewing one does not. Git and JJ, not configuration, determine their existing checkouts and branches/revisions. Existing valid directories continue through ordinary open.
97
-
98
- Setup leaves user-owned `setup({...})` settings untouched on upgrades, whether inside or outside the `-- BEGIN rex-worktrees` markers; it never appends a second registration to an existing unmarked `require("rex-worktrees")` configuration. Its installed binary path lives in the managed module, so no `bin` setting is needed. An explicit `bin` option overrides that installed path. After editing `init.lua`, run `rex config reload` on that machine. A default setup invocation migrates the former `${XDG_CONFIG_HOME:-~/.config}/rex-worktrees/config.json` to native Lua settings, resolving relative paths against the old JSON directory. Only after native installation succeeds does it remove `config.json`, any old `config.json.backup`, and the old directory if empty; other files in that directory are untouched. If user-owned Lua registration conflicts with legacy JSON, setup stops before making changes: transfer the legacy values into your registration, back up and remove the JSON file yourself, then rerun. `setup --config` targets an explicit Rex init and never migrates or removes the current user's JSON file. Runtime association state remains separate at `${XDG_STATE_HOME:-~/.local/state}/rex-worktrees/associations`.
99
-
100
- For a popup launched from a Rex pane on this machine, the chooser checks that exact pane's reported directory (a local OSC 7 `file://` URI or absolute path). If that directory is absent or its URI is not trusted as local, it uses the same verified pane's foreground process `cwd` when available. A remote pane or foreign URI is never treated as a local path. Context can legitimately be absent if the pane has no usable local directory, or the directory is not inside a Git or JJ repository; select or enter a project in that case. `--no-context` explicitly disables origin discovery.
101
-
102
- New checkout location follows this order: a project's `worktreeRoot/<name>`, the global `worktreeRoot/<primary-project-name>/<name>`, or, by default, a sibling `<main-checkout>.worktrees/<name>`. `~` refers to the destination user's home; relative paths resolve against that machine's Rex config directory (the directory containing `init.lua`). Checkout locations must be outside existing checkouts and version-control metadata. Collisions and escaping paths are rejected rather than renamed. JJ's own `git.colocate` setting governs whether its workspace also has Git metadata; the helper does not emulate colocation.
103
-
104
- ## CLI
105
-
106
- ```sh
107
- rex-worktrees popup
108
- rex-worktrees launch-popup --session session:FULL-ID
109
- rex-worktrees launch-popup --session session:FULL-ID --host workstation
110
-
111
- rex-worktrees open --repo /absolute/path/project \
112
- --branch feature/name --worktree-name feature-task \
113
- --session session:FULL-ID --name Feature
114
-
115
- rex-worktrees open --host workstation --repo /destination/path/project \
116
- --worktree /destination/path/existing-checkout \
117
- --session session:DESTINATION-ID --name Existing
73
+ Both settings are optional. `projects` lists repositories explicitly; `roots` discovers them up to two directory levels deep. New checkouts default to a sibling `<repository>.worktrees/<name>` directory. Set `worktreeRoot` globally or on a project object (`{ path = "…", worktreeRoot = "…" }`) to override it. Setup preserves these settings on upgrades and migrates the former JSON configuration.
118
74
 
119
- rex-worktrees open --repo /absolute/path/jj-workspace \
120
- --revision 'main@origin' --worktree-name task \
121
- --session session:FULL-ID --name Task
122
- ```
123
-
124
- Standalone CLI invocations obtain settings from the execution machine's native `worktrees_config` Rex action; register `require("rex-worktrees").setup(...)` there and reload Rex first. An unregistered action is an error, not a fallback to the former JSON file. The popup and Rex action paths pass those settings directly to the destination helper.
75
+ ### Other machines
125
76
 
126
- `popup` runs the chooser in the invoking terminal; `launch-popup` opens its floating UI in the source Rex window. For `launch-popup` from an external terminal, supply `--session`; inside Rex, the originating session is available automatically. The `worktrees_open` shortcut delegates to the originating Rex server when invoked from a remote tab, so its popup and helper run on that machine. `launch-popup --host` keeps the UI on the caller's server while selecting another execution host. `--host` accepts an existing Rex host label or registry ID; find exact destination session IDs with `rex -S HOST ls --json`. `open --session` still requires an existing exact ID; new-session naming is available in the popup. Remote `--repo` and `--worktree` paths must be absolute paths on the destination.
77
+ Install and run setup on each execution machine, with matching plugin versions and local Git/JJ tools. Connect the host through Rex first. Paths and configuration belong to the selected machine.
127
78
 
128
- `open` detects Git or JJ at `--repo`; no VCS switch is needed. Git accepts `--branch` or `--worktree`, with `--worktree-name` for a new branch checkout. JJ accepts `--worktree` for an existing workspace, or `--revision` plus `--worktree-name` for a new workspace. `--repo` is the actual invoking JJ workspace on the destination: relative revisions such as `@-` resolve there, and creating a new workspace may snapshot it. `--name` independently labels the tab or pane. By default, a matching live tab is reused; `--additional` opens another tab, and `--split` splits a matching task or falls back to a new tab. These two flags cannot be combined. `--client ID` selects an exact Rex app client when needed. See `rex-worktrees --help` for popup origin/context flags.
79
+ The chooser can clone a known project to another directory or host. Only pushed history transfers—not uncommitted work, unpublished changes, or credentials. Cross-host execution and cloning are experimental; live remote Linux destinations have not been verified.
129
80
 
130
- ## Safety and limits
81
+ ## Safety
131
82
 
132
- A submitted checkout or clone task can continue after the chooser closes, and closing a tab does not delete its checkout or clone. If a launch times out or Rex reports an uncertain result, inspect the destination repository and exact session before retrying; partial/registered JJ workspaces and clone destinations are retained rather than blindly removed or retried. Opening or browsing an existing JJ workspace does not snapshot, edit, update-stale, rebase, or move bookmarks. **Creating a JJ workspace invokes native `jj workspace add`, which may snapshot the actual source workspace and change its JJ working-copy commit and Git index intent-to-add entries**; the review notice names that source. Git worktrees keep their separate files, HEAD, and index while sharing refs, objects, remotes, and config. The tool does not force checkout, switch, stash, reset, clean, or prune. A cross-host clone transfers only published Git history from the source origin, not uncommitted files, local-only commits/branches/changes, source credentials, or environment. An explicitly pinned JJ base must be reachable after destination clone or the retained clone requires inspection; omitting a pin uses the clone's native default. Destination credentials and network access must work independently. Shells are not confined to the checkout. Associations live per destination at `${XDG_STATE_HOME:-~/.local/state}/rex-worktrees/associations`; Git/JJ inventory remains authoritative if an association becomes stale.
83
+ - Existing checkouts open unchanged. The plugin does not switch, reset, stash, clean, or delete your work.
84
+ - **Creating a JJ workspace runs `jj workspace add`, which may snapshot its source workspace.**
85
+ - Closing the chooser or a tab does not delete a checkout or stop an already-submitted task.
86
+ - If a launch times out or says **needs inspection**, inspect the destination and session before retrying; a task may already exist.
133
87
 
134
- New Rex sessions are created only on form submission, after plan validation and any required confirmation. If the tab or focus step fails, inspect the retained session before retrying; neither sessions nor checkouts are automatically deleted or blindly retried.
88
+ ## CLI and development
135
89
 
136
- The release workflow builds and checks macOS ARM64 and Linux x64 executables in their native CI runners, including Git/JJ integration tests and malformed-request smoke checks. Linux destinations have not been verified against a live remote Rex/JJ setup; cross-host execution and cloning remain experimental. Each execution machine requires a matching Rex Worktrees build (older helper protocols are rejected), its own Git/JJ executables as applicable, and a connected Rex host. Native app navigation requires Rex Remote Control permission. Local endpoints must be Unix endpoints; Windows named pipes are not supported. For a custom local Unix server, set `REX_WORKTREES_LOCAL_ENDPOINT=unix:///absolute/path/server.sock` in the plugin environment.
90
+ Run `rex-worktrees --help` for direct `open` commands and host/session options. `rex-worktrees popup` runs the chooser in the current terminal.
137
91
 
138
- ## Contributing
92
+ Build from source with Bun 1.3.13:
139
93
 
140
94
  ```sh
141
- bun install
95
+ bun install --frozen-lockfile
142
96
  bun run check
143
97
  bun run test
144
98
  bun run build
99
+ ./dist/rex-worktrees setup
100
+ rex config reload
145
101
  ```
146
102
 
147
- ## License and runtime sources
103
+ Source-build setup installs to `~/.local/bin/rex-worktrees`. To uninstall, remove the `BEGIN rex-worktrees` / `END rex-worktrees` section and adjacent `rex-worktrees.lua` from your active Rex config (`rex config check --json`), remove the executable, and reload. Repositories are retained.
148
104
 
149
- Project code is [MIT-licensed](LICENSE). The standalone executable embeds Bun; bundled components retain their upstream licenses, reproduced in [the third-party notices](licenses/THIRD-PARTY-NOTICES). Normal use requires no Bun installation or runtime source files.
105
+ Releases publish the tested macOS archive to npm through GitHub Actions OIDC, then verify registry version and tarball integrity. The npm trusted publisher must authorize `samuelho-dev/rex-worktrees`, workflow `release.yml`, for direct publishing; no npm token is used. Tag a matching package version (`vX.Y.Z`) to release.
150
106
 
151
- <details>
152
- <summary>Rebuilding with a modified runtime</summary>
107
+ Registry verification allows up to 120 checks, ten seconds apart, for npm processing. Publishing is not retried; an integrity mismatch still fails the release.
108
+
109
+ ## License
153
110
 
154
- Each application [release](https://github.com/samuelho-dev/rex-worktrees/releases) includes the relinkable `rex-worktrees.js` bundle, README, MIT license, and third-party notices in its binary archive. The matching Bun 1.3.13 runtime sources are available from the fixed [runtime-source release (v0.1.1)](https://github.com/samuelho-dev/rex-worktrees/releases/tag/v0.1.1): [Bun source](https://github.com/samuelho-dev/rex-worktrees/releases/download/v0.1.1/bun-1.3.13-source.tar.gz), [WebKit/JavaScriptCore source](https://github.com/samuelho-dev/rex-worktrees/releases/download/v0.1.1/bun-webkit-source.tar.gz), and [tinycc source](https://github.com/samuelho-dev/rex-worktrees/releases/download/v0.1.1/bun-tinycc-source.tar.gz). Each release's `SHA256SUMS` covers its own downloadable assets; use [v0.1.1 checksums](https://github.com/samuelho-dev/rex-worktrees/releases/download/v0.1.1/SHA256SUMS) for runtime sources.
111
+ [MIT](LICENSE). Standalone builds embed Bun; see [third-party notices](licenses/THIRD-PARTY-NOTICES).
112
+
113
+ <details>
114
+ <summary>Runtime sources and rebuilding</summary>
155
115
 
156
- Runtime source revisions are Bun 1.3.13 (`bf2e2cecf27e800962b1e7f03d66278f9d5d2e79`), WebKit (`4d5e75ebd84a14edbc7ae264245dcd77fe597c10`), and tinycc (`12882eee073cfe5c7621bcfadf679e1372d4537b`). Rebuilding requires the toolchain described in [Bun's contributing guide](https://github.com/oven-sh/bun/blob/bun-v1.3.13/CONTRIBUTING.md), including its LLVM requirements.
116
+ Release archives include the relinkable `rex-worktrees.js` bundle. Matching Bun 1.3.13, WebKit, and tinycc sources and checksums are in the [runtime-source release](https://github.com/samuelho-dev/rex-worktrees/releases/tag/v0.1.1). Extract all three source archives, placing WebKit at `bun-source/vendor/WebKit` and tinycc at `bun-source/vendor/tinycc` (strip each archive's top-level directory).
157
117
 
158
- Extract the Bun source and matching library snapshots, make the desired library changes, then rebuild the runtime and application:
118
+ Follow [Bun's build prerequisites](https://github.com/oven-sh/bun/blob/bun-1.3.13/CONTRIBUTING.md), then run in `bun-source`:
159
119
 
160
120
  ```sh
161
- mkdir -p bun-source/vendor/WebKit bun-source/vendor/tinycc
162
- tar -xzf bun-1.3.13-source.tar.gz -C bun-source --strip-components 1
163
- tar -xzf bun-webkit-source.tar.gz -C bun-source/vendor/WebKit --strip-components 1
164
- tar -xzf bun-tinycc-source.tar.gz -C bun-source/vendor/tinycc --strip-components 1
165
- cd bun-source
166
121
  bun install --frozen-lockfile
167
122
  GIT_SHA=bf2e2cecf27e800962b1e7f03d66278f9d5d2e79 bun run build:release:local
168
- ./build/release-local/bun build /absolute/path/to/rex-worktrees.js \
169
- --compile --outfile /absolute/path/to/rex-worktrees-relinked
170
- codesign --force --sign - /absolute/path/to/rex-worktrees-relinked
123
+ ./build/release-local/bun build /absolute/path/to/rex-worktrees.js --compile --outfile /absolute/path/to/rex-worktrees-relinked
124
+ codesign --force --sign - /absolute/path/to/rex-worktrees-relinked # macOS only
171
125
  ```
172
126
 
173
127
  </details>
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/rex-worktrees
3
3
  size: 64491792 bytes
4
- sha256: 64000e1b797b1ed3c24ee7f9adaaec560f28f4c2a34726498cf5598d843abc89
4
+ sha256: 3b5a2d72d0cdaf0ae7a5740652b6c35fbefcb5dc70443b7fc4da973ff1f36937