wrangler 4.30.0 → 4.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
1
+ import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
2
2
  import * as undici from 'undici';
3
3
  import { RequestInfo, RequestInit, Response, FormData } from 'undici';
4
4
  import { CamelCaseKey, ArgumentsCamelCase, InferredOptionTypes, Alias, PositionalOptions, Options } from 'yargs';
5
5
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
6
+ import { Metafile } from 'esbuild';
6
7
  import { EventEmitter } from 'node:events';
7
8
  import Protocol from 'devtools-protocol/types/protocol-mapping';
8
- import { Metafile } from 'esbuild';
9
9
  import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
10
10
  import { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
11
11
  import { URLSearchParams } from 'node:url';
@@ -150,11 +150,22 @@ type ContainerApp = {
150
150
  namespace_id: string;
151
151
  };
152
152
  /**
153
- * How a rollout should be done, defining the size of it
153
+ * Configures what percentage of instances should be updated at each step of a rollout.
154
+ * You can specify this as a single number, or an array of numbers.
155
+ *
156
+ * If this is a single number, each step will progress by that percentage.
157
+ * The options are 5, 10, 20, 25, 50 or 100.
158
+ *
159
+ * If this is an array, each step specifies the cumulative rollout progress.
160
+ * The final step must be 100.
161
+ *
162
+ * This can be overridden adhoc by deploying with the `--containers-rollout=immediate` flag,
163
+ * which will roll out to 100% of instances in one step.
164
+ *
154
165
  * @optional
155
- * @default 25
166
+ * @default [10,100]
156
167
  * */
157
- rollout_step_percentage?: number;
168
+ rollout_step_percentage?: number | number[];
158
169
  /**
159
170
  * How a rollout should be created. It supports the following modes:
160
171
  * - full_auto: The container application will be rolled out fully automatically.
@@ -162,6 +173,7 @@ type ContainerApp = {
162
173
  * - manual: The container application will be rollout fully by manually actioning progress steps.
163
174
  * @optional
164
175
  * @default "full_auto"
176
+ * @hidden
165
177
  */
166
178
  rollout_kind?: "full_auto" | "none" | "full_manual";
167
179
  /**
@@ -770,9 +782,18 @@ interface EnvironmentNonInheritable {
770
782
  services: {
771
783
  /** The binding name used to refer to the bound service. */
772
784
  binding: string;
773
- /** The name of the service. */
785
+ /**
786
+ * The name of the service.
787
+ * To bind to a worker in a specific environment,
788
+ * you should use the format `<worker_name>-<environment_name>`.
789
+ */
774
790
  service: string;
775
- /** The environment of the service (e.g. production, staging, etc). */
791
+ /**
792
+ * @hidden
793
+ * @deprecated you should use `service: <worker_name>-<environment_name>` instead.
794
+ * This refers to the deprecated concept of 'service environments'.
795
+ * The environment of the service (e.g. production, staging, etc).
796
+ */
776
797
  environment?: string;
777
798
  /** Optionally, the entrypoint (named export) of the service to bind to. */
778
799
  entrypoint?: string;
@@ -1417,6 +1438,7 @@ interface CfKvNamespace {
1417
1438
  */
1418
1439
  type CfSendEmailBindings = {
1419
1440
  name: string;
1441
+ experimental_remote?: boolean;
1420
1442
  } & ({
1421
1443
  destination_address?: string;
1422
1444
  } | {
@@ -1527,6 +1549,7 @@ interface CfLogfwdrBinding {
1527
1549
  interface CfPipeline {
1528
1550
  binding: string;
1529
1551
  pipeline: string;
1552
+ experimental_remote?: boolean;
1530
1553
  }
1531
1554
  interface CfUnsafeBinding {
1532
1555
  name: string;
@@ -1775,7 +1798,6 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1775
1798
  modified_on: string;
1776
1799
  short_id: string;
1777
1800
  build_image_major_version: number;
1778
- kv_namespaces?: any;
1779
1801
  source?: {
1780
1802
  type: "github" | "gitlab";
1781
1803
  config: {
@@ -1790,6 +1812,7 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
1790
1812
  preview_branch_excludes?: string[] | undefined;
1791
1813
  };
1792
1814
  } | undefined;
1815
+ kv_namespaces?: any;
1793
1816
  env_vars?: any;
1794
1817
  durable_object_namespaces?: any;
1795
1818
  is_skipped?: boolean | undefined;
@@ -1809,26 +1832,6 @@ declare const unstable_pages: {
1809
1832
  */
1810
1833
  type ComplianceConfig = Partial<Pick<Config, "compliance_region">>;
1811
1834
 
1812
- type WorkerRegistry = Record<string, WorkerDefinition>;
1813
- type WorkerEntrypointsDefinition = Record<"default" | string, {
1814
- host: string;
1815
- port: number;
1816
- } | undefined>;
1817
- type WorkerDefinition = {
1818
- port: number | undefined;
1819
- protocol: "http" | "https" | undefined;
1820
- host: string | undefined;
1821
- mode: "local" | "remote";
1822
- headers?: Record<string, string>;
1823
- entrypointAddresses?: WorkerEntrypointsDefinition;
1824
- durableObjects: {
1825
- name: string;
1826
- className: string;
1827
- }[];
1828
- durableObjectsHost?: string;
1829
- durableObjectsPort?: number;
1830
- };
1831
-
1832
1835
  type _Params<ParamsArray extends [unknown?]> = ParamsArray extends [infer P] ? P : undefined;
1833
1836
  type _EventMethods = keyof Protocol.Events;
1834
1837
  type DevToolsEvent<Method extends _EventMethods> = Method extends unknown ? {
@@ -1946,6 +1949,7 @@ declare class ConfigController extends Controller<ConfigControllerEventMap> {
1946
1949
  latestConfig?: StartDevWorkerOptions;
1947
1950
  set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
1948
1951
  patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
1952
+ onDevRegistryUpdate(event: DevRegistryUpdateEvent): void;
1949
1953
  teardown(): Promise<void>;
1950
1954
  emitConfigUpdateEvent(config: StartDevWorkerOptions): void;
1951
1955
  }
@@ -2071,8 +2075,6 @@ interface StartDevWorkerInput {
2071
2075
  outboundService?: ServiceFetch;
2072
2076
  /** An undici MockAgent to declaratively mock fetch calls to particular resources. */
2073
2077
  mockFetch?: undici.MockAgent;
2074
- /** Describes the registry of other Workers running locally */
2075
- registry?: WorkerRegistry | null;
2076
2078
  testScheduled?: boolean;
2077
2079
  /** Whether to use Vectorize as a remote binding -- the worker is run locally but accesses to Vectorize are made remotely */
2078
2080
  bindVectorizeToProd?: boolean;
@@ -2085,6 +2087,8 @@ interface StartDevWorkerInput {
2085
2087
  containerBuildId?: string;
2086
2088
  /** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
2087
2089
  enableContainers?: boolean;
2090
+ /** Path to the dev registry directory */
2091
+ registry?: string;
2088
2092
  /** Path to the docker executable. Defaults to 'docker' */
2089
2093
  dockerPath?: string;
2090
2094
  /** Options for the container engine */
@@ -2260,6 +2264,10 @@ type ReloadCompleteEvent = {
2260
2264
  bundle: Bundle;
2261
2265
  proxyData: ProxyData;
2262
2266
  };
2267
+ type DevRegistryUpdateEvent = {
2268
+ type: "devRegistryUpdate";
2269
+ registry: WorkerRegistry;
2270
+ };
2263
2271
  type PreviewTokenExpiredEvent = {
2264
2272
  type: "previewTokenExpired";
2265
2273
  proxyData: ProxyData;
@@ -2322,8 +2330,6 @@ type ProxyData = {
2322
2330
  headers: Record<string, string>;
2323
2331
  liveReload?: boolean;
2324
2332
  proxyLogsToController?: boolean;
2325
- internalDurableObjects?: CfDurableObject[];
2326
- entrypointAddresses: WorkerEntrypointsDefinition | undefined;
2327
2333
  };
2328
2334
 
2329
2335
  interface TypedEventEmitter<EventMap extends Record<string | symbol, unknown[]>> extends EventEmitter {
@@ -2352,6 +2358,7 @@ declare abstract class Controller<EventMap extends ControllerEventMap = Controll
2352
2358
  type RuntimeControllerEventMap = ControllerEventMap & {
2353
2359
  reloadStart: [ReloadStartEvent];
2354
2360
  reloadComplete: [ReloadCompleteEvent];
2361
+ devRegistryUpdate: [DevRegistryUpdateEvent];
2355
2362
  };
2356
2363
  declare abstract class RuntimeController extends Controller<RuntimeControllerEventMap> {
2357
2364
  abstract onBundleStart(_: BundleStartEvent): void;
@@ -2653,9 +2660,6 @@ type WorkerConfigObject = {
2653
2660
  /**
2654
2661
  * Utility for potentially starting or updating a remote proxy session.
2655
2662
  *
2656
- * It uses an internal map for storing existing remote proxy session indexed by worker names. If no worker name is provided
2657
- * the remote proxy session won't be retrieved nor saved to/from the internal map.
2658
- *
2659
2663
  * @param wranglerOrWorkerConfigObject either a file path to a wrangler configuration file or an object containing the name of
2660
2664
  * the target worker alongside its bindings.
2661
2665
  * @param preExistingRemoteProxySessionData the optional data of a pre-existing remote proxy session if there was one, this
@@ -2740,6 +2744,7 @@ type ExperimentalFlags = {
2740
2744
  MULTIWORKER: boolean;
2741
2745
  RESOURCES_PROVISION: boolean;
2742
2746
  REMOTE_BINDINGS: boolean;
2747
+ DEPLOY_REMOTE_DIFF_CHECK: boolean;
2743
2748
  };
2744
2749
 
2745
2750
  // Team names from https://wiki.cfdata.org/display/EW/Developer+Platform+Components+and+Pillar+Ownership