Skip to content

Commit

Permalink
docs: use tag $BUN_LATEST_VERSION for version instead of manual (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
RiskyMH authored Jan 13, 2025
1 parent 22436ed commit 6473d83
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/api/fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ This will print the request and response headers to your terminal:
```sh
[fetch] > HTTP/1.1 GET http://example.com/
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.21
[fetch] > User-Agent: Bun/$BUN_LATEST_VERSION
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br
Expand Down
2 changes: 1 addition & 1 deletion docs/api/spawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
```ts
const proc = Bun.spawn(["bun", "--version"]);
const text = await new Response(proc.stdout).text();
console.log(text); // => "1.1.7"
console.log(text); // => "$BUN_LATEST_VERSION"
```

Configure the output stream by passing one of the following values to `stdout/stderr`:
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Use `bun publish` to publish a package to the npm registry.
$ bun publish

## Output
bun publish v1.1.30 (ca7428e9)
bun publish v$BUN_LATEST_VERSION (ca7428e9)

packed 203B package.json
packed 224B README.md
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/ecosystem/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $ bunx nuxi init my-nuxt-app
✔ Which package manager would you like to use?
bun
◐ Installing dependencies...
bun install v1.x (16b4bf34)
bun install v$BUN_LATEST_VERSION (16b4bf34)
+ @nuxt/[email protected]
+ [email protected]
785 packages installed [2.67s]
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/install/add-peer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This will add the package to `peerDependencies` in `package.json`.
```json-diff
{
"peerDependencies": {
+ "@types/bun": "^1.0.0"
+ "@types/bun": "^$BUN_LATEST_VERSION"
}
}
```
Expand All @@ -28,7 +28,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
```json-diff
{
"peerDependencies": {
"@types/bun": "^1.0.0"
"@types/bun": "^$BUN_LATEST_VERSION"
},
"peerDependenciesMeta": {
+ "@types/bun": {
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/install/from-npm-install-to-bun-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ $ bun update
$ bun update @types/bun --latest

# Update a dependency to a specific version
$ bun update @types/bun@1.1.10
$ bun update @types/bun@$BUN_LATEST_VERSION

# Update all dependencies to the latest versions
$ bun update --latest
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/test/run-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here's what the output of a typical test run looks like. In this case, there are

```sh
$ bun test
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test.test.js:
✓ add [0.87ms]
Expand All @@ -47,7 +47,7 @@ To only run certain test files, pass a positional argument to `bun test`. The ru

```sh
$ bun test test3
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test3.test.js:
✓ add [1.40ms]
Expand Down Expand Up @@ -85,7 +85,7 @@ Adding `-t add` will only run tests with "add" in the name. This works with test

```sh
$ bun test -t add
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test.test.js:
✓ add [1.79ms]
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/test/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The first time this test is executed, Bun will evaluate the value passed into `e

```sh
$ bun test test/snap
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test/snap.test.ts:
✓ snapshot [1.48ms]
Expand Down Expand Up @@ -61,7 +61,7 @@ Later, when this test file is executed again, Bun will read the snapshot file an

```sh
$ bun test
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test/snap.test.ts:
✓ snapshot [1.05ms]
Expand All @@ -78,7 +78,7 @@ To update snapshots, use the `--update-snapshots` flag.

```sh
$ bun test --update-snapshots
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test/snap.test.ts:
✓ snapshot [0.86ms]
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/test/update-snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To regenerate snapshots, use the `--update-snapshots` flag.

```sh
$ bun test --update-snapshots
bun test v1.x (9c68abdb)
bun test v$BUN_LATEST_VERSION (9c68abdb)

test/snap.test.ts:
✓ snapshot [0.86ms]
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/util/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Get the current Bun version
Get the current version of Bun in a semver format.

```ts#index.ts
Bun.version; // => "0.6.15"
Bun.version; // => "$BUN_LATEST_VERSION"
```

---
Expand Down
8 changes: 4 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Us
```bash#macOS/Linux_(curl)
$ curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
# to install a specific version
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
$ curl -fsSL https://bun.sh/install | bash -s "bun-v$BUN_LATEST_VERSION"
```

```bash#npm
Expand Down Expand Up @@ -166,10 +166,10 @@ Since Bun is a single binary, you can install older versions of Bun by re-runnin

### Installing a specific version of Bun on Linux/Mac

To install a specific version of Bun, you can pass the git tag of the version you want to install to the install script, such as `bun-v1.1.6` or `bun-v1.1.1`.
To install a specific version of Bun, you can pass the git tag of the version you want to install to the install script, such as `bun-v1.2.0` or `bun-v$BUN_LATEST_VERSION`.

```sh
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.1.6"
$ curl -fsSL https://bun.sh/install | bash -s "bun-v$BUN_LATEST_VERSION"
```

### Installing a specific version of Bun on Windows
Expand All @@ -178,7 +178,7 @@ On Windows, you can install a specific version of Bun by passing the version num

```sh
# PowerShell:
$ iex "& {$(irm https://bun.sh/install.ps1)} -Version 1.1.6"
$ iex "& {$(irm https://bun.sh/install.ps1)} -Version $BUN_LATEST_VERSION"
```

## Downloading Bun binaries directly
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Bun can also execute `"scripts"` from your `package.json`. Add the following scr
+ "start": "bun run index.ts"
+ },
"devDependencies": {
"@types/bun": "^1.0.0"
"@types/bun": "latest"
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/runtime/debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ await fetch("https://example.com", {
This prints the `fetch` request as a single-line `curl` command to let you copy-paste into your terminal to replicate the request.

```sh
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.14" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/$BUN_LATEST_VERSION" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
[fetch] > HTTP/1.1 POST https://example.com/
[fetch] > content-type: application/json
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.14
[fetch] > User-Agent: Bun/$BUN_LATEST_VERSION
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br
Expand Down Expand Up @@ -170,7 +170,7 @@ This prints the following to the console:
[fetch] > HTTP/1.1 POST https://example.com/
[fetch] > content-type: application/json
[fetch] > Connection: keep-alive
[fetch] > User-Agent: Bun/1.1.14
[fetch] > User-Agent: Bun/$BUN_LATEST_VERSION
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br
Expand Down
2 changes: 1 addition & 1 deletion docs/test/dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Let's run this test with `bun test`:

```bash
$ bun test
bun test v1.x
bun test v$BUN_LATEST_VERSION

dom.test.ts:
✓ dom test [0.82ms]
Expand Down
2 changes: 1 addition & 1 deletion packages/bun-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"scripts": {
"prebuild": "echo $(pwd)",
"copy-docs": "rm -rf docs && cp -r ../../docs/ ./docs",
"copy-docs": "rm -rf docs && cp -rL ../../docs/ ./docs && sed -i 's/\\$BUN_LATEST_VERSION/'\"${BUN_VERSION:-1.0.0}\"'/g' ./docs/**/*.md",
"build": "bun run copy-docs && bun scripts/build.ts && bun run fmt",
"test": "tsc",
"fmt": "echo $(which biome) && biome format --write ."
Expand Down

0 comments on commit 6473d83

Please sign in to comment.