Skip to content

Commit 6ae018d

Browse files
committed
v0.9.0
1 parent ed04295 commit 6ae018d

File tree

5 files changed

+334
-29
lines changed

5 files changed

+334
-29
lines changed

CHANGELOG.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# Changelog
2+
3+
All notable, and not so notable, changes to this project will be documented in this file.
4+
5+
## [0.9.0] - 2024-04-19
6+
7+
### Features
8+
9+
- [`7c1576e`](https://github.com/ryanccn/nrr/commit/7c1576e939bb07704d4e654f424a8b498ec4b418) [**breaking**] Arbitrary command execution (#27) - Ryan Cao
10+
- [`b6d0d14`](https://github.com/ryanccn/nrr/commit/b6d0d14fc49de19db6a109a6e651e6e93bdd18f2) Add `silent` flag - Ryan Cao
11+
- [`e3ebf16`](https://github.com/ryanccn/nrr/commit/e3ebf165a08571d341ce3b717a0cea49050046bd) Adopt `simd_json`, drop zero-copy - Ryan Cao
12+
- [`0adae88`](https://github.com/ryanccn/nrr/commit/0adae88811096ded12a6e028c5c8ee829579d21e) Add binary artifacts and static builds (#31) - seth
13+
- [`fd8e1de`](https://github.com/ryanccn/nrr/commit/fd8e1dee6658473de4d1c4ce1a25355945e122ea) Load environment files with `-e/--env-file` - Ryan Cao
14+
- [`6aa164f`](https://github.com/ryanccn/nrr/commit/6aa164fc4f9bd1c3fedfcbf3b270af4e1496a0e9) (_exec_) Allow non-npm installed commands, adopt `execvp` on unix - Ryan Cao
15+
16+
### Bug Fixes
17+
18+
- [`ff7320e`](https://github.com/ryanccn/nrr/commit/ff7320ec7b7876514891f193cc95857efee37133) (_exec_) Never print information - Ryan Cao
19+
20+
### Refactor
21+
22+
- [`ed04295`](https://github.com/ryanccn/nrr/commit/ed04295ff662f1e2fc497e6e73c5d6650b1d2a32) Reduce duplication and improve organization - Ryan Cao
23+
24+
### Performance
25+
26+
- [`6d187e6`](https://github.com/ryanccn/nrr/commit/6d187e6c6bfeecea6239b07c0ba23004d87dd9e9) Use `itoa` for integer formatting - Ryan Cao
27+
28+
### Testing
29+
30+
- [`a8a4859`](https://github.com/ryanccn/nrr/commit/a8a485922abd742bd6f4acd9c50e11d1a72ca7ab) Add integration tests - Ryan Cao
31+
32+
### Documentation
33+
34+
- [`7eba97b`](https://github.com/ryanccn/nrr/commit/7eba97bc83cfaca9e2ecaaa1e874b4d7d4e897f4) Fix admonition syntax - Ryan Cao
35+
36+
### Miscellaneous
37+
38+
- [`06ec194`](https://github.com/ryanccn/nrr/commit/06ec194a0447f449c3457234d0cd7c0423c7f9d2) Adopt `cargo-auditable` - Ryan Cao
39+
- [`d622834`](https://github.com/ryanccn/nrr/commit/d622834916e5a9e7973bfcd577697675879f929e) Remove unused fns - Ryan Cao
40+
41+
### Revert
42+
43+
- [`10aaa49`](https://github.com/ryanccn/nrr/commit/10aaa49a33f4daa223a46da1c03df1396e18019c) Don't use `exec` on unix - Ryan Cao
44+
45+
## [0.8.1] - 2024-02-24
46+
47+
### Bug Fixes
48+
49+
- [`f0ed577`](https://github.com/ryanccn/nrr/commit/f0ed577b5df48b81eb3331ca8389fc2339c36442) Inverted suggestions sorting - Ryan Cao
50+
51+
### Documentation
52+
53+
- [`5c09207`](https://github.com/ryanccn/nrr/commit/5c09207426ab432cb48703a6d63d97ac128cfb4b) Explain features - Ryan Cao
54+
55+
## [0.8.0] - 2024-02-24
56+
57+
### Features
58+
59+
- [`79aefab`](https://github.com/ryanccn/nrr/commit/79aefabb74e6f5cd459fdab853fb73c785e046b2) Add spelling suggestions - Ryan Cao
60+
61+
### Bug Fixes
62+
63+
- [`a38d15d`](https://github.com/ryanccn/nrr/commit/a38d15da479c63910235e611de5ce2866b4de128) Remove extra newline when listing - Ryan Cao
64+
- [`e52fded`](https://github.com/ryanccn/nrr/commit/e52fded8d970f344311f9c66fb0d7277fba7185a) Adopt `serde_with` - Ryan Cao
65+
66+
### Performance
67+
68+
- [`2876e81`](https://github.com/ryanccn/nrr/commit/2876e81ef4903bb49e0de24e96fb928f25624ea4) Remove async runtime (Tokio) - Ryan Cao
69+
70+
### Miscellaneous
71+
72+
- [`123e864`](https://github.com/ryanccn/nrr/commit/123e864ca95b876ed8195d1c38c3d50b21efe3f8) Update benchmarks - Ryan Cao
73+
74+
## [0.7.0] - 2024-02-21
75+
76+
### Features
77+
78+
- [`922dbb1`](https://github.com/ryanccn/nrr/commit/922dbb10a1f21c405901138d5eb9cdf9980b2ed3) [**breaking**] Allow hyphen values for extra arguments - Ryan Cao
79+
80+
### Performance
81+
82+
- [`2cea6d5`](https://github.com/ryanccn/nrr/commit/2cea6d5206f24ac931270c102bece1e79ad6d8a7) Use AES-backed hashing - Ryan Cao
83+
- [`d6ba0c1`](https://github.com/ryanccn/nrr/commit/d6ba0c11b8b1f6914e45a8866cdbbdfc26dae473) Reduce unnecessary allocs when constructing arguments - Ryan Cao
84+
- [`5322336`](https://github.com/ryanccn/nrr/commit/5322336981e803b9805d776f6509faaa522ca7cf) Adopt `smartstring` to automatically inline small strings - Ryan Cao
85+
86+
## [0.6.0] - 2024-02-20
87+
88+
### Performance
89+
90+
- [`abad8b7`](https://github.com/ryanccn/nrr/commit/abad8b7b6a6e031f9d69b5d278e13772d14a8c47) Use `OnceLock` to cache script level - Ryan Cao
91+
- [`f5b9727`](https://github.com/ryanccn/nrr/commit/f5b97273ed931e9a687ccfac11c776fbcdbdfc25) Implement zero-copy correctly - Ryan Cao
92+
93+
## [0.5.2] - 2024-02-04
94+
95+
### Bug Fixes
96+
97+
- [`065f285`](https://github.com/ryanccn/nrr/commit/065f2854b76ef3799d29cec83f5e2c042243d681) Use `Cow` in `PackageJson` struct - Ryan Cao
98+
99+
## [0.5.1] - 2024-01-28
100+
101+
### Refactor
102+
103+
- [`e9293dd`](https://github.com/ryanccn/nrr/commit/e9293dd78a69e02821aea9ae388a3a3d571f835a) Improve logic, cleanup - Ryan Cao
104+
105+
### Documentation
106+
107+
- [`db71ba5`](https://github.com/ryanccn/nrr/commit/db71ba5c58a81bf6211c4e97c1a9b1f2eb8556f9) Remove code block languages in usage [skip ci] - Ryan Cao
108+
109+
## [0.5.0] - 2024-01-26
110+
111+
### Removed
112+
113+
- [`2a64c47`](https://github.com/ryanccn/nrr/commit/2a64c472602ef0634000a361ebe4f0cf7595d752) [**breaking**] Compatibility modes - Ryan Cao
114+
115+
### Documentation
116+
117+
- [`79133da`](https://github.com/ryanccn/nrr/commit/79133da713313d98bcdcc061ff49619350dc66a5) Update README - Ryan Cao
118+
119+
### Miscellaneous
120+
121+
- [`be8c177`](https://github.com/ryanccn/nrr/commit/be8c177639b0ca15ac4e4fd91554e392651eb441) Update flake inputs - Ryan Cao
122+
123+
## [0.4.1] - 2024-01-24
124+
125+
### Features
126+
127+
- [`0713169`](https://github.com/ryanccn/nrr/commit/07131690cf3ee1e780077392e422aaaea5c29a5e) Add exit status logging - Ryan Cao
128+
129+
### Refactor
130+
131+
- [`97b61c3`](https://github.com/ryanccn/nrr/commit/97b61c3726dbaed7c241b85a4a90f86c268f2e31) Don't read package again when serializing to environment - Ryan Cao
132+
133+
### Miscellaneous
134+
135+
- [`74f1061`](https://github.com/ryanccn/nrr/commit/74f1061478941c604a385fc3e3032042826e4704) Add garnix config - Ryan Cao
136+
- [`59fac25`](https://github.com/ryanccn/nrr/commit/59fac25986cc9bc7108954a81a84a42ed2cc7378) Remove Nix workflow in favor of garnix - Ryan Cao
137+
138+
## [0.4.0] - 2024-01-23
139+
140+
### Features
141+
142+
- [`b8d8c4a`](https://github.com/ryanccn/nrr/commit/b8d8c4a8837a7ad43200b28b56525c9c0c6667f2) Track script level and log script name in nested scripts - Ryan Cao
143+
144+
## [0.3.1] - 2023-12-25
145+
146+
### Features
147+
148+
- [`73924d9`](https://github.com/ryanccn/nrr/commit/73924d90dff5373c0f47904c1568492d6b7a78a3) Print help if no scripts are found - Ryan Cao
149+
150+
### Refactor
151+
152+
- [`318d5b1`](https://github.com/ryanccn/nrr/commit/318d5b1ca674f2fa3f2df9a8299fbc55ea559ecc) Improve iterators - Ryan Cao
153+
154+
## [0.3.0] - 2023-12-18
155+
156+
### Bug Fixes
157+
158+
- [`7a166f0`](https://github.com/ryanccn/nrr/commit/7a166f0c8dca85eaabe506fd93111666d809ee34) Handle pre/post script prefixes properly - Ryan Cao
159+
160+
### Refactor
161+
162+
- [`c4a32f5`](https://github.com/ryanccn/nrr/commit/c4a32f589b656f6cbf56bd9c4b3ee44cad33c5ed) Use `color_eyre` - Ryan Cao
163+
164+
## [0.2.0] - 2023-11-25
165+
166+
### Features
167+
168+
- [`cd0aea7`](https://github.com/ryanccn/nrr/commit/cd0aea7f1577c05161295f90c202f6b65e5d7a49) Initial commit - Ryan Cao
169+
- [`819be15`](https://github.com/ryanccn/nrr/commit/819be15cebcc4f0caf39c7a7fc48d5292134e1dd) Add script listing - Ryan Cao
170+
171+
### Bug Fixes
172+
173+
- [`7483b4d`](https://github.com/ryanccn/nrr/commit/7483b4dacd537bd484377e9023179bc24179fc3b) Ensure that `NRR_COMPAT_MODE` is not empty - Ryan Cao
174+
- [`b70afec`](https://github.com/ryanccn/nrr/commit/b70afec1e5adb55454c42ae4993476ded0221850) Handle errors on `Child::wait` - Ryan Cao
175+
- [`ce8e4fb`](https://github.com/ryanccn/nrr/commit/ce8e4fb921b33283dcedb44e78a6aa312a3a0a49) Allow run-script in nested compat mode - Ryan Cao
176+
- [`efa2e97`](https://github.com/ryanccn/nrr/commit/efa2e97a9c7e4da3114c8f33cd0e5508fe4aac56) Only handle unix signals on unix - Ryan Cao
177+
- [`733288e`](https://github.com/ryanccn/nrr/commit/733288e58416a7b9337952bf41e0d4a0f8888877) Sort scripts and display in normal text - Ryan Cao
178+
179+
### Refactor
180+
181+
- [`d2d6afe`](https://github.com/ryanccn/nrr/commit/d2d6afec34a5c93b2f90d5c3e86ddec4ff3a4568) Search packages and resolve node modules incrementally - Ryan Cao
182+
- [`5f6ede8`](https://github.com/ryanccn/nrr/commit/5f6ede88e911868146acb35fb8af39543354ddf1) Optionally run pre and post scripts - Ryan Cao
183+
184+
### Performance
185+
186+
- [`58d45d0`](https://github.com/ryanccn/nrr/commit/58d45d08ddeab4cf09b53c7240b2a14f618399aa) Only include `ctrl_c` on unix - Ryan Cao
187+
188+
### Documentation
189+
190+
- [`2d6ec80`](https://github.com/ryanccn/nrr/commit/2d6ec80884f74d33c1296d57aa826887cba1a9f2) Add cargo git install [skip ci] - Ryan Cao
191+
- [`93bebed`](https://github.com/ryanccn/nrr/commit/93bebeda5422731dbda362a05e9fad25d1af1edf) Use published crate - Ryan Cao
192+
193+
### Styling
194+
195+
- [`d3db9c1`](https://github.com/ryanccn/nrr/commit/d3db9c1fc1d2e0ae5aaa9dca2dc780cadc476164) `searched_dirs``searched_pkgs` - Ryan Cao
196+
197+
### Miscellaneous
198+
199+
- [`1373b97`](https://github.com/ryanccn/nrr/commit/1373b972de7540e9496217b3121455b4eddb83dd) Add cargo release workflow - Ryan Cao
200+
201+
[0.9.0]: https://github.com/ryanccn/nrr/compare/v0.8.1..v0.9.0
202+
[0.8.1]: https://github.com/ryanccn/nrr/compare/v0.8.0..v0.8.1
203+
[0.8.0]: https://github.com/ryanccn/nrr/compare/v0.7.0..v0.8.0
204+
[0.7.0]: https://github.com/ryanccn/nrr/compare/v0.6.0..v0.7.0
205+
[0.6.0]: https://github.com/ryanccn/nrr/compare/v0.5.2..v0.6.0
206+
[0.5.2]: https://github.com/ryanccn/nrr/compare/v0.5.1..v0.5.2
207+
[0.5.1]: https://github.com/ryanccn/nrr/compare/v0.5.0..v0.5.1
208+
[0.5.0]: https://github.com/ryanccn/nrr/compare/v0.4.1..v0.5.0
209+
[0.4.1]: https://github.com/ryanccn/nrr/compare/v0.4.0..v0.4.1
210+
[0.4.0]: https://github.com/ryanccn/nrr/compare/v0.3.1..v0.4.0
211+
[0.3.1]: https://github.com/ryanccn/nrr/compare/v0.3.0..v0.3.1
212+
[0.3.0]: https://github.com/ryanccn/nrr/compare/v0.2.0..v0.3.0

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nrr"
3-
version = "0.8.1"
3+
version = "0.9.0"
44
edition = "2021"
55
rust-version = "1.70"
66

README.md

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,63 @@
1-
# `nrr`
1+
# nrr
2+
3+
[![Crates.io Version](https://img.shields.io/crates/v/nrr?style=flat-square&logo=rust)](https://crates.io/crates/nrr) [![Crates.io Total Downloads](https://img.shields.io/crates/d/nrr?style=flat-square&logo=rust)](https://crates.io/crates/nrr) [![GitHub Actions Build Workflow Status](https://img.shields.io/github/actions/workflow/status/ryanccn/nrr/build.yml?branch=main&event=push&style=flat-square&logo=github)](https://github.com/ryanccn/nrr/actions/workflows/build.yml) [![GitHub Actions Build Workflow Status](https://img.shields.io/github/actions/workflow/status/ryanccn/nrr/test.yml?branch=main&event=push&style=flat-square&logo=github&label=test)](https://github.com/ryanccn/nrr/actions/workflows/test.yml) [![GitHub License](https://img.shields.io/github/license/ryanccn/nrr?style=flat-square&color=blue)](https://github.com/ryanccn/nrr/blob/main/LICENSE)
4+
5+
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
26

37
Minimal, blazing fast npm scripts runner.
48

9+
[**Features**](#features)[**Installation**](#installation)[**Usage**](#usage)
10+
511
## Features
612

713
### Performance
814

9-
`nrr` initializes and resolves scripts way faster than package managers. It achieves this by providing the largest feature coverage possible while keeping it simple and performant.
15+
nrr initializes and resolves scripts way faster than other package managers and script runners. It achieves this by providing the largest feature coverage possible while keeping it simple and performant.
1016

1117
<details>
1218

13-
<summary>Benchmark of <code>nrr</code>, <code>npm</code>, <code>yarn</code>, <code>pnpm</code>, <code>bun</code>, and <code>dum</code> running a simple <code>echo</code> script</summary>
19+
<summary>Benchmark of <code>nrr</code>, <code>npm</code>, <code>yarn</code>, <code>pnpm</code>, <code>bun</code>, and <code>dum</code> running a simple <code>true</code> script</summary>
1420

15-
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
16-
| :-------- | ----------: | -------: | -------: | -----------: |
17-
| **`nrr`** | 6.1 ± 0.3 | 5.6 | 8.2 | 1.17 ± 0.09 |
18-
| `dum` | 5.2 ± 0.3 | 4.9 | 6.1 | 1.00 |
19-
| `bun` | 7.8 ± 0.3 | 7.3 | 9.0 | 1.50 ± 0.10 |
20-
| `yarn` | 152.7 ± 0.9 | 151.0 | 154.8 | 29.39 ± 1.51 |
21-
| `npm` | 162.2 ± 1.3 | 159.9 | 164.8 | 31.21 ± 1.62 |
22-
| `pnpm` | 223.8 ± 2.7 | 220.4 | 231.3 | 43.07 ± 2.27 |
21+
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
22+
| :-------- | -----------: | -------: | -------: | -------------: |
23+
| **`nrr`** | 1.9 ± 0.1 | 1.7 | 2.3 | 1.00 |
24+
| `dum` | 2.5 ± 0.2 | 2.3 | 3.5 | 1.35 ± 0.11 |
25+
| `bun` | 6.9 ± 0.2 | 6.6 | 7.7 | 3.69 ± 0.21 |
26+
| `yarn` | 304.8 ± 10.5 | 291.2 | 347.2 | 162.32 ± 10.13 |
27+
| `npm` | 332.0 ± 17.5 | 314.1 | 421.5 | 176.84 ± 13.10 |
28+
| `pnpm` | 511.5 ± 20.6 | 482.8 | 606.3 | 272.41 ± 17.91 |
2329

24-
<small><code>hyperfine --shell=none --warmup=5 --output=pipe --export-markdown=benchmark.md 'npm run dev' -n 'npm' 'yarn run dev' -n 'yarn' 'pnpm run dev' -n 'pnpm' 'bun run dev' -n 'bun' 'dum run dev' -n 'dum' 'nrr dev' -n 'nrr'</code></small>
30+
<small>Benchmarks run on an AWS EC2 `t4g.micro` instance with the command <code>hyperfine --shell=none --warmup=5 --runs=1000 --output=pipe --export-markdown=benchmark.md 'npm run dev' -n 'npm' 'yarn run dev' -n 'yarn' 'pnpm run dev' -n 'pnpm' 'bun run dev' -n 'bun' 'dum run dev' -n 'dum' 'nrr dev' -n 'nrr'</code></small>
2531

2632
</details>
2733

2834
### Package and script metadata display
2935

30-
`nrr` provides a better-looking display of package details and the command being run than most, and also prints this information to `stderr` instead of `stdout` like some of the package managers do (erroneously).
36+
nrr provides a better-looking display of package details and the command being run than most, and also prints this information to `stderr` instead of `stdout` like some of the package managers do (erroneously).
3137

32-
### Spelling suggestions
38+
### Command execution
39+
40+
On top of the standard script runner functionality that runs your scripts in `package.json`, nrr can also execute arbitrary commands in your npm package environments! You can use the `nrr exec` and `nrr x` commands to execute commands, similar to how `npx` or `pnpm exec` works (but faster, of course).
3341

34-
If you mistype a script name (e.g. `buils` instead of `build`), `nrr` will intelligently suggest the right script to run in the error message using the Jaro similarity algorithm from the [`strsim`](https://docs.rs/strsim/latest/strsim/fn.jaro.html) crate.
42+
Do note, however, that nrr cannot run commands from remote packages! That feature falls within the purview of package managers, which nrr is not.
43+
44+
> [!TIP]
45+
>
46+
> If you create a symlink that has a name of `nrx` (or, on Windows, a hard link that has a name of `nrx.exe`) in your `PATH`, you can execute commands through the `nrx` binary without using a subcommand!
3547
3648
### Script listing
3749

38-
Running `nrr` without any arguments will try to find any packages in the current working directory and its ancestors, and list the scripts available from them, both name and command.
50+
Running nrr without any arguments or running the `nrr list` subcommand will try to find any packages in the current working directory and its ancestors, and list the scripts available from them, both name and command.
3951

4052
### Tooling compatibility
4153

42-
`nrr` has compatibility functionality that patches `npm_execpath` so that tools like [`npm-run-all2`](https://github.com/bcomnes/npm-run-all2) use it instead of package managers for running sub-scripts.
54+
nrr has compatibility functionality that patches `npm_execpath` so that tools like [`npm-run-all2`](https://github.com/bcomnes/npm-run-all2) use it instead of package managers for running sub-scripts.
4355

4456
> [!WARNING]
4557
>
4658
> This may cause unexpected behavior when `npm_execpath` is used for non-script running purposes, so open an issue if you encounter any bugs.
4759
48-
When running nested scripts with `nrr`, `nrr` has specialized behavior that prints extra information while staying minimal and performant:
60+
When running nested scripts with nrr, nrr has specialized behavior that prints extra information while staying minimal and performant:
4961

5062
```
5163
@@ -54,6 +66,10 @@ [email protected] lint
5466
$$ eslint .
5567
```
5668

69+
### Spelling suggestions
70+
71+
If you mistype a script name (e.g. `buils` instead of `build`), nrr will intelligently suggest the right script to run in the error message using the Jaro similarity algorithm from the [`strsim`](https://docs.rs/strsim/latest/strsim/fn.jaro.html) crate.
72+
5773
## Installation
5874

5975
### Nix
@@ -64,7 +80,7 @@ Add the overlay or package from the `github:ryanccn/nrr` flake to your own syste
6480
$ nix profile install 'github:ryanccn/nrr#nrr'
6581
```
6682

67-
`nrr` is also available in [Nixpkgs](https://github.com/NixOS/nixpkgs) as `nixpkgs#nrr`.
83+
nrr is also available in [Nixpkgs](https://github.com/NixOS/nixpkgs) as `nixpkgs#nrr`.
6884

6985
### Cargo
7086

@@ -76,23 +92,30 @@ $ cargo install nrr
7692
$ cargo install --git https://github.com/ryanccn/nrr.git
7793
```
7894

95+
### GitHub Releases
96+
97+
You can download
98+
7999
## Usage
80100

81-
```
101+
```console
82102
$ nrr dev
103+
$ nrr run dev
83104
```
84105

106+
```console
107+
$ nrx eslint --help
108+
$ nrr x eslint --help
109+
$ nrr exec eslint --help
85110
```
86-
87-
$ vite dev
88-
89-
VITE v5.0.12 ready in 10 ms
90111

91-
➜ Local: http://localhost:5173/
92-
➜ Network: use --host to expose
93-
➜ press h + enter to show help
112+
```console
113+
$ nrr
114+
$ nrr list
94115
```
95116

117+
This section provides an overview of nrr's command-line functionality. For more options and information, run `nrr --help`!
118+
96119
## License
97120

98121
GPLv3

0 commit comments

Comments
 (0)