diff --git a/docs/api/fetch.md b/docs/api/fetch.md index 5cb4068c9c5a09..c70aa2e764128c 100644 --- a/docs/api/fetch.md +++ b/docs/api/fetch.md @@ -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 diff --git a/docs/api/spawn.md b/docs/api/spawn.md index 3097af8585cfdf..4219e016c6d229 100644 --- a/docs/api/spawn.md +++ b/docs/api/spawn.md @@ -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`: diff --git a/docs/cli/publish.md b/docs/cli/publish.md index 7dec42659310de..f8d7bbddbfe725 100644 --- a/docs/cli/publish.md +++ b/docs/cli/publish.md @@ -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 diff --git a/docs/guides/ecosystem/nuxt.md b/docs/guides/ecosystem/nuxt.md index ca42c765bcbdf5..9eeded94d0856f 100644 --- a/docs/guides/ecosystem/nuxt.md +++ b/docs/guides/ecosystem/nuxt.md @@ -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/devtools@0.8.2 + nuxt@3.7.0 785 packages installed [2.67s] diff --git a/docs/guides/install/add-peer.md b/docs/guides/install/add-peer.md index 059be163a85338..0018cd1771bbd8 100644 --- a/docs/guides/install/add-peer.md +++ b/docs/guides/install/add-peer.md @@ -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" } } ``` @@ -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": { diff --git a/docs/guides/install/from-npm-install-to-bun-install.md b/docs/guides/install/from-npm-install-to-bun-install.md index 31e69238cd7d2f..2ab8a8ba1efa21 100644 --- a/docs/guides/install/from-npm-install-to-bun-install.md +++ b/docs/guides/install/from-npm-install-to-bun-install.md @@ -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 diff --git a/docs/guides/test/run-tests.md b/docs/guides/test/run-tests.md index 5768a668eded9b..f813ea944eaa69 100644 --- a/docs/guides/test/run-tests.md +++ b/docs/guides/test/run-tests.md @@ -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] @@ -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] @@ -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] diff --git a/docs/guides/test/snapshot.md b/docs/guides/test/snapshot.md index f30feb0492ee13..12d1fa1a000a96 100644 --- a/docs/guides/test/snapshot.md +++ b/docs/guides/test/snapshot.md @@ -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] @@ -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] @@ -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] diff --git a/docs/guides/test/update-snapshots.md b/docs/guides/test/update-snapshots.md index 24f76440a8b002..9d0fb7c967b497 100644 --- a/docs/guides/test/update-snapshots.md +++ b/docs/guides/test/update-snapshots.md @@ -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] diff --git a/docs/guides/util/version.md b/docs/guides/util/version.md index c24074bd06ce6c..0e358b8ce5573a 100644 --- a/docs/guides/util/version.md +++ b/docs/guides/util/version.md @@ -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" ``` --- diff --git a/docs/installation.md b/docs/installation.md index f98e3bbfa16cda..c1c6a09eab0976 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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 @@ -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 @@ -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 diff --git a/docs/quickstart.md b/docs/quickstart.md index 68ac012ed75792..6e151b3fefd088 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -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" } } ``` diff --git a/docs/runtime/debugger.md b/docs/runtime/debugger.md index ed7916c5591e1d..d505c28eafd699 100644 --- a/docs/runtime/debugger.md +++ b/docs/runtime/debugger.md @@ -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 @@ -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 diff --git a/docs/test/dom.md b/docs/test/dom.md index 98ab8101c7de95..dc5c38a4e87552 100644 --- a/docs/test/dom.md +++ b/docs/test/dom.md @@ -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] diff --git a/packages/bun-types/package.json b/packages/bun-types/package.json index 5cf34ddc8e63fc..e23b3228fe3d44 100644 --- a/packages/bun-types/package.json +++ b/packages/bun-types/package.json @@ -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 ."