From 1374e929db804a3d6aec13255af5639d3596e60f Mon Sep 17 00:00:00 2001 From: Thomas Rubini Date: Fri, 7 Aug 2026 21:14:44 +0100 Subject: [PATCH] chore: update generated workerd.ts --- .../miniflare/src/plugins/core/modules.ts | 2 +- .../src/runtime/config/generated/workerd.ts | 114 ++++++++++++------ .../miniflare/src/runtime/config/workerd.ts | 4 +- .../src/pool/module-fallback.ts | 2 +- 4 files changed, 82 insertions(+), 40 deletions(-) diff --git a/packages/miniflare/src/plugins/core/modules.ts b/packages/miniflare/src/plugins/core/modules.ts index 6e438989f46..64bccd857ce 100644 --- a/packages/miniflare/src/plugins/core/modules.ts +++ b/packages/miniflare/src/plugins/core/modules.ts @@ -123,7 +123,7 @@ export function convertManifestModule( case "python": return { name, pythonModule: contentsToString(contents) }; case "python-requirement": - return { name, pythonRequirement: contentsToString(contents) }; + return { name, obsoletePythonRequirement: contentsToString(contents) }; case "sourcemap": assert.fail("Unreachable: sourcemap modules are unsupported"); break; diff --git a/packages/miniflare/src/runtime/config/generated/workerd.ts b/packages/miniflare/src/runtime/config/generated/workerd.ts index 9ac5a1093bc..01142998739 100644 --- a/packages/miniflare/src/runtime/config/generated/workerd.ts +++ b/packages/miniflare/src/runtime/config/generated/workerd.ts @@ -1,6 +1,5 @@ // This file has been automatically generated by capnp-es. import * as $ from "capnp-es"; - export const _capnpFileId = 0xe6afd26682091c01n; /** * Top-level configuration for a workerd instance. @@ -292,6 +291,34 @@ export class Socket_Https extends $.Struct { return "Socket_Https_" + super.toString(); } } +export class Socket_Tcp extends $.Struct { + static readonly _capnp = { + displayName: "tcp", + id: "b59d8ecf6886b64c", + size: new $.ObjectSize(8, 5), + }; + _adoptTlsOptions(value: $.Orphan): void { + $.utils.adopt(value, $.utils.getPointer(2, this)); + } + _disownTlsOptions(): $.Orphan { + return $.utils.disown(this.tlsOptions); + } + get tlsOptions(): TlsOptions { + return $.utils.getStruct(2, TlsOptions, this); + } + _hasTlsOptions(): boolean { + return !$.utils.isNull($.utils.getPointer(2, this)); + } + _initTlsOptions(): TlsOptions { + return $.utils.initStructAt(2, TlsOptions, this); + } + set tlsOptions(value: TlsOptions) { + $.utils.copyFrom(value, $.utils.getPointer(2, this)); + } + toString(): string { + return "Socket_Tcp_" + super.toString(); + } +} export const Socket_Which = { /** * Each socket has a unique name which can be used on the command line to override the socket's @@ -319,11 +346,13 @@ export const Socket_Which = { * */ HTTPS: 1, + TCP: 2, } as const; export type Socket_Which = (typeof Socket_Which)[keyof typeof Socket_Which]; export class Socket extends $.Struct { static readonly HTTP = Socket_Which.HTTP; static readonly HTTPS = Socket_Which.HTTPS; + static readonly TCP = Socket_Which.TCP; static readonly _capnp = { displayName: "Socket", id: "9a0eba45530ee79f", @@ -404,6 +433,20 @@ export class Socket extends $.Struct { set https(_: true) { $.utils.setUint16(0, 1, this); } + get tcp(): Socket_Tcp { + $.utils.testWhich("tcp", $.utils.getUint16(0, this), 2, this); + return $.utils.getAs(Socket_Tcp, this); + } + _initTcp(): Socket_Tcp { + $.utils.setUint16(0, 2, this); + return $.utils.getAs(Socket_Tcp, this); + } + get _isTcp(): boolean { + return $.utils.getUint16(0, this) === 2; + } + set tcp(_: true) { + $.utils.setUint16(0, 2, this); + } _adoptService(value: $.Orphan): void { $.utils.adopt(value, $.utils.getPointer(4, this)); } @@ -789,7 +832,7 @@ export const Worker_Module_Which = { * Bundle prior to execution. * */ - PYTHON_REQUIREMENT: 8, + OBSOLETE_PYTHON_REQUIREMENT: 8, } as const; export type Worker_Module_Which = (typeof Worker_Module_Which)[keyof typeof Worker_Module_Which]; @@ -802,7 +845,8 @@ export class Worker_Module extends $.Struct { static readonly JSON = Worker_Module_Which.JSON; static readonly OBSOLETE = Worker_Module_Which.OBSOLETE; static readonly PYTHON_MODULE = Worker_Module_Which.PYTHON_MODULE; - static readonly PYTHON_REQUIREMENT = Worker_Module_Which.PYTHON_REQUIREMENT; + static readonly OBSOLETE_PYTHON_REQUIREMENT = + Worker_Module_Which.OBSOLETE_PYTHON_REQUIREMENT; static readonly _capnp = { displayName: "Module", id: "d9d87a63770a12f3", @@ -972,22 +1016,22 @@ export class Worker_Module extends $.Struct { $.utils.setText(1, value, this); } /** - * A Python package that is required by this bundle. The package must be supported by - * Pyodide (https://pyodide.org/en/stable/usage/packages-in-pyodide.html). All packages listed - * will be installed prior to the execution of the worker. - * - * The value of this field is ignored and should always be an empty string. Only the module - * name matters. The field should have been declared `Void`, but it's difficult to change now. + * This position used to be the pythonRequirement type that has now been deprecated. * */ - get pythonRequirement(): string { - $.utils.testWhich("pythonRequirement", $.utils.getUint16(0, this), 8, this); + get obsoletePythonRequirement(): string { + $.utils.testWhich( + "obsoletePythonRequirement", + $.utils.getUint16(0, this), + 8, + this + ); return $.utils.getText(1, this); } - get _isPythonRequirement(): boolean { + get _isObsoletePythonRequirement(): boolean { return $.utils.getUint16(0, this) === 8; } - set pythonRequirement(value: string) { + set obsoletePythonRequirement(value: string) { $.utils.setUint16(0, 8, this); $.utils.setText(1, value, this); } @@ -1039,7 +1083,7 @@ export const Worker_Binding_Type_Which = { DURABLE_OBJECT_NAMESPACE: 7, KV_NAMESPACE: 8, R2BUCKET: 9, - R2ADMIN: 10, + OBSOLETE0: 10, QUEUE: 11, ANALYTICS_ENGINE: 12, HYPERDRIVE: 13, @@ -1064,7 +1108,7 @@ export class Worker_Binding_Type extends $.Struct { Worker_Binding_Type_Which.DURABLE_OBJECT_NAMESPACE; static readonly KV_NAMESPACE = Worker_Binding_Type_Which.KV_NAMESPACE; static readonly R2BUCKET = Worker_Binding_Type_Which.R2BUCKET; - static readonly R2ADMIN = Worker_Binding_Type_Which.R2ADMIN; + static readonly OBSOLETE0 = Worker_Binding_Type_Which.OBSOLETE0; static readonly QUEUE = Worker_Binding_Type_Which.QUEUE; static readonly ANALYTICS_ENGINE = Worker_Binding_Type_Which.ANALYTICS_ENGINE; static readonly HYPERDRIVE = Worker_Binding_Type_Which.HYPERDRIVE; @@ -1167,10 +1211,10 @@ export class Worker_Binding_Type extends $.Struct { set r2Bucket(_: true) { $.utils.setUint16(0, 9, this); } - get _isR2Admin(): boolean { + get _isObsolete0(): boolean { return $.utils.getUint16(0, this) === 10; } - set r2Admin(_: true) { + set obsolete0(_: true) { $.utils.setUint16(0, 10, this); } get _isQueue(): boolean { @@ -1912,12 +1956,12 @@ export const Worker_Binding_Which = { * */ R2BUCKET: 10, - R2ADMIN: 11, /** - * R2 bucket and admin API bindings. Similar to KV namespaces, these turn operations into - * HTTP requests aimed at the named service. + * R2 bucket binding. Similar to KV namespaces, this turns operations into HTTP requests aimed + * at the named service. * */ + OBSOLETE0: 11, WRAPPED: 12, /** * Wraps a collection of inner bindings in a common api functionality. @@ -1991,7 +2035,7 @@ export class Worker_Binding extends $.Struct { Worker_Binding_Which.DURABLE_OBJECT_NAMESPACE; static readonly KV_NAMESPACE = Worker_Binding_Which.KV_NAMESPACE; static readonly R2BUCKET = Worker_Binding_Which.R2BUCKET; - static readonly R2ADMIN = Worker_Binding_Which.R2ADMIN; + static readonly OBSOLETE0 = Worker_Binding_Which.OBSOLETE0; static readonly WRAPPED = Worker_Binding_Which.WRAPPED; static readonly QUEUE = Worker_Binding_Which.QUEUE; static readonly FROM_ENVIRONMENT = Worker_Binding_Which.FROM_ENVIRONMENT; @@ -2320,6 +2364,11 @@ export class Worker_Binding extends $.Struct { _disownR2Bucket(): $.Orphan { return $.utils.disown(this.r2Bucket); } + /** + * R2 bucket binding. Similar to KV namespaces, this turns operations into HTTP requests aimed + * at the named service. + * + */ get r2Bucket(): ServiceDesignator { $.utils.testWhich("r2Bucket", $.utils.getUint16(0, this), 10, this); return $.utils.getStruct(1, ServiceDesignator, this); @@ -2338,33 +2387,28 @@ export class Worker_Binding extends $.Struct { $.utils.setUint16(0, 10, this); $.utils.copyFrom(value, $.utils.getPointer(1, this)); } - _adoptR2Admin(value: $.Orphan): void { + _adoptObsolete0(value: $.Orphan): void { $.utils.setUint16(0, 11, this); $.utils.adopt(value, $.utils.getPointer(1, this)); } - _disownR2Admin(): $.Orphan { - return $.utils.disown(this.r2Admin); + _disownObsolete0(): $.Orphan { + return $.utils.disown(this.obsolete0); } - /** - * R2 bucket and admin API bindings. Similar to KV namespaces, these turn operations into - * HTTP requests aimed at the named service. - * - */ - get r2Admin(): ServiceDesignator { - $.utils.testWhich("r2Admin", $.utils.getUint16(0, this), 11, this); + get obsolete0(): ServiceDesignator { + $.utils.testWhich("obsolete0", $.utils.getUint16(0, this), 11, this); return $.utils.getStruct(1, ServiceDesignator, this); } - _hasR2Admin(): boolean { + _hasObsolete0(): boolean { return !$.utils.isNull($.utils.getPointer(1, this)); } - _initR2Admin(): ServiceDesignator { + _initObsolete0(): ServiceDesignator { $.utils.setUint16(0, 11, this); return $.utils.initStructAt(1, ServiceDesignator, this); } - get _isR2Admin(): boolean { + get _isObsolete0(): boolean { return $.utils.getUint16(0, this) === 11; } - set r2Admin(value: ServiceDesignator) { + set obsolete0(value: ServiceDesignator) { $.utils.setUint16(0, 11, this); $.utils.copyFrom(value, $.utils.getPointer(1, this)); } diff --git a/packages/miniflare/src/runtime/config/workerd.ts b/packages/miniflare/src/runtime/config/workerd.ts index 4ee0396b224..e295b52fe72 100644 --- a/packages/miniflare/src/runtime/config/workerd.ts +++ b/packages/miniflare/src/runtime/config/workerd.ts @@ -93,7 +93,7 @@ export type Worker_Module = { | { wasm?: Uint8Array } | { json?: string } | { pythonModule?: string } - | { pythonRequirement?: string } + | { obsoletePythonRequirement?: string } ); export type Worker_Binding = { @@ -109,7 +109,6 @@ export type Worker_Binding = { | { durableObjectNamespace?: Worker_Binding_DurableObjectNamespaceDesignator } | { kvNamespace?: ServiceDesignator } | { r2Bucket?: ServiceDesignator } - | { r2Admin?: ServiceDesignator } | { wrapped?: Worker_Binding_WrappedBinding } | { queue?: ServiceDesignator } | { fromEnvironment?: string } @@ -135,7 +134,6 @@ export type Worker_Binding_Type = | { durableObjectNamespace: Void } | { kvNamespace?: Void } | { r2Bucket?: Void } - | { r2Admin?: Void } | { queue?: Void } | { analyticsEngine?: Void } | { hyperdrive?: Void }; diff --git a/packages/vitest-pool-workers/src/pool/module-fallback.ts b/packages/vitest-pool-workers/src/pool/module-fallback.ts index 44d2195e9ef..f0bd89b3dc4 100644 --- a/packages/vitest-pool-workers/src/pool/module-fallback.ts +++ b/packages/vitest-pool-workers/src/pool/module-fallback.ts @@ -475,7 +475,7 @@ function maybeGetForceTypeModuleContents( case "PythonModule": return { pythonModule: contents.toString() }; case "PythonRequirement": - return { pythonRequirement: contents.toString() }; + return { obsoletePythonRequirement: contents.toString() }; default: { // `type` should've been validated against `LegacyModuleRuleType` const exhaustive: never = type;