warm-worktrees 0.0.0-stage → 0.1.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 (42) hide show
  1. package/BENCHMARKS.md +179 -0
  2. package/GUIDE.md +343 -0
  3. package/LICENSE.md +21 -0
  4. package/README.md +79 -2
  5. package/bench/results/adobe.json +1739 -0
  6. package/bench/results/build-lifecycle.json +1618 -0
  7. package/bench/results/cache-selection.json +3155 -0
  8. package/bench/results/cache-tuning.json +1554 -0
  9. package/bench/results/cargo-cache-scans.json +522 -0
  10. package/bench/results/cargo-snapshot-storage.json +1068 -0
  11. package/bench/results/checkout-selection.json +157 -0
  12. package/bench/results/compiler-seeds.json +634 -0
  13. package/bench/results/concurrent-publication.json +7999 -0
  14. package/bench/results/directory-export.json +4501 -0
  15. package/bench/results/firefox-checkout-control.json +4160 -0
  16. package/bench/results/four-worktrees.json +594 -0
  17. package/bench/results/incremental-cache-directories.json +555 -0
  18. package/bench/results/ninja.json +2133 -0
  19. package/bench/results/output-delivery.json +719 -0
  20. package/bench/results/per-checkout-archives.json +7044 -0
  21. package/bench/results/pool-maintenance.json +447 -0
  22. package/bench/results/rebuild-latency.json +138 -0
  23. package/bench/results/seed-scenarios.json +295 -0
  24. package/bench/results/snapshot-reclamation.json +885 -0
  25. package/bench/results/snapshot-writers.json +46 -0
  26. package/bench/results/source-mirror.json +150 -0
  27. package/bench/results/startup.json +703 -0
  28. package/bench/results/swift-scenarios.json +173 -0
  29. package/bench/results/upstream/firefox-ios.json +2395 -0
  30. package/bench/results/upstream/ripgrep.json +3275 -0
  31. package/bench/results/upstream/swift-syntax.json +2305 -0
  32. package/bench/results/upstream/vscode-seeded.json +3181 -0
  33. package/bench/results/upstream/vscode.json +2121 -0
  34. package/dist/Commander-LICENSE +22 -0
  35. package/dist/JSON5-LICENSE +23 -0
  36. package/dist/Zod-LICENSE +21 -0
  37. package/dist/benchmark.js +289 -0
  38. package/dist/cli.js +18337 -0
  39. package/dist/warm-copy.node +0 -0
  40. package/docs/assets/worktrees-cargo.png +0 -0
  41. package/package.json +55 -4
  42. package/profiles.json5 +82 -0
package/README.md CHANGED
@@ -1,3 +1,80 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="docs/assets/worktrees-cargo.png" alt="Cargo compiles both greeting and hello in the direct build but only hello in the Warm build." width="100%" />
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h1 align="center">Warm</h1>
6
+
7
+ <p align="center">Warm is a macOS command-line tool that helps you avoid rebuilding the same dependencies in every Git worktree.</p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/warm-worktrees"><img src="https://img.shields.io/npm/v/warm-worktrees" alt="Latest release on npm" /></a>
11
+ <a href="#run-your-first-build"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2Fwarm-worktrees%2Flatest&amp;query=%24.os%5B%2A%5D&amp;label=platform" alt="Supported operating systems" /></a>
12
+ <a href="#run-your-first-build"><img src="https://img.shields.io/node/v/warm-worktrees" alt="Supported Node.js versions" /></a>
13
+ <a href="LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" /></a>
14
+ </p>
15
+
16
+ - [Run your first build](#run-your-first-build)
17
+ - [How Warm works](#how-warm-works)
18
+ - [User guide](#user-guide)
19
+ - [Development](#development)
20
+ - [Licence](#licence)
21
+
22
+ ## Run your first build
23
+
24
+ On a Mac with Git and Node.js 24.4 or later, install Warm with npm.
25
+
26
+ ```sh
27
+ npm install -g warm-worktrees
28
+ ```
29
+
30
+ Keep using Git or your editor to create worktrees. In each one, put `warm run --` before your usual build or test command. For example, in a Rust project you can run the tests like this.
31
+
32
+ ```sh
33
+ warm run -- cargo test
34
+ ```
35
+
36
+ Warm recognises build directories for Cargo, SwiftPM and Xcode scheme builds without a configuration file. It can also find the build info for a single incremental TypeScript project when you run `tsc` directly. For a custom build, you can [tell Warm which paths to keep](GUIDE.md#project-settings).
37
+
38
+ ## How Warm works
39
+
40
+ Say you're halfway through a feature when someone asks you to test a pull request. You can leave your edits where they are and open the pull request in a second worktree. If you built the feature with `warm run`, use it again in the second worktree so Warm can reuse the build directory. We [timed that second build and measured disk use across both worktrees](BENCHMARKS.md#building-across-worktrees).
41
+
42
+ | Project | Direct build time | Warm build time | Time saved | Direct disk use | Warm disk use | Disk saved |
43
+ | --------------- | ----------------: | --------------: | ---------: | --------------: | ------------: | ---------: |
44
+ | Firefox for iOS | 2 min 43 s | 32 s | 80.4% | 5.80 GiB | 3.21 GiB | 44.8% |
45
+ | SwiftSyntax | 12.69 s | 3.03 s | 76.1% | 387.2 MiB | 211.8 MiB | 45.3% |
46
+ | ripgrep | 4.00 s | 1.50 s | 62.4% | 381.0 MiB | 188.6 MiB | 50.5% |
47
+ | VS Code | 15.34 s | 2.77 s | 81.9% | 848.8 MiB | 440.3 MiB | 48.1% |
48
+
49
+ Warm runs your command in a Git worktree of its own called a _build checkout_. The first build there can take as long as a clean build, but the next worktree can use what your build tool left behind. You can see what Warm reused with `warm explain`.
50
+
51
+ All worktrees in a repository share the same pool of build checkouts. If you're testing two fixes at once or have agents working on separate branches, their builds can [run in parallel](GUIDE.md#set-build-and-disk-limits) in different checkouts. Warm uses APFS copy-on-write clones for your saved files and [reusable caches](GUIDE.md#start-a-new-checkout-with-an-existing-cache), so the copies share disk space until they change.
52
+
53
+ If you usually rebuild in one worktree, your build tool has its previous output and you're better off building there directly. Warm can also save less time when a fresh worktree can reuse most of a build through a [shared cache such as Bazel's](https://bazel.build/remote/caching).
54
+
55
+ ## User guide
56
+
57
+ The [user guide](GUIDE.md) includes a [configuration reference](GUIDE.md#configuration-reference) and covers other ways to use Warm.
58
+
59
+ - [Build directly in your editor with a cache from another worktree](GUIDE.md#keep-a-worktree-open-in-your-editor)
60
+ - [Run a watcher or Git hook in your own worktree](GUIDE.md#run-in-your-own-worktree)
61
+ - [Copy build products back to your worktree](GUIDE.md#return-files-from-a-build)
62
+ - [Install dependencies or generate files before a build](GUIDE.md#prepare-a-build-checkout)
63
+
64
+ For a project-local install, run `npm install warm-worktrees` in the project. You can then [call Warm from a package script](GUIDE.md#use-warm-in-a-project-script) so everyone can keep using the project's usual command.
65
+
66
+ ## Development
67
+
68
+ To try changes to Warm, install the Xcode Command Line Tools and then build and link the CLI from the Warm repository.
69
+
70
+ ```sh
71
+ npm ci
72
+ npm run build
73
+ npm link
74
+ ```
75
+
76
+ Your `warm` command now uses the local build. After an edit, `npm test` rebuilds the CLI and runs the tests. See the [development guide](GUIDE.md#development) for the other CI checks and packaging commands.
77
+
78
+ ## Licence
79
+
80
+ Warm is available under the [MIT licence](LICENSE.md).