bun-types 1.2.5-canary.20250303T140616 → 1.2.5-canary.20250304T140606
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/ambient.d.ts +6 -0
- package/bun.d.ts +226 -81
- package/devserver.d.ts +24 -0
- package/docs/api/fetch.md +2 -2
- package/docs/api/spawn.md +1 -1
- package/docs/cli/publish.md +1 -1
- 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/runtime/nodejs-apis.md +1 -1
- package/docs/test/dom.md +1 -1
- package/fetch.d.ts +123 -12
- package/globals.d.ts +174 -423
- package/index.d.ts +5 -4
- package/package.json +3 -4
- package/test.d.ts +21 -0
package/ambient.d.ts
CHANGED
package/bun.d.ts
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
declare class _ShellError extends Error implements ShellOutput {
|
|
2
|
+
readonly stdout: Buffer;
|
|
3
|
+
readonly stderr: Buffer;
|
|
4
|
+
readonly exitCode: number;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Read from stdout as a string
|
|
8
|
+
*
|
|
9
|
+
* @param encoding - The encoding to use when decoding the output
|
|
10
|
+
* @returns Stdout as a string with the given encoding
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* ## Read as UTF-8 string
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const output = await $`echo hello`;
|
|
17
|
+
* console.log(output.text()); // "hello\n"
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ## Read as base64 string
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const output = await $`echo ${atob("hello")}`;
|
|
24
|
+
* console.log(output.text("base64")); // "hello\n"
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
text(encoding?: BufferEncoding): string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Read from stdout as a JSON object
|
|
32
|
+
*
|
|
33
|
+
* @returns Stdout as a JSON object
|
|
34
|
+
* @example
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* const output = await $`echo '{"hello": 123}'`;
|
|
38
|
+
* console.log(output.json()); // { hello: 123 }
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
json(): any;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Read from stdout as an ArrayBuffer
|
|
46
|
+
*
|
|
47
|
+
* @returns Stdout as an ArrayBuffer
|
|
48
|
+
* @example
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* const output = await $`echo hello`;
|
|
52
|
+
* console.log(output.arrayBuffer()); // ArrayBuffer { byteLength: 6 }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
arrayBuffer(): ArrayBuffer;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Read from stdout as a Blob
|
|
59
|
+
*
|
|
60
|
+
* @returns Stdout as a blob
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const output = await $`echo hello`;
|
|
64
|
+
* console.log(output.blob()); // Blob { size: 6, type: "" }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
blob(): Blob;
|
|
68
|
+
|
|
69
|
+
bytes(): Uint8Array;
|
|
70
|
+
}
|
|
71
|
+
|
|
1
72
|
/**
|
|
2
73
|
* Bun.js runtime APIs
|
|
3
74
|
*
|
|
@@ -16,13 +87,17 @@
|
|
|
16
87
|
declare module "bun" {
|
|
17
88
|
import type { FFIFunctionCallableSymbol } from "bun:ffi";
|
|
18
89
|
import type { Encoding as CryptoEncoding } from "crypto";
|
|
90
|
+
import type { X509Certificate } from "node:crypto";
|
|
91
|
+
import type { Stats } from "node:fs";
|
|
19
92
|
import type {
|
|
20
93
|
CipherNameAndProtocol,
|
|
21
94
|
EphemeralKeyInfo,
|
|
22
95
|
PeerCertificate,
|
|
23
96
|
} from "tls";
|
|
24
|
-
|
|
25
|
-
|
|
97
|
+
|
|
98
|
+
type DistributedOmit<T, K extends keyof T> = T extends T ? Omit<T, K> : never;
|
|
99
|
+
type PathLike = string | NodeJS.TypedArray | ArrayBufferLike | URL;
|
|
100
|
+
|
|
26
101
|
interface Env {
|
|
27
102
|
NODE_ENV?: string;
|
|
28
103
|
/**
|
|
@@ -117,77 +192,6 @@ declare module "bun" {
|
|
|
117
192
|
| SpawnOptions.Writable
|
|
118
193
|
| ReadableStream;
|
|
119
194
|
|
|
120
|
-
class ShellError extends Error implements ShellOutput {
|
|
121
|
-
readonly stdout: Buffer;
|
|
122
|
-
readonly stderr: Buffer;
|
|
123
|
-
readonly exitCode: number;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Read from stdout as a string
|
|
127
|
-
*
|
|
128
|
-
* @param encoding - The encoding to use when decoding the output
|
|
129
|
-
* @returns Stdout as a string with the given encoding
|
|
130
|
-
* @example
|
|
131
|
-
*
|
|
132
|
-
* ## Read as UTF-8 string
|
|
133
|
-
*
|
|
134
|
-
* ```ts
|
|
135
|
-
* const output = await $`echo hello`;
|
|
136
|
-
* console.log(output.text()); // "hello\n"
|
|
137
|
-
* ```
|
|
138
|
-
*
|
|
139
|
-
* ## Read as base64 string
|
|
140
|
-
*
|
|
141
|
-
* ```ts
|
|
142
|
-
* const output = await $`echo ${atob("hello")}`;
|
|
143
|
-
* console.log(output.text("base64")); // "hello\n"
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
*/
|
|
147
|
-
text(encoding?: BufferEncoding): string;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Read from stdout as a JSON object
|
|
151
|
-
*
|
|
152
|
-
* @returns Stdout as a JSON object
|
|
153
|
-
* @example
|
|
154
|
-
*
|
|
155
|
-
* ```ts
|
|
156
|
-
* const output = await $`echo '{"hello": 123}'`;
|
|
157
|
-
* console.log(output.json()); // { hello: 123 }
|
|
158
|
-
* ```
|
|
159
|
-
*
|
|
160
|
-
*/
|
|
161
|
-
json(): any;
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Read from stdout as an ArrayBuffer
|
|
165
|
-
*
|
|
166
|
-
* @returns Stdout as an ArrayBuffer
|
|
167
|
-
* @example
|
|
168
|
-
*
|
|
169
|
-
* ```ts
|
|
170
|
-
* const output = await $`echo hello`;
|
|
171
|
-
* console.log(output.arrayBuffer()); // ArrayBuffer { byteLength: 6 }
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
arrayBuffer(): ArrayBuffer;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Read from stdout as a Blob
|
|
178
|
-
*
|
|
179
|
-
* @returns Stdout as a blob
|
|
180
|
-
* @example
|
|
181
|
-
* ```ts
|
|
182
|
-
* const output = await $`echo hello`;
|
|
183
|
-
* console.log(output.blob()); // Blob { size: 6, type: "" }
|
|
184
|
-
* ```
|
|
185
|
-
*/
|
|
186
|
-
blob(): Blob;
|
|
187
|
-
|
|
188
|
-
bytes(): Uint8Array;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
195
|
class ShellPromise extends Promise<ShellOutput> {
|
|
192
196
|
get stdin(): WritableStream;
|
|
193
197
|
/**
|
|
@@ -307,12 +311,16 @@ declare module "bun" {
|
|
|
307
311
|
new (): Shell;
|
|
308
312
|
}
|
|
309
313
|
|
|
314
|
+
type ShellError = _ShellError;
|
|
315
|
+
|
|
310
316
|
export interface Shell {
|
|
311
317
|
(
|
|
312
318
|
strings: TemplateStringsArray,
|
|
313
319
|
...expressions: ShellExpression[]
|
|
314
320
|
): ShellPromise;
|
|
315
321
|
|
|
322
|
+
readonly ShellError: typeof _ShellError;
|
|
323
|
+
|
|
316
324
|
/**
|
|
317
325
|
* Perform bash-like brace expansion on the given pattern.
|
|
318
326
|
* @param pattern - Brace pattern to expand
|
|
@@ -4092,13 +4100,14 @@ declare module "bun" {
|
|
|
4092
4100
|
|
|
4093
4101
|
interface TLSWebSocketServeOptions<WebSocketDataType = undefined>
|
|
4094
4102
|
extends WebSocketServeOptions<WebSocketDataType>,
|
|
4095
|
-
|
|
4103
|
+
TLSOptionsAsDeprecated {
|
|
4096
4104
|
unix?: never;
|
|
4097
4105
|
tls?: TLSOptions | TLSOptions[];
|
|
4098
4106
|
}
|
|
4107
|
+
|
|
4099
4108
|
interface UnixTLSWebSocketServeOptions<WebSocketDataType = undefined>
|
|
4100
4109
|
extends UnixWebSocketServeOptions<WebSocketDataType>,
|
|
4101
|
-
|
|
4110
|
+
TLSOptionsAsDeprecated {
|
|
4102
4111
|
/**
|
|
4103
4112
|
* If set, the HTTP server will listen on a unix socket instead of a port.
|
|
4104
4113
|
* (Cannot be used with hostname+port)
|
|
@@ -4106,6 +4115,7 @@ declare module "bun" {
|
|
|
4106
4115
|
unix: string;
|
|
4107
4116
|
tls?: TLSOptions | TLSOptions[];
|
|
4108
4117
|
}
|
|
4118
|
+
|
|
4109
4119
|
interface ErrorLike extends Error {
|
|
4110
4120
|
code?: string;
|
|
4111
4121
|
errno?: number;
|
|
@@ -4200,11 +4210,146 @@ declare module "bun" {
|
|
|
4200
4210
|
secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
4201
4211
|
}
|
|
4202
4212
|
|
|
4203
|
-
|
|
4213
|
+
// Note for contributors: TLSOptionsAsDeprecated should be considered immutable
|
|
4214
|
+
// and new TLS option keys should only be supported on the `.tls` property (which comes
|
|
4215
|
+
// from the TLSOptions interface above).
|
|
4216
|
+
/**
|
|
4217
|
+
* This exists because Bun.serve() extends the TLSOptions object, but
|
|
4218
|
+
* they're now considered deprecated. You should be passing the
|
|
4219
|
+
* options on `.tls` instead.
|
|
4220
|
+
*
|
|
4221
|
+
* @example
|
|
4222
|
+
* ```ts
|
|
4223
|
+
* //// OLD ////
|
|
4224
|
+
* Bun.serve({
|
|
4225
|
+
* fetch: () => new Response("Hello World"),
|
|
4226
|
+
* passphrase: "secret",
|
|
4227
|
+
* });
|
|
4228
|
+
*
|
|
4229
|
+
* //// NEW ////
|
|
4230
|
+
* Bun.serve({
|
|
4231
|
+
* fetch: () => new Response("Hello World"),
|
|
4232
|
+
* tls: {
|
|
4233
|
+
* passphrase: "secret",
|
|
4234
|
+
* },
|
|
4235
|
+
* });
|
|
4236
|
+
* ```
|
|
4237
|
+
*/
|
|
4238
|
+
interface TLSOptionsAsDeprecated {
|
|
4239
|
+
/**
|
|
4240
|
+
* Passphrase for the TLS key
|
|
4241
|
+
*
|
|
4242
|
+
* @deprecated Use `.tls.passphrase` instead
|
|
4243
|
+
*/
|
|
4244
|
+
passphrase?: string;
|
|
4245
|
+
|
|
4246
|
+
/**
|
|
4247
|
+
* File path to a .pem file custom Diffie Helman parameters
|
|
4248
|
+
*
|
|
4249
|
+
* @deprecated Use `.tls.dhParamsFile` instead
|
|
4250
|
+
*/
|
|
4251
|
+
dhParamsFile?: string;
|
|
4252
|
+
|
|
4253
|
+
/**
|
|
4254
|
+
* Explicitly set a server name
|
|
4255
|
+
*
|
|
4256
|
+
* @deprecated Use `.tls.serverName` instead
|
|
4257
|
+
*/
|
|
4258
|
+
serverName?: string;
|
|
4259
|
+
|
|
4260
|
+
/**
|
|
4261
|
+
* This sets `OPENSSL_RELEASE_BUFFERS` to 1.
|
|
4262
|
+
* It reduces overall performance but saves some memory.
|
|
4263
|
+
* @default false
|
|
4264
|
+
*
|
|
4265
|
+
* @deprecated Use `.tls.lowMemoryMode` instead
|
|
4266
|
+
*/
|
|
4267
|
+
lowMemoryMode?: boolean;
|
|
4268
|
+
|
|
4269
|
+
/**
|
|
4270
|
+
* If set to `false`, any certificate is accepted.
|
|
4271
|
+
* Default is `$NODE_TLS_REJECT_UNAUTHORIZED` environment variable, or `true` if it is not set.
|
|
4272
|
+
*
|
|
4273
|
+
* @deprecated Use `.tls.rejectUnauthorized` instead
|
|
4274
|
+
*/
|
|
4275
|
+
rejectUnauthorized?: boolean;
|
|
4276
|
+
|
|
4277
|
+
/**
|
|
4278
|
+
* If set to `true`, the server will request a client certificate.
|
|
4279
|
+
*
|
|
4280
|
+
* Default is `false`.
|
|
4281
|
+
*
|
|
4282
|
+
* @deprecated Use `.tls.requestCert` instead
|
|
4283
|
+
*/
|
|
4284
|
+
requestCert?: boolean;
|
|
4285
|
+
|
|
4286
|
+
/**
|
|
4287
|
+
* Optionally override the trusted CA certificates. Default is to trust
|
|
4288
|
+
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
4289
|
+
* replaced when CAs are explicitly specified using this option.
|
|
4290
|
+
*
|
|
4291
|
+
* @deprecated Use `.tls.ca` instead
|
|
4292
|
+
*/
|
|
4293
|
+
ca?:
|
|
4294
|
+
| string
|
|
4295
|
+
| Buffer
|
|
4296
|
+
| BunFile
|
|
4297
|
+
| Array<string | Buffer | BunFile>
|
|
4298
|
+
| undefined;
|
|
4299
|
+
/**
|
|
4300
|
+
* Cert chains in PEM format. One cert chain should be provided per
|
|
4301
|
+
* private key. Each cert chain should consist of the PEM formatted
|
|
4302
|
+
* certificate for a provided private key, followed by the PEM
|
|
4303
|
+
* formatted intermediate certificates (if any), in order, and not
|
|
4304
|
+
* including the root CA (the root CA must be pre-known to the peer,
|
|
4305
|
+
* see ca). When providing multiple cert chains, they do not have to
|
|
4306
|
+
* be in the same order as their private keys in key. If the
|
|
4307
|
+
* intermediate certificates are not provided, the peer will not be
|
|
4308
|
+
* able to validate the certificate, and the handshake will fail.
|
|
4309
|
+
*
|
|
4310
|
+
* @deprecated Use `.tls.cert` instead
|
|
4311
|
+
*/
|
|
4312
|
+
cert?:
|
|
4313
|
+
| string
|
|
4314
|
+
| Buffer
|
|
4315
|
+
| BunFile
|
|
4316
|
+
| Array<string | Buffer | BunFile>
|
|
4317
|
+
| undefined;
|
|
4318
|
+
/**
|
|
4319
|
+
* Private keys in PEM format. PEM allows the option of private keys
|
|
4320
|
+
* being encrypted. Encrypted keys will be decrypted with
|
|
4321
|
+
* options.passphrase. Multiple keys using different algorithms can be
|
|
4322
|
+
* provided either as an array of unencrypted key strings or buffers,
|
|
4323
|
+
* or an array of objects in the form {pem: <string|buffer>[,
|
|
4324
|
+
* passphrase: <string>]}. The object form can only occur in an array.
|
|
4325
|
+
* object.passphrase is optional. Encrypted keys will be decrypted with
|
|
4326
|
+
* object.passphrase if provided, or options.passphrase if it is not.
|
|
4327
|
+
*
|
|
4328
|
+
* @deprecated Use `.tls.key` instead
|
|
4329
|
+
*/
|
|
4330
|
+
key?:
|
|
4331
|
+
| string
|
|
4332
|
+
| Buffer
|
|
4333
|
+
| BunFile
|
|
4334
|
+
| Array<string | Buffer | BunFile>
|
|
4335
|
+
| undefined;
|
|
4336
|
+
/**
|
|
4337
|
+
* Optionally affect the OpenSSL protocol behavior, which is not
|
|
4338
|
+
* usually necessary. This should be used carefully if at all! Value is
|
|
4339
|
+
* a numeric bitmask of the SSL_OP_* options from OpenSSL Options
|
|
4340
|
+
*
|
|
4341
|
+
* @deprecated `Use .tls.secureOptions` instead
|
|
4342
|
+
*/
|
|
4343
|
+
secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
interface TLSServeOptions extends ServeOptions, TLSOptionsAsDeprecated {
|
|
4204
4347
|
tls?: TLSOptions | TLSOptions[];
|
|
4205
4348
|
}
|
|
4206
4349
|
|
|
4207
|
-
interface UnixTLSServeOptions
|
|
4350
|
+
interface UnixTLSServeOptions
|
|
4351
|
+
extends UnixServeOptions,
|
|
4352
|
+
TLSOptionsAsDeprecated {
|
|
4208
4353
|
tls?: TLSOptions | TLSOptions[];
|
|
4209
4354
|
}
|
|
4210
4355
|
|
|
@@ -4672,7 +4817,7 @@ declare module "bun" {
|
|
|
4672
4817
|
R extends { [K in keyof R]: RouterTypes.RouteValue<K & string> },
|
|
4673
4818
|
>(
|
|
4674
4819
|
options: (
|
|
4675
|
-
| (
|
|
4820
|
+
| (DistributedOmit<Serve, "fetch"> & {
|
|
4676
4821
|
routes: R;
|
|
4677
4822
|
fetch?: (
|
|
4678
4823
|
this: Server,
|
|
@@ -4680,7 +4825,7 @@ declare module "bun" {
|
|
|
4680
4825
|
server: Server,
|
|
4681
4826
|
) => Response | Promise<Response>;
|
|
4682
4827
|
})
|
|
4683
|
-
| (
|
|
4828
|
+
| (DistributedOmit<Serve, "routes"> & {
|
|
4684
4829
|
routes?: never;
|
|
4685
4830
|
fetch: (
|
|
4686
4831
|
this: Server,
|
|
@@ -4691,7 +4836,7 @@ declare module "bun" {
|
|
|
4691
4836
|
| WebSocketServeOptions<T>
|
|
4692
4837
|
) & {
|
|
4693
4838
|
/**
|
|
4694
|
-
* @deprecated Use `routes` instead in new code. This will continue to work for
|
|
4839
|
+
* @deprecated Use `routes` instead in new code. This will continue to work for a while though.
|
|
4695
4840
|
*/
|
|
4696
4841
|
static?: R;
|
|
4697
4842
|
},
|
|
@@ -5122,7 +5267,7 @@ declare module "bun" {
|
|
|
5122
5267
|
*/
|
|
5123
5268
|
function openInEditor(path: string, options?: EditorOptions): void;
|
|
5124
5269
|
|
|
5125
|
-
|
|
5270
|
+
var fetch: typeof globalThis.fetch & {
|
|
5126
5271
|
preconnect(url: string): void;
|
|
5127
5272
|
};
|
|
5128
5273
|
|
package/devserver.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface ImportMeta {
|
|
5
|
+
/**
|
|
6
|
+
* Hot module replacement
|
|
7
|
+
*
|
|
8
|
+
* https://bun.sh/docs/bundler/fullstack
|
|
9
|
+
*/
|
|
10
|
+
hot: {
|
|
11
|
+
/**
|
|
12
|
+
* import.meta.hot.data maintains state between module instances during hot replacement, enabling data transfer from previous to new versions.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import.meta.hot.data = {
|
|
17
|
+
* bun: 'is cool',
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
data: any;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
package/docs/api/fetch.md
CHANGED
|
@@ -204,7 +204,7 @@ To customize the TLS validation, use the `checkServerIdentity` option in `tls`
|
|
|
204
204
|
await fetch("https://example.com", {
|
|
205
205
|
tls: {
|
|
206
206
|
checkServerIdentity: (hostname, peerCertificate) => {
|
|
207
|
-
// Return an
|
|
207
|
+
// Return an Error if the certificate is invalid
|
|
208
208
|
},
|
|
209
209
|
},
|
|
210
210
|
});
|
|
@@ -337,7 +337,7 @@ This will print the request and response headers to your terminal:
|
|
|
337
337
|
```sh
|
|
338
338
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
339
339
|
[fetch] > Connection: keep-alive
|
|
340
|
-
[fetch] > User-Agent: Bun/1.2.5-canary.
|
|
340
|
+
[fetch] > User-Agent: Bun/1.2.5-canary.20250304T140606
|
|
341
341
|
[fetch] > Accept: */*
|
|
342
342
|
[fetch] > Host: example.com
|
|
343
343
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/spawn.md
CHANGED
|
@@ -110,7 +110,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
110
110
|
```ts
|
|
111
111
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
112
112
|
const text = await new Response(proc.stdout).text();
|
|
113
|
-
console.log(text); // => "1.2.5-canary.
|
|
113
|
+
console.log(text); // => "1.2.5-canary.20250304T140606"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/cli/publish.md
CHANGED
|
@@ -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.5-canary.
|
|
12
|
+
bun install v1.2.5-canary.20250304T140606 (16b4bf34)
|
|
13
13
|
+ @nuxt/devtools@0.8.2
|
|
14
14
|
+ nuxt@3.7.0
|
|
15
15
|
785 packages installed [2.67s]
|
|
@@ -16,7 +16,7 @@ This will add the package to `peerDependencies` in `package.json`.
|
|
|
16
16
|
```json-diff
|
|
17
17
|
{
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
+ "@types/bun": "^1.2.5-canary.
|
|
19
|
+
+ "@types/bun": "^1.2.5-canary.20250304T140606"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
```
|
|
@@ -28,7 +28,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
|
|
|
28
28
|
```json-diff
|
|
29
29
|
{
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@types/bun": "^1.2.5-canary.
|
|
31
|
+
"@types/bun": "^1.2.5-canary.20250304T140606"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
34
34
|
+ "@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.5-canary.
|
|
100
|
+
$ bun update @types/bun@1.2.5-canary.20250304T140606
|
|
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.5-canary.
|
|
24
|
+
bun test v1.2.5-canary.20250304T140606 (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.5-canary.
|
|
50
|
+
bun test v1.2.5-canary.20250304T140606 (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.5-canary.
|
|
88
|
+
bun test v1.2.5-canary.20250304T140606 (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.5-canary.
|
|
21
|
+
bun test v1.2.5-canary.20250304T140606 (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.5-canary.
|
|
64
|
+
bun test v1.2.5-canary.20250304T140606 (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.5-canary.
|
|
81
|
+
bun test v1.2.5-canary.20250304T140606 (9c68abdb)
|
|
82
82
|
|
|
83
83
|
test/snap.test.ts:
|
|
84
84
|
✓ 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.sh/install | bash # for macOS, Linux, and WSL
|
|
16
16
|
# to install a specific version
|
|
17
|
-
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5-canary.
|
|
17
|
+
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5-canary.20250304T140606"
|
|
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.5-canary.
|
|
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.5-canary.20250304T140606`.
|
|
193
193
|
|
|
194
194
|
```sh
|
|
195
|
-
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5-canary.
|
|
195
|
+
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.5-canary.20250304T140606"
|
|
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.sh/install.ps1)} -Version 1.2.5-canary.
|
|
204
|
+
$ iex "& {$(irm https://bun.sh/install.ps1)} -Version 1.2.5-canary.20250304T140606"
|
|
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.5-canary.
|
|
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.5-canary.20250304T140606" -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.5-canary.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.2.5-canary.20250304T140606
|
|
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.5-canary.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.2.5-canary.20250304T140606
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -142,7 +142,7 @@ Some methods are not optimized yet.
|
|
|
142
142
|
|
|
143
143
|
### [`node:util`](https://nodejs.org/api/util.html)
|
|
144
144
|
|
|
145
|
-
🟡 Missing `
|
|
145
|
+
🟡 Missing `getCallSite` `getCallSites` `getSystemErrorMap` `getSystemErrorMessage` `transferableAbortSignal` `transferableAbortController` `MIMEType` `MIMEParams`
|
|
146
146
|
|
|
147
147
|
### [`node:v8`](https://nodejs.org/api/v8.html)
|
|
148
148
|
|