1
0
Fork 0

Changed stuff, added filter for statistics module

This commit is contained in:
Techognito 2025-09-02 16:37:06 +02:00
parent 4a91ae2bf9
commit fe87374e47
251 changed files with 3295 additions and 1705 deletions

2
node_modules/@types/bun/README.md generated vendored
View file

@ -13,7 +13,7 @@ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree
````
### Additional Details
* Last updated: Sat, 19 Jul 2025 15:35:34 GMT
* Last updated: Tue, 26 Aug 2025 05:02:57 GMT
* Dependencies: [bun-types](https://npmjs.com/package/bun-types)
# Credits

View file

@ -1,6 +1,6 @@
{
"name": "@types/bun",
"version": "1.2.19",
"version": "1.2.21",
"description": "TypeScript definitions for bun",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bun",
"license": "MIT",
@ -45,9 +45,9 @@
},
"scripts": {},
"dependencies": {
"bun-types": "1.2.19"
"bun-types": "1.2.21"
},
"peerDependencies": {},
"typesPublisherContentHash": "8da2dd3c51d5ee111d571de82c46eca1d872d4f3a39c3e3a06eff0ab145d6882",
"typeScriptVersion": "5.1"
"typesPublisherContentHash": "95edf465084e25778ca108276e8cf5eade636e3fed1e56e4e91d1d0cfabf74b3",
"typeScriptVersion": "5.2"
}

View file

@ -8,7 +8,7 @@ This package contains type definitions for react-dom (https://react.dev/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom.
### Additional Details
* Last updated: Wed, 04 Jun 2025 12:44:27 GMT
* Last updated: Thu, 28 Aug 2025 12:02:46 GMT
* Dependencies: none
* Peer dependencies: [@types/react](https://npmjs.com/package/@types/react)

View file

@ -30,3 +30,8 @@ import React = require("react");
import ReactDOM = require(".");
export {};
declare module "react" {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface CacheSignal extends AbortSignal {}
}

View file

@ -72,6 +72,7 @@ declare module "react" {
listener: EventListener,
optionsOrUseCapture?: Parameters<Element["removeEventListener"]>[2],
): void;
experimental_scrollIntoView(alignToTop?: boolean): void;
}
}

View file

@ -1,6 +1,6 @@
{
"name": "@types/react-dom",
"version": "19.1.6",
"version": "19.1.9",
"description": "TypeScript definitions for react-dom",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom",
"license": "MIT",
@ -123,6 +123,6 @@
"peerDependencies": {
"@types/react": "^19.0.0"
},
"typesPublisherContentHash": "7b56a76f96eb2aa35d120d8e3b6f3d4d931764fe44b89b21cd496919cab0e223",
"typeScriptVersion": "5.1"
"typesPublisherContentHash": "7dbb3f6967ec6ea50b0b724a9bb3c8d7c7b80b27e0134b57296d46f7b9291d18",
"typeScriptVersion": "5.2"
}

View file

@ -22,7 +22,7 @@ declare global {
}
import { ReactNode } from "react";
import { ErrorInfo } from "./client";
import { ErrorInfo, ReactFormState } from "./client";
export type BootstrapScriptDescriptor = {
src: string;
@ -42,6 +42,7 @@ export interface RenderToPipeableStreamOptions {
onShellError?: (error: unknown) => void;
onAllReady?: () => void;
onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
formState?: ReactFormState | null;
}
export interface PipeableStream {
@ -93,6 +94,7 @@ export interface RenderToReadableStreamOptions {
progressiveChunkSize?: number;
signal?: AbortSignal;
onError?: (error: unknown, errorInfo: ErrorInfo) => string | void;
formState?: ReactFormState | null;
}
export interface ReactDOMServerReadableStream extends ReadableStream {

View file

@ -8,7 +8,7 @@ This package contains type definitions for react (https://react.dev/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react.
### Additional Details
* Last updated: Wed, 11 Jun 2025 13:41:16 GMT
* Last updated: Wed, 27 Aug 2025 17:02:32 GMT
* Dependencies: [csstype](https://npmjs.com/package/csstype)
# Credits

View file

@ -32,4 +32,7 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
declare module "." {
export function unstable_useCacheRefresh(): () => void;
export interface CacheSignal {}
export function cacheSignal(): null | CacheSignal;
}

View file

@ -226,6 +226,11 @@ declare module "." {
| "hidden"
| "visible"
| undefined;
/**
* A name for this Activity boundary for instrumentation purposes.
* The name will help identify this boundary in React DevTools.
*/
name?: string | undefined;
children: ReactNode;
}

21
node_modules/@types/react/index.d.ts generated vendored
View file

@ -1779,8 +1779,6 @@ declare namespace React {
* `useImperativeHandle` customizes the instance value that is exposed to parent components when using
* `ref`. As always, imperative code using refs should be avoided in most cases.
*
* `useImperativeHandle` should be used with `React.forwardRef`.
*
* @version 16.8.0
* @see {@link https://react.dev/reference/react/useImperativeHandle}
*/
@ -3365,6 +3363,7 @@ declare namespace React {
charSet?: string | undefined;
crossOrigin?: CrossOrigin;
defer?: boolean | undefined;
fetchPriority?: "high" | "low" | "auto" | undefined;
integrity?: string | undefined;
noModule?: boolean | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
@ -3572,7 +3571,21 @@ declare namespace React {
direction?: number | string | undefined;
display?: number | string | undefined;
divisor?: number | string | undefined;
dominantBaseline?: number | string | undefined;
dominantBaseline?:
| "auto"
| "use-script"
| "no-change"
| "reset-size"
| "ideographic"
| "alphabetic"
| "hanging"
| "mathematical"
| "central"
| "middle"
| "text-after-edge"
| "text-before-edge"
| "inherit"
| undefined;
dur?: number | string | undefined;
dx?: number | string | undefined;
dy?: number | string | undefined;
@ -3719,7 +3732,7 @@ declare namespace React {
tableValues?: number | string | undefined;
targetX?: number | string | undefined;
targetY?: number | string | undefined;
textAnchor?: string | undefined;
textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
textDecoration?: number | string | undefined;
textLength?: number | string | undefined;
textRendering?: number | string | undefined;

View file

@ -1,6 +1,6 @@
{
"name": "@types/react",
"version": "19.1.8",
"version": "19.1.12",
"description": "TypeScript definitions for react",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react",
"license": "MIT",
@ -205,6 +205,6 @@
"csstype": "^3.0.2"
},
"peerDependencies": {},
"typesPublisherContentHash": "585a01b49a65d7fbb67c6837bf92323a5aeed126fb67079897cfc5b780c19454",
"typeScriptVersion": "5.1"
"typesPublisherContentHash": "59e7509ab740518a751d8910ee1150e7e8056ac89bef5db10db693128940b821",
"typeScriptVersion": "5.2"
}

View file

@ -32,4 +32,7 @@ type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
declare module "." {
export function unstable_useCacheRefresh(): () => void;
export interface CacheSignal {}
export function cacheSignal(): null | CacheSignal;
}

View file

@ -226,6 +226,11 @@ declare module "." {
| "hidden"
| "visible"
| undefined;
/**
* A name for this Activity boundary for instrumentation purposes.
* The name will help identify this boundary in React DevTools.
*/
name?: string | undefined;
children: ReactNode;
}

View file

@ -1777,8 +1777,6 @@ declare namespace React {
* `useImperativeHandle` customizes the instance value that is exposed to parent components when using
* `ref`. As always, imperative code using refs should be avoided in most cases.
*
* `useImperativeHandle` should be used with `React.forwardRef`.
*
* @version 16.8.0
* @see {@link https://react.dev/reference/react/useImperativeHandle}
*/
@ -3363,6 +3361,7 @@ declare namespace React {
charSet?: string | undefined;
crossOrigin?: CrossOrigin;
defer?: boolean | undefined;
fetchPriority?: "high" | "low" | "auto" | undefined;
integrity?: string | undefined;
noModule?: boolean | undefined;
referrerPolicy?: HTMLAttributeReferrerPolicy | undefined;
@ -3570,7 +3569,21 @@ declare namespace React {
direction?: number | string | undefined;
display?: number | string | undefined;
divisor?: number | string | undefined;
dominantBaseline?: number | string | undefined;
dominantBaseline?:
| "auto"
| "use-script"
| "no-change"
| "reset-size"
| "ideographic"
| "alphabetic"
| "hanging"
| "mathematical"
| "central"
| "middle"
| "text-after-edge"
| "text-before-edge"
| "inherit"
| undefined;
dur?: number | string | undefined;
dx?: number | string | undefined;
dy?: number | string | undefined;
@ -3717,7 +3730,7 @@ declare namespace React {
tableValues?: number | string | undefined;
targetX?: number | string | undefined;
targetY?: number | string | undefined;
textAnchor?: string | undefined;
textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
textDecoration?: number | string | undefined;
textLength?: number | string | undefined;
textRendering?: number | string | undefined;

View file

@ -3733,7 +3733,21 @@ declare namespace React {
direction?: number | string | undefined;
display?: number | string | undefined;
divisor?: number | string | undefined;
dominantBaseline?: number | string | undefined;
dominantBaseline?:
| "auto"
| "use-script"
| "no-change"
| "reset-size"
| "ideographic"
| "alphabetic"
| "hanging"
| "mathematical"
| "central"
| "middle"
| "text-after-edge"
| "text-before-edge"
| "inherit"
| undefined;
dur?: number | string | undefined;
dx?: number | string | undefined;
dy?: number | string | undefined;
@ -3880,7 +3894,7 @@ declare namespace React {
tableValues?: number | string | undefined;
targetX?: number | string | undefined;
targetY?: number | string | undefined;
textAnchor?: string | undefined;
textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
textDecoration?: number | string | undefined;
textLength?: number | string | undefined;
textRendering?: number | string | undefined;

View file

@ -3734,7 +3734,21 @@ declare namespace React {
direction?: number | string | undefined;
display?: number | string | undefined;
divisor?: number | string | undefined;
dominantBaseline?: number | string | undefined;
dominantBaseline?:
| "auto"
| "use-script"
| "no-change"
| "reset-size"
| "ideographic"
| "alphabetic"
| "hanging"
| "mathematical"
| "central"
| "middle"
| "text-after-edge"
| "text-before-edge"
| "inherit"
| undefined;
dur?: number | string | undefined;
dx?: number | string | undefined;
dy?: number | string | undefined;
@ -3881,7 +3895,7 @@ declare namespace React {
tableValues?: number | string | undefined;
targetX?: number | string | undefined;
targetY?: number | string | undefined;
textAnchor?: string | undefined;
textAnchor?: "start" | "middle" | "end" | "inherit" | undefined;
textDecoration?: number | string | undefined;
textLength?: number | string | undefined;
textRendering?: number | string | undefined;

1208
node_modules/bun-types/bun.d.ts generated vendored

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,88 @@
declare module "bun" {
/** @deprecated This type is unused in Bun's types and might be removed in the near future */
type Platform =
| "aix"
| "android"
| "darwin"
| "freebsd"
| "haiku"
| "linux"
| "openbsd"
| "sunos"
| "win32"
| "cygwin"
| "netbsd";
/** @deprecated This type is unused in Bun's types and might be removed in the near future */
type Architecture = "arm" | "arm64" | "ia32" | "mips" | "mipsel" | "ppc" | "ppc64" | "s390" | "s390x" | "x64";
/** @deprecated This type is unused in Bun's types and might be removed in the near future */
type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void;
/**
* Most of the time the unhandledRejection will be an Error, but this should not be relied upon
* as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
*
* @deprecated This type is unused in Bun's types and might be removed in the near future
*/
type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
/** @deprecated This type is unused in Bun's types and might be removed in the near future */
type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<unknown>, value: unknown) => void;
/**
* Consume all data from a {@link ReadableStream} until it closes or errors.
*
* Concatenate the chunks into a single {@link ArrayBuffer}.
*
* Each chunk must be a TypedArray or an ArrayBuffer. If you need to support
* chunks of different types, consider {@link readableStreamToBlob}
*
* @param stream The stream to consume.
* @returns A promise that resolves with the concatenated chunks or the concatenated chunks as a {@link Uint8Array}.
*
* @deprecated Use {@link ReadableStream.bytes}
*/
function readableStreamToBytes(
stream: ReadableStream<ArrayBufferView | ArrayBufferLike>,
): Promise<Uint8Array<ArrayBuffer>> | Uint8Array<ArrayBuffer>;
/**
* Consume all data from a {@link ReadableStream} until it closes or errors.
*
* Concatenate the chunks into a single {@link Blob}.
*
* @param stream The stream to consume.
* @returns A promise that resolves with the concatenated chunks as a {@link Blob}.
*
* @deprecated Use {@link ReadableStream.blob}
*/
function readableStreamToBlob(stream: ReadableStream): Promise<Blob>;
/**
* Consume all data from a {@link ReadableStream} until it closes or errors.
*
* Concatenate the chunks into a single string. Chunks must be a TypedArray or an ArrayBuffer. If you need to support chunks of different types, consider {@link readableStreamToBlob}.
*
* @param stream The stream to consume.
* @returns A promise that resolves with the concatenated chunks as a {@link String}.
*
* @deprecated Use {@link ReadableStream.text}
*/
function readableStreamToText(stream: ReadableStream): Promise<string>;
/**
* Consume all data from a {@link ReadableStream} until it closes or errors.
*
* Concatenate the chunks into a single string and parse as JSON. Chunks must be a TypedArray or an ArrayBuffer. If you need to support chunks of different types, consider {@link readableStreamToBlob}.
*
* @param stream The stream to consume.
* @returns A promise that resolves with the concatenated chunks as a {@link String}.
*
* @deprecated Use {@link ReadableStream.json}
*/
function readableStreamToJSON(stream: ReadableStream): Promise<any>;
interface BunMessageEvent<T> {
/**
* @deprecated
@ -31,6 +115,9 @@ declare module "bun" {
*/
type Errorlike = ErrorLike;
/** @deprecated This is unused in Bun's types and may be removed in the future */
type ShellFunction = (input: Uint8Array<ArrayBuffer>) => Uint8Array<ArrayBuffer>;
interface TLSOptions {
/**
* File path to a TLS key
@ -59,7 +146,7 @@ declare module "bun" {
}
/** @deprecated This type is unused in Bun's declarations and may be removed in the future */
type ReadableIO = ReadableStream<Uint8Array> | number | undefined;
type ReadableIO = ReadableStream<Uint8Array<ArrayBuffer>> | number | undefined;
}
declare namespace NodeJS {

View file

@ -320,7 +320,6 @@ Bun automatically sets the `Content-Type` header for request bodies when not exp
- For `Blob` objects, uses the blob's `type`
- For `FormData`, sets appropriate multipart boundary
- For JSON objects, sets `application/json`
## Debugging
@ -337,7 +336,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.2.19
[fetch] > User-Agent: Bun/1.2.21
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br

View file

@ -164,6 +164,70 @@ Static responses do not allocate additional memory after initialization. You can
Static route responses are cached for the lifetime of the server object. To reload static routes, call `server.reload(options)`.
### File Responses vs Static Responses
When serving files in routes, there are two distinct behaviors depending on whether you buffer the file content or serve it directly:
```ts
Bun.serve({
routes: {
// Static route - content is buffered in memory at startup
"/logo.png": new Response(await Bun.file("./logo.png").bytes()),
// File route - content is read from filesystem on each request
"/download.zip": new Response(Bun.file("./download.zip")),
},
});
```
**Static routes** (`new Response(await file.bytes())`) buffer content in memory at startup:
- **Zero filesystem I/O** during requests - content served entirely from memory
- **ETag support** - Automatically generates and validates ETags for caching
- **If-None-Match** - Returns `304 Not Modified` when client ETag matches
- **No 404 handling** - Missing files cause startup errors, not runtime 404s
- **Memory usage** - Full file content stored in RAM
- **Best for**: Small static assets, API responses, frequently accessed files
**File routes** (`new Response(Bun.file(path))`) read from filesystem per request:
- **Filesystem reads** on each request - checks file existence and reads content
- **Built-in 404 handling** - Returns `404 Not Found` if file doesn't exist or becomes inaccessible
- **Last-Modified support** - Uses file modification time for `If-Modified-Since` headers
- **If-Modified-Since** - Returns `304 Not Modified` when file hasn't changed since client's cached version
- **Range request support** - Automatically handles partial content requests with `Content-Range` headers
- **Streaming transfers** - Uses buffered reader with backpressure handling for efficient memory usage
- **Memory efficient** - Only buffers small chunks during transfer, not entire file
- **Best for**: Large files, dynamic content, user uploads, files that change frequently
### HTTP Caching Behavior
Both route types implement HTTP caching standards but with different strategies:
#### Static Routes Caching
- **ETag generation**: Automatically computes ETag hash from content at startup
- **If-None-Match**: Validates client ETag against server ETag
- **304 responses**: Returns `304 Not Modified` with empty body when ETags match
- **Cache headers**: Inherits any `Cache-Control` headers you provide in the Response
- **Consistency**: ETag remains constant until server restart or route reload
#### File Routes Caching
- **Last-Modified**: Uses file's `mtime` for `Last-Modified` header
- **If-Modified-Since**: Compares client date with file modification time
- **304 responses**: Returns `304 Not Modified` when file unchanged since client's cached version
- **Content-Length**: Automatically set based on current file size
- **Dynamic validation**: Checks file modification time on each request
#### Status Code Handling
Both route types automatically adjust status codes:
- **200 → 204**: Empty files (0 bytes) return `204 No Content` instead of `200 OK`
- **200 → 304**: Successful cache validation returns `304 Not Modified`
- **File routes only**: Missing or inaccessible files return `404 Not Found`
```ts
const server = Bun.serve({
static: {

View file

@ -140,7 +140,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
```ts
const proc = Bun.spawn(["bun", "--version"]);
const text = await proc.stdout.text();
console.log(text); // => "1.2.19\n"
console.log(text); // => "1.2.21\n"
```
Configure the output stream by passing one of the following values to `stdout/stderr`:

View file

@ -1,20 +1,20 @@
Bun provides native bindings for working with PostgreSQL databases with a modern, Promise-based API. The interface is designed to be simple and performant, using tagged template literals for queries and offering features like connection pooling, transactions, and prepared statements.
Bun provides native bindings for working with SQL databases through a unified Promise-based API that supports both PostgreSQL and SQLite. The interface is designed to be simple and performant, using tagged template literals for queries and offering features like connection pooling, transactions, and prepared statements.
```ts
import { sql } from "bun";
import { sql, SQL } from "bun";
// PostgreSQL (default)
const users = await sql`
SELECT * FROM users
WHERE active = ${true}
LIMIT ${10}
`;
// Select with multiple conditions
const activeUsers = await sql`
SELECT *
FROM users
WHERE active = ${true}
AND age >= ${18}
// With a a SQLite db
const sqlite = new SQL("sqlite://myapp.db");
const results = await sqlite`
SELECT * FROM users
WHERE active = ${1}
`;
```
@ -44,6 +44,115 @@ const activeUsers = await sql`
{% /features %}
## Database Support
Bun.SQL provides a unified API for multiple database systems:
### PostgreSQL
PostgreSQL is used when:
- The connection string doesn't match SQLite patterns (it's the fallback adapter)
- The connection string explicitly uses `postgres://` or `postgresql://` protocols
- No connection string is provided and environment variables point to PostgreSQL
```ts
import { sql } from "bun";
// Uses PostgreSQL if DATABASE_URL is not set or is a PostgreSQL URL
await sql`SELECT ...`;
import { SQL } from "bun";
const pg = new SQL("postgres://user:pass@localhost:5432/mydb");
await pg`SELECT ...`;
```
### SQLite
SQLite support is now built into Bun.SQL, providing the same tagged template literal interface as PostgreSQL:
```ts
import { SQL } from "bun";
// In-memory database
const memory = new SQL(":memory:");
const memory2 = new SQL("sqlite://:memory:");
// File-based database
const db = new SQL("sqlite://myapp.db");
// Using options object
const db2 = new SQL({
adapter: "sqlite",
filename: "./data/app.db",
});
// For simple filenames, specify adapter explicitly
const db3 = new SQL("myapp.db", { adapter: "sqlite" });
```
<details>
<summary>SQLite Connection String Formats</summary>
SQLite accepts various URL formats for connection strings:
```ts
// Standard sqlite:// protocol
new SQL("sqlite://path/to/database.db");
new SQL("sqlite:path/to/database.db"); // Without slashes
// file:// protocol (also recognized as SQLite)
new SQL("file://path/to/database.db");
new SQL("file:path/to/database.db");
// Special :memory: database
new SQL(":memory:");
new SQL("sqlite://:memory:");
new SQL("file://:memory:");
// Relative and absolute paths
new SQL("sqlite://./local.db"); // Relative to current directory
new SQL("sqlite://../parent/db.db"); // Parent directory
new SQL("sqlite:///absolute/path.db"); // Absolute path
// With query parameters
new SQL("sqlite://data.db?mode=ro"); // Read-only mode
new SQL("sqlite://data.db?mode=rw"); // Read-write mode (no create)
new SQL("sqlite://data.db?mode=rwc"); // Read-write-create mode (default)
```
**Note:** Simple filenames without a protocol (like `"myapp.db"`) require explicitly specifying `{ adapter: "sqlite" }` to avoid ambiguity with PostgreSQL.
</details>
<details>
<summary>SQLite-Specific Options</summary>
SQLite databases support additional configuration options:
```ts
const db = new SQL({
adapter: "sqlite",
filename: "app.db",
// SQLite-specific options
readonly: false, // Open in read-only mode
create: true, // Create database if it doesn't exist
readwrite: true, // Open for reading and writing
// Additional Bun:sqlite options
strict: true, // Enable strict mode
safeIntegers: false, // Use JavaScript numbers for integers
});
```
Query parameters in the URL are parsed to set these options:
- `?mode=ro``readonly: true`
- `?mode=rw``readonly: false, create: false`
- `?mode=rwc``readonly: false, create: true` (default)
</details>
### Inserting data
You can pass JavaScript values directly to the SQL template literal and escaping will be handled for you.
@ -251,14 +360,55 @@ await query;
## Database Environment Variables
`sql` connection parameters can be configured using environment variables. The client checks these variables in a specific order of precedence.
`sql` connection parameters can be configured using environment variables. The client checks these variables in a specific order of precedence and automatically detects the database type based on the connection string format.
The following environment variables can be used to define the connection URL:
### Automatic Database Detection
When using `Bun.sql()` without arguments or `new SQL()` with a connection string, the adapter is automatically detected based on the URL format. SQLite becomes the default adapter in these cases:
#### SQLite Auto-Detection
SQLite is automatically selected when the connection string matches these patterns:
- `:memory:` - In-memory database
- `sqlite://...` - SQLite protocol URLs
- `sqlite:...` - SQLite protocol without slashes
- `file://...` - File protocol URLs
- `file:...` - File protocol without slashes
```ts
// These all use SQLite automatically (no adapter needed)
const sql1 = new SQL(":memory:");
const sql2 = new SQL("sqlite://app.db");
const sql3 = new SQL("file://./database.db");
// Works with DATABASE_URL environment variable
DATABASE_URL=":memory:" bun run app.js
DATABASE_URL="sqlite://myapp.db" bun run app.js
DATABASE_URL="file://./data/app.db" bun run app.js
```
#### PostgreSQL Auto-Detection
PostgreSQL is the default for all other connection strings:
```bash
# PostgreSQL is detected for these patterns
DATABASE_URL="postgres://user:pass@localhost:5432/mydb" bun run app.js
DATABASE_URL="postgresql://user:pass@localhost:5432/mydb" bun run app.js
# Or any URL that doesn't match SQLite patterns
DATABASE_URL="localhost:5432/mydb" bun run app.js
```
### PostgreSQL Environment Variables
The following environment variables can be used to define the PostgreSQL connection:
| Environment Variable | Description |
| --------------------------- | ------------------------------------------ |
| `POSTGRES_URL` | Primary connection URL for PostgreSQL |
| `DATABASE_URL` | Alternative connection URL |
| `DATABASE_URL` | Alternative connection URL (auto-detected) |
| `PGURL` | Alternative connection URL |
| `PG_URL` | Alternative connection URL |
| `TLS_POSTGRES_DATABASE_URL` | SSL/TLS-enabled connection URL |
@ -274,6 +424,19 @@ If no connection URL is provided, the system checks for the following individual
| `PGPASSWORD` | - | (empty) | Database password |
| `PGDATABASE` | - | username | Database name |
### SQLite Environment Variables
SQLite connections can be configured via `DATABASE_URL` when it contains a SQLite-compatible URL:
```bash
# These are all recognized as SQLite
DATABASE_URL=":memory:"
DATABASE_URL="sqlite://./app.db"
DATABASE_URL="file:///absolute/path/to/db.sqlite"
```
**Note:** PostgreSQL-specific environment variables (`POSTGRES_URL`, `PGHOST`, etc.) are ignored when using SQLite.
## Runtime Preconnection
Bun can preconnect to PostgreSQL at startup to improve performance by establishing database connections before your application code runs. This is useful for reducing connection latency on the first database query.
@ -293,16 +456,18 @@ The `--sql-preconnect` flag will automatically establish a PostgreSQL connection
## Connection Options
You can configure your database connection manually by passing options to the SQL constructor:
You can configure your database connection manually by passing options to the SQL constructor. Options vary depending on the database adapter:
### PostgreSQL Options
```ts
import { SQL } from "bun";
const db = new SQL({
// Required
// Connection details (adapter is auto-detected as PostgreSQL)
url: "postgres://user:pass@localhost:5432/dbname",
// Optional configuration
// Alternative connection parameters
hostname: "localhost",
port: 5432,
database: "myapp",
@ -330,14 +495,53 @@ const db = new SQL({
// Callbacks
onconnect: client => {
console.log("Connected to database");
console.log("Connected to PostgreSQL");
},
onclose: client => {
console.log("Connection closed");
console.log("PostgreSQL connection closed");
},
});
```
### SQLite Options
```ts
import { SQL } from "bun";
const db = new SQL({
// Required for SQLite
adapter: "sqlite",
filename: "./data/app.db", // or ":memory:" for in-memory database
// SQLite-specific access modes
readonly: false, // Open in read-only mode
create: true, // Create database if it doesn't exist
readwrite: true, // Allow read and write operations
// SQLite data handling
strict: true, // Enable strict mode for better type safety
safeIntegers: false, // Use BigInt for integers exceeding JS number range
// Callbacks
onconnect: client => {
console.log("SQLite database opened");
},
onclose: client => {
console.log("SQLite database closed");
},
});
```
<details>
<summary>SQLite Connection Notes</summary>
- **Connection Pooling**: SQLite doesn't use connection pooling as it's a file-based database. Each `SQL` instance represents a single connection.
- **Transactions**: SQLite supports nested transactions through savepoints, similar to PostgreSQL.
- **Concurrent Access**: SQLite handles concurrent access through file locking. Use WAL mode for better concurrency.
- **Memory Databases**: Using `:memory:` creates a temporary database that exists only for the connection lifetime.
</details>
## Dynamic passwords
When clients need to use alternative authentication schemes such as access tokens or connections to databases with rotating passwords, provide either a synchronous or asynchronous function that will resolve the dynamic password value at connection time.
@ -353,11 +557,66 @@ const sql = new SQL(url, {
});
```
## SQLite-Specific Features
### Query Execution
SQLite executes queries synchronously, unlike PostgreSQL which uses asynchronous I/O. However, the API remains consistent using Promises:
```ts
const sqlite = new SQL("sqlite://app.db");
// Works the same as PostgreSQL, but executes synchronously under the hood
const users = await sqlite`SELECT * FROM users`;
// Parameters work identically
const user = await sqlite`SELECT * FROM users WHERE id = ${userId}`;
```
### SQLite Pragmas
You can use PRAGMA statements to configure SQLite behavior:
```ts
const sqlite = new SQL("sqlite://app.db");
// Enable foreign keys
await sqlite`PRAGMA foreign_keys = ON`;
// Set journal mode to WAL for better concurrency
await sqlite`PRAGMA journal_mode = WAL`;
// Check integrity
const integrity = await sqlite`PRAGMA integrity_check`;
```
### Data Type Differences
SQLite has a more flexible type system than PostgreSQL:
```ts
// SQLite stores data in 5 storage classes: NULL, INTEGER, REAL, TEXT, BLOB
const sqlite = new SQL("sqlite://app.db");
// SQLite is more lenient with types
await sqlite`
CREATE TABLE flexible (
id INTEGER PRIMARY KEY,
data TEXT, -- Can store numbers as strings
value NUMERIC, -- Can store integers, reals, or text
blob BLOB -- Binary data
)
`;
// JavaScript values are automatically converted
await sqlite`INSERT INTO flexible VALUES (${1}, ${"text"}, ${123.45}, ${Buffer.from("binary")})`;
```
## Transactions
To start a new transaction, use `sql.begin`. This method reserves a dedicated connection for the duration of the transaction and provides a scoped `sql` instance to use within the callback function. Once the callback completes, `sql.begin` resolves with the return value of the callback.
To start a new transaction, use `sql.begin`. This method works for both PostgreSQL and SQLite. For PostgreSQL, it reserves a dedicated connection from the pool. For SQLite, it begins a transaction on the single connection.
The `BEGIN` command is sent automatically, including any optional configurations you specify. If an error occurs during the transaction, a `ROLLBACK` is triggered to release the reserved connection and ensure the process continues smoothly.
The `BEGIN` command is sent automatically, including any optional configurations you specify. If an error occurs during the transaction, a `ROLLBACK` is triggered to ensure the process continues smoothly.
### Basic Transactions
@ -552,9 +811,34 @@ Note that disabling prepared statements may impact performance for queries that
## Error Handling
The client provides typed errors for different failure scenarios:
The client provides typed errors for different failure scenarios. Errors are database-specific and extend from base error classes:
### Connection Errors
### Error Classes
```ts
import { SQL } from "bun";
try {
await sql`SELECT * FROM users`;
} catch (error) {
if (error instanceof SQL.PostgresError) {
// PostgreSQL-specific error
console.log(error.code); // PostgreSQL error code
console.log(error.detail); // Detailed error message
console.log(error.hint); // Helpful hint from PostgreSQL
} else if (error instanceof SQL.SQLiteError) {
// SQLite-specific error
console.log(error.code); // SQLite error code (e.g., "SQLITE_CONSTRAINT")
console.log(error.errno); // SQLite error number
console.log(error.byteOffset); // Byte offset in SQL statement (if available)
} else if (error instanceof SQL.SQLError) {
// Generic SQL error (base class)
console.log(error.message);
}
}
```
### PostgreSQL Connection Errors
| Connection Errors | Description |
| --------------------------------- | ---------------------------------------------------- |
@ -619,6 +903,50 @@ The client provides typed errors for different failure scenarios:
| `ERR_POSTGRES_UNSAFE_TRANSACTION` | Unsafe transaction operation detected |
| `ERR_POSTGRES_INVALID_TRANSACTION_STATE` | Invalid transaction state |
### SQLite-Specific Errors
SQLite errors provide error codes and numbers that correspond to SQLite's standard error codes:
<details>
<summary>Common SQLite Error Codes</summary>
| Error Code | errno | Description |
| ------------------- | ----- | ---------------------------------------------------- |
| `SQLITE_CONSTRAINT` | 19 | Constraint violation (UNIQUE, CHECK, NOT NULL, etc.) |
| `SQLITE_BUSY` | 5 | Database is locked |
| `SQLITE_LOCKED` | 6 | Table in the database is locked |
| `SQLITE_READONLY` | 8 | Attempt to write to a readonly database |
| `SQLITE_IOERR` | 10 | Disk I/O error |
| `SQLITE_CORRUPT` | 11 | Database disk image is malformed |
| `SQLITE_FULL` | 13 | Database or disk is full |
| `SQLITE_CANTOPEN` | 14 | Unable to open database file |
| `SQLITE_PROTOCOL` | 15 | Database lock protocol error |
| `SQLITE_SCHEMA` | 17 | Database schema has changed |
| `SQLITE_TOOBIG` | 18 | String or BLOB exceeds size limit |
| `SQLITE_MISMATCH` | 20 | Data type mismatch |
| `SQLITE_MISUSE` | 21 | Library used incorrectly |
| `SQLITE_AUTH` | 23 | Authorization denied |
Example error handling:
```ts
const sqlite = new SQL("sqlite://app.db");
try {
await sqlite`INSERT INTO users (id, name) VALUES (1, 'Alice')`;
await sqlite`INSERT INTO users (id, name) VALUES (1, 'Bob')`; // Duplicate ID
} catch (error) {
if (error instanceof SQL.SQLiteError) {
if (error.code === "SQLITE_CONSTRAINT") {
console.log("Constraint violation:", error.message);
// Handle unique constraint violation
}
}
}
```
</details>
## Numbers and BigInt
Bun's SQL client includes special handling for large numbers that exceed the range of a 53-bit integer. Here's how it works:
@ -652,7 +980,6 @@ There's still some things we haven't finished yet.
- Connection preloading via `--db-preconnect` Bun CLI flag
- MySQL support: [we're working on it](https://github.com/oven-sh/bun/pull/15274)
- SQLite support: planned, but not started. Ideally, we implement it natively instead of wrapping `bun:sqlite`.
- Column name transforms (e.g. `snake_case` to `camelCase`). This is mostly blocked on a unicode-aware implementation of changing the case in C++ using WebKit's `WTF::String`.
- Column type transforms

View file

@ -208,8 +208,8 @@ export class ArrayBufferSink {
*
* This API might change later to separate Uint8ArraySink and ArrayBufferSink
*/
flush(): number | Uint8Array | ArrayBuffer;
end(): ArrayBuffer | Uint8Array;
flush(): number | Uint8Array<ArrayBuffer> | ArrayBuffer;
end(): ArrayBuffer | Uint8Array<ArrayBuffer>;
}
```

View file

@ -772,6 +772,65 @@ console.log(obj); // => { foo: "bar" }
Internally, [`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) and [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) serialize and deserialize the same way. This exposes the underlying [HTML Structured Clone Algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) to JavaScript as an ArrayBuffer.
## `Bun.stripANSI()` ~6-57x faster `strip-ansi` alternative
`Bun.stripANSI(text: string): string`
Strip ANSI escape codes from a string. This is useful for removing colors and formatting from terminal output.
```ts
const coloredText = "\u001b[31mHello\u001b[0m \u001b[32mWorld\u001b[0m";
const plainText = Bun.stripANSI(coloredText);
console.log(plainText); // => "Hello World"
// Works with various ANSI codes
const formatted = "\u001b[1m\u001b[4mBold and underlined\u001b[0m";
console.log(Bun.stripANSI(formatted)); // => "Bold and underlined"
```
`Bun.stripANSI` is significantly faster than the popular [`strip-ansi`](https://www.npmjs.com/package/strip-ansi) npm package:
```js
> bun bench/snippets/strip-ansi.mjs
cpu: Apple M3 Max
runtime: bun 1.2.21 (arm64-darwin)
benchmark avg (min … max) p75 / p99
------------------------------------------------------- ----------
Bun.stripANSI 11 chars no-ansi 8.13 ns/iter 8.27 ns
(7.45 ns … 33.59 ns) 10.29 ns
Bun.stripANSI 13 chars ansi 51.68 ns/iter 52.51 ns
(46.16 ns … 113.71 ns) 57.71 ns
Bun.stripANSI 16,384 chars long-no-ansi 298.39 ns/iter 305.44 ns
(281.50 ns … 331.65 ns) 320.70 ns
Bun.stripANSI 212,992 chars long-ansi 227.65 µs/iter 234.50 µs
(216.46 µs … 401.92 µs) 262.25 µs
```
```js
> node bench/snippets/strip-ansi.mjs
cpu: Apple M3 Max
runtime: node 24.6.0 (arm64-darwin)
benchmark avg (min … max) p75 / p99
-------------------------------------------------------- ---------
npm/strip-ansi 11 chars no-ansi 466.79 ns/iter 468.67 ns
(454.08 ns … 570.67 ns) 543.67 ns
npm/strip-ansi 13 chars ansi 546.77 ns/iter 550.23 ns
(532.74 ns … 651.08 ns) 590.35 ns
npm/strip-ansi 16,384 chars long-no-ansi 4.85 µs/iter 4.89 µs
(4.71 µs … 5.00 µs) 4.98 µs
npm/strip-ansi 212,992 chars long-ansi 1.36 ms/iter 1.38 ms
(1.27 ms … 1.73 ms) 1.49 ms
```
## `estimateShallowMemoryUsageOf` in `bun:jsc`
The `estimateShallowMemoryUsageOf` function returns a best-effort estimate of the memory usage of an object in bytes, excluding the memory usage of properties or other objects it references. For accurate per-object memory usage, use `Bun.generateHeapSnapshot`.

View file

@ -1,5 +1,5 @@
{% callout %}
**🚧** — The `Worker` API is still experimental and should not be considered ready for production.
**🚧** — The `Worker` API is still experimental (particularly for terminating workers). We are actively working on improving this.
{% /callout %}
[`Worker`](https://developer.mozilla.org/en-US/docs/Web/API/Worker) lets you start and communicate with a new JavaScript instance running on a separate thread while sharing I/O resources with the main thread.

View file

@ -408,16 +408,119 @@ $ bun build --compile --asset-naming="[name].[ext]" ./index.ts
To trim down the size of the executable a little, pass `--minify` to `bun build --compile`. This uses Bun's minifier to reduce the code size. Overall though, Bun's binary is still way too big and we need to make it smaller.
## Using Bun.build() API
You can also generate standalone executables using the `Bun.build()` JavaScript API. This is useful when you need programmatic control over the build process.
### Basic usage
```js
await Bun.build({
entrypoints: ["./app.ts"],
outdir: "./dist",
compile: {
target: "bun-windows-x64",
outfile: "myapp.exe",
},
});
```
### Windows metadata with Bun.build()
When targeting Windows, you can specify metadata through the `windows` object:
```js
await Bun.build({
entrypoints: ["./app.ts"],
outdir: "./dist",
compile: {
target: "bun-windows-x64",
outfile: "myapp.exe",
windows: {
title: "My Application",
publisher: "My Company Inc",
version: "1.2.3.4",
description: "A powerful application built with Bun",
copyright: "© 2024 My Company Inc",
hideConsole: false, // Set to true for GUI applications
icon: "./icon.ico", // Path to icon file
},
},
});
```
### Cross-compilation with Bun.build()
You can cross-compile for different platforms:
```js
// Build for multiple platforms
const platforms = [
{ target: "bun-windows-x64", outfile: "app-windows.exe" },
{ target: "bun-linux-x64", outfile: "app-linux" },
{ target: "bun-darwin-arm64", outfile: "app-macos" },
];
for (const platform of platforms) {
await Bun.build({
entrypoints: ["./app.ts"],
outdir: "./dist",
compile: platform,
});
}
```
## Windows-specific flags
When compiling a standalone executable on Windows, there are two platform-specific options that can be used to customize metadata on the generated `.exe` file:
When compiling a standalone executable for Windows, there are several platform-specific options that can be used to customize the generated `.exe` file:
- `--windows-icon=path/to/icon.ico` to customize the executable file icon.
- `--windows-hide-console` to disable the background terminal, which can be used for applications that do not need a TTY.
### Visual customization
- `--windows-icon=path/to/icon.ico` - Set the executable file icon
- `--windows-hide-console` - Disable the background terminal window (useful for GUI applications)
### Metadata customization
You can embed version information and other metadata into your Windows executable:
- `--windows-title <STR>` - Set the product name (appears in file properties)
- `--windows-publisher <STR>` - Set the company name
- `--windows-version <STR>` - Set the version number (e.g. "1.2.3.4")
- `--windows-description <STR>` - Set the file description
- `--windows-copyright <STR>` - Set the copyright information
#### Example with all metadata flags:
```sh
bun build --compile ./app.ts \
--outfile myapp.exe \
--windows-title "My Application" \
--windows-publisher "My Company Inc" \
--windows-version "1.2.3.4" \
--windows-description "A powerful application built with Bun" \
--windows-copyright "© 2024 My Company Inc"
```
This metadata will be visible in Windows Explorer when viewing the file properties:
1. Right-click the executable in Windows Explorer
2. Select "Properties"
3. Go to the "Details" tab
#### Version string format
The `--windows-version` flag accepts version strings in the following formats:
- `"1"` - Will be normalized to "1.0.0.0"
- `"1.2"` - Will be normalized to "1.2.0.0"
- `"1.2.3"` - Will be normalized to "1.2.3.0"
- `"1.2.3.4"` - Full version format
Each version component must be a number between 0 and 65535.
{% callout %}
These flags currently cannot be used when cross-compiling because they depend on Windows APIs.
These flags currently cannot be used when cross-compiling because they depend on Windows APIs. They are only available when building on Windows itself.
{% /callout %}

View file

@ -1,4 +1,4 @@
Bun's fast native bundler is now in beta. It can be used via the `bun build` CLI command or the `Bun.build()` JavaScript API.
Bun's fast native bundler can be used via the `bun build` CLI command or the `Bun.build()` JavaScript API.
{% codetabs group="a" %}

View file

@ -1,6 +1,6 @@
The Bun bundler implements a set of default loaders out of the box. As a rule of thumb, the bundler and the runtime both support the same set of file types out of the box.
`.js` `.cjs` `.mjs` `.mts` `.cts` `.ts` `.tsx` `.jsx` `.toml` `.json` `.txt` `.wasm` `.node` `.html`
`.js` `.cjs` `.mjs` `.mts` `.cts` `.ts` `.tsx` `.jsx` `.toml` `.json` `.yaml` `.yml` `.txt` `.wasm` `.node` `.html`
Bun uses the file extension to determine which built-in _loader_ should be used to parse the file. Every loader has a name, such as `js`, `tsx`, or `json`. These names are used when building [plugins](https://bun.com/docs/bundler/plugins) that extend Bun with custom loaders.
@ -121,6 +121,55 @@ export default {
{% /codetabs %}
### `yaml`
**YAML loader**. Default for `.yaml` and `.yml`.
YAML files can be directly imported. Bun will parse them with its fast native YAML parser.
```ts
import config from "./config.yaml";
config.database.host; // => "localhost"
// via import attribute:
// import myCustomYAML from './my.config' with {type: "yaml"};
```
During bundling, the parsed YAML is inlined into the bundle as a JavaScript object.
```ts
var config = {
database: {
host: "localhost",
port: 5432,
},
// ...other fields
};
config.database.host;
```
If a `.yaml` or `.yml` file is passed as an entrypoint, it will be converted to a `.js` module that `export default`s the parsed object.
{% codetabs %}
```yaml#Input
name: John Doe
age: 35
email: johndoe@example.com
```
```js#Output
export default {
name: "John Doe",
age: 35,
email: "johndoe@example.com"
}
```
{% /codetabs %}
For more details on YAML support including the runtime API `Bun.YAML.parse()`, see the [YAML API documentation](/docs/api/yaml).
### `text`
**Text loader**. Default for `.txt`.

View file

@ -183,6 +183,30 @@ Bun supports installing dependencies from Git, GitHub, and local or remotely-hos
}
```
## Installation strategies
Bun supports two package installation strategies that determine how dependencies are organized in `node_modules`:
### Hoisted installs (default for single projects)
The traditional npm/Yarn approach that flattens dependencies into a shared `node_modules` directory:
```bash
$ bun install --linker hoisted
```
### Isolated installs
A pnpm-like approach that creates strict dependency isolation to prevent phantom dependencies:
```bash
$ bun install --linker isolated
```
Isolated installs create a central package store in `node_modules/.bun/` with symlinks in the top-level `node_modules`. This ensures packages can only access their declared dependencies.
For complete documentation on isolated installs, refer to [Package manager > Isolated installs](https://bun.com/docs/install/isolated).
## Configuration
The default behavior of `bun install` can be configured in `bunfig.toml`. The default values are shown below.
@ -213,11 +237,15 @@ dryRun = false
# equivalent to `--concurrent-scripts` flag
concurrentScripts = 16 # (cpu count or GOMAXPROCS) x2
# installation strategy: "hoisted" or "isolated"
# default: "hoisted"
linker = "hoisted"
```
## CI/CD
Looking to speed up your CI? Use the official [`oven-sh/setup-bun`](https://github.com/oven-sh/setup-bun) action to install `bun` in a GitHub Actions pipeline.
Use the official [`oven-sh/setup-bun`](https://github.com/oven-sh/setup-bun) action to install `bun` in a GitHub Actions pipeline:
```yaml#.github/workflows/release.yml
name: bun-types
@ -236,4 +264,31 @@ jobs:
run: bun run build
```
For CI/CD environments that want to enforce reproducible builds, use `bun ci` to fail the build if the package.json is out of sync with the lockfile:
```bash
$ bun ci
```
This is equivalent to `bun install --frozen-lockfile`. It installs exact versions from `bun.lock` and fails if `package.json` doesn't match the lockfile. To use `bun ci` or `bun install --frozen-lockfile`, you must commit `bun.lock` to version control.
And instead of running `bun install`, run `bun ci`.
```yaml#.github/workflows/release.yml
name: bun-types
jobs:
build:
name: build-app
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun ci
- name: Build app
run: bun run build
```
{% bunCLIUsage command="install" /%}

View file

@ -213,7 +213,7 @@ To display current package version and help:
```bash
$ bun pm version
bun pm version v1.2.19 (ca7428e9)
bun pm version v1.2.21 (ca7428e9)
Current package version: v1.0.0
Increment:

View file

@ -7,7 +7,7 @@ Use `bun publish` to publish a package to the npm registry.
$ bun publish
## Output
bun publish v1.2.19 (ca7428e9)
bun publish v1.2.21 (ca7428e9)
packed 203B package.json
packed 224B README.md

View file

@ -158,7 +158,7 @@ See [Test > Lifecycle](https://bun.com/docs/test/lifecycle) for complete documen
## Mocks
Create mock functions with the `mock` function. Mocks are automatically reset between tests.
Create mock functions with the `mock` function.
```ts
import { test, expect, mock } from "bun:test";

View file

@ -10,6 +10,86 @@ To update a specific dependency to the latest version:
$ bun update [package]
```
## `--interactive`
For a more controlled update experience, use the `--interactive` flag to select which packages to update:
```sh
$ bun update --interactive
$ bun update -i
```
This launches an interactive terminal interface that shows all outdated packages with their current and target versions. You can then select which packages to update.
### Interactive Interface
The interface displays packages grouped by dependency type:
```
? Select packages to update - Space to toggle, Enter to confirm, a to select all, n to select none, i to invert, l to toggle latest
dependencies Current Target Latest
□ react 17.0.2 18.2.0 18.3.1
□ lodash 4.17.20 4.17.21 4.17.21
devDependencies Current Target Latest
□ typescript 4.8.0 5.0.0 5.3.3
@types/node 16.11.7 18.0.0 20.11.5
optionalDependencies Current Target Latest
□ some-optional-package 1.0.0 1.1.0 1.2.0
```
**Sections:**
- Packages are grouped under section headers: `dependencies`, `devDependencies`, `peerDependencies`, `optionalDependencies`
- Each section shows column headers aligned with the package data
**Columns:**
- **Package**: Package name (may have suffix like ` dev`, ` peer`, ` optional` for clarity)
- **Current**: Currently installed version
- **Target**: Version that would be installed (respects semver constraints)
- **Latest**: Latest available version
### Keyboard Controls
**Selection:**
- **Space**: Toggle package selection
- **Enter**: Confirm selections and update
- **a/A**: Select all packages
- **n/N**: Select none
- **i/I**: Invert selection
**Navigation:**
- **↑/↓ Arrow keys** or **j/k**: Move cursor
- **l/L**: Toggle between target and latest version for current package
**Exit:**
- **Ctrl+C** or **Ctrl+D**: Cancel without updating
### Visual Indicators
- **☑** Selected packages (will be updated)
- **□** Unselected packages
- **>** Current cursor position
- **Colors**: Red (major), yellow (minor), green (patch) version changes
- **Underlined**: Currently selected update target
### Package Grouping
Packages are organized in sections by dependency type:
- **dependencies** - Regular runtime dependencies
- **devDependencies** - Development dependencies
- **peerDependencies** - Peer dependencies
- **optionalDependencies** - Optional dependencies
Within each section, individual packages may have additional suffixes (` dev`, ` peer`, ` optional`) for extra clarity.
## `--latest`
By default, `bun update` will update to the latest version of a dependency that satisfies the version range specified in your `package.json`.
@ -20,6 +100,8 @@ To update to the latest version, regardless of if it's compatible with the curre
$ bun update --latest
```
In interactive mode, you can toggle individual packages between their target version (respecting semver) and latest version using the **l** key.
For example, with the following `package.json`:
```json

View file

@ -9,7 +9,7 @@ $ bunx nuxi init my-nuxt-app
✔ Which package manager would you like to use?
bun
◐ Installing dependencies...
bun install v1.2.19 (16b4bf34)
bun install v1.2.21 (16b4bf34)
+ @nuxt/devtools@0.8.2
+ nuxt@3.7.0
785 packages installed [2.67s]

View file

@ -15,7 +15,7 @@ This will add the package to `peerDependencies` in `package.json`.
```json-diff
{
"peerDependencies": {
+ "@types/bun": "^1.2.19"
+ "@types/bun": "^1.2.21"
}
}
```
@ -27,7 +27,7 @@ Running `bun install` will install peer dependencies by default, unless marked o
```json-diff
{
"peerDependencies": {
"@types/bun": "^1.2.19"
"@types/bun": "^1.2.21"
},
"peerDependenciesMeta": {
+ "@types/bun": {

View file

@ -97,7 +97,7 @@ $ bun update
$ bun update @types/bun --latest
# Update a dependency to a specific version
$ bun update @types/bun@1.2.19
$ bun update @types/bun@1.2.21
# Update all dependencies to the latest versions
$ bun update --latest

View file

@ -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.2.19 (9c68abdb)
bun test v1.2.21 (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.2.19 (9c68abdb)
bun test v1.2.21 (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.2.19 (9c68abdb)
bun test v1.2.21 (9c68abdb)
test.test.js:
✓ add [1.79ms]

View file

@ -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.2.19 (9c68abdb)
bun test v1.2.21 (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.2.19 (9c68abdb)
bun test v1.2.21 (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.2.19 (9c68abdb)
bun test v1.2.21 (9c68abdb)
test/snap.test.ts:
✓ snapshot [0.86ms]

View file

@ -29,7 +29,7 @@ To regenerate snapshots, use the `--update-snapshots` flag.
```sh
$ bun test --update-snapshots
bun test v1.2.19 (9c68abdb)
bun test v1.2.21 (9c68abdb)
test/snap.test.ts:
✓ snapshot [0.86ms]

View file

@ -14,7 +14,7 @@ if (typeof Bun !== "undefined") {
---
In TypeScript environments, the previous approach will result in a type error unless `bun-types` is globally installed. To avoid this, you can check `process.versions` instead.
In TypeScript environments, the previous approach will result in a type error unless `@types/bun` is installed. To avoid this, you can check `process.versions` instead.
```ts
if (process.versions.bun) {

View file

@ -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; // => "1.2.19"
Bun.version; // => "1.2.21"
```
---

View file

@ -81,6 +81,14 @@ $ bun install --verbose # debug logging
$ bun install --silent # no logging
```
To use isolated installs instead of the default hoisted strategy:
```bash
$ bun install --linker isolated
```
Isolated installs create strict dependency isolation similar to pnpm, preventing phantom dependencies and ensuring more deterministic builds. For complete documentation, see [Isolated installs](https://bun.com/docs/install/isolated).
{% details summary="Configuring behavior" %}
The default behavior of `bun install` can be configured in `bunfig.toml`:
@ -110,6 +118,10 @@ dryRun = false
# equivalent to `--concurrent-scripts` flag
concurrentScripts = 16 # (cpu count or GOMAXPROCS) x2
# installation strategy: "hoisted" or "isolated"
# default: "hoisted"
linker = "hoisted"
```
{% /details %}

View file

@ -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.com/install | bash # for macOS, Linux, and WSL
# to install a specific version
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.19"
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.21"
```
```bash#npm
@ -189,10 +189,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.2.0` or `bun-v1.2.19`.
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.21`.
```sh
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.19"
$ curl -fsSL https://bun.com/install | bash -s "bun-v1.2.21"
```
### 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
```sh
# PowerShell:
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.19"
$ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.2.21"
```
## Downloading Bun binaries directly

View file

@ -20,7 +20,7 @@ this one:
Given a file implementing a simple function, such as `add`
```zig#src/bun.js/math.zig
pub fn add(global: *JSC.JSGlobalObject, a: i32, b: i32) !i32 {
pub fn add(global: *jsc.JSGlobalObject, a: i32, b: i32) !i32 {
return std.math.add(i32, a, b) catch {
// Binding functions can return `error.OutOfMemory` and `error.JSError`.
// Others like `error.Overflow` from `std.math.add` must be converted.
@ -33,7 +33,7 @@ const gen = bun.gen.math; // "math" being this file's basename
const std = @import("std");
const bun = @import("bun");
const JSC = bun.JSC;
const jsc = bun.jsc;
```
Then describe the API schema using a `.bind.ts` function. The binding file goes next to the Zig file.

View file

@ -160,6 +160,7 @@ In particular, these are:
- `./src/codegen/generate-jssink.ts` -- Generates `build/debug/codegen/JSSink.cpp`, `build/debug/codegen/JSSink.h` which implement various classes for interfacing with `ReadableStream`. This is internally how `FileSink`, `ArrayBufferSink`, `"type": "direct"` streams and other code related to streams works.
- `./src/codegen/generate-classes.ts` -- Generates `build/debug/codegen/ZigGeneratedClasses*`, which generates Zig & C++ bindings for JavaScriptCore classes implemented in Zig. In `**/*.classes.ts` files, we define the interfaces for various classes, methods, prototypes, getters/setters etc which the code generator reads to generate boilerplate code implementing the JavaScript objects in C++ and wiring them up to Zig
- `./src/codegen/cppbind.ts` -- Generates automatic Zig bindings for C++ functions marked with `[[ZIG_EXPORT]]` attributes.
- `./src/codegen/bundle-modules.ts` -- Bundles built-in modules like `node:fs`, `bun:ffi` into files we can include in the final binary. In development, these can be reloaded without rebuilding Zig (you still need to run `bun run build`, but it re-reads the transpiled files from disk afterwards). In release builds, these are embedded into the binary.
- `./src/codegen/bundle-functions.ts` -- Bundles globally-accessible functions implemented in JavaScript/TypeScript like `ReadableStream`, `WritableStream`, and a handful more. These are used similarly to the builtin modules, but the output more closely aligns with what WebKit/Safari does for Safari's built-in functions so that we can copy-paste the implementations from WebKit as a starting point.

View file

@ -195,12 +195,12 @@ Click the link in the right column to jump to the associated documentation.
---
- Parsing & Formatting
- [`Bun.semver`](https://bun.com/docs/api/semver), `Bun.TOML.parse`, [`Bun.color`](https://bun.com/docs/api/color)
- [`Bun.semver`](https://bun.com/docs/api/semver), `Bun.TOML.parse`, [`Bun.YAML.parse`](https://bun.com/docs/api/yaml), [`Bun.color`](https://bun.com/docs/api/color)
---
- Low-level / Internals
- `Bun.mmap`, `Bun.gc`, `Bun.generateHeapSnapshot`, [`bun:jsc`](https://bun.com/docs/api/bun-jsc)
- `Bun.mmap`, `Bun.gc`, `Bun.generateHeapSnapshot`, [`bun:jsc`](https://bun.com/reference/bun/jsc)
---

View file

@ -94,6 +94,7 @@ Bun supports the following loaders:
- `file`
- `json`
- `toml`
- `yaml`
- `wasm`
- `napi`
- `base64`
@ -496,6 +497,62 @@ Whether to generate a non-Bun lockfile alongside `bun.lock`. (A `bun.lock` will
print = "yarn"
```
### `install.security.scanner`
Configure a security scanner to scan packages for vulnerabilities before installation.
First, install a security scanner from npm:
```bash
$ bun add -d @acme/bun-security-scanner
```
Then configure it in your `bunfig.toml`:
```toml
[install.security]
scanner = "@acme/bun-security-scanner"
```
When a security scanner is configured:
- Auto-install is automatically disabled for security
- Packages are scanned before installation
- Installation is cancelled if fatal issues are found
- Security warnings are displayed during installation
Learn more about [using and writing security scanners](/docs/install/security).
### `install.linker`
Configure the default linker strategy. Default `"hoisted"`.
For complete documentation refer to [Package manager > Isolated installs](https://bun.com/docs/install/isolated).
```toml
[install]
linker = "hoisted"
```
Valid values are:
{% table %}
- Value
- Description
---
- `"hoisted"`
- Link dependencies in a shared `node_modules` directory.
---
- `"isolated"`
- Link dependencies inside each package installation.
{% /table %}
<!-- ## Debugging -->
<!--

View file

@ -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.2.19" -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/1.2.21" -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.2.19
[fetch] > User-Agent: Bun/1.2.21
[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.2.19
[fetch] > User-Agent: Bun/1.2.21
[fetch] > Accept: */*
[fetch] > Host: example.com
[fetch] > Accept-Encoding: gzip, deflate, br

View file

@ -92,15 +92,18 @@ every file before execution. Its transpiler can directly run TypeScript and JSX
## JSX
## JSON and TOML
## JSON, TOML, and YAML
Source files can import a `*.json` or `*.toml` file to load its contents as a plain old JavaScript object.
Source files can import `*.json`, `*.toml`, or `*.yaml` files to load their contents as plain JavaScript objects.
```ts
import pkg from "./package.json";
import bunfig from "./bunfig.toml";
import config from "./config.yaml";
```
See the [YAML API documentation](/docs/api/yaml) for more details on YAML support.
## WASI
{% callout %}

View file

@ -52,15 +52,18 @@ Hello world!
{% /codetabs %}
## JSON and TOML
## JSON, TOML, and YAML
JSON and TOML files can be directly imported from a source file. The contents will be loaded and returned as a JavaScript object.
JSON, TOML, and YAML files can be directly imported from a source file. The contents will be loaded and returned as a JavaScript object.
```ts
import pkg from "./package.json";
import data from "./data.toml";
import config from "./config.yaml";
```
For more details on YAML support, see the [YAML API documentation](/docs/api/yaml).
## WASI
{% callout %}

View file

@ -148,7 +148,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
### [`node:vm`](https://nodejs.org/api/vm.html)
🟡 Core functionality works, but experimental VM ES modules are not implemented, including `vm.Module`, `vm.SourceTextModule`, `vm.SyntheticModule`,`importModuleDynamically`, and `vm.measureMemory`. Options like `timeout`, `breakOnSigint`, `cachedData` are not implemented yet.
🟡 Core functionality and ES modules are implemented, including `vm.Script`, `vm.createContext`, `vm.runInContext`, `vm.runInNewContext`, `vm.runInThisContext`, `vm.compileFunction`, `vm.isContext`, `vm.Module`, `vm.SourceTextModule`, `vm.SyntheticModule`, and `importModuleDynamically` support. Options like `timeout` and `breakOnSigint` are fully supported. Missing `vm.measureMemory` and some `cachedData` functionality.
### [`node:wasi`](https://nodejs.org/api/wasi.html)
@ -214,6 +214,10 @@ The table below lists all globals implemented by Node.js and Bun's current compa
🟢 Fully implemented.
### [`Atomics`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics)
🟢 Fully implemented.
### [`BroadcastChannel`](https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel)
🟢 Fully implemented.

View file

@ -532,6 +532,74 @@ Hello World! pwd=C:\Users\Demo
Bun Shell is a small programming language in Bun that is implemented in Zig. It includes a handwritten lexer, parser, and interpreter. Unlike bash, zsh, and other shells, Bun Shell runs operations concurrently.
## Security in the Bun shell
By design, the Bun shell _does not invoke a system shell_ (like `/bin/sh`) and
is instead a re-implementation of bash that runs in the same Bun process,
designed with security in mind.
When parsing command arguments, it treats all _interpolated variables_ as single, literal strings.
This protects the Bun shell against **command injection**:
```js
import { $ } from "bun";
const userInput = "my-file.txt; rm -rf /";
// SAFE: `userInput` is treated as a single quoted string
await $`ls ${userInput}`;
```
In the above example, `userInput` is treated as a single string. This causes
the `ls` command to try to read the contents of a single directory named
"my-file; rm -rf /".
### Security considerations
While command injection is prevented by default, developers are still
responsible for security in certain scenarios.
Similar to the `Bun.spawn` or `node:child_process.exec()` APIs, you can intentionally
execute a command which spawns a new shell (e.g. `bash -c`) with arguments.
When you do this, you hand off control, and Bun's built-in protections no
longer apply to the string interpreted by that new shell.
```js
import { $ } from "bun";
const userInput = "world; touch /tmp/pwned";
// UNSAFE: You have explicitly started a new shell process with `bash -c`.
// This new shell will execute the `touch` command. Any user input
// passed this way must be rigorously sanitized.
await $`bash -c "echo ${userInput}"`;
```
### Argument injection
The Bun shell cannot know how an external command interprets its own
command-line arguments. An attacker can supply input that the target program
recognizes as one of its own options or flags, leading to unintended behavior.
```js
import { $ } from "bun";
// Malicious input formatted as a Git command-line flag
const branch = "--upload-pack=echo pwned";
// UNSAFE: While Bun safely passes the string as a single argument,
// the `git` program itself sees and acts upon the malicious flag.
await $`git ls-remote origin ${branch}`;
```
{% callout %}
**Recommendation** — As is best practice in every language, always sanitize
user-provided input before passing it as an argument to an external command.
The responsibility for validating arguments rests with your application code.
{% /callout %}
## Credits
Large parts of this API were inspired by [zx](https://github.com/google/zx), [dax](https://github.com/dsherret/dax), and [bnx](https://github.com/wobsoriano/bnx). Thank you to the authors of those projects.

View file

@ -55,7 +55,7 @@ Let's run this test with `bun test`:
```bash
$ bun test
bun test v1.2.19
bun test v1.2.21
dom.test.ts:
✓ dom test [0.82ms]

View file

@ -426,6 +426,54 @@ test("exactly two assertions", () => {
This helps ensure all your assertions run, especially in complex async code with multiple code paths.
## Type Testing
Bun includes `expectTypeOf` for testing typescript types, compatible with Vitest.
### expectTypeOf
{% callout %}
**Note** — These functions are no-ops at runtime - you need to run TypeScript separately to verify the type checks.
{% endcallout %}
The `expectTypeOf` function provides type-level assertions that are checked by TypeScript's type checker. **Important**:
To test your types:
1. Write your type assertions using `expectTypeOf`
2. Run `bunx tsc --noEmit` to check that your types are correct
```ts
import { expectTypeOf } from "bun:test";
// Basic type assertions
expectTypeOf<string>().toEqualTypeOf<string>();
expectTypeOf(123).toBeNumber();
expectTypeOf("hello").toBeString();
// Object type matching
expectTypeOf({ a: 1, b: "hello" }).toMatchObjectType<{ a: number }>();
// Function types
function greet(name: string): string {
return `Hello ${name}`;
}
expectTypeOf(greet).toBeFunction();
expectTypeOf(greet).parameters.toEqualTypeOf<[string]>();
expectTypeOf(greet).returns.toEqualTypeOf<string>();
// Array types
expectTypeOf([1, 2, 3]).items.toBeNumber();
// Promise types
expectTypeOf(Promise.resolve(42)).resolves.toBeNumber();
```
For full documentation on expectTypeOf matchers, see the [API Reference](/reference/bun/test/expectTypeOf)
## Matchers
Bun implements the following matchers. Full Jest compatibility is on the roadmap; track progress [here](https://github.com/oven-sh/bun/issues/1825).
@ -629,17 +677,17 @@ Bun implements the following matchers. Full Jest compatibility is on the roadmap
---
-
-
- [`.toHaveReturnedWith()`](https://jestjs.io/docs/expect#tohavereturnedwithvalue)
---
-
-
- [`.toHaveLastReturnedWith()`](https://jestjs.io/docs/expect#tohavelastreturnedwithvalue)
---
-
-
- [`.toHaveNthReturnedWith()`](https://jestjs.io/docs/expect#tohaventhreturnedwithnthcall-value)
---

View file

@ -8,6 +8,16 @@ declare module "*.toml" {
export = contents;
}
declare module "*.yaml" {
var contents: any;
export = contents;
}
declare module "*.yml" {
var contents: any;
export = contents;
}
declare module "*.jsonc" {
var contents: any;
export = contents;

22
node_modules/bun-types/fetch.d.ts generated vendored
View file

@ -1,19 +1,21 @@
/*
This file does not declare any global types.
That should only happen in [./globals.d.ts](./globals.d.ts)
so that our documentation generator can pick it up, as it
expects all globals to be declared in one file.
* This file does not declare any global types.
*
* That should only happen in [./globals.d.ts](./globals.d.ts)
* so that our documentation generator can pick it up, as it
* expects all globals to be declared in one file.
*
* This may change in the future, which would be
* a nice thing as it would allow us to split up
* relevant types into their own files.
*/
declare module "bun" {
type HeadersInit = string[][] | Record<string, string | ReadonlyArray<string>> | Headers;
type BodyInit =
| ReadableStream
| Bun.XMLHttpRequestBodyInit
| URLSearchParams
// Extras that Bun supports:
| AsyncIterable<string | ArrayBuffer | ArrayBufferView>
| AsyncGenerator<string | ArrayBuffer | ArrayBufferView>
| (() => AsyncGenerator<string | ArrayBuffer | ArrayBufferView>);
@ -26,7 +28,7 @@ declare module "bun" {
? {}
: Omit<import("undici-types").RequestInit, "body" | "headers"> & {
body?: Bun.BodyInit | null | undefined;
headers?: Bun.HeadersInit;
headers?: Bun.HeadersInit | undefined;
};
interface BunHeadersOverride extends LibOrFallbackHeaders {

31
node_modules/bun-types/globals.d.ts generated vendored
View file

@ -999,6 +999,7 @@ interface ArrayBuffer {
* Read-only. The length of the ArrayBuffer (in bytes).
*/
readonly byteLength: number;
/**
* Resize an ArrayBuffer in-place.
*/
@ -1008,7 +1009,6 @@ interface ArrayBuffer {
* Returns a section of an ArrayBuffer.
*/
slice(begin: number, end?: number): ArrayBuffer;
readonly [Symbol.toStringTag]: string;
}
interface SharedArrayBuffer {
@ -1284,7 +1284,7 @@ interface ImportMeta {
* )
* ```
*/
readonly main: boolean;
main: boolean;
/** Alias of `import.meta.dir`. Exists for Node.js compatibility */
dirname: string;
@ -1426,12 +1426,12 @@ interface Blob {
/**
* Returns a promise that resolves to the contents of the blob as a Uint8Array (array of bytes) its the same as `new Uint8Array(await blob.arrayBuffer())`
*/
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/**
* Returns a readable stream of the blob's contents
*/
stream(): ReadableStream<Uint8Array>;
stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
}
declare var Blob: Bun.__internal.UseLibDomIfAvailable<
@ -1506,14 +1506,14 @@ interface Uint8ArrayConstructor {
alphabet?: "base64" | "base64url";
lastChunkHandling?: "loose" | "strict" | "stop-before-partial";
},
): Uint8Array;
): Uint8Array<ArrayBuffer>;
/**
* Create a new Uint8Array from a hex encoded string
* @param hex The hex encoded string to convert to a Uint8Array
* @returns A new Uint8Array containing the decoded data
*/
fromHex(hex: string): Uint8Array;
fromHex(hex: string): Uint8Array<ArrayBuffer>;
}
interface BroadcastChannel extends Bun.__internal.LibEmptyOrBroadcastChannel {}
@ -1888,6 +1888,25 @@ interface BunFetchRequestInit extends RequestInit {
* ```
*/
unix?: string;
/**
* Control automatic decompression of the response body.
* When set to `false`, the response body will not be automatically decompressed,
* and the `Content-Encoding` header will be preserved. This can improve performance
* when you need to handle compressed data manually or forward it as-is.
* This is a custom property that is not part of the Fetch API specification.
*
* @default true
* @example
* ```js
* // Disable automatic decompression for a proxy server
* const response = await fetch("https://example.com/api", {
* decompress: false
* });
* // response.headers.get('content-encoding') might be 'gzip' or 'br'
* ```
*/
decompress?: boolean;
}
/**

2
node_modules/bun-types/index.d.ts generated vendored
View file

@ -21,6 +21,8 @@
/// <reference path="./redis.d.ts" />
/// <reference path="./shell.d.ts" />
/// <reference path="./experimental.d.ts" />
/// <reference path="./sql.d.ts" />
/// <reference path="./security.d.ts" />
/// <reference path="./bun.ns.d.ts" />

View file

@ -6,14 +6,17 @@ declare module "stream/web" {
* Consume a ReadableStream as text
*/
text(): Promise<string>;
/**
* Consume a ReadableStream as a Uint8Array
*/
bytes(): Promise<Uint8Array>;
bytes(): Promise<Uint8Array<ArrayBuffer>>;
/**
* Consume a ReadableStream as JSON
*/
json(): Promise<any>;
/**
* Consume a ReadableStream as a Blob
*/
@ -21,6 +24,12 @@ declare module "stream/web" {
}
}
declare module "url" {
interface URLSearchParams {
toJSON(): Record<string, string>;
}
}
declare global {
namespace NodeJS {
interface ProcessEnv extends Bun.Env {}

14
node_modules/bun-types/package.json generated vendored
View file

@ -1,5 +1,5 @@
{
"version": "1.2.19",
"version": "1.2.21",
"name": "bun-types",
"license": "MIT",
"types": "./index.d.ts",
@ -11,10 +11,11 @@
},
"files": [
"./*.d.ts",
"docs/**/*.md",
"docs/*.md",
"CLAUDE.md",
"README.md"
"./vendor/**/*.d.ts",
"./docs/**/*.md",
"./docs/*.md",
"./CLAUDE.md",
"./README.md"
],
"homepage": "https://bun.com",
"dependencies": {
@ -24,8 +25,7 @@
"@types/react": "^19"
},
"devDependencies": {
"@types/react": "^19",
"typescript": "^5.0.2"
"@types/react": "^19"
},
"scripts": {
"prebuild": "echo $(pwd)",

44
node_modules/bun-types/redis.d.ts generated vendored
View file

@ -574,6 +574,50 @@ declare module "bun" {
*/
getex(key: RedisClient.KeyLike): Promise<string | null>;
/**
* Get the value of a key and set its expiration in seconds
* @param key The key to get
* @param ex Set the specified expire time, in seconds
* @param seconds The number of seconds until expiration
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
*/
getex(key: RedisClient.KeyLike, ex: "EX", seconds: number): Promise<string | null>;
/**
* Get the value of a key and set its expiration in milliseconds
* @param key The key to get
* @param px Set the specified expire time, in milliseconds
* @param milliseconds The number of milliseconds until expiration
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
*/
getex(key: RedisClient.KeyLike, px: "PX", milliseconds: number): Promise<string | null>;
/**
* Get the value of a key and set its expiration at a specific Unix timestamp in seconds
* @param key The key to get
* @param exat Set the specified Unix time at which the key will expire, in seconds
* @param timestampSeconds The Unix timestamp in seconds
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
*/
getex(key: RedisClient.KeyLike, exat: "EXAT", timestampSeconds: number): Promise<string | null>;
/**
* Get the value of a key and set its expiration at a specific Unix timestamp in milliseconds
* @param key The key to get
* @param pxat Set the specified Unix time at which the key will expire, in milliseconds
* @param timestampMilliseconds The Unix timestamp in milliseconds
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
*/
getex(key: RedisClient.KeyLike, pxat: "PXAT", timestampMilliseconds: number): Promise<string | null>;
/**
* Get the value of a key and remove its expiration
* @param key The key to get
* @param persist Remove the expiration from the key
* @returns Promise that resolves with the value of the key, or null if the key doesn't exist
*/
getex(key: RedisClient.KeyLike, persist: "PERSIST"): Promise<string | null>;
/**
* Ping the server
* @returns Promise that resolves with "PONG" if the server is reachable, or throws an error if the server is not reachable

4
node_modules/bun-types/s3.d.ts generated vendored
View file

@ -487,8 +487,8 @@ declare module "bun" {
* // Process text chunk by chunk
* }
*/
readonly readable: ReadableStream;
stream(): ReadableStream;
readonly readable: ReadableStream<Uint8Array<ArrayBuffer>>;
stream(): ReadableStream<Uint8Array<ArrayBuffer>>;
/**
* The name or path of the file in the bucket.

8
node_modules/bun-types/shell.d.ts generated vendored
View file

@ -1,6 +1,4 @@
declare module "bun" {
type ShellFunction = (input: Uint8Array) => Uint8Array;
type ShellExpression =
| { toString(): string }
| Array<ShellExpression>
@ -213,7 +211,7 @@ declare module "bun" {
* try {
* const result = await $`exit 1`;
* } catch (error) {
* if (error instanceof ShellError) {
* if (error instanceof $.ShellError) {
* console.log(error.exitCode); // 1
* }
* }
@ -294,7 +292,7 @@ declare module "bun" {
* console.log(output.bytes()); // Uint8Array { byteLength: 6 }
* ```
*/
bytes(): Uint8Array;
bytes(): Uint8Array<ArrayBuffer>;
}
interface ShellOutput {
@ -361,7 +359,7 @@ declare module "bun" {
* console.log(output.bytes()); // Uint8Array { byteLength: 6 }
* ```
*/
bytes(): Uint8Array;
bytes(): Uint8Array<ArrayBuffer>;
/**
* Read from stdout as a Blob

215
node_modules/bun-types/sqlite.d.ts generated vendored
View file

@ -24,6 +24,66 @@
* | `null` | `NULL` |
*/
declare module "bun:sqlite" {
/**
* Options for {@link Database}
*/
export interface DatabaseOptions {
/**
* Open the database as read-only (no write operations, no create).
*
* Equivalent to {@link constants.SQLITE_OPEN_READONLY}
*/
readonly?: boolean;
/**
* Allow creating a new database
*
* Equivalent to {@link constants.SQLITE_OPEN_CREATE}
*/
create?: boolean;
/**
* Open the database as read-write
*
* Equivalent to {@link constants.SQLITE_OPEN_READWRITE}
*/
readwrite?: boolean;
/**
* When set to `true`, integers are returned as `bigint` types.
*
* When set to `false`, integers are returned as `number` types and truncated to 52 bits.
*
* @default false
* @since v1.1.14
*/
safeIntegers?: boolean;
/**
* When set to `false` or `undefined`:
* - Queries missing bound parameters will NOT throw an error
* - Bound named parameters in JavaScript need to exactly match the SQL query.
*
* @example
* ```ts
* const db = new Database(":memory:", { strict: false });
* db.run("INSERT INTO foo (name) VALUES ($name)", { $name: "foo" });
* ```
*
* When set to `true`:
* - Queries missing bound parameters will throw an error
* - Bound named parameters in JavaScript no longer need to be `$`, `:`, or `@`. The SQL query will remain prefixed.
*
* @example
* ```ts
* const db = new Database(":memory:", { strict: true });
* db.run("INSERT INTO foo (name) VALUES ($name)", { name: "foo" });
* ```
* @since v1.1.14
*/
strict?: boolean;
}
/**
* A SQLite3 database
*
@ -53,8 +113,6 @@ declare module "bun:sqlite" {
* ```ts
* const db = new Database("mydb.sqlite", {readonly: true});
* ```
*
* @category Database
*/
export class Database implements Disposable {
/**
@ -63,96 +121,19 @@ declare module "bun:sqlite" {
* @param filename The filename of the database to open. Pass an empty string (`""`) or `":memory:"` or undefined for an in-memory database.
* @param options defaults to `{readwrite: true, create: true}`. If a number, then it's treated as `SQLITE_OPEN_*` constant flags.
*/
constructor(
filename?: string,
options?:
| number
| {
/**
* Open the database as read-only (no write operations, no create).
*
* Equivalent to {@link constants.SQLITE_OPEN_READONLY}
*/
readonly?: boolean;
/**
* Allow creating a new database
*
* Equivalent to {@link constants.SQLITE_OPEN_CREATE}
*/
create?: boolean;
/**
* Open the database as read-write
*
* Equivalent to {@link constants.SQLITE_OPEN_READWRITE}
*/
readwrite?: boolean;
/**
* When set to `true`, integers are returned as `bigint` types.
*
* When set to `false`, integers are returned as `number` types and truncated to 52 bits.
*
* @default false
* @since v1.1.14
*/
safeIntegers?: boolean;
/**
* When set to `false` or `undefined`:
* - Queries missing bound parameters will NOT throw an error
* - Bound named parameters in JavaScript need to exactly match the SQL query.
*
* @example
* ```ts
* const db = new Database(":memory:", { strict: false });
* db.run("INSERT INTO foo (name) VALUES ($name)", { $name: "foo" });
* ```
*
* When set to `true`:
* - Queries missing bound parameters will throw an error
* - Bound named parameters in JavaScript no longer need to be `$`, `:`, or `@`. The SQL query will remain prefixed.
*
* @example
* ```ts
* const db = new Database(":memory:", { strict: true });
* db.run("INSERT INTO foo (name) VALUES ($name)", { name: "foo" });
* ```
* @since v1.1.14
*/
strict?: boolean;
},
);
constructor(filename?: string, options?: number | DatabaseOptions);
/**
* Open or create a SQLite3 databases
*
* @param filename The filename of the database to open. Pass an empty string (`""`) or `":memory:"` or undefined for an in-memory database.
* @param options defaults to `{readwrite: true, create: true}`. If a number, then it's treated as `SQLITE_OPEN_*` constant flags.
*
* This is an alias of `new Database()`
*
* See {@link Database}
*/
static open(
filename: string,
options?:
| number
| {
/**
* Open the database as read-only (no write operations, no create).
*
* Equivalent to {@link constants.SQLITE_OPEN_READONLY}
*/
readonly?: boolean;
/**
* Allow creating a new database
*
* Equivalent to {@link constants.SQLITE_OPEN_CREATE}
*/
create?: boolean;
/**
* Open the database as read-write
*
* Equivalent to {@link constants.SQLITE_OPEN_READWRITE}
*/
readwrite?: boolean;
},
): Database;
static open(filename: string, options?: number | DatabaseOptions): Database;
/**
* Execute a SQL query **without returning any results**.
@ -203,8 +184,11 @@ declare module "bun:sqlite" {
* @returns `Database` instance
*/
run<ParamsType extends SQLQueryBindings[]>(sql: string, ...bindings: ParamsType[]): Changes;
/**
* This is an alias of {@link Database.run}
*
* @deprecated Prefer {@link Database.run}
*/
exec<ParamsType extends SQLQueryBindings[]>(sql: string, ...bindings: ParamsType[]): Changes;
@ -351,6 +335,16 @@ declare module "bun:sqlite" {
*/
static setCustomSQLite(path: string): boolean;
/**
* Closes the database when using the async resource proposal
*
* @example
* ```
* using db = new Database("myapp.db");
* doSomethingWithDatabase(db);
* // Automatically closed when `db` goes out of scope
* ```
*/
[Symbol.dispose](): void;
/**
@ -383,19 +377,28 @@ declare module "bun:sqlite" {
* ]);
* ```
*/
transaction(insideTransaction: (...args: any) => void): CallableFunction & {
transaction<A extends any[], T>(
insideTransaction: (...args: A) => T,
): {
/**
* uses "BEGIN DEFERRED"
* Execute the transaction
*/
deferred: (...args: any) => void;
(...args: A): T;
/**
* uses "BEGIN IMMEDIATE"
* Execute the transaction using "BEGIN DEFERRED"
*/
immediate: (...args: any) => void;
deferred: (...args: A) => T;
/**
* uses "BEGIN EXCLUSIVE"
* Execute the transaction using "BEGIN IMMEDIATE"
*/
exclusive: (...args: any) => void;
immediate: (...args: A) => T;
/**
* Execute the transaction using "BEGIN EXCLUSIVE"
*/
exclusive: (...args: A) => T;
};
/**
@ -664,7 +667,7 @@ declare module "bun:sqlite" {
[Symbol.iterator](): IterableIterator<ReturnType>;
/**
* Execute the prepared statement. This returns `undefined`.
* Execute the prepared statement.
*
* @param params optional values to bind to the statement. If omitted, the statement is run with the last bound values or no parameters if there are none.
*
@ -735,6 +738,30 @@ declare module "bun:sqlite" {
*/
values(...params: ParamsType): Array<Array<string | bigint | number | boolean | Uint8Array>>;
/**
* Execute the prepared statement and return all results as arrays of
* `Uint8Array`s.
*
* This is similar to `values()` but returns all values as Uint8Array
* objects, regardless of their original SQLite type.
*
* @param params optional values to bind to the statement. If omitted, the
* statement is run with the last bound values or no parameters if there are
* none.
*
* @example
* ```ts
* const stmt = db.prepare("SELECT * FROM foo WHERE bar = ?");
*
* stmt.raw("baz");
* // => [[Uint8Array(24)]]
*
* stmt.raw();
* // => [[Uint8Array(24)]]
* ```
*/
raw(...params: ParamsType): Array<Array<Uint8Array | null>>;
/**
* The names of the columns returned by the prepared statement.
* @example

View file

@ -10,6 +10,7 @@ declare var test: typeof import("bun:test").test;
declare var it: typeof import("bun:test").it;
declare var describe: typeof import("bun:test").describe;
declare var expect: typeof import("bun:test").expect;
declare var expectTypeOf: typeof import("bun:test").expectTypeOf;
declare var beforeAll: typeof import("bun:test").beforeAll;
declare var beforeEach: typeof import("bun:test").beforeEach;
declare var afterEach: typeof import("bun:test").afterEach;

27
node_modules/bun-types/test.d.ts generated vendored
View file

@ -56,6 +56,11 @@ declare module "bun:test" {
* Restore the previous value of mocks.
*/
restore(): void;
/**
* Reset all mock function state (calls, results, etc.) without restoring their original implementation.
*/
clearAllMocks(): void;
};
/**
@ -1642,6 +1647,26 @@ declare module "bun:test" {
*/
toHaveReturnedTimes(times: number): void;
/**
* Ensures that a mock function has returned a specific value.
* This matcher uses deep equality, like toEqual(), and supports asymmetric matchers.
*/
toHaveReturnedWith(expected: unknown): void;
/**
* Ensures that a mock function has returned a specific value on its last invocation.
* This matcher uses deep equality, like toEqual(), and supports asymmetric matchers.
*/
toHaveLastReturnedWith(expected: unknown): void;
/**
* Ensures that a mock function has returned a specific value on the nth invocation.
* This matcher uses deep equality, like toEqual(), and supports asymmetric matchers.
* @param n The 1-based index of the function call
* @param expected The expected return value
*/
toHaveNthReturnedWith(n: number, expected: unknown): void;
/**
* Ensures that a mock function is called.
*/
@ -2182,4 +2207,6 @@ declare module "bun:test" {
export type UnknownFunction = (...args: unknown[]) => unknown;
}
export const expectTypeOf: typeof import("./vendor/expect-type").expectTypeOf;
}

View file

@ -433,6 +433,27 @@ var postProcessor = {
}
};
const PATH_KEY = Symbol('i18next/PATH_KEY');
function createProxy() {
const state = [];
const handler = Object.create(null);
let proxy;
handler.get = (target, key) => {
proxy?.revoke?.();
if (key === PATH_KEY) return state;
state.push(key);
proxy = Proxy.revocable(target, handler);
return proxy.proxy;
};
return Proxy.revocable(Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
const {
[PATH_KEY]: path
} = selector(createProxy());
return path.join(opts?.keySeparator ?? '.');
}
const checkedLoadedFor = {};
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
class Translator extends EventEmitter {
@ -489,11 +510,15 @@ class Translator extends EventEmitter {
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
opt = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') opt = {
if (typeof opt === 'object') opt = {
...opt
};
if (!opt) opt = {};
if (keys == null) return '';
if (typeof keys === 'function') keys = keysFromSelector(keys, {
...this.options,
...opt
});
if (!Array.isArray(keys)) keys = [String(keys)];
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
@ -771,22 +796,22 @@ class Translator extends EventEmitter {
const zeroSuffix = `${this.options.pluralSeparator}zero`;
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (needsPluralHandling) {
finalKeys.push(key + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(key + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key + zeroSuffix);
}
}
if (needsContextHandling) {
const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
@ -1105,7 +1130,7 @@ class Interpolator {
};
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
}
interpolate(str, data, lng, options) {
let match;
@ -1750,7 +1775,7 @@ class I18n extends EventEmitter {
});
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
if (usingLegacyFormatFunction) {
this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
}
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s.formatter = createClassOnDemand(formatter);
@ -1984,8 +2009,18 @@ class I18n extends EventEmitter {
const keySeparator = this.options.keySeparator || '.';
let resultKey;
if (o.keyPrefix && Array.isArray(key)) {
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
resultKey = key.map(k => {
if (typeof k === 'function') k = keysFromSelector(k, {
...this.options,
...opts
});
return `${o.keyPrefix}${keySeparator}${k}`;
});
} else {
if (typeof key === 'function') key = keysFromSelector(key, {
...this.options,
...opts
});
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
}
return this.t(resultKey, o);

View file

@ -431,6 +431,27 @@ var postProcessor = {
}
};
const PATH_KEY = Symbol('i18next/PATH_KEY');
function createProxy() {
const state = [];
const handler = Object.create(null);
let proxy;
handler.get = (target, key) => {
proxy?.revoke?.();
if (key === PATH_KEY) return state;
state.push(key);
proxy = Proxy.revocable(target, handler);
return proxy.proxy;
};
return Proxy.revocable(Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
const {
[PATH_KEY]: path
} = selector(createProxy());
return path.join(opts?.keySeparator ?? '.');
}
const checkedLoadedFor = {};
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
class Translator extends EventEmitter {
@ -487,11 +508,15 @@ class Translator extends EventEmitter {
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
opt = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') opt = {
if (typeof opt === 'object') opt = {
...opt
};
if (!opt) opt = {};
if (keys == null) return '';
if (typeof keys === 'function') keys = keysFromSelector(keys, {
...this.options,
...opt
});
if (!Array.isArray(keys)) keys = [String(keys)];
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
@ -769,22 +794,22 @@ class Translator extends EventEmitter {
const zeroSuffix = `${this.options.pluralSeparator}zero`;
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (needsPluralHandling) {
finalKeys.push(key + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(key + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key + zeroSuffix);
}
}
if (needsContextHandling) {
const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
@ -1103,7 +1128,7 @@ class Interpolator {
};
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
}
interpolate(str, data, lng, options) {
let match;
@ -1748,7 +1773,7 @@ class I18n extends EventEmitter {
});
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
if (usingLegacyFormatFunction) {
this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
}
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s.formatter = createClassOnDemand(formatter);
@ -1982,8 +2007,18 @@ class I18n extends EventEmitter {
const keySeparator = this.options.keySeparator || '.';
let resultKey;
if (o.keyPrefix && Array.isArray(key)) {
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
resultKey = key.map(k => {
if (typeof k === 'function') k = keysFromSelector(k, {
...this.options,
...opts
});
return `${o.keyPrefix}${keySeparator}${k}`;
});
} else {
if (typeof key === 'function') key = keysFromSelector(key, {
...this.options,
...opts
});
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
}
return this.t(resultKey, o);

View file

@ -431,6 +431,27 @@ var postProcessor = {
}
};
const PATH_KEY = Symbol('i18next/PATH_KEY');
function createProxy() {
const state = [];
const handler = Object.create(null);
let proxy;
handler.get = (target, key) => {
proxy?.revoke?.();
if (key === PATH_KEY) return state;
state.push(key);
proxy = Proxy.revocable(target, handler);
return proxy.proxy;
};
return Proxy.revocable(Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
const {
[PATH_KEY]: path
} = selector(createProxy());
return path.join(opts?.keySeparator ?? '.');
}
const checkedLoadedFor = {};
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
class Translator extends EventEmitter {
@ -487,11 +508,15 @@ class Translator extends EventEmitter {
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
opt = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') opt = {
if (typeof opt === 'object') opt = {
...opt
};
if (!opt) opt = {};
if (keys == null) return '';
if (typeof keys === 'function') keys = keysFromSelector(keys, {
...this.options,
...opt
});
if (!Array.isArray(keys)) keys = [String(keys)];
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
@ -769,22 +794,22 @@ class Translator extends EventEmitter {
const zeroSuffix = `${this.options.pluralSeparator}zero`;
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (needsPluralHandling) {
finalKeys.push(key + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(key + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key + zeroSuffix);
}
}
if (needsContextHandling) {
const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
@ -1103,7 +1128,7 @@ class Interpolator {
};
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
}
interpolate(str, data, lng, options) {
let match;
@ -1748,7 +1773,7 @@ class I18n extends EventEmitter {
});
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
if (usingLegacyFormatFunction) {
this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
}
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s.formatter = createClassOnDemand(formatter);
@ -1982,8 +2007,18 @@ class I18n extends EventEmitter {
const keySeparator = this.options.keySeparator || '.';
let resultKey;
if (o.keyPrefix && Array.isArray(key)) {
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
resultKey = key.map(k => {
if (typeof k === 'function') k = keysFromSelector(k, {
...this.options,
...opts
});
return `${o.keyPrefix}${keySeparator}${k}`;
});
} else {
if (typeof key === 'function') key = keysFromSelector(key, {
...this.options,
...opts
});
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
}
return this.t(resultKey, o);

View file

@ -1 +1 @@
{"type":"module","version":"25.3.2"}
{"type":"module","version":"25.4.2"}

View file

@ -437,6 +437,27 @@
}
};
const PATH_KEY = Symbol('i18next/PATH_KEY');
function createProxy() {
const state = [];
const handler = Object.create(null);
let proxy;
handler.get = (target, key) => {
proxy?.revoke?.();
if (key === PATH_KEY) return state;
state.push(key);
proxy = Proxy.revocable(target, handler);
return proxy.proxy;
};
return Proxy.revocable(Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
const {
[PATH_KEY]: path
} = selector(createProxy());
return path.join(opts?.keySeparator ?? '.');
}
const checkedLoadedFor = {};
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
class Translator extends EventEmitter {
@ -493,11 +514,15 @@
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
opt = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') opt = {
if (typeof opt === 'object') opt = {
...opt
};
if (!opt) opt = {};
if (keys == null) return '';
if (typeof keys === 'function') keys = keysFromSelector(keys, {
...this.options,
...opt
});
if (!Array.isArray(keys)) keys = [String(keys)];
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
@ -775,22 +800,22 @@
const zeroSuffix = `${this.options.pluralSeparator}zero`;
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (needsPluralHandling) {
finalKeys.push(key + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(key + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key + zeroSuffix);
}
}
if (needsContextHandling) {
const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
@ -1109,7 +1134,7 @@
};
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
}
interpolate(str, data, lng, options) {
let match;
@ -1754,7 +1779,7 @@
});
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
if (usingLegacyFormatFunction) {
this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
}
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s.formatter = createClassOnDemand(formatter);
@ -1988,8 +2013,18 @@
const keySeparator = this.options.keySeparator || '.';
let resultKey;
if (o.keyPrefix && Array.isArray(key)) {
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
resultKey = key.map(k => {
if (typeof k === 'function') k = keysFromSelector(k, {
...this.options,
...opts
});
return `${o.keyPrefix}${keySeparator}${k}`;
});
} else {
if (typeof key === 'function') key = keysFromSelector(key, {
...this.options,
...opts
});
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
}
return this.t(resultKey, o);

File diff suppressed because one or more lines are too long

49
node_modules/i18next/i18next.js generated vendored
View file

@ -437,6 +437,27 @@
}
};
const PATH_KEY = Symbol('i18next/PATH_KEY');
function createProxy() {
const state = [];
const handler = Object.create(null);
let proxy;
handler.get = (target, key) => {
proxy?.revoke?.();
if (key === PATH_KEY) return state;
state.push(key);
proxy = Proxy.revocable(target, handler);
return proxy.proxy;
};
return Proxy.revocable(Object.create(null), handler).proxy;
}
function keysFromSelector(selector, opts) {
const {
[PATH_KEY]: path
} = selector(createProxy());
return path.join(opts?.keySeparator ?? '.');
}
const checkedLoadedFor = {};
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
class Translator extends EventEmitter {
@ -493,11 +514,15 @@
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
opt = this.options.overloadTranslationOptionHandler(arguments);
}
if (typeof options === 'object') opt = {
if (typeof opt === 'object') opt = {
...opt
};
if (!opt) opt = {};
if (keys == null) return '';
if (typeof keys === 'function') keys = keysFromSelector(keys, {
...this.options,
...opt
});
if (!Array.isArray(keys)) keys = [String(keys)];
const returnDetails = opt.returnDetails !== undefined ? opt.returnDetails : this.options.returnDetails;
const keySeparator = opt.keySeparator !== undefined ? opt.keySeparator : this.options.keySeparator;
@ -775,22 +800,22 @@
const zeroSuffix = `${this.options.pluralSeparator}zero`;
const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
if (needsPluralHandling) {
finalKeys.push(key + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(key + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(key + zeroSuffix);
}
}
if (needsContextHandling) {
const contextKey = `${key}${this.options.contextSeparator}${opt.context}`;
const contextKey = `${key}${this.options.contextSeparator || '_'}${opt.context}`;
finalKeys.push(contextKey);
if (needsPluralHandling) {
finalKeys.push(contextKey + pluralSuffix);
if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {
finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
}
finalKeys.push(contextKey + pluralSuffix);
if (needsZeroSuffixLookup) {
finalKeys.push(contextKey + zeroSuffix);
}
@ -1109,7 +1134,7 @@
};
this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
}
interpolate(str, data, lng, options) {
let match;
@ -1754,7 +1779,7 @@
});
const usingLegacyFormatFunction = this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format;
if (usingLegacyFormatFunction) {
this.logger.warn(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
}
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
s.formatter = createClassOnDemand(formatter);
@ -1988,8 +2013,18 @@
const keySeparator = this.options.keySeparator || '.';
let resultKey;
if (o.keyPrefix && Array.isArray(key)) {
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
resultKey = key.map(k => {
if (typeof k === 'function') k = keysFromSelector(k, {
...this.options,
...opts
});
return `${o.keyPrefix}${keySeparator}${k}`;
});
} else {
if (typeof key === 'function') key = keysFromSelector(key, {
...this.options,
...opts
});
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
}
return this.t(resultKey, o);

File diff suppressed because one or more lines are too long

3
node_modules/i18next/package.json generated vendored
View file

@ -1,6 +1,6 @@
{
"name": "i18next",
"version": "25.3.2",
"version": "25.4.2",
"description": "i18next internationalization framework",
"main": "./dist/cjs/i18next.js",
"module": "./dist/esm/i18next.js",
@ -60,6 +60,7 @@
}
},
"devDependencies": {
"@arktype/attest": "^0.46.0",
"@babel/core": "^7.27.4",
"@babel/plugin-transform-async-generator-functions": "^7.27.1",
"@babel/plugin-transform-modules-commonjs": "^7.27.1",

View file

@ -6,6 +6,15 @@ export type $SpecialObject = object | Array<string | object>;
// Types Operators
export type $Prune<T> =
| never
| { [K in keyof T as [keyof T[K]] extends [never] ? never : K]: T[K] };
/** All the way down. */
export interface $Turtles {
[x: string]: $Turtles;
}
export type $MergeBy<T, K> = Omit<T, keyof K> & K;
export type $OmitArrayKeys<Arr> = Arr extends readonly any[] ? Omit<Arr, keyof any[]> : Arr;

View file

@ -95,6 +95,24 @@ export type TypeOptions = $MergeBy<
/** @see {InterpolationOptions.unescapeSuffix} */
unescapeSuffix: '';
/**
* Use a proxy-based selector to select a translation.
*
* Enables features like go-to definition, and better DX/faster autocompletion
* for TypeScript developers.
*
* If you're working with an especially large set of translations and aren't
* using context, you set `enableSelector` to `"optimize"` and i18next won't do
* any type-level processing of your translations at all.
*
* With `enableSelector` set to `"optimize"`, i18next is capable of supporting
* arbitrarily large/deep translation sets without causing any IDE slowdown
* whatsoever.
*
* @default false
*/
enableSelector: false;
},
CustomTypeOptions
>;

View file

@ -5,6 +5,8 @@ import type {
$SpecialObject,
$StringKeyPathToRecord,
$NoInfer,
$Prune,
$Turtles,
} from './helpers.js';
import type {
TypeOptions,
@ -12,6 +14,7 @@ import type {
FlatNamespace,
DefaultNamespace,
TOptions,
TOptionsBase,
} from './options.js';
/** @todo consider to replace {} with Record<string, never> */
@ -33,6 +36,7 @@ type _InterpolationSuffix = TypeOptions['interpolationSuffix'];
type _UnescapePrefix = TypeOptions['unescapePrefix'];
type _UnescapeSuffix = TypeOptions['unescapeSuffix'];
type _StrictKeyChecks = TypeOptions['strictKeyChecks'];
type _EnableSelector = TypeOptions['enableSelector'];
type $IsResourcesDefined = [keyof _Resources] extends [never] ? false : true;
type $ValueIfResourcesDefined<Value, Fallback> = $IsResourcesDefined extends true
@ -63,6 +67,12 @@ type TrimSpaces<T extends string, Acc extends string = ''> = T extends `${infer
? Acc
: never;
interface Branded<Ns extends Namespace> {
$TFunctionBrand: $IsResourcesDefined extends true
? `${Ns extends readonly any[] ? Ns[0] : Ns}`
: never;
}
/** ****************************************************
* Build all keys and key prefixes based on Resources *
***************************************************** */
@ -212,12 +222,14 @@ type ParseTReturn<Key, Res, TOpt extends TOptions = {}> = ParseTReturnWithFallba
>;
type TReturnOptionalNull = _ReturnNull extends true ? null : never;
type TReturnOptionalObjects<TOpt extends TOptions> = _ReturnObjects extends true
type TReturnOptionalObjects<TOpt extends { returnObjects?: unknown }> = _ReturnObjects extends true
? $SpecialObject | string
: TOpt['returnObjects'] extends true
? $SpecialObject
: string;
type DefaultTReturn<TOpt extends TOptions> = TReturnOptionalObjects<TOpt> | TReturnOptionalNull;
type DefaultTReturn<TOpt extends { returnObjects?: unknown }> =
| TReturnOptionalObjects<TOpt>
| TReturnOptionalNull;
export type KeyWithContext<Key, TOpt extends TOptions> = TOpt['context'] extends string
? `${Key & string}${_ContextSeparator}${TOpt['context']}`
@ -280,8 +292,8 @@ type AppendKeyPrefix<Key, KPrefix> = KPrefix extends string
* T function declaration *
************************* */
interface TFunctionStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> {
$TFunctionBrand: $IsResourcesDefined extends true ? `${$FirstNamespace<Ns>}` : never;
interface TFunctionStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>
extends Branded<Ns> {
<
const Key extends ParseKeys<Ns, TOpt, KPrefix> | TemplateStringsArray,
const TOpt extends TOptions,
@ -301,8 +313,8 @@ interface TFunctionStrict<Ns extends Namespace = DefaultNamespace, KPrefix = und
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
}
interface TFunctionNonStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined> {
$TFunctionBrand: $IsResourcesDefined extends true ? `${$FirstNamespace<Ns>}` : never;
interface TFunctionNonStrict<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>
extends Branded<Ns> {
<
const Key extends ParseKeys<Ns, TOpt, KPrefix> | TemplateStringsArray,
const TOpt extends TOptions,
@ -320,9 +332,134 @@ interface TFunctionNonStrict<Ns extends Namespace = DefaultNamespace, KPrefix =
type TFunctionSignature<
Ns extends Namespace = DefaultNamespace,
KPrefix = undefined,
> = _StrictKeyChecks extends true ? TFunctionStrict<Ns, KPrefix> : TFunctionNonStrict<Ns, KPrefix>;
> = _EnableSelector extends true | 'optimize'
? TFunctionSelector<Ns, KPrefix, GetSource<Ns, KPrefix>>
: _StrictKeyChecks extends true
? TFunctionStrict<Ns, KPrefix>
: TFunctionNonStrict<Ns, KPrefix>;
export interface TFunction<Ns extends Namespace = DefaultNamespace, KPrefix = undefined>
extends TFunctionSignature<Ns, KPrefix> {}
export type KeyPrefix<Ns extends Namespace> = ResourceKeys<true>[$FirstNamespace<Ns>] | undefined;
/// ////////////// ///
/// ↆ selector ↆ ///
/// ////////////// ///
interface TFunctionSelector<Ns extends Namespace, KPrefix, Source> extends Branded<Ns> {
<
Target extends ConstrainTarget<Opts>,
const Opts extends SelectorOptions<NewNs>,
NewNs extends Namespace,
NewSrc extends GetSource<NewNs, KPrefix>,
>(
selector: SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>,
options: Opts & InterpolationMap<Target> & { ns: NewNs },
): SelectorReturn<Target, Opts>;
<Target extends ConstrainTarget<Opts>, const Opts extends SelectorOptions<Ns>>(
selector: SelectorFn<Source, ApplyTarget<Target, Opts>, Opts>,
options?: Opts & InterpolationMap<Target>,
): SelectorReturn<Target, Opts>;
}
interface SelectorOptions<Ns = Namespace>
extends Omit<TOptionsBase, 'ns' | 'nsSeparator'>,
$Dictionary {
ns?: Ns;
}
type SelectorReturn<
Target,
Opts extends { defaultValue?: unknown; returnObjects?: boolean },
> = $IsResourcesDefined extends true
? TFunctionReturnOptionalDetails<ProcessReturnValue<Target, Opts['defaultValue']>, Opts>
: DefaultTReturn<Opts>;
interface SelectorFn<Source, Target, Opts extends SelectorOptions<unknown>> {
(translations: Select<Source, Opts['context']>): Target;
}
type ApplyKeyPrefix<
T extends [any],
KPrefix,
> = KPrefix extends `${infer Head}${_KeySeparator}${infer Tail}`
? ApplyKeyPrefix<[T[0][Head]], Tail>
: T[0][KPrefix & string];
type ApplyTarget<
Target,
Opts extends { returnObjects?: unknown },
> = Opts['returnObjects'] extends true ? unknown : Target;
type ConstrainTarget<Opts extends SelectorOptions<any>> = _ReturnObjects extends true
? unknown
: Opts['returnObjects'] extends true
? unknown
: $IsResourcesDefined extends false
? unknown
: string;
type ProcessReturnValue<Target, DefaultValue> = $Turtles extends Target
? string
: [DefaultValue] extends [never]
? Target
: unknown extends DefaultValue
? Target
: Target | DefaultValue;
type PickNamespaces<T, K extends keyof any> = {
[P in K as P extends keyof T ? P : never]: T[P & keyof T];
};
type GetSource<
Ns extends Namespace,
KPrefix,
Res = Ns extends readonly [keyof Resources, any, ...any]
? Resources[Ns[0]] & PickNamespaces<Resources, Ns[number]>
: Resources[$FirstNamespace<Ns>],
> = KPrefix extends keyof Res
? Res[KPrefix]
: undefined extends KPrefix
? Res
: ApplyKeyPrefix<[Res], KPrefix>;
type Select<T, Context> = $IsResourcesDefined extends false
? $Turtles
: [_EnableSelector] extends ['optimize']
? T
: FilterKeys<T, Context>;
type FilterKeys<T, Context> = never | T extends readonly any[]
? { [I in keyof T]: FilterKeys<T[I], Context> }
: $Prune<
{
[K in keyof T as T[K] extends object
? K
: Context extends string
? never
: K extends `${string}${_PluralSeparator}${PluralSuffix}`
? never
: K]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
} & {
[K in keyof T as T[K] extends object
? never
: Context extends string
? never
: K extends
| `${infer Prefix}${_PluralSeparator}${PluralSuffix}`
| `${infer Prefix}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
? Prefix
: never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
} & {
[K in keyof T as T[K] extends object
? never
: Context extends string
? K extends
| `${infer Prefix}${_ContextSeparator}${Context}`
| `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}`
? Prefix
: never
: never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
}
>;

BIN
node_modules/node/bin/node generated vendored

Binary file not shown.

View file

@ -1 +1 @@
require('node-bin-setup')("22.18.0", require)
require('node-bin-setup')("22.19.0", require)

View file

@ -9,9 +9,9 @@
"license": "ISC"
},
"node_modules/node-linux-x64": {
"version": "22.18.0",
"resolved": "https://registry.npmjs.org/node-linux-x64/-/node-linux-x64-22.18.0.tgz",
"integrity": "sha512-ZPIlJmsQkDY/Q+VeDIuNTphYIPHYwV4T2lF7lfkmW0gFFkohycbGQYm25yhJ/Gz42eFD2wF5zwAzs9yPRAwbhg==",
"version": "22.19.0",
"resolved": "https://registry.npmjs.org/node-linux-x64/-/node-linux-x64-22.19.0.tgz",
"integrity": "sha512-kjgmAijr2xPcEIrK1eky8L05W9pZcVUYihQbsN99F0zQP6VXX+DlAbSFbVre3bI7oLjtyUd10/vCdCkxfqnysw==",
"cpu": "x64",
"os": "linux",
"bin": {

View file

@ -9,6 +9,7 @@
</tr>
<tr>
<td>
<a href="#22.19.0">22.19.0</a><br/>
<a href="#22.18.0">22.18.0</a><br/>
<a href="#22.17.1">22.17.1</a><br/>
<a href="#22.17.0">22.17.0</a><br/>
@ -63,6 +64,160 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)
<a id="22.19.0"></a>
## 2025-08-28, Version 22.19.0 'Jod' (LTS), @aduh95
### Notable Changes
* \[[`8e2076a24f`](https://github.com/nodejs/node/commit/8e2076a24f)] - **(SEMVER-MINOR)** **cli**: add NODE\_USE\_SYSTEM\_CA=1 (Joyee Cheung) [#59276](https://github.com/nodejs/node/pull/59276)
* \[[`e592d739c2`](https://github.com/nodejs/node/commit/e592d739c2)] - **(SEMVER-MINOR)** **cli**: support `${pid}` placeholder in --cpu-prof-name (Haram Jeong) [#59072](https://github.com/nodejs/node/pull/59072)
* \[[`cda1dab6e2`](https://github.com/nodejs/node/commit/cda1dab6e2)] - **(SEMVER-MINOR)** **crypto**: add tls.setDefaultCACertificates() (Joyee Cheung) [#58822](https://github.com/nodejs/node/pull/58822)
* \[[`1f184513e9`](https://github.com/nodejs/node/commit/1f184513e9)] - **(SEMVER-MINOR)** **dns**: support max timeout (theanarkh) [#58440](https://github.com/nodejs/node/pull/58440)
* \[[`bace73a173`](https://github.com/nodejs/node/commit/bace73a173)] - **doc**: update the instruction on how to verify releases (Antoine du Hamel) [#59113](https://github.com/nodejs/node/pull/59113)
* \[[`fa9a9e9c69`](https://github.com/nodejs/node/commit/fa9a9e9c69)] - **(SEMVER-MINOR)** **esm**: unflag --experimental-wasm-modules (Guy Bedford) [#57038](https://github.com/nodejs/node/pull/57038)
* \[[`390a9dc20b`](https://github.com/nodejs/node/commit/390a9dc20b)] - **(SEMVER-MINOR)** **http**: add server.keepAliveTimeoutBuffer option (Haram Jeong) [#59243](https://github.com/nodejs/node/pull/59243)
* \[[`c12c5343ad`](https://github.com/nodejs/node/commit/c12c5343ad)] - **lib**: docs deprecate \_http\_\* (Sebastian Beltran) [#59293](https://github.com/nodejs/node/pull/59293)
* \[[`f57ee3d71f`](https://github.com/nodejs/node/commit/f57ee3d71f)] - **(SEMVER-MINOR)** **net**: update net.blocklist to allow file save and file management (alphaleadership) [#58087](https://github.com/nodejs/node/pull/58087)
* \[[`035da74c31`](https://github.com/nodejs/node/commit/035da74c31)] - **(SEMVER-MINOR)** **process**: add threadCpuUsage (Paolo Insogna) [#56467](https://github.com/nodejs/node/pull/56467)
* \[[`8e697d1884`](https://github.com/nodejs/node/commit/8e697d1884)] - **(SEMVER-MINOR)** **zlib**: add dictionary support to zstdCompress and zstdDecompress (lluisemper) [#59240](https://github.com/nodejs/node/pull/59240)
### Commits
* \[[`73aa0ae37f`](https://github.com/nodejs/node/commit/73aa0ae37f)] - **assert**: change utils to use index instead of for...of (방진혁) [#59278](https://github.com/nodejs/node/pull/59278)
* \[[`dfe3a11eed`](https://github.com/nodejs/node/commit/dfe3a11eed)] - **benchmark**: remove deprecated \_extend from benchmark (Rafael Gonzaga) [#59228](https://github.com/nodejs/node/pull/59228)
* \[[`9b9d30042a`](https://github.com/nodejs/node/commit/9b9d30042a)] - **benchmark**: add fs warmup to writefile-promises (Bruno Rodrigues) [#59215](https://github.com/nodejs/node/pull/59215)
* \[[`a663f7f954`](https://github.com/nodejs/node/commit/a663f7f954)] - **benchmark**: add calibrate-n script (Rafael Gonzaga) [#59186](https://github.com/nodejs/node/pull/59186)
* \[[`1b9b5bddd6`](https://github.com/nodejs/node/commit/1b9b5bddd6)] - **benchmark**: adjust configuration for string-decoder bench (Rafael Gonzaga) [#59187](https://github.com/nodejs/node/pull/59187)
* \[[`d0ac3319f9`](https://github.com/nodejs/node/commit/d0ac3319f9)] - **benchmark**: add --track to benchmark (Rafael Gonzaga) [#59174](https://github.com/nodejs/node/pull/59174)
* \[[`2044968b86`](https://github.com/nodejs/node/commit/2044968b86)] - **benchmark**: small lint fix on \_cli.js (Rafael Gonzaga) [#59172](https://github.com/nodejs/node/pull/59172)
* \[[`4e519934cb`](https://github.com/nodejs/node/commit/4e519934cb)] - **benchmark**: drop misc/punycode benchmark (Rafael Gonzaga) [#59171](https://github.com/nodejs/node/pull/59171)
* \[[`07e173d969`](https://github.com/nodejs/node/commit/07e173d969)] - **benchmark**: fix sqlite-is-transaction (Rafael Gonzaga) [#59170](https://github.com/nodejs/node/pull/59170)
* \[[`8440b6177f`](https://github.com/nodejs/node/commit/8440b6177f)] - **benchmark**: reduce N for diagnostics\_channel subscribe benchmark (Arthur Angelo) [#59116](https://github.com/nodejs/node/pull/59116)
* \[[`8615ea6db0`](https://github.com/nodejs/node/commit/8615ea6db0)] - **buffer**: cache Environment::GetCurrent to avoid repeated calls (Mert Can Altin) [#59043](https://github.com/nodejs/node/pull/59043)
* \[[`3deb5361d2`](https://github.com/nodejs/node/commit/3deb5361d2)] - **build**: fix node\_use\_sqlite for GN builds (Shelley Vohr) [#59017](https://github.com/nodejs/node/pull/59017)
* \[[`0f0ce63116`](https://github.com/nodejs/node/commit/0f0ce63116)] - **build**: remove suppressions.supp (Rafael Gonzaga) [#59079](https://github.com/nodejs/node/pull/59079)
* \[[`b30a2117dc`](https://github.com/nodejs/node/commit/b30a2117dc)] - **build,deps,tools**: prepare to update to OpenSSL 3.5 (Richard Lau) [#58100](https://github.com/nodejs/node/pull/58100)
* \[[`8e2076a24f`](https://github.com/nodejs/node/commit/8e2076a24f)] - **(SEMVER-MINOR)** **cli**: add NODE\_USE\_SYSTEM\_CA=1 (Joyee Cheung) [#59276](https://github.com/nodejs/node/pull/59276)
* \[[`e592d739c2`](https://github.com/nodejs/node/commit/e592d739c2)] - **(SEMVER-MINOR)** **cli**: support `${pid}` placeholder in --cpu-prof-name (Haram Jeong) [#59072](https://github.com/nodejs/node/pull/59072)
* \[[`b5571047ed`](https://github.com/nodejs/node/commit/b5571047ed)] - **crypto**: prepare webcrypto key import/export for modern algorithms (Filip Skokan) [#59284](https://github.com/nodejs/node/pull/59284)
* \[[`cda1dab6e2`](https://github.com/nodejs/node/commit/cda1dab6e2)] - **(SEMVER-MINOR)** **crypto**: add tls.setDefaultCACertificates() (Joyee Cheung) [#58822](https://github.com/nodejs/node/pull/58822)
* \[[`76dab34fb7`](https://github.com/nodejs/node/commit/76dab34fb7)] - **deps**: support madvise(3C) across ALL illumos revisions (Dan McDonald) [#58237](https://github.com/nodejs/node/pull/58237)
* \[[`19d3ed64b6`](https://github.com/nodejs/node/commit/19d3ed64b6)] - **deps**: update sqlite to 3.50.4 (Node.js GitHub Bot) [#59337](https://github.com/nodejs/node/pull/59337)
* \[[`38bafc59e0`](https://github.com/nodejs/node/commit/38bafc59e0)] - **deps**: V8: backport 493cb53691be (Chengzhong Wu) [#59238](https://github.com/nodejs/node/pull/59238)
* \[[`e8da171cc3`](https://github.com/nodejs/node/commit/e8da171cc3)] - **deps**: update sqlite to 3.50.3 (Node.js GitHub Bot) [#59132](https://github.com/nodejs/node/pull/59132)
* \[[`fd4ba38ab6`](https://github.com/nodejs/node/commit/fd4ba38ab6)] - **deps**: update googletest to 7e17b15 (Node.js GitHub Bot) [#59131](https://github.com/nodejs/node/pull/59131)
* \[[`f71f427b95`](https://github.com/nodejs/node/commit/f71f427b95)] - **deps**: update archs files for openssl-3.0.17 (Node.js GitHub Bot) [#59134](https://github.com/nodejs/node/pull/59134)
* \[[`79c5a8f4d2`](https://github.com/nodejs/node/commit/79c5a8f4d2)] - **deps**: upgrade openssl sources to openssl-3.0.17 (Node.js GitHub Bot) [#59134](https://github.com/nodejs/node/pull/59134)
* \[[`0dcc84cf53`](https://github.com/nodejs/node/commit/0dcc84cf53)] - **deps**: update corepack to 0.34.0 (Node.js GitHub Bot) [#59133](https://github.com/nodejs/node/pull/59133)
* \[[`1f184513e9`](https://github.com/nodejs/node/commit/1f184513e9)] - **(SEMVER-MINOR)** **dns**: support max timeout (theanarkh) [#58440](https://github.com/nodejs/node/pull/58440)
* \[[`f64f5df80e`](https://github.com/nodejs/node/commit/f64f5df80e)] - **doc**: fix `--use-system-ca` history (Joyee Cheung) [#59411](https://github.com/nodejs/node/pull/59411)
* \[[`e22aeaa38f`](https://github.com/nodejs/node/commit/e22aeaa38f)] - **doc**: add missing section for `setReturnArrays` in `sqlite.md` (Edy Silva) [#59074](https://github.com/nodejs/node/pull/59074)
* \[[`e44ef07235`](https://github.com/nodejs/node/commit/e44ef07235)] - **doc**: rename x509.extKeyUsage to x509.keyUsage (Filip Skokan) [#59332](https://github.com/nodejs/node/pull/59332)
* \[[`2c5d0aac5e`](https://github.com/nodejs/node/commit/2c5d0aac5e)] - **doc**: fix Pbkdf2Params hash attribute heading (Filip Skokan) [#59395](https://github.com/nodejs/node/pull/59395)
* \[[`fde94346e5`](https://github.com/nodejs/node/commit/fde94346e5)] - **doc**: fix missing reference links for server.keepAliveTimeoutBuffer (Lee Jiho) [#59356](https://github.com/nodejs/node/pull/59356)
* \[[`9af8bcea58`](https://github.com/nodejs/node/commit/9af8bcea58)] - **doc**: fix grammar in global dispatcher usage (Eng Zer Jun) [#59344](https://github.com/nodejs/node/pull/59344)
* \[[`0edf17198f`](https://github.com/nodejs/node/commit/0edf17198f)] - **doc**: run license-builder (github-actions\[bot]) [#59343](https://github.com/nodejs/node/pull/59343)
* \[[`7f767a2e38`](https://github.com/nodejs/node/commit/7f767a2e38)] - **doc**: correct orthography `eg.``e.g.` (Jacob Smith) [#59329](https://github.com/nodejs/node/pull/59329)
* \[[`a46ed50350`](https://github.com/nodejs/node/commit/a46ed50350)] - **doc**: clarify the need of compiler compatible with c++20 (Rafael Gonzaga) [#59297](https://github.com/nodejs/node/pull/59297)
* \[[`212263a305`](https://github.com/nodejs/node/commit/212263a305)] - **doc**: clarify release candidate stability index (Filip Skokan) [#59295](https://github.com/nodejs/node/pull/59295)
* \[[`ce93b8b556`](https://github.com/nodejs/node/commit/ce93b8b556)] - **doc**: add WDYT to glossary (btea) [#59280](https://github.com/nodejs/node/pull/59280)
* \[[`ebaaf2c67f`](https://github.com/nodejs/node/commit/ebaaf2c67f)] - **doc**: add manpage entry for --use-system-ca (Joyee Cheung) [#59273](https://github.com/nodejs/node/pull/59273)
* \[[`43b5a21916`](https://github.com/nodejs/node/commit/43b5a21916)] - **doc**: add path.join and path.normalize clarification (Rafael Gonzaga) [#59262](https://github.com/nodejs/node/pull/59262)
* \[[`409c66d328`](https://github.com/nodejs/node/commit/409c66d328)] - **doc**: fix typo in `test/common/README.md` (Yoo) [#59180](https://github.com/nodejs/node/pull/59180)
* \[[`cbb0a8eb13`](https://github.com/nodejs/node/commit/cbb0a8eb13)] - **doc**: add note on process memoryUsage (fengmk2) [#59026](https://github.com/nodejs/node/pull/59026)
* \[[`9892b15d81`](https://github.com/nodejs/node/commit/9892b15d81)] - **doc**: format safely for `doc-kit` (Aviv Keller) [#59229](https://github.com/nodejs/node/pull/59229)
* \[[`bace73a173`](https://github.com/nodejs/node/commit/bace73a173)] - **doc**: update the instruction on how to verify releases (Antoine du Hamel) [#59113](https://github.com/nodejs/node/pull/59113)
* \[[`b549deac02`](https://github.com/nodejs/node/commit/b549deac02)] - **doc**: copyedit SECURITY.md (Rich Trott) [#59190](https://github.com/nodejs/node/pull/59190)
* \[[`ef1bc3f344`](https://github.com/nodejs/node/commit/ef1bc3f344)] - **doc**: fix broken sentence in `URL.parse` (Superchupu) [#59164](https://github.com/nodejs/node/pull/59164)
* \[[`3c6639e8ec`](https://github.com/nodejs/node/commit/3c6639e8ec)] - **doc**: improve onboarding instructions (Joyee Cheung) [#59159](https://github.com/nodejs/node/pull/59159)
* \[[`6ffaac66bc`](https://github.com/nodejs/node/commit/6ffaac66bc)] - **doc**: add constraints for mem leak to threat model (Rafael Gonzaga) [#58917](https://github.com/nodejs/node/pull/58917)
* \[[`e419d20144`](https://github.com/nodejs/node/commit/e419d20144)] - **doc**: add Aditi-1400 to collaborators (Aditi Singh) [#59157](https://github.com/nodejs/node/pull/59157)
* \[[`ba380f7bf3`](https://github.com/nodejs/node/commit/ba380f7bf3)] - **doc**: avoid suggesting testing fast api with intense loop (Chengzhong Wu) [#59111](https://github.com/nodejs/node/pull/59111)
* \[[`fa1a532f2b`](https://github.com/nodejs/node/commit/fa1a532f2b)] - **doc**: fix typo in writing-test.md (SeokHun) [#59123](https://github.com/nodejs/node/pull/59123)
* \[[`0b93ca3d19`](https://github.com/nodejs/node/commit/0b93ca3d19)] - **doc**: add RafaelGSS as steward July 25 (Rafael Gonzaga) [#59078](https://github.com/nodejs/node/pull/59078)
* \[[`7d747aeac8`](https://github.com/nodejs/node/commit/7d747aeac8)] - **doc**: clarify ERR\_FS\_FILE\_TOO\_LARGE to reflect fs.readFile() I/O limit (Haram Jeong) [#59050](https://github.com/nodejs/node/pull/59050)
* \[[`0b5613f9fe`](https://github.com/nodejs/node/commit/0b5613f9fe)] - **doc**: run license-builder (github-actions\[bot]) [#59056](https://github.com/nodejs/node/pull/59056)
* \[[`1b6b5e72d3`](https://github.com/nodejs/node/commit/1b6b5e72d3)] - **doc**: fix typed list formatting (Aviv Keller) [#59019](https://github.com/nodejs/node/pull/59019)
* \[[`756c7dd639`](https://github.com/nodejs/node/commit/756c7dd639)] - **doc**: refine `util.parseArgs` `default` definition (Slayer95) [#58958](https://github.com/nodejs/node/pull/58958)
* \[[`0b840523a2`](https://github.com/nodejs/node/commit/0b840523a2)] - **doc**: remove unused import in `zlib.md` (coderaiser) [#59041](https://github.com/nodejs/node/pull/59041)
* \[[`3e9ed4b080`](https://github.com/nodejs/node/commit/3e9ed4b080)] - **doc**: add stability index to the `--watch-kill-signal` flag (Dario Piotrowicz) [#58997](https://github.com/nodejs/node/pull/58997)
* \[[`cb08a5d43f`](https://github.com/nodejs/node/commit/cb08a5d43f)] - **doc**: add missing `<code>` blocks (Antoine du Hamel) [#58995](https://github.com/nodejs/node/pull/58995)
* \[[`4a42360fe5`](https://github.com/nodejs/node/commit/4a42360fe5)] - **doc**: add scroll margin to links (Roman Reiss) [#58982](https://github.com/nodejs/node/pull/58982)
* \[[`9d073f32da`](https://github.com/nodejs/node/commit/9d073f32da)] - **doc**: add sponsorship link to RafaelGSS (Rafael Gonzaga) [#58983](https://github.com/nodejs/node/pull/58983)
* \[[`3cc11fc9ac`](https://github.com/nodejs/node/commit/3cc11fc9ac)] - **domain**: remove deprecated API call (Alex Yang) [#59339](https://github.com/nodejs/node/pull/59339)
* \[[`fa9a9e9c69`](https://github.com/nodejs/node/commit/fa9a9e9c69)] - **(SEMVER-MINOR)** **esm**: unflag --experimental-wasm-modules (Guy Bedford) [#57038](https://github.com/nodejs/node/pull/57038)
* \[[`177ed3b3dd`](https://github.com/nodejs/node/commit/177ed3b3dd)] - **esm**: js-string Wasm builtins in ESM Integration (Guy Bedford) [#59020](https://github.com/nodejs/node/pull/59020)
* \[[`4619fe0e04`](https://github.com/nodejs/node/commit/4619fe0e04)] - **fs**: fix glob TypeError on restricted dirs (Sylphy-0xd3ac) [#58674](https://github.com/nodejs/node/pull/58674)
* \[[`ad2089e32d`](https://github.com/nodejs/node/commit/ad2089e32d)] - **fs**: correct error message when FileHandle is transferred (Alex Yang) [#59156](https://github.com/nodejs/node/pull/59156)
* \[[`390a9dc20b`](https://github.com/nodejs/node/commit/390a9dc20b)] - **(SEMVER-MINOR)** **http**: add server.keepAliveTimeoutBuffer option (Haram Jeong) [#59243](https://github.com/nodejs/node/pull/59243)
* \[[`659002359d`](https://github.com/nodejs/node/commit/659002359d)] - **http2**: set Http2Stream#sentHeaders for raw headers (Darshan Sen) [#59244](https://github.com/nodejs/node/pull/59244)
* \[[`d02831ef73`](https://github.com/nodejs/node/commit/d02831ef73)] - **inspector**: initial support for Network.loadNetworkResource (Shima Ryuhei) [#58077](https://github.com/nodejs/node/pull/58077)
* \[[`264a838779`](https://github.com/nodejs/node/commit/264a838779)] - **lib**: add trace-sigint APIs (theanarkh) [#59040](https://github.com/nodejs/node/pull/59040)
* \[[`d22d2fa6d4`](https://github.com/nodejs/node/commit/d22d2fa6d4)] - **lib**: optimize writable stream buffer clearing (Yoo) [#59406](https://github.com/nodejs/node/pull/59406)
* \[[`a5e9759409`](https://github.com/nodejs/node/commit/a5e9759409)] - **lib**: do not modify prototype deprecated asyncResource (RafaelGSS) [#59195](https://github.com/nodejs/node/pull/59195)
* \[[`9254257fc0`](https://github.com/nodejs/node/commit/9254257fc0)] - **lib**: restructure assert to become a class (Miguel Marcondes Filho) [#58253](https://github.com/nodejs/node/pull/58253)
* \[[`946eab8d77`](https://github.com/nodejs/node/commit/946eab8d77)] - **lib**: handle superscript variants on windows device (Rafael Gonzaga) [#59261](https://github.com/nodejs/node/pull/59261)
* \[[`cd857a97b5`](https://github.com/nodejs/node/commit/cd857a97b5)] - **lib**: use validateString (hotpineapple) [#59296](https://github.com/nodejs/node/pull/59296)
* \[[`c12c5343ad`](https://github.com/nodejs/node/commit/c12c5343ad)] - **lib**: docs deprecate \_http\_\* (Sebastian Beltran) [#59293](https://github.com/nodejs/node/pull/59293)
* \[[`a28e5f0938`](https://github.com/nodejs/node/commit/a28e5f0938)] - **lib**: add type names in source mapped stack traces (Chengzhong Wu) [#58976](https://github.com/nodejs/node/pull/58976)
* \[[`6aec5aee7c`](https://github.com/nodejs/node/commit/6aec5aee7c)] - **lib**: prefer AsyncIteratorPrototype primordial (René) [#59097](https://github.com/nodejs/node/pull/59097)
* \[[`e704349858`](https://github.com/nodejs/node/commit/e704349858)] - **lib**: fix incorrect `ArrayBufferPrototypeGetDetached` primordial type (Dario Piotrowicz) [#58978](https://github.com/nodejs/node/pull/58978)
* \[[`2fc25fd400`](https://github.com/nodejs/node/commit/2fc25fd400)] - **lib**: flag to conditionally modify proto on deprecate (Rafael Gonzaga) [#58928](https://github.com/nodejs/node/pull/58928)
* \[[`446ee98e00`](https://github.com/nodejs/node/commit/446ee98e00)] - **meta**: clarify pr objection process further (James M Snell) [#59096](https://github.com/nodejs/node/pull/59096)
* \[[`46c339e4f3`](https://github.com/nodejs/node/commit/46c339e4f3)] - **meta**: add mailmap entry for aditi-1400 (Aditi) [#59316](https://github.com/nodejs/node/pull/59316)
* \[[`70a586261f`](https://github.com/nodejs/node/commit/70a586261f)] - **meta**: add tsc and build team as codeowners building.md (Rafael Gonzaga) [#59298](https://github.com/nodejs/node/pull/59298)
* \[[`e666e06781`](https://github.com/nodejs/node/commit/e666e06781)] - **meta**: add nodejs/path to path files (Rafael Gonzaga) [#59289](https://github.com/nodejs/node/pull/59289)
* \[[`251b65dd6c`](https://github.com/nodejs/node/commit/251b65dd6c)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#59140](https://github.com/nodejs/node/pull/59140)
* \[[`c8a7964da8`](https://github.com/nodejs/node/commit/c8a7964da8)] - **meta**: add marco-ippolito to security release stewards (Marco Ippolito) [#58944](https://github.com/nodejs/node/pull/58944)
* \[[`0eec5cc492`](https://github.com/nodejs/node/commit/0eec5cc492)] - **module**: fix conditions override in synchronous resolve hooks (Joyee Cheung) [#59011](https://github.com/nodejs/node/pull/59011)
* \[[`4acf7cd6d3`](https://github.com/nodejs/node/commit/4acf7cd6d3)] - **module**: throw error when re-runing errored module jobs (Joyee Cheung) [#58957](https://github.com/nodejs/node/pull/58957)
* \[[`f57ee3d71f`](https://github.com/nodejs/node/commit/f57ee3d71f)] - **(SEMVER-MINOR)** **net**: update net.blocklist to allow file save and file management (alphaleadership) [#58087](https://github.com/nodejs/node/pull/58087)
* \[[`4aefcfc318`](https://github.com/nodejs/node/commit/4aefcfc318)] - **node-api**: reword "implementation in an alternative VM" as implementable (Chengzhong Wu) [#59036](https://github.com/nodejs/node/pull/59036)
* \[[`ff6be2ed5d`](https://github.com/nodejs/node/commit/ff6be2ed5d)] - **node-api,doc**: update links to ecma262 with section names (Chengzhong Wu) [#59087](https://github.com/nodejs/node/pull/59087)
* \[[`8d60602677`](https://github.com/nodejs/node/commit/8d60602677)] - **perf\_hooks**: do not expose SafeMap via Histogram wrapper (René) [#59094](https://github.com/nodejs/node/pull/59094)
* \[[`035da74c31`](https://github.com/nodejs/node/commit/035da74c31)] - **(SEMVER-MINOR)** **process**: add threadCpuUsage (Paolo Insogna) [#56467](https://github.com/nodejs/node/pull/56467)
* \[[`74e1aa4d06`](https://github.com/nodejs/node/commit/74e1aa4d06)] - **process**: make execve's args argument optional (Allon Murienik) [#58412](https://github.com/nodejs/node/pull/58412)
* \[[`3366e60bd9`](https://github.com/nodejs/node/commit/3366e60bd9)] - **src**: use simdjson to parse SEA configuration (Joyee Cheung) [#59323](https://github.com/nodejs/node/pull/59323)
* \[[`63cc06977a`](https://github.com/nodejs/node/commit/63cc06977a)] - **src**: mark realm leaf classes final (Anna Henningsen) [#59355](https://github.com/nodejs/node/pull/59355)
* \[[`133d410cd9`](https://github.com/nodejs/node/commit/133d410cd9)] - **src**: use C++20 `contains()` method (iknoom) [#59304](https://github.com/nodejs/node/pull/59304)
* \[[`57fe96fe49`](https://github.com/nodejs/node/commit/57fe96fe49)] - **src**: added CHECK\_NOT\_NULL check for multiple eq\_wrap\_async (F3lixTheCat) [#59267](https://github.com/nodejs/node/pull/59267)
* \[[`a8f381a6c5`](https://github.com/nodejs/node/commit/a8f381a6c5)] - **src**: add nullptr checks in `StreamPipe::New` (Burkov Egor) [#57613](https://github.com/nodejs/node/pull/57613)
* \[[`0769e5a0dc`](https://github.com/nodejs/node/commit/0769e5a0dc)] - **src**: call unmask after install signal handler (theanarkh) [#59059](https://github.com/nodejs/node/pull/59059)
* \[[`1e7639e9e1`](https://github.com/nodejs/node/commit/1e7639e9e1)] - **src**: use `FastStringKey` for `TrackV8FastApiCall` (Anna Henningsen) [#59148](https://github.com/nodejs/node/pull/59148)
* \[[`9075a1a4bf`](https://github.com/nodejs/node/commit/9075a1a4bf)] - **src**: use C++20 `consteval` for `FastStringKey` (Anna Henningsen) [#59148](https://github.com/nodejs/node/pull/59148)
* \[[`5a0fd5689b`](https://github.com/nodejs/node/commit/5a0fd5689b)] - **src**: remove declarations of removed BaseObject static fns (Anna Henningsen) [#59093](https://github.com/nodejs/node/pull/59093)
* \[[`c637a2c41d`](https://github.com/nodejs/node/commit/c637a2c41d)] - **src**: add cache to nearest parent package json (Ilyas Shabi) [#59086](https://github.com/nodejs/node/pull/59086)
* \[[`3375a6cfee`](https://github.com/nodejs/node/commit/3375a6cfee)] - **test**: deflake sequential/test-tls-session-timeout (Joyee Cheung) [#59423](https://github.com/nodejs/node/pull/59423)
* \[[`438cb11a15`](https://github.com/nodejs/node/commit/438cb11a15)] - **test**: update WPT resources,WebCryptoAPI,webstorage (Filip Skokan) [#59311](https://github.com/nodejs/node/pull/59311)
* \[[`68bec19f76`](https://github.com/nodejs/node/commit/68bec19f76)] - **test**: add known issue test for fs.cpSync dereference bug (James M Snell) [#58941](https://github.com/nodejs/node/pull/58941)
* \[[`a100cce379`](https://github.com/nodejs/node/commit/a100cce379)] - **test**: deflake stream-readable-to-web test (Ethan Arrowood) [#58948](https://github.com/nodejs/node/pull/58948)
* \[[`b7577d853b`](https://github.com/nodejs/node/commit/b7577d853b)] - **test**: make test-inspector-network-resource sequential (Shima Ryuhei) [#59104](https://github.com/nodejs/node/pull/59104)
* \[[`667ee82443`](https://github.com/nodejs/node/commit/667ee82443)] - **test**: don't use expose internals in test-http-outgoing-buffer.js (Meghan Denny) [#59219](https://github.com/nodejs/node/pull/59219)
* \[[`feec26d3bb`](https://github.com/nodejs/node/commit/feec26d3bb)] - **test**: use mustSucceed in test-fs-read (Sungwon) [#59204](https://github.com/nodejs/node/pull/59204)
* \[[`d7e23769ab`](https://github.com/nodejs/node/commit/d7e23769ab)] - **test**: prepare test-crypto-rsa-dsa for newer OpenSSL (Richard Lau) [#58100](https://github.com/nodejs/node/pull/58100)
* \[[`3a9aca91c6`](https://github.com/nodejs/node/commit/3a9aca91c6)] - **test**: fix flaky test-worker-message-port-transfer-filehandle test (Alex Yang) [#59158](https://github.com/nodejs/node/pull/59158)
* \[[`3aee7625b9`](https://github.com/nodejs/node/commit/3aee7625b9)] - **test**: expand linting rules around `assert` w literal messages (Anna Henningsen) [#59147](https://github.com/nodejs/node/pull/59147)
* \[[`667c2ced38`](https://github.com/nodejs/node/commit/667c2ced38)] - **test**: update WPT for WebCryptoAPI to ab08796857 (Node.js GitHub Bot) [#59129](https://github.com/nodejs/node/pull/59129)
* \[[`89ac344393`](https://github.com/nodejs/node/commit/89ac344393)] - **test**: update WPT for WebCryptoAPI to 19d82c57ab (Node.js GitHub Bot) [#59129](https://github.com/nodejs/node/pull/59129)
* \[[`d332957ac6`](https://github.com/nodejs/node/commit/d332957ac6)] - **test**: skip tests that cause timeouts on IBM i (Abdirahim Musse) [#59014](https://github.com/nodejs/node/pull/59014)
* \[[`a23562ff72`](https://github.com/nodejs/node/commit/a23562ff72)] - **test**: update `startCLI` to set `--port=0` by default (Dario Piotrowicz) [#59042](https://github.com/nodejs/node/pull/59042)
* \[[`4a12f5d83b`](https://github.com/nodejs/node/commit/4a12f5d83b)] - **test**: mark test-inspector-network-fetch as flaky on Windows (Joyee Cheung) [#59091](https://github.com/nodejs/node/pull/59091)
* \[[`ac4f7aa69c`](https://github.com/nodejs/node/commit/ac4f7aa69c)] - **test**: add missing port=0 arg in test-debugger-extract-function-name (Dario Piotrowicz) [#58977](https://github.com/nodejs/node/pull/58977)
* \[[`8dd09267e3`](https://github.com/nodejs/node/commit/8dd09267e3)] - **test,crypto**: skip unsupported ciphers (Shelley Vohr) [#59388](https://github.com/nodejs/node/pull/59388)
* \[[`45200b43ea`](https://github.com/nodejs/node/commit/45200b43ea)] - **tools**: update coverage GitHub Actions to fixed version (Rich Trott) [#59512](https://github.com/nodejs/node/pull/59512)
* \[[`8f2b8b3dc4`](https://github.com/nodejs/node/commit/8f2b8b3dc4)] - **tools**: allow selecting test subsystems with numbers in their names (Darshan Sen) [#59242](https://github.com/nodejs/node/pull/59242)
* \[[`f9bc2573dd`](https://github.com/nodejs/node/commit/f9bc2573dd)] - **tools**: clarify README linter error message (Joyee Cheung) [#59160](https://github.com/nodejs/node/pull/59160)
* \[[`cba0de128d`](https://github.com/nodejs/node/commit/cba0de128d)] - **tools**: add support for URLs to PR commits in `merge.sh` (Antoine du Hamel) [#59162](https://github.com/nodejs/node/pull/59162)
* \[[`039949ef5b`](https://github.com/nodejs/node/commit/039949ef5b)] - **tools**: bump @eslint/plugin-kit from 0.3.1 to 0.3.3 in /tools/eslint (dependabot\[bot]) [#59119](https://github.com/nodejs/node/pull/59119)
* \[[`6a8a73aa35`](https://github.com/nodejs/node/commit/6a8a73aa35)] - **tools**: ignore CVE mention when linting release proposals (Antoine du Hamel) [#59037](https://github.com/nodejs/node/pull/59037)
* \[[`d0f40f3a3a`](https://github.com/nodejs/node/commit/d0f40f3a3a)] - **tools,test**: enforce best practices to detect never settling promises (Antoine du Hamel) [#58992](https://github.com/nodejs/node/pull/58992)
* \[[`9d801a3f00`](https://github.com/nodejs/node/commit/9d801a3f00)] - **typings**: improve internal binding types (Nam Yooseong) [#59351](https://github.com/nodejs/node/pull/59351)
* \[[`6dbda6cb25`](https://github.com/nodejs/node/commit/6dbda6cb25)] - **typings**: improve internal binding types (Michaël Zasso) [#59176](https://github.com/nodejs/node/pull/59176)
* \[[`e22dddf859`](https://github.com/nodejs/node/commit/e22dddf859)] - **util**: respect nested formats in styleText (Alex Yang) [#59098](https://github.com/nodejs/node/pull/59098)
* \[[`491f390515`](https://github.com/nodejs/node/commit/491f390515)] - **worker**: add cpuUsage for worker (theanarkh) [#59177](https://github.com/nodejs/node/pull/59177)
* \[[`8e697d1884`](https://github.com/nodejs/node/commit/8e697d1884)] - **(SEMVER-MINOR)** **zlib**: add dictionary support to zstdCompress and zstdDecompress (lluisemper) [#59240](https://github.com/nodejs/node/pull/59240)
<a id="22.18.0"></a>
## 2025-07-31, Version 22.18.0 'Jod' (LTS), @aduh95

View file

@ -2100,7 +2100,7 @@ The externally maintained libraries used by Node.js are:
- inspector_protocol, located at deps/inspector_protocol, is licensed as follows:
"""
// Copyright 2016 The Chromium Authors. All rights reserved.
// Copyright 2016 The Chromium Authors.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@ -2639,3 +2639,28 @@ The externally maintained libraries used by Node.js are:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
- sonic-boom, located at lib/internal/streams/fast-utf8-stream.js, is licensed as follows:
"""
MIT License
Copyright (c) 2017 Matteo Collina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

View file

@ -95,37 +95,27 @@ _docs_ subdirectory. Version-specific documentation is also at
### Verifying binaries
Download directories contain a `SHASUMS256.txt` file with SHA checksums for the
files.
Download directories contain a `SHASUMS256.txt.asc` file with SHA checksums for the
files and the releaser PGP signature.
To download `SHASUMS256.txt` using `curl`:
You can get a trusted keyring from nodejs/release-keys, e.g. using `curl`:
```bash
curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
curl -fsLo "/path/to/nodejs-keyring.kbx" "https://github.com/nodejs/release-keys/raw/HEAD/gpg/pubring.kbx"
```
To check that downloaded files match the checksum, use `sha256sum`:
Alternatively, you can import the releaser keys in your default keyring, see
[Release keys](#release-keys) for commands to how to do that.
Then, you can verify the files you've downloaded locally
(if you're using your default keyring, pass `--keyring="${GNUPGHOME:-~/.gnupg}/pubring.kbx"`):
```bash
sha256sum -c SHASUMS256.txt --ignore-missing
curl -fsO "https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc" \
&& gpgv --keyring="/path/to/nodejs-keyring.kbx" --output SHASUMS256.txt < SHASUMS256.txt.asc \
&& shasum --check SHASUMS256.txt --ignore-missing
```
For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in
`SHASUMS256.txt.sig`. You can use it with `gpg` to verify the integrity of
`SHASUMS256.txt`. You will first need to import
[the GPG keys of individuals authorized to create releases](#release-keys).
See [Release keys](#release-keys) for commands to import active release keys.
Next, download the `SHASUMS256.txt.sig` for the release:
```bash
curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig
```
Then use `gpg --verify SHASUMS256.txt.sig SHASUMS256.txt` to verify
the file's signature.
## Building Node.js
See [BUILDING.md](BUILDING.md) for instructions on how to build Node.js from
@ -289,6 +279,8 @@ For information about the governance of the Node.js project, see
**Abdirahim Musse** <<abdirahim.musse@ibm.com>>
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** <<anna@addaleax.net>> (she/her)
* [Aditi-1400](https://github.com/Aditi-1400) -
**Aditi Singh** <<aditisingh1400@gmail.com>> (she/her)
* [aduh95](https://github.com/aduh95) -
**Antoine du Hamel** <<duhamelantoine1995@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/aduh95)
* [anonrig](https://github.com/anonrig) -
@ -383,8 +375,6 @@ For information about the governance of the Node.js project, see
**Chengzhong Wu** <<legendecas@gmail.com>> (he/him)
* [lemire](https://github.com/lemire) -
**Daniel Lemire** <<daniel@lemire.me>>
* [Linkgoron](https://github.com/Linkgoron) -
**Nitzan Uziely** <<linkgoron@gmail.com>>
* [LiviaMedeiros](https://github.com/LiviaMedeiros) -
**LiviaMedeiros** <<livia@cirno.name>>
* [ljharb](https://github.com/ljharb) -
@ -424,7 +414,7 @@ For information about the governance of the Node.js project, see
* [Qard](https://github.com/Qard) -
**Stephen Belanger** <<admin@stephenbelanger.com>> (he/him)
* [RafaelGSS](https://github.com/RafaelGSS) -
**Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
**Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him) - [Support me](https://github.com/sponsors/RafaelGSS)
* [RaisinTen](https://github.com/RaisinTen) -
**Darshan Sen** <<raisinten@gmail.com>> (he/him) - [Support me](https://github.com/sponsors/RaisinTen)
* [richardlau](https://github.com/richardlau) -
@ -597,6 +587,8 @@ For information about the governance of the Node.js project, see
**Lance Ball** <<lball@redhat.com>> (he/him)
* [Leko](https://github.com/Leko) -
**Shingo Inoue** <<leko.noor@gmail.com>> (he/him)
* [Linkgoron](https://github.com/Linkgoron) -
**Nitzan Uziely** <<linkgoron@gmail.com>>
* [lucamaraschi](https://github.com/lucamaraschi) -
**Luca Maraschi** <<luca.maraschi@gmail.com>> (he/him)
* [lundibundi](https://github.com/lundibundi) -
@ -806,8 +798,11 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):
* **Ulises Gascón** <<ulisesgascongonzalez@gmail.com>>
`A363A499291CBBC940DD62E41F10027AF002F8B0`
To import the full set of trusted release keys (including subkeys possibly used
to sign releases):
You can use the keyring the project maintains at
<https://github.com/nodejs/release-keys/raw/refs/heads/main/gpg-only-active-keys/pubring.kbx>.
Alternatively, you can import them from a public key server. Have in mind that
the project cannot guarantee the availability of the server nor the keys on
that server.
```bash
gpg --keyserver hkps://keys.openpgp.org --recv-keys 5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 # Antoine du Hamel
@ -867,6 +862,9 @@ verify a downloaded file.
* **Timothy J Fontaine** <<tjfontaine@gmail.com>>
`7937DFD2AB06298B2293C3187D33FF9D0246406D`
The project maintains a keyring able to verify all past releases of Node.js at
<https://github.com/nodejs/release-keys/raw/refs/heads/main/gpg/pubring.kbx>.
</details>
### Security release stewards
@ -882,6 +880,9 @@ releases on a rotation basis as outlined in the
* [Datadog](https://www.datadoghq.com/)
* [bengl](https://github.com/bengl) -
**Bryan English** <<bryan@bryanenglish.com>> (he/him)
* [HeroDevs](https://www.herodevs.com/)
* [marco-ippolito](https://github.com/marco-ippolito) -
**Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
* [NodeSource](https://nodesource.com/)
* [juanarbol](https://github.com/juanarbol) -
**Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)

View file

@ -38,7 +38,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.27',
'v8_embedder_string': '-node.29',
##### V8 defaults for Node.js #####

View file

@ -199,6 +199,7 @@
'lib/internal/http2/util.js',
'lib/internal/inspector/network.js',
'lib/internal/inspector/network_http.js',
'lib/internal/inspector/network_resources.js',
'lib/internal/inspector/network_undici.js',
'lib/internal/inspector_async_hook.js',
'lib/internal/inspector_network_tracking.js',
@ -343,6 +344,7 @@
'lib/internal/util/inspector.js',
'lib/internal/util/parse_args/parse_args.js',
'lib/internal/util/parse_args/utils.js',
'lib/internal/util/trace_sigint.js',
'lib/internal/util/types.js',
'lib/internal/v8/startup_snapshot.js',
'lib/internal/v8_prof_polyfill.js',

View file

@ -23,7 +23,7 @@
#define SRC_NODE_VERSION_H_
#define NODE_MAJOR_VERSION 22
#define NODE_MINOR_VERSION 18
#define NODE_MINOR_VERSION 19
#define NODE_PATCH_VERSION 0
#define NODE_VERSION_IS_LTS 1

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86"
#define DATE "built on: Wed Mar 5 20:59:02 2025 UTC"
#define DATE "built on: Sun Jul 20 00:45:41 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

View file

@ -29,7 +29,7 @@ extern "C" {
*/
# define OPENSSL_VERSION_MAJOR 3
# define OPENSSL_VERSION_MINOR 0
# define OPENSSL_VERSION_PATCH 16
# define OPENSSL_VERSION_PATCH 17
/*
* Additional version information
@ -74,21 +74,21 @@ extern "C" {
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
*/
# define OPENSSL_VERSION_STR "3.0.16"
# define OPENSSL_FULL_VERSION_STR "3.0.16"
# define OPENSSL_VERSION_STR "3.0.17"
# define OPENSSL_FULL_VERSION_STR "3.0.17"
/*
* SECTION 3: ADDITIONAL METADATA
*
* These strings are defined separately to allow them to be parsable.
*/
# define OPENSSL_RELEASE_DATE "11 Feb 2025"
# define OPENSSL_RELEASE_DATE "1 Jul 2025"
/*
* SECTION 4: BACKWARD COMPATIBILITY
*/
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.16 11 Feb 2025"
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.17 1 Jul 2025"
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86"
#define DATE "built on: Wed Mar 5 20:59:15 2025 UTC"
#define DATE "built on: Sun Jul 20 00:45:53 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

View file

@ -29,7 +29,7 @@ extern "C" {
*/
# define OPENSSL_VERSION_MAJOR 3
# define OPENSSL_VERSION_MINOR 0
# define OPENSSL_VERSION_PATCH 16
# define OPENSSL_VERSION_PATCH 17
/*
* Additional version information
@ -74,21 +74,21 @@ extern "C" {
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
*/
# define OPENSSL_VERSION_STR "3.0.16"
# define OPENSSL_FULL_VERSION_STR "3.0.16"
# define OPENSSL_VERSION_STR "3.0.17"
# define OPENSSL_FULL_VERSION_STR "3.0.17"
/*
* SECTION 3: ADDITIONAL METADATA
*
* These strings are defined separately to allow them to be parsable.
*/
# define OPENSSL_RELEASE_DATE "11 Feb 2025"
# define OPENSSL_RELEASE_DATE "1 Jul 2025"
/*
* SECTION 4: BACKWARD COMPATIBILITY
*/
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.16 11 Feb 2025"
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.17 1 Jul 2025"
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86"
#define DATE "built on: Wed Mar 5 20:59:28 2025 UTC"
#define DATE "built on: Sun Jul 20 00:46:06 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

View file

@ -29,7 +29,7 @@ extern "C" {
*/
# define OPENSSL_VERSION_MAJOR 3
# define OPENSSL_VERSION_MINOR 0
# define OPENSSL_VERSION_PATCH 16
# define OPENSSL_VERSION_PATCH 17
/*
* Additional version information
@ -74,21 +74,21 @@ extern "C" {
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
*/
# define OPENSSL_VERSION_STR "3.0.16"
# define OPENSSL_FULL_VERSION_STR "3.0.16"
# define OPENSSL_VERSION_STR "3.0.17"
# define OPENSSL_FULL_VERSION_STR "3.0.17"
/*
* SECTION 3: ADDITIONAL METADATA
*
* These strings are defined separately to allow them to be parsable.
*/
# define OPENSSL_RELEASE_DATE "11 Feb 2025"
# define OPENSSL_RELEASE_DATE "1 Jul 2025"
/*
* SECTION 4: BACKWARD COMPATIBILITY
*/
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.16 11 Feb 2025"
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.17 1 Jul 2025"
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86_64"
#define DATE "built on: Wed Mar 5 20:59:39 2025 UTC"
#define DATE "built on: Sun Jul 20 00:46:18 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

View file

@ -29,7 +29,7 @@ extern "C" {
*/
# define OPENSSL_VERSION_MAJOR 3
# define OPENSSL_VERSION_MINOR 0
# define OPENSSL_VERSION_PATCH 16
# define OPENSSL_VERSION_PATCH 17
/*
* Additional version information
@ -74,21 +74,21 @@ extern "C" {
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
*/
# define OPENSSL_VERSION_STR "3.0.16"
# define OPENSSL_FULL_VERSION_STR "3.0.16"
# define OPENSSL_VERSION_STR "3.0.17"
# define OPENSSL_FULL_VERSION_STR "3.0.17"
/*
* SECTION 3: ADDITIONAL METADATA
*
* These strings are defined separately to allow them to be parsable.
*/
# define OPENSSL_RELEASE_DATE "11 Feb 2025"
# define OPENSSL_RELEASE_DATE "1 Jul 2025"
/*
* SECTION 4: BACKWARD COMPATIBILITY
*/
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.16 11 Feb 2025"
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.17 1 Jul 2025"
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86_64"
#define DATE "built on: Wed Mar 5 20:59:54 2025 UTC"
#define DATE "built on: Sun Jul 20 00:46:33 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

View file

@ -29,7 +29,7 @@ extern "C" {
*/
# define OPENSSL_VERSION_MAJOR 3
# define OPENSSL_VERSION_MINOR 0
# define OPENSSL_VERSION_PATCH 16
# define OPENSSL_VERSION_PATCH 17
/*
* Additional version information
@ -74,21 +74,21 @@ extern "C" {
* longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
* OPENSSL_VERSION_BUILD_METADATA_STR appended.
*/
# define OPENSSL_VERSION_STR "3.0.16"
# define OPENSSL_FULL_VERSION_STR "3.0.16"
# define OPENSSL_VERSION_STR "3.0.17"
# define OPENSSL_FULL_VERSION_STR "3.0.17"
/*
* SECTION 3: ADDITIONAL METADATA
*
* These strings are defined separately to allow them to be parsable.
*/
# define OPENSSL_RELEASE_DATE "11 Feb 2025"
# define OPENSSL_RELEASE_DATE "1 Jul 2025"
/*
* SECTION 4: BACKWARD COMPATIBILITY
*/
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.16 11 Feb 2025"
# define OPENSSL_VERSION_TEXT "OpenSSL 3.0.17 1 Jul 2025"
/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
# ifdef OPENSSL_VERSION_PRE_RELEASE

View file

@ -11,7 +11,7 @@
*/
#define PLATFORM "platform: BSD-x86_64"
#define DATE "built on: Wed Mar 5 21:00:10 2025 UTC"
#define DATE "built on: Sun Jul 20 00:46:48 2025 UTC"
/*
* Generate compiler_flags as an array of individual characters. This is a

Some files were not shown because too many files have changed in this diff Show more