wrangler 4.20.1 → 4.20.3

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,4 +1,4 @@
1
- import { Json, Request, Response as Response$1, DispatchFetch, WorkerOptions, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, ModuleRule, MixedModeConnectionString } from 'miniflare';
1
+ import { Json, Request, Response as Response$1, DispatchFetch, WorkerOptions, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
2
2
  import * as undici from 'undici';
3
3
  import { RequestInfo, RequestInit, Response, FormData } from 'undici';
4
4
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
@@ -66,7 +66,7 @@ type ContainerApp = {
66
66
  image_vars?: Record<string, string>;
67
67
  class_name: string;
68
68
  /** The scheduling policy of the application, default is regional */
69
- scheduling_policy?: "regional" | "moon";
69
+ scheduling_policy?: "regional" | "moon" | "default";
70
70
  configuration: {
71
71
  image: string;
72
72
  labels?: {
@@ -427,8 +427,8 @@ type WorkflowBinding = {
427
427
  class_name: string;
428
428
  /** The script where the Workflow is defined (if it's external to this Worker) */
429
429
  script_name?: string;
430
- /** Whether the Workflow should be remote or not (only available under `--x-mixed-mode`) */
431
- remote?: boolean;
430
+ /** Whether the Workflow should be remote or not (only available under `--x-remote-bindings`) */
431
+ experimental_remote?: boolean;
432
432
  };
433
433
  /**
434
434
  * The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
@@ -500,6 +500,9 @@ interface EnvironmentNonInheritable {
500
500
  /**
501
501
  * Container related configuration
502
502
  *
503
+ * NOTE: This field is not automatically inherited from the top level environment,
504
+ * and so must be specified in every named environment.
505
+ *
503
506
  * @default []
504
507
  * @nonInheritable
505
508
  */
@@ -526,8 +529,8 @@ interface EnvironmentNonInheritable {
526
529
  id?: string;
527
530
  /** The ID of the KV namespace used during `wrangler dev` */
528
531
  preview_id?: string;
529
- /** Whether the KV namespace should be remote or not (only available under `--x-mixed-mode`) */
530
- remote?: boolean;
532
+ /** Whether the KV namespace should be remote or not (only available under `--x-remote-bindings`) */
533
+ experimental_remote?: boolean;
531
534
  }[];
532
535
  /**
533
536
  * These specify bindings to send email from inside your Worker.
@@ -568,8 +571,8 @@ interface EnvironmentNonInheritable {
568
571
  queue: string;
569
572
  /** The number of seconds to wait before delivering a message */
570
573
  delivery_delay?: number;
571
- /** Whether the Queue producer should be remote or not (only available under `--x-mixed-mode`) */
572
- remote?: boolean;
574
+ /** Whether the Queue producer should be remote or not (only available under `--x-remote-bindings`) */
575
+ experimental_remote?: boolean;
573
576
  }[];
574
577
  /** Consumer configuration */
575
578
  consumers?: {
@@ -613,8 +616,8 @@ interface EnvironmentNonInheritable {
613
616
  preview_bucket_name?: string;
614
617
  /** The jurisdiction that the bucket exists in. Default if not present. */
615
618
  jurisdiction?: string;
616
- /** Whether the R2 bucket should be remote or not (only available under `--x-mixed-mode`) */
617
- remote?: boolean;
619
+ /** Whether the R2 bucket should be remote or not (only available under `--x-remote-bindings`) */
620
+ experimental_remote?: boolean;
618
621
  }[];
619
622
  /**
620
623
  * Specifies D1 databases that are bound to this Worker environment.
@@ -642,8 +645,8 @@ interface EnvironmentNonInheritable {
642
645
  migrations_dir?: string;
643
646
  /** Internal use only. */
644
647
  database_internal_env?: string;
645
- /** Whether the D1 database should be remote or not (only available under `--x-mixed-mode`) */
646
- remote?: boolean;
648
+ /** Whether the D1 database should be remote or not (only available under `--x-remote-bindings`) */
649
+ experimental_remote?: boolean;
647
650
  }[];
648
651
  /**
649
652
  * Specifies Vectorize indexes that are bound to this Worker environment.
@@ -661,8 +664,8 @@ interface EnvironmentNonInheritable {
661
664
  binding: string;
662
665
  /** The name of the index. */
663
666
  index_name: string;
664
- /** Whether the Vectorize index should be remote or not (only available under `--x-mixed-mode`) */
665
- remote?: boolean;
667
+ /** Whether the Vectorize index should be remote or not (only available under `--x-remote-bindings`) */
668
+ experimental_remote?: boolean;
666
669
  }[];
667
670
  /**
668
671
  * Specifies Hyperdrive configs that are bound to this Worker environment.
@@ -705,8 +708,8 @@ interface EnvironmentNonInheritable {
705
708
  entrypoint?: string;
706
709
  /** Optional properties that will be made available to the service via ctx.props. */
707
710
  props?: Record<string, unknown>;
708
- /** Whether the service binding should be remote or not (only available under `--x-mixed-mode`) */
709
- remote?: boolean;
711
+ /** Whether the service binding should be remote or not (only available under `--x-remote-bindings`) */
712
+ experimental_remote?: boolean;
710
713
  }[] | undefined;
711
714
  /**
712
715
  * Specifies analytics engine datasets that are bound to this Worker environment.
@@ -738,8 +741,8 @@ interface EnvironmentNonInheritable {
738
741
  */
739
742
  browser: {
740
743
  binding: string;
741
- /** Whether the Browser binding should be remote or not (only available under `--x-mixed-mode`) */
742
- remote?: boolean;
744
+ /** Whether the Browser binding should be remote or not (only available under `--x-remote-bindings`) */
745
+ experimental_remote?: boolean;
743
746
  } | undefined;
744
747
  /**
745
748
  * Binding to the AI project.
@@ -755,8 +758,8 @@ interface EnvironmentNonInheritable {
755
758
  ai: {
756
759
  binding: string;
757
760
  staging?: boolean;
758
- /** Whether the AI binding should be remote or not (only available under `--x-mixed-mode`) */
759
- remote?: boolean;
761
+ /** Whether the AI binding should be remote or not (only available under `--x-remote-bindings`) */
762
+ experimental_remote?: boolean;
760
763
  } | undefined;
761
764
  /**
762
765
  * Binding to Cloudflare Images
@@ -771,8 +774,8 @@ interface EnvironmentNonInheritable {
771
774
  */
772
775
  images: {
773
776
  binding: string;
774
- /** Whether the Images binding should be remote or not (only available under `--x-mixed-mode`) */
775
- remote?: boolean;
777
+ /** Whether the Images binding should be remote or not (only available under `--x-remote-bindings`) */
778
+ experimental_remote?: boolean;
776
779
  } | undefined;
777
780
  /**
778
781
  * Binding to the Worker Version's metadata
@@ -836,8 +839,8 @@ interface EnvironmentNonInheritable {
836
839
  binding: string;
837
840
  /** The uuid of the uploaded mTLS certificate */
838
841
  certificate_id: string;
839
- /** Whether the mtls fetcher should be remote or not (only available under `--x-mixed-mode`) */
840
- remote?: boolean;
842
+ /** Whether the mtls fetcher should be remote or not (only available under `--x-remote-bindings`) */
843
+ experimental_remote?: boolean;
841
844
  }[];
842
845
  /**
843
846
  * Specifies a list of Tail Workers that are bound to this Worker environment
@@ -867,8 +870,8 @@ interface EnvironmentNonInheritable {
867
870
  namespace: string;
868
871
  /** Details about the outbound Worker which will handle outbound requests from your namespace */
869
872
  outbound?: DispatchNamespaceOutbound;
870
- /** Whether the Dispatch Namespace should be remote or not (only available under `--x-mixed-mode`) */
871
- remote?: boolean;
873
+ /** Whether the Dispatch Namespace should be remote or not (only available under `--x-remote-bindings`) */
874
+ experimental_remote?: boolean;
872
875
  }[];
873
876
  /**
874
877
  * Specifies list of Pipelines bound to this Worker environment
@@ -984,6 +987,13 @@ interface Observability {
984
987
  invocation_logs?: boolean;
985
988
  };
986
989
  }
990
+ type DockerConfiguration = {
991
+ /** Socket used by miniflare to communicate with Docker */
992
+ socketPath: string;
993
+ };
994
+ type ContainerEngine = {
995
+ localDocker: DockerConfiguration;
996
+ } | string;
987
997
 
988
998
  /**
989
999
  * This is the static type definition for the configuration object.
@@ -1189,6 +1199,11 @@ interface DevConfig {
1189
1199
  * @default true
1190
1200
  */
1191
1201
  enable_containers: boolean;
1202
+ /**
1203
+ * Either the Docker unix socket i.e. `unix:/var/run/docker.sock` or a full configuration.
1204
+ * Note that windows is only supported via WSL at the moment
1205
+ */
1206
+ container_engine: ContainerEngine | undefined;
1192
1207
  }
1193
1208
  type RawDevConfig = Partial<DevConfig>;
1194
1209
  interface EnvironmentMap {
@@ -1223,6 +1238,7 @@ type NormalizeAndValidateConfigArgs = {
1223
1238
  upstreamProtocol?: string;
1224
1239
  script?: string;
1225
1240
  enableContainers?: boolean;
1241
+ containerEngine?: ContainerEngine;
1226
1242
  };
1227
1243
 
1228
1244
  type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
@@ -1232,7 +1248,7 @@ type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
1232
1248
  type ReadConfigOptions = ResolveConfigPathOptions & {
1233
1249
  hideWarnings?: boolean;
1234
1250
  experimental?: {
1235
- mixedModeEnabled?: boolean;
1251
+ remoteBindingsEnabled?: boolean;
1236
1252
  };
1237
1253
  };
1238
1254
  type ConfigBindingOptions = Pick<Config, "ai" | "browser" | "d1_databases" | "dispatch_namespaces" | "durable_objects" | "queues" | "r2_buckets" | "services" | "kv_namespaces" | "mtls_certificates" | "vectorize" | "workflows">;
@@ -1309,7 +1325,7 @@ interface CfModule {
1309
1325
  interface CfKvNamespace {
1310
1326
  binding: string;
1311
1327
  id?: string | typeof INHERIT_SYMBOL;
1312
- remote?: boolean;
1328
+ experimental_remote?: boolean;
1313
1329
  raw?: boolean;
1314
1330
  }
1315
1331
  /**
@@ -1336,21 +1352,21 @@ interface CfWorkflow {
1336
1352
  class_name: string;
1337
1353
  binding: string;
1338
1354
  script_name?: string;
1339
- remote?: boolean;
1355
+ experimental_remote?: boolean;
1340
1356
  raw?: boolean;
1341
1357
  }
1342
1358
  interface CfQueue {
1343
1359
  binding: string;
1344
1360
  queue_name: string;
1345
1361
  delivery_delay?: number;
1346
- remote?: boolean;
1362
+ experimental_remote?: boolean;
1347
1363
  raw?: boolean;
1348
1364
  }
1349
1365
  interface CfR2Bucket {
1350
1366
  binding: string;
1351
1367
  bucket_name?: string | typeof INHERIT_SYMBOL;
1352
1368
  jurisdiction?: string;
1353
- remote?: boolean;
1369
+ experimental_remote?: boolean;
1354
1370
  raw?: boolean;
1355
1371
  }
1356
1372
  interface CfD1Database {
@@ -1361,14 +1377,14 @@ interface CfD1Database {
1361
1377
  database_internal_env?: string;
1362
1378
  migrations_table?: string;
1363
1379
  migrations_dir?: string;
1364
- remote?: boolean;
1380
+ experimental_remote?: boolean;
1365
1381
  raw?: boolean;
1366
1382
  }
1367
1383
  interface CfVectorize {
1368
1384
  binding: string;
1369
1385
  index_name: string;
1370
1386
  raw?: boolean;
1371
- remote?: boolean;
1387
+ experimental_remote?: boolean;
1372
1388
  }
1373
1389
  interface CfSecretsStoreSecrets {
1374
1390
  binding: string;
@@ -1390,7 +1406,7 @@ interface CfService {
1390
1406
  environment?: string;
1391
1407
  entrypoint?: string;
1392
1408
  props?: Record<string, unknown>;
1393
- remote?: boolean;
1409
+ experimental_remote?: boolean;
1394
1410
  }
1395
1411
  interface CfAnalyticsEngineDataset {
1396
1412
  binding: string;
@@ -1404,12 +1420,12 @@ interface CfDispatchNamespace {
1404
1420
  environment?: string;
1405
1421
  parameters?: string[];
1406
1422
  };
1407
- remote?: boolean;
1423
+ experimental_remote?: boolean;
1408
1424
  }
1409
1425
  interface CfMTlsCertificate {
1410
1426
  binding: string;
1411
1427
  certificate_id: string;
1412
- remote?: boolean;
1428
+ experimental_remote?: boolean;
1413
1429
  }
1414
1430
  interface CfLogfwdrBinding {
1415
1431
  name: string;
@@ -1549,6 +1565,7 @@ interface Unstable_DevOptions {
1549
1565
  enableIpc?: boolean;
1550
1566
  enableContainers?: boolean;
1551
1567
  dockerPath?: string;
1568
+ containerEngine?: string;
1552
1569
  };
1553
1570
  }
1554
1571
  interface Unstable_DevWorker {
@@ -1908,7 +1925,7 @@ interface StartDevWorkerInput {
1908
1925
  watch?: boolean;
1909
1926
  /** Whether a script tag is inserted on text/html responses which will reload the page upon file changes. Defaults to false. */
1910
1927
  liveReload?: boolean;
1911
- /** The local address to reach your worker. Applies to remote: true (remote mode) and remote: false (local mode). */
1928
+ /** The local address to reach your worker. Applies to experimental_remote: true (remote mode) and remote: false (local mode). */
1912
1929
  server?: {
1913
1930
  hostname?: string;
1914
1931
  port?: number;
@@ -1934,12 +1951,14 @@ interface StartDevWorkerInput {
1934
1951
  imagesLocalMode?: boolean;
1935
1952
  /** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
1936
1953
  multiworkerPrimary?: boolean;
1937
- /** Whether the experimental mixed mode feature should be enabled */
1938
- experimentalMixedMode?: boolean;
1954
+ /** Whether the experimental remote bindings feature should be enabled */
1955
+ experimentalRemoteBindings?: boolean;
1939
1956
  /** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
1940
1957
  enableContainers?: boolean;
1941
1958
  /** Path to the docker executable. Defaults to 'docker' */
1942
1959
  dockerPath?: string;
1960
+ /** Options for the container engine */
1961
+ containerEngine?: ContainerEngine;
1943
1962
  };
1944
1963
  legacy?: {
1945
1964
  site?: Hook<Config["site"], [Config]>;
@@ -2400,53 +2419,53 @@ interface Unstable_MiniflareWorkerOptions {
2400
2419
  }
2401
2420
  declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string, options?: {
2402
2421
  imagesLocalMode?: boolean;
2403
- mixedModeConnectionString?: MixedModeConnectionString;
2404
- mixedModeEnabled?: boolean;
2422
+ remoteProxyConnectionString?: RemoteProxyConnectionString;
2423
+ remoteBindingsEnabled?: boolean;
2405
2424
  overrides?: {
2406
2425
  assets?: Partial<AssetsOptions>;
2407
2426
  };
2408
2427
  }): Unstable_MiniflareWorkerOptions;
2409
2428
  declare function unstable_getMiniflareWorkerOptions(config: Config, env?: string, options?: {
2410
2429
  imagesLocalMode?: boolean;
2411
- mixedModeConnectionString?: MixedModeConnectionString;
2412
- mixedModeEnabled?: boolean;
2430
+ remoteProxyConnectionString?: RemoteProxyConnectionString;
2431
+ remoteBindingsEnabled?: boolean;
2413
2432
  overrides?: {
2414
2433
  assets?: Partial<AssetsOptions>;
2415
2434
  };
2416
2435
  }): Unstable_MiniflareWorkerOptions;
2417
2436
 
2418
- type MixedModeSession = Pick<Worker, "ready" | "dispose"> & {
2437
+ type RemoteProxySession = Pick<Worker, "ready" | "dispose"> & {
2419
2438
  updateBindings: (bindings: StartDevWorkerInput["bindings"]) => Promise<void>;
2420
- mixedModeConnectionString: MixedModeConnectionString;
2439
+ remoteProxyConnectionString: RemoteProxyConnectionString;
2421
2440
  };
2422
- type StartMixedModeSessionOptions = {
2441
+ type StartRemoteProxySessionOptions = {
2423
2442
  workerName?: string;
2424
2443
  auth?: NonNullable<StartDevWorkerInput["dev"]>["auth"];
2425
2444
  /** If running in a non-public compliance region, set this here. */
2426
2445
  complianceRegion?: Config["compliance_region"];
2427
2446
  };
2428
- declare function startMixedModeSession(bindings: StartDevWorkerInput["bindings"], options?: StartMixedModeSessionOptions): Promise<MixedModeSession>;
2447
+ declare function startRemoteProxySession(bindings: StartDevWorkerInput["bindings"], options?: StartRemoteProxySessionOptions): Promise<RemoteProxySession>;
2429
2448
  declare function pickRemoteBindings(bindings: Record<string, Binding>): Record<string, Binding>;
2430
2449
  /**
2431
- * Utility for potentially starting or updating a mixed mode session.
2450
+ * Utility for potentially starting or updating a remote proxy session.
2432
2451
  *
2433
- * It uses an internal map for storing existing mixed mode session indexed by worker names. If no worker name is provided
2434
- * the mixed mode session won't be retrieved nor saved to/from the internal map.
2452
+ * It uses an internal map for storing existing remote proxy session indexed by worker names. If no worker name is provided
2453
+ * the remote proxy session won't be retrieved nor saved to/from the internal map.
2435
2454
  *
2436
2455
  * @param configPathOrWorkerConfig either a file path to a wrangler configuration file or an object containing the name of
2437
2456
  * the target worker alongside its bindings.
2438
- * @param preExistingMixedModeSessionData the data of a pre-existing mixed mode session if there was one null otherwise
2439
- * @returns null if no existing mixed mode session was provided and one should not be created (because the worker is not
2440
- * defining any remote bindings), the data associated to the created/updated mixed mode session otherwise.
2457
+ * @param preExistingRemoteProxySessionData the data of a pre-existing remote proxy session if there was one null otherwise
2458
+ * @returns null if no existing remote proxy session was provided and one should not be created (because the worker is not
2459
+ * defining any remote bindings), the data associated to the created/updated remote proxy session otherwise.
2441
2460
  */
2442
- declare function maybeStartOrUpdateMixedModeSession(configPathOrWorkerConfig: string | {
2461
+ declare function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig: string | {
2443
2462
  name?: string;
2444
2463
  bindings: NonNullable<StartDevWorkerInput["bindings"]>;
2445
- }, preExistingMixedModeSessionData: {
2446
- session: MixedModeSession;
2464
+ }, preExistingRemoteProxySessionData: {
2465
+ session: RemoteProxySession;
2447
2466
  remoteBindings: Record<string, Binding>;
2448
2467
  } | null): Promise<{
2449
- session: MixedModeSession;
2468
+ session: RemoteProxySession;
2450
2469
  remoteBindings: Record<string, Binding>;
2451
2470
  } | null>;
2452
2471
 
@@ -2505,4 +2524,4 @@ interface Unstable_ASSETSBindingsOptions {
2505
2524
  }
2506
2525
  declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
2507
2526
 
2508
- export { type ConfigBindingOptions as Experimental_ConfigBindingOptions, type MixedModeSession as Experimental_MixedModeSession, type GetPlatformProxyOptions, type PlatformProxy, type SourcelessWorkerOptions, type Unstable_ASSETSBindingsOptions, type Binding as Unstable_Binding, type Config as Unstable_Config, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, type RawConfig as Unstable_RawConfig, type RawEnvironment as Unstable_RawEnvironment, type StartMixedModeSessionOptions as experimental_StartMixedModeSessionOptions, maybeStartOrUpdateMixedModeSession as experimental_maybeStartOrUpdateMixedModeSession, experimental_patchConfig, pickRemoteBindings as experimental_pickRemoteBindings, experimental_readRawConfig, startMixedModeSession as experimental_startMixedModeSession, getPlatformProxy, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
2527
+ export { type ConfigBindingOptions as Experimental_ConfigBindingOptions, type RemoteProxySession as Experimental_RemoteProxySession, type GetPlatformProxyOptions, type PlatformProxy, type SourcelessWorkerOptions, type Unstable_ASSETSBindingsOptions, type Binding as Unstable_Binding, type Config as Unstable_Config, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, type RawConfig as Unstable_RawConfig, type RawEnvironment as Unstable_RawEnvironment, type StartRemoteProxySessionOptions as experimental_StartRemoteProxySessionOptions, maybeStartOrUpdateRemoteProxySession as experimental_maybeStartOrUpdateRemoteProxySession, experimental_patchConfig, pickRemoteBindings as experimental_pickRemoteBindings, experimental_readRawConfig, startRemoteProxySession as experimental_startRemoteProxySession, getPlatformProxy, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };