@j178/prek 0.2.30 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ Released on 2026-01-22.
6
+
7
+ ### Highlights
8
+
9
+ - `prek cache gc` (also available via `prek gc` for pre-commit compatibility) is finally here! You can now run `prek cache gc` to clean up unused repos, hook envs and tool versions from prek cache.
10
+
11
+ - `language: bun` is now supported, making it possible to write and run hooks with [Bun](https://bun.sh/).
12
+
13
+ ### Enhancements
14
+
15
+ - Implement `prek cache gc` ([#1410](https://github.com/j178/prek/pull/1410))
16
+
17
+ - Bootstrap tracking configs from workspace cache ([#1417](https://github.com/j178/prek/pull/1417))
18
+ - Show total size `prek cache gc` removed ([#1418](https://github.com/j178/prek/pull/1418))
19
+ - Show accurate repo and hook details in `prek cache gc -v` ([#1420](https://github.com/j178/prek/pull/1420))
20
+ - `prek cache gc` remove specific unused tool versions ([#1422](https://github.com/j178/prek/pull/1422))
21
+ - Fix unused tool versions not removed in `prek cache gc` ([#1436](https://github.com/j178/prek/pull/1436))
22
+
23
+ - Add `language: bun` support ([#1411](https://github.com/j178/prek/pull/1411))
24
+
25
+ - Use `git ls-remote --tags` to list bun versions ([#1439](https://github.com/j178/prek/pull/1439))
26
+
27
+ - Accept `--stage` as an alias for `--hook-stage` in `prek run` ([#1398](https://github.com/j178/prek/pull/1398))
28
+
29
+ - Expand `~` tilde in `PREK_HOME` ([#1431](https://github.com/j178/prek/pull/1431))
30
+
31
+ - Support refs to trees ([#1449](https://github.com/j178/prek/pull/1449))
32
+
33
+ ### Bug fixes
34
+
35
+ - Avoid file lock warning for in-process contention ([#1406](https://github.com/j178/prek/pull/1406))
36
+ - Resolve relative repo paths from config file directory ([#1443](https://github.com/j178/prek/pull/1443))
37
+ - fix: use `split()` instead of `resolve(None)` for builtin hook argument parsing ([#1415](https://github.com/j178/prek/pull/1415))
38
+
39
+ ### Documentation
40
+
41
+ - Add `simple-icons` and `ast-grep` to the users of prek ([#1403](https://github.com/j178/prek/pull/1403))
42
+ - Improve JSON schema for `repo` field ([#1432](https://github.com/j178/prek/pull/1432))
43
+ - Improve JSON schema for builtin and meta hooks ([#1427](https://github.com/j178/prek/pull/1427))
44
+ - Add pronunciation entry to FAQ ([#1442](https://github.com/j178/prek/pull/1442))
45
+ - Add commitizen to the list of projects using prek ([#1413](https://github.com/j178/prek/pull/1413))
46
+ - Move docs to zensical ([#1421](https://github.com/j178/prek/pull/1421))
47
+
48
+ ### Other Changes
49
+
50
+ - Refactor config layout ([#1407](https://github.com/j178/prek/pull/1407))
51
+
52
+ ### Contributors
53
+
54
+ - @shaanmajid
55
+ - @KevinGimbel
56
+ - @jtamagnan
57
+ - @jmeickle-theaiinstitute
58
+ - @YazdanRa
59
+ - @j178
60
+ - @mschoettle
61
+ - @tisonkun
62
+
3
63
  ## 0.2.30
4
64
 
5
65
  Released on 2026-01-18.
@@ -234,7 +294,7 @@ Big thanks to @lmmx for driving this feature!
234
294
  ### Enhancements
235
295
 
236
296
  - Support`--cooldown-days` in `prek auto-update` ([#1172](https://github.com/j178/prek/pull/1172))
237
- - Prefer tag creation timestamp in `--cooldown-days` ([#1221](https://github.com/j178/prek/pull/1221))
297
+ - Prefer tag creation timestamp in `--cooldown-days` ([#1221](https://github.com/j178/prek/pull/1221))
238
298
  - Use `cargo install` for packages in workspace ([#1207](https://github.com/j178/prek/pull/1207))
239
299
 
240
300
  ### Bug fixes
@@ -277,8 +337,8 @@ Want to show your project runs on prek? Add our README badge to your docs or rep
277
337
  ### Enhancements
278
338
 
279
339
  - Support Rust language ([#989](https://github.com/j178/prek/pull/989))
280
- - Refactor Rust toolchain management ([#1198](https://github.com/j178/prek/pull/1198))
281
- - Add support for finding packages in virtual workspaces ([#1180](https://github.com/j178/prek/pull/1180))
340
+ - Refactor Rust toolchain management ([#1198](https://github.com/j178/prek/pull/1198))
341
+ - Add support for finding packages in virtual workspaces ([#1180](https://github.com/j178/prek/pull/1180))
282
342
  - Add `prek cache size` command ([#1183](https://github.com/j178/prek/pull/1183))
283
343
  - Support orphan projects ([#1129](https://github.com/j178/prek/pull/1129))
284
344
  - Fallback to `manual` stage for hooks specified directly in command line ([#1185](https://github.com/j178/prek/pull/1185))
@@ -1155,6 +1215,7 @@ Then uninstall the old `prefligit` and install the new `prek` from scratch.
1155
1215
  - Set `GOROOT` when installing golang hook ([#381](https://github.com/j178/prefligit/pull/381))
1156
1216
 
1157
1217
  ### Other changes
1218
+
1158
1219
  - Add devcontainer config ([#379](https://github.com/j178/prefligit/pull/379))
1159
1220
  - Bump rust toolchain to 1.89 ([#386](https://github.com/j178/prefligit/pull/386))
1160
1221
 
package/README.md CHANGED
@@ -13,21 +13,24 @@
13
13
 
14
14
  </div>
15
15
 
16
- <!-- description:start -->
16
+ <!-- --8<-- [start: description] -->
17
+
17
18
  [pre-commit](https://pre-commit.com/) is a framework to run hooks written in many languages, and it manages the
18
19
  language toolchain and dependencies for running the hooks.
19
20
 
20
21
  *prek* is a reimagined version of pre-commit, built in Rust.
21
22
  It is designed to be a faster, dependency-free and drop-in alternative for it,
22
23
  while also providing some additional long-requested features.
23
- <!-- description:end -->
24
+
25
+ <!-- --8<-- [end: description] -->
24
26
 
25
27
  > [!NOTE]
26
- > Although prek is pretty new, it’s already powering real‑world projects like [Apache Airflow](https://github.com/apache/airflow), [FastAPI](https://github.com/fastapi/fastapi), and more projects are picking it up—see [Who is using prek?](#who-is-using-prek). If you’re looking for an alternative to `pre-commit`, please give it a try—we’d love your feedback!
28
+ > Although prek is pretty new, it’s already powering real‑world projects like [CPython](https://github.com/python/cpython), [Apache Airflow](https://github.com/apache/airflow), [FastAPI](https://github.com/fastapi/fastapi), and more projects are picking it up—see [Who is using prek?](#who-is-using-prek). If you’re looking for an alternative to `pre-commit`, please give it a try—we’d love your feedback!
27
29
  >
28
30
  > Please note that some subcommands and languages are still missing for full drop‑in parity with `pre-commit`. Track the remaining gaps here: [TODO](https://prek.j178.dev/todo/).
29
31
 
30
- <!-- features:start -->
32
+ <!-- --8<-- [start:features] -->
33
+
31
34
  ## Features
32
35
 
33
36
  - 🚀 A single binary with no dependencies, does not require Python or any other runtime.
@@ -35,9 +38,10 @@ while also providing some additional long-requested features.
35
38
  - 🔄 Fully compatible with the original pre-commit configurations and hooks.
36
39
  - 🏗️ Built-in support for monorepos (i.e. [workspace mode](https://prek.j178.dev/workspace/)).
37
40
  - 🐍 Integration with [`uv`](https://github.com/astral-sh/uv) for managing Python virtual environments and dependencies.
38
- - 🛠️ Improved toolchain installations for Python, Node.js, Go, Rust and Ruby, shared between hooks.
41
+ - 🛠️ Improved toolchain installations for Python, Node.js, Bun, Go, Rust and Ruby, shared between hooks.
39
42
  - 📦 [Built-in](https://prek.j178.dev/builtin/) Rust-native implementation of some common hooks.
40
- <!-- features:end -->
43
+
44
+ <!-- --8<-- [end:features] -->
41
45
 
42
46
  ## Table of contents
43
47
 
@@ -56,26 +60,31 @@ prek provides a standalone installer script to download and install the tool,
56
60
 
57
61
  On Linux and macOS:
58
62
 
59
- <!-- linux-standalone-install:start -->
63
+ <!-- --8<-- [start: linux-standalone-install] -->
64
+
60
65
  ```bash
61
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.30/prek-installer.sh | sh
66
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.sh | sh
62
67
  ```
63
- <!-- linux-standalone-install:end -->
68
+
69
+ <!-- --8<-- [end: linux-standalone-install] -->
64
70
 
65
71
  On Windows:
66
72
 
67
- <!-- windows-standalone-install:start -->
73
+ <!-- --8<-- [start: windows-standalone-install] -->
74
+
68
75
  ```powershell
69
- powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.30/prek-installer.ps1 | iex"
76
+ powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.3.0/prek-installer.ps1 | iex"
70
77
  ```
71
- <!-- windows-standalone-install:end -->
78
+
79
+ <!-- --8<-- [end: windows-standalone-install] -->
72
80
 
73
81
  </details>
74
82
 
75
83
  <details>
76
84
  <summary>PyPI</summary>
77
85
 
78
- <!-- pypi-install:start -->
86
+ <!-- --8<-- [start: pypi-install] -->
87
+
79
88
  prek is published as Python binary wheel to PyPI, you can install it using `pip`, `uv` (recommended), or `pipx`:
80
89
 
81
90
  ```bash
@@ -94,64 +103,74 @@ pip install prek
94
103
  # Using pipx
95
104
  pipx install prek
96
105
  ```
97
- <!-- pypi-install:end -->
106
+
107
+ <!-- --8<-- [end: pypi-install] -->
98
108
 
99
109
  </details>
100
110
 
101
111
  <details>
102
112
  <summary>Homebrew</summary>
103
113
 
104
- <!-- homebrew-install:start -->
114
+ <!-- --8<-- [start: homebrew-install] -->
115
+
105
116
  ```bash
106
117
  brew install prek
107
118
  ```
108
- <!-- homebrew-install:end -->
119
+
120
+ <!-- --8<-- [end: homebrew-install] -->
109
121
 
110
122
  </details>
111
123
 
112
124
  <details>
113
125
  <summary>mise</summary>
114
126
 
115
- <!-- mise-install:start -->
127
+ <!-- --8<-- [start: mise-install] -->
128
+
116
129
  To use prek with [mise](https://mise.jdx.dev) ([v2025.8.11](https://github.com/jdx/mise/releases/tag/v2025.8.11) or later):
117
130
 
118
131
  ```bash
119
132
  mise use prek
120
133
  ```
121
- <!-- mise-install:end -->
134
+
135
+ <!-- --8<-- [end: mise-install] -->
122
136
 
123
137
  </details>
124
138
 
125
139
  <details>
126
140
  <summary>Cargo binstall</summary>
127
141
 
128
- <!-- cargo-binstall:start -->
142
+ <!-- --8<-- [start: cargo-binstall] -->
143
+
129
144
  Install pre-compiled binaries from GitHub using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall):
130
145
 
131
146
  ```bash
132
147
  cargo binstall prek
133
148
  ```
134
- <!-- cargo-binstall:end -->
149
+
150
+ <!-- --8<-- [end: cargo-binstall] -->
135
151
 
136
152
  </details>
137
153
 
138
154
  <details>
139
155
  <summary>Cargo</summary>
140
156
 
141
- <!-- cargo-install:start -->
157
+ <!-- --8<-- [start: cargo-install] -->
158
+
142
159
  Build from source using Cargo (Rust 1.89+ is required):
143
160
 
144
161
  ```bash
145
162
  cargo install --locked prek
146
163
  ```
147
- <!-- cargo-install:end -->
164
+
165
+ <!-- --8<-- [end: cargo-install] -->
148
166
 
149
167
  </details>
150
168
 
151
169
  <details>
152
170
  <summary>npmjs</summary>
153
171
 
154
- <!-- npmjs-install:start -->
172
+ <!-- --8<-- [start: npmjs-install] -->
173
+
155
174
  prek is published as a Node.js package, you can install it using `npm`, `pnpm`, or `npx`:
156
175
 
157
176
  ```bash
@@ -170,14 +189,16 @@ npm install -g @j178/prek
170
189
  # then use `prek` command
171
190
  prek --version
172
191
  ```
173
- <!-- npmjs-install:end -->
192
+
193
+ <!-- --8<-- [end: npmjs-install] -->
174
194
 
175
195
  </details>
176
196
 
177
197
  <details>
178
198
  <summary>Nix</summary>
179
199
 
180
- <!-- nix-install:start -->
200
+ <!-- --8<-- [start: nix-install] -->
201
+
181
202
  prek is available via [Nixpkgs](https://search.nixos.org/packages?channel=unstable&show=prek&query=prek).
182
203
 
183
204
  ```shell
@@ -191,60 +212,72 @@ nix-env -iA nixos.prek
191
212
  # Non-NixOS with flakes:
192
213
  nix profile install nixpkgs#prek
193
214
  ```
194
- <!-- nix-install:end -->
215
+
216
+ <!-- --8<-- [end: nix-install] -->
195
217
 
196
218
  </details>
197
219
 
198
220
  <details>
199
221
  <summary>Conda</summary>
200
222
 
201
- <!-- conda-forge-install:start -->
223
+ <!-- --8<-- [start: conda-forge-install] -->
224
+
202
225
  prek is available as `prek` via [conda-forge](https://anaconda.org/conda-forge/prek).
203
226
 
204
227
  ```shell
205
228
  conda install conda-forge::prek
206
229
  ```
207
- <!-- conda-forge-install:end -->
230
+
231
+ <!-- --8<-- [end: conda-forge-install] -->
208
232
 
209
233
  </details>
210
234
 
211
235
  <details>
212
236
  <summary>Scoop (Windows)</summary>
213
237
 
214
- <!-- scoop-install:start -->
238
+ <!-- --8<-- [start: scoop-install] -->
239
+
215
240
  prek is available via [Scoop](https://scoop.sh/#/apps?q=prek).
216
241
 
217
242
  ```powershell
218
243
  scoop install main/prek
219
244
  ```
220
- <!-- scoop-install:end -->
245
+
246
+ <!-- --8<-- [end: scoop-install] -->
247
+
221
248
  </details>
222
249
 
223
250
  <details>
224
251
  <summary>MacPorts</summary>
225
252
 
226
- <!-- macports-install:start -->
253
+ <!-- --8<-- [start: macports-install] -->
254
+
227
255
  prek is available via [MacPorts](https://ports.macports.org/port/prek/).
228
256
 
229
257
  ```bash
230
258
  sudo port install prek
231
259
  ```
232
- <!-- macports-install:end -->
260
+
261
+ <!-- --8<-- [end: macports-install] -->
262
+
233
263
  </details>
234
264
 
235
265
  <details>
236
266
  <summary>GitHub Releases</summary>
237
267
 
238
- <!-- pre-built-binaries:start -->
268
+ <!-- --8<-- [start: pre-built-binaries] -->
269
+
239
270
  Pre-built binaries are available for download from the [GitHub releases](https://github.com/j178/prek/releases) page.
240
- <!-- pre-built-binaries:end -->
271
+
272
+ <!-- --8<-- [end: pre-built-binaries] -->
241
273
 
242
274
  </details>
243
275
 
244
276
  <details>
245
277
  <summary>GitHub Actions</summary>
246
278
 
247
- <!-- github-actions:start -->
279
+ <!-- --8<-- [start: github-actions] -->
280
+
248
281
  prek can be used in GitHub Actions via the [j178/prek-action](https://github.com/j178/prek-action) repository.
249
282
 
250
283
  Example workflow:
@@ -264,23 +297,28 @@ jobs:
264
297
  This action installs prek and runs `prek run --all-files` on your repository.
265
298
 
266
299
  prek is also available via [`taiki-e/install-action`](https://github.com/taiki-e/install-action) for installing various tools.
267
- <!-- github-actions:end -->
300
+
301
+ <!-- --8<-- [end: github-actions] -->
302
+
268
303
  </details>
269
304
 
270
- <!-- self-update:start -->
305
+ <!-- --8<-- [start: self-update] -->
306
+
271
307
  If installed via the standalone installer, prek can update itself to the latest version:
272
308
 
273
309
  ```bash
274
310
  prek self update
275
311
  ```
276
- <!-- self-update:end -->
312
+
313
+ <!-- --8<-- [end: self-update] -->
277
314
 
278
315
  ## Quick start
279
316
 
280
317
  - **I already use pre-commit:** follow the short migration checklist in the [quickstart guide](https://prek.j178.dev/quickstart/#already-using-pre-commit) to swap in `prek` safely.
281
318
  - **I'm new to pre-commit-style tools:** learn the basics—creating a config, running hooks, and installing git hooks—in the [beginner quickstart walkthrough](https://prek.j178.dev/quickstart/#new-to-pre-commit-style-workflows).
282
319
 
283
- <!-- why:start -->
320
+ <!-- --8<-- [start: why] -->
321
+
284
322
  ## Why prek?
285
323
 
286
324
  ### prek is faster
@@ -299,9 +337,9 @@ prek self update
299
337
  - No hassle with your Python version or virtual environments, prek automatically installs the required Python version and creates a virtual environment for you.
300
338
  - Built-in support for [workspaces](https://prek.j178.dev/workspace/) (or monorepos), each subproject can have its own `.pre-commit-config.yaml` file.
301
339
  - [`prek run`](https://prek.j178.dev/cli/#prek-run) has some nifty improvements over `pre-commit run`, such as:
302
- - `prek run --directory <dir>` runs hooks for files in the specified directory, no need to use `git ls-files -- <dir> | xargs pre-commit run --files` anymore.
303
- - `prek run --last-commit` runs hooks for files changed in the last commit.
304
- - `prek run [HOOK] [HOOK]` selects and runs multiple hooks.
340
+ - `prek run --directory <dir>` runs hooks for files in the specified directory, no need to use `git ls-files -- <dir> | xargs pre-commit run --files` anymore.
341
+ - `prek run --last-commit` runs hooks for files changed in the last commit.
342
+ - `prek run [HOOK] [HOOK]` selects and runs multiple hooks.
305
343
  - [`prek list`](https://prek.j178.dev/cli/#prek-list) command lists all available hooks, their ids, and descriptions, providing a better overview of the configured hooks.
306
344
  - [`prek auto-update`](https://prek.j178.dev/cli/#prek-auto-update) supports `--cooldown-days` to mitigate open source supply chain attacks.
307
345
  - prek provides shell completions for `prek run <hook_id>` command, making it easier to run specific hooks without remembering their ids.
@@ -334,9 +372,11 @@ prek is pretty new, but it is already being used or recommend by some projects a
334
372
  - [jcrist/msgspec](https://github.com/jcrist/msgspec/pull/918)
335
373
  - [python-humanize/humanize](https://github.com/python-humanize/humanize/pull/276)
336
374
  - [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli/pull/535)
337
- - [ZhuoZhuoCrayon/throttled-py](https://github.com/ZhuoZhuoCrayon/throttled-py/pull/119)
375
+ - [simple-icons/simple-icons](https://github.com/simple-icons/simple-icons/pull/14245)
376
+ - [ast-grep/ast-grep](https://github.com/ast-grep/ast-grep.github.io/commit/e30818144b2967a7f9172c8cf2f4596bba219bf5)
377
+ - [commitizen-tools/commitizen](https://github.com/commitizen-tools/commitizen)
338
378
 
339
- <!-- why:end -->
379
+ <!-- --8<-- [end: why] -->
340
380
 
341
381
  ## Acknowledgements
342
382
 
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@j178/prek",
26
- "version": "0.2.30"
26
+ "version": "0.3.0"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -515,5 +515,5 @@
515
515
  }
516
516
  },
517
517
  "requires": true,
518
- "version": "0.2.30"
518
+ "version": "0.3.0"
519
519
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.2.30",
2
+ "artifactDownloadUrl": "https://github.com/j178/prek/releases/download/v0.3.0",
3
3
  "author": "j178 <hi@j178.dev>",
4
4
  "bin": {
5
5
  "prek": "run-prek.js"
@@ -210,7 +210,7 @@
210
210
  "zipExt": ".tar.gz"
211
211
  }
212
212
  },
213
- "version": "0.2.30",
213
+ "version": "0.3.0",
214
214
  "volta": {
215
215
  "node": "18.14.1",
216
216
  "npm": "9.5.0"