bun-types 1.2.21-canary.20250827T140618 → 1.2.22-canary.20250828T140722
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/docs/api/fetch.md +1 -1
- package/docs/api/spawn.md +1 -1
- package/docs/cli/pm.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/guides/deployment/railway.md +157 -0
- package/docs/guides/ecosystem/nuxt.md +1 -1
- package/docs/guides/install/add-peer.md +2 -2
- package/docs/guides/install/from-npm-install-to-bun-install.md +1 -1
- package/docs/guides/test/run-tests.md +3 -3
- package/docs/guides/test/snapshot.md +3 -3
- package/docs/guides/test/update-snapshots.md +1 -1
- package/docs/guides/util/version.md +1 -1
- package/docs/installation.md +4 -4
- package/docs/runtime/debugger.md +3 -3
- package/docs/test/dom.md +1 -1
- package/overrides.d.ts +90 -0
- package/package.json +1 -1
package/docs/api/fetch.md
CHANGED
|
@@ -336,7 +336,7 @@ This will print the request and response headers to your terminal:
|
|
|
336
336
|
```sh
|
|
337
337
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
338
338
|
[fetch] > Connection: keep-alive
|
|
339
|
-
[fetch] > User-Agent: Bun/1.2.
|
|
339
|
+
[fetch] > User-Agent: Bun/1.2.22-canary.20250828T140722
|
|
340
340
|
[fetch] > Accept: */*
|
|
341
341
|
[fetch] > Host: example.com
|
|
342
342
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/spawn.md
CHANGED
|
@@ -140,7 +140,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
140
140
|
```ts
|
|
141
141
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
142
142
|
const text = await proc.stdout.text();
|
|
143
|
-
console.log(text); // => "1.2.
|
|
143
|
+
console.log(text); // => "1.2.22-canary.20250828T140722\n"
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/cli/pm.md
CHANGED
|
@@ -213,7 +213,7 @@ To display current package version and help:
|
|
|
213
213
|
|
|
214
214
|
```bash
|
|
215
215
|
$ bun pm version
|
|
216
|
-
bun pm version v1.2.
|
|
216
|
+
bun pm version v1.2.22-canary.20250828T140722 (ca7428e9)
|
|
217
217
|
Current package version: v1.0.0
|
|
218
218
|
|
|
219
219
|
Increment:
|
package/docs/cli/publish.md
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Deploy a Bun application on Railway
|
|
3
|
+
description: Deploy Bun applications to Railway with this step-by-step guide covering CLI and dashboard methods, optional PostgreSQL setup, and automatic SSL configuration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud. It enables instant deployments from GitHub with zero configuration, automatic SSL, and built-in database provisioning.
|
|
7
|
+
|
|
8
|
+
This guide walks through deploying a Bun application with a PostgreSQL database (optional), which is exactly what the template below provides.
|
|
9
|
+
|
|
10
|
+
You can either follow this guide step-by-step or simply deploy the pre-configured template with one click:
|
|
11
|
+
|
|
12
|
+
{% raw %}
|
|
13
|
+
|
|
14
|
+
<a href="https://railway.com/deploy/bun-react-postgres?referralCode=Bun&utm_medium=integration&utm_source=template&utm_campaign=bun" target="_blank">
|
|
15
|
+
<img src="https://railway.com/button.svg" alt="Deploy on Railway" />
|
|
16
|
+
</a>
|
|
17
|
+
|
|
18
|
+
{% /raw %}
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
**Prerequisites**:
|
|
23
|
+
|
|
24
|
+
- A Bun application ready for deployment
|
|
25
|
+
- A [Railway account](https://railway.app/)
|
|
26
|
+
- Railway CLI (for CLI deployment method)
|
|
27
|
+
- A GitHub account (for Dashboard deployment method)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Method 1: Deploy via CLI
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
#### Step 1
|
|
36
|
+
|
|
37
|
+
Ensure sure you have the Railway CLI installed.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
bun install -g @railway/cli
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
#### Step 2
|
|
46
|
+
|
|
47
|
+
Log into your Railway account.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
railway login
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
#### Step 3
|
|
56
|
+
|
|
57
|
+
After successfully authenticating, initialize a new project.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Initialize project
|
|
61
|
+
bun-react-postgres$ railway init
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
#### Step 4
|
|
67
|
+
|
|
68
|
+
After initializing the project, add a new database and service.
|
|
69
|
+
|
|
70
|
+
> **Note:** Step 4 is only necessary if your application uses a database. If you don't need PostgreSQL, skip to Step 5.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Add PostgreSQL database. Make sure to add this first!
|
|
74
|
+
bun-react-postgres$ railway add --database postgres
|
|
75
|
+
|
|
76
|
+
# Add your application service.
|
|
77
|
+
bun-react-postgres$ railway add --service bun-react-db --variables DATABASE_URL=\${{Postgres.DATABASE_URL}}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
#### Step 5
|
|
83
|
+
|
|
84
|
+
After the services have been created and connected, deploy the application to Railway. By default, services are only accessible within Railway's private network. To make your app publicly accessible, you need to generate a public domain.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Deploy your application
|
|
88
|
+
bun-nextjs-starter$ railway up
|
|
89
|
+
|
|
90
|
+
# Generate public domain
|
|
91
|
+
bun-nextjs-starter$ railway domain
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Method 2: Deploy via Dashboard
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
#### Step 1
|
|
101
|
+
|
|
102
|
+
Create a new project
|
|
103
|
+
|
|
104
|
+
1. Go to [Railway Dashboard](http://railway.com/dashboard?utm_medium=integration&utm_source=docs&utm_campaign=bun)
|
|
105
|
+
2. Click **"+ New"** → **"GitHub repo"**
|
|
106
|
+
3. Choose your repository
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
#### Step 2
|
|
111
|
+
|
|
112
|
+
Add a PostgreSQL database, and connect this database to the service
|
|
113
|
+
|
|
114
|
+
> **Note:** Step 2 is only necessary if your application uses a database. If you don't need PostgreSQL, skip to Step 3.
|
|
115
|
+
|
|
116
|
+
1. Click **"+ New"** → **"Database"** → **"Add PostgreSQL"**
|
|
117
|
+
2. After the database has been created, select your service (not the database)
|
|
118
|
+
3. Go to **"Variables"** tab
|
|
119
|
+
4. Click **"+ New Variable"** → **"Add Reference"**
|
|
120
|
+
5. Select `DATABASE_URL` from postgres
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
#### Step 3
|
|
125
|
+
|
|
126
|
+
Generate a public domain
|
|
127
|
+
|
|
128
|
+
1. Select your service
|
|
129
|
+
2. Go to **"Settings"** tab
|
|
130
|
+
3. Under **"Networking"**, click **"Generate Domain"**
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
Your app is now live! Railway auto-deploys on every GitHub push.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Configuration (Optional)
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
By default, Railway uses [Nixpacks](https://docs.railway.com/guides/build-configuration#nixpacks-options) to automatically detect and build your Bun application with zero configuration.
|
|
143
|
+
|
|
144
|
+
However, using the [Railpack](https://docs.railway.com/guides/build-configuration#railpack) application builder provides better Bun support, and will always support the latest version of Bun. The pre-configured templates use Railpack by default.
|
|
145
|
+
|
|
146
|
+
To enable Railpack in a custom project, add the following to your `railway.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"$schema": "https://railway.com/railway.schema.json",
|
|
151
|
+
"build": {
|
|
152
|
+
"builder": "RAILPACK"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For more build configuration settings, check out the [Railway documentation](https://docs.railway.com/guides/build-configuration).
|
|
@@ -9,7 +9,7 @@ $ bunx nuxi init my-nuxt-app
|
|
|
9
9
|
✔ Which package manager would you like to use?
|
|
10
10
|
bun
|
|
11
11
|
◐ Installing dependencies...
|
|
12
|
-
bun install v1.2.
|
|
12
|
+
bun install v1.2.22-canary.20250828T140722 (16b4bf34)
|
|
13
13
|
+ @nuxt/devtools@0.8.2
|
|
14
14
|
+ nuxt@3.7.0
|
|
15
15
|
785 packages installed [2.67s]
|
|
@@ -15,7 +15,7 @@ This will add the package to `peerDependencies` in `package.json`.
|
|
|
15
15
|
```json-diff
|
|
16
16
|
{
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
+ "@types/bun": "^1.2.
|
|
18
|
+
+ "@types/bun": "^1.2.22-canary.20250828T140722"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
```
|
|
@@ -27,7 +27,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
|
|
|
27
27
|
```json-diff
|
|
28
28
|
{
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@types/bun": "^1.2.
|
|
30
|
+
"@types/bun": "^1.2.22-canary.20250828T140722"
|
|
31
31
|
},
|
|
32
32
|
"peerDependenciesMeta": {
|
|
33
33
|
+ "@types/bun": {
|
|
@@ -97,7 +97,7 @@ $ bun update
|
|
|
97
97
|
$ bun update @types/bun --latest
|
|
98
98
|
|
|
99
99
|
# Update a dependency to a specific version
|
|
100
|
-
$ bun update @types/bun@1.2.
|
|
100
|
+
$ bun update @types/bun@1.2.22-canary.20250828T140722
|
|
101
101
|
|
|
102
102
|
# Update all dependencies to the latest versions
|
|
103
103
|
$ bun update --latest
|
|
@@ -21,7 +21,7 @@ Here's what the output of a typical test run looks like. In this case, there are
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
$ bun test
|
|
24
|
-
bun test v1.2.
|
|
24
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
25
25
|
|
|
26
26
|
test.test.js:
|
|
27
27
|
✓ add [0.87ms]
|
|
@@ -47,7 +47,7 @@ To only run certain test files, pass a positional argument to `bun test`. The ru
|
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
$ bun test test3
|
|
50
|
-
bun test v1.2.
|
|
50
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
51
51
|
|
|
52
52
|
test3.test.js:
|
|
53
53
|
✓ add [1.40ms]
|
|
@@ -85,7 +85,7 @@ Adding `-t add` will only run tests with "add" in the name. This works with test
|
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
87
|
$ bun test -t add
|
|
88
|
-
bun test v1.2.
|
|
88
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
89
89
|
|
|
90
90
|
test.test.js:
|
|
91
91
|
✓ add [1.79ms]
|
|
@@ -18,7 +18,7 @@ The first time this test is executed, Bun will evaluate the value passed into `e
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
$ bun test test/snap
|
|
21
|
-
bun test v1.2.
|
|
21
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
22
22
|
|
|
23
23
|
test/snap.test.ts:
|
|
24
24
|
✓ snapshot [1.48ms]
|
|
@@ -61,7 +61,7 @@ Later, when this test file is executed again, Bun will read the snapshot file an
|
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
63
|
$ bun test
|
|
64
|
-
bun test v1.2.
|
|
64
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
65
65
|
|
|
66
66
|
test/snap.test.ts:
|
|
67
67
|
✓ snapshot [1.05ms]
|
|
@@ -78,7 +78,7 @@ To update snapshots, use the `--update-snapshots` flag.
|
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
80
|
$ bun test --update-snapshots
|
|
81
|
-
bun test v1.2.
|
|
81
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
82
82
|
|
|
83
83
|
test/snap.test.ts:
|
|
84
84
|
✓ snapshot [0.86ms]
|
|
@@ -29,7 +29,7 @@ To regenerate snapshots, use the `--update-snapshots` flag.
|
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
$ bun test --update-snapshots
|
|
32
|
-
bun test v1.2.
|
|
32
|
+
bun test v1.2.22-canary.20250828T140722 (9c68abdb)
|
|
33
33
|
|
|
34
34
|
test/snap.test.ts:
|
|
35
35
|
✓ snapshot [0.86ms]
|
package/docs/installation.md
CHANGED
|
@@ -14,7 +14,7 @@ Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Us
|
|
|
14
14
|
```bash#macOS/Linux_(curl)
|
|
15
15
|
$ curl -fsSL https://bun.com/install | bash # for macOS, Linux, and WSL
|
|
16
16
|
# to install a specific version
|
|
17
|
-
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.
|
|
17
|
+
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.22-canary.20250828T140722"
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
```bash#npm
|
|
@@ -189,10 +189,10 @@ Since Bun is a single binary, you can install older versions of Bun by re-runnin
|
|
|
189
189
|
|
|
190
190
|
### Installing a specific version of Bun on Linux/Mac
|
|
191
191
|
|
|
192
|
-
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-v1.2.
|
|
192
|
+
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-v1.2.22-canary.20250828T140722`.
|
|
193
193
|
|
|
194
194
|
```sh
|
|
195
|
-
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.
|
|
195
|
+
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.22-canary.20250828T140722"
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
### Installing a specific version of Bun on Windows
|
|
@@ -201,7 +201,7 @@ On Windows, you can install a specific version of Bun by passing the version num
|
|
|
201
201
|
|
|
202
202
|
```sh
|
|
203
203
|
# PowerShell:
|
|
204
|
-
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.
|
|
204
|
+
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.22-canary.20250828T140722"
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
## Downloading Bun binaries directly
|
package/docs/runtime/debugger.md
CHANGED
|
@@ -124,11 +124,11 @@ await fetch("https://example.com", {
|
|
|
124
124
|
This prints the `fetch` request as a single-line `curl` command to let you copy-paste into your terminal to replicate the request.
|
|
125
125
|
|
|
126
126
|
```sh
|
|
127
|
-
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.2.
|
|
127
|
+
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.2.22-canary.20250828T140722" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
|
|
128
128
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
129
129
|
[fetch] > content-type: application/json
|
|
130
130
|
[fetch] > Connection: keep-alive
|
|
131
|
-
[fetch] > User-Agent: Bun/1.2.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.2.22-canary.20250828T140722
|
|
132
132
|
[fetch] > Accept: */*
|
|
133
133
|
[fetch] > Host: example.com
|
|
134
134
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -170,7 +170,7 @@ This prints the following to the console:
|
|
|
170
170
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
171
171
|
[fetch] > content-type: application/json
|
|
172
172
|
[fetch] > Connection: keep-alive
|
|
173
|
-
[fetch] > User-Agent: Bun/1.2.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.2.22-canary.20250828T140722
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/test/dom.md
CHANGED
package/overrides.d.ts
CHANGED
|
@@ -174,6 +174,96 @@ declare global {
|
|
|
174
174
|
UV_ENODATA: number;
|
|
175
175
|
UV_EUNATCH: number;
|
|
176
176
|
};
|
|
177
|
+
binding(m: "http_parser"): {
|
|
178
|
+
methods: [
|
|
179
|
+
"DELETE",
|
|
180
|
+
"GET",
|
|
181
|
+
"HEAD",
|
|
182
|
+
"POST",
|
|
183
|
+
"PUT",
|
|
184
|
+
"CONNECT",
|
|
185
|
+
"OPTIONS",
|
|
186
|
+
"TRACE",
|
|
187
|
+
"COPY",
|
|
188
|
+
"LOCK",
|
|
189
|
+
"MKCOL",
|
|
190
|
+
"MOVE",
|
|
191
|
+
"PROPFIND",
|
|
192
|
+
"PROPPATCH",
|
|
193
|
+
"SEARCH",
|
|
194
|
+
"UNLOCK",
|
|
195
|
+
"BIND",
|
|
196
|
+
"REBIND",
|
|
197
|
+
"UNBIND",
|
|
198
|
+
"ACL",
|
|
199
|
+
"REPORT",
|
|
200
|
+
"MKACTIVITY",
|
|
201
|
+
"CHECKOUT",
|
|
202
|
+
"MERGE",
|
|
203
|
+
"M - SEARCH",
|
|
204
|
+
"NOTIFY",
|
|
205
|
+
"SUBSCRIBE",
|
|
206
|
+
"UNSUBSCRIBE",
|
|
207
|
+
"PATCH",
|
|
208
|
+
"PURGE",
|
|
209
|
+
"MKCALENDAR",
|
|
210
|
+
"LINK",
|
|
211
|
+
"UNLINK",
|
|
212
|
+
"SOURCE",
|
|
213
|
+
"QUERY",
|
|
214
|
+
];
|
|
215
|
+
allMethods: [
|
|
216
|
+
"DELETE",
|
|
217
|
+
"GET",
|
|
218
|
+
"HEAD",
|
|
219
|
+
"POST",
|
|
220
|
+
"PUT",
|
|
221
|
+
"CONNECT",
|
|
222
|
+
"OPTIONS",
|
|
223
|
+
"TRACE",
|
|
224
|
+
"COPY",
|
|
225
|
+
"LOCK",
|
|
226
|
+
"MKCOL",
|
|
227
|
+
"MOVE",
|
|
228
|
+
"PROPFIND",
|
|
229
|
+
"PROPPATCH",
|
|
230
|
+
"SEARCH",
|
|
231
|
+
"UNLOCK",
|
|
232
|
+
"BIND",
|
|
233
|
+
"REBIND",
|
|
234
|
+
"UNBIND",
|
|
235
|
+
"ACL",
|
|
236
|
+
"REPORT",
|
|
237
|
+
"MKACTIVITY",
|
|
238
|
+
"CHECKOUT",
|
|
239
|
+
"MERGE",
|
|
240
|
+
"M - SEARCH",
|
|
241
|
+
"NOTIFY",
|
|
242
|
+
"SUBSCRIBE",
|
|
243
|
+
"UNSUBSCRIBE",
|
|
244
|
+
"PATCH",
|
|
245
|
+
"PURGE",
|
|
246
|
+
"MKCALENDAR",
|
|
247
|
+
"LINK",
|
|
248
|
+
"UNLINK",
|
|
249
|
+
"SOURCE",
|
|
250
|
+
"PRI",
|
|
251
|
+
"DESCRIBE",
|
|
252
|
+
"ANNOUNCE",
|
|
253
|
+
"SETUP",
|
|
254
|
+
"PLAY",
|
|
255
|
+
"PAUSE",
|
|
256
|
+
"TEARDOWN",
|
|
257
|
+
"GET_PARAMETER",
|
|
258
|
+
"SET_PARAMETER",
|
|
259
|
+
"REDIRECT",
|
|
260
|
+
"RECORD",
|
|
261
|
+
"FLUSH",
|
|
262
|
+
"QUERY",
|
|
263
|
+
];
|
|
264
|
+
HTTPParser: unknown;
|
|
265
|
+
ConnectionsList: unknown;
|
|
266
|
+
};
|
|
177
267
|
binding(m: string): object;
|
|
178
268
|
}
|
|
179
269
|
|
package/package.json
CHANGED