wrangler 3.92.0 → 3.93.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.
- package/config-schema.json +7 -9
- package/package.json +10 -10
- package/templates/init-tests/test-vitest-new-worker.ts +2 -2
- package/wrangler-dist/cli.d.ts +204 -77
- package/wrangler-dist/cli.js +7825 -7485
- package/wrangler-dist/cli.js.map +4 -4
package/config-schema.json
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
"additionalProperties": false,
|
7
7
|
"properties": {
|
8
8
|
"binding": {
|
9
|
+
"description": "Name of `env` binding property in the User Worker.",
|
9
10
|
"type": "string"
|
10
11
|
},
|
11
12
|
"directory": {
|
@@ -13,9 +14,11 @@
|
|
13
14
|
"type": "string"
|
14
15
|
},
|
15
16
|
"experimental_serve_directly": {
|
17
|
+
"description": "If true, then respond to requests that match an asset with that asset directly. If false, route every request to the User Worker, whether or not it matches an asset.",
|
16
18
|
"type": "boolean"
|
17
19
|
},
|
18
20
|
"html_handling": {
|
21
|
+
"description": "How to handle HTML requests.",
|
19
22
|
"enum": [
|
20
23
|
"auto-trailing-slash",
|
21
24
|
"force-trailing-slash",
|
@@ -25,6 +28,7 @@
|
|
25
28
|
"type": "string"
|
26
29
|
},
|
27
30
|
"not_found_handling": {
|
31
|
+
"description": "How to handle requests that do not match an asset.",
|
28
32
|
"enum": [
|
29
33
|
"single-page-application",
|
30
34
|
"404-page",
|
@@ -33,9 +37,6 @@
|
|
33
37
|
"type": "string"
|
34
38
|
}
|
35
39
|
},
|
36
|
-
"required": [
|
37
|
-
"directory"
|
38
|
-
],
|
39
40
|
"type": "object"
|
40
41
|
},
|
41
42
|
"CloudchamberConfig": {
|
@@ -1110,15 +1111,9 @@
|
|
1110
1111
|
"type": "boolean"
|
1111
1112
|
}
|
1112
1113
|
},
|
1113
|
-
"required": [
|
1114
|
-
"enabled"
|
1115
|
-
],
|
1116
1114
|
"type": "object"
|
1117
1115
|
}
|
1118
1116
|
},
|
1119
|
-
"required": [
|
1120
|
-
"enabled"
|
1121
|
-
],
|
1122
1117
|
"type": "object"
|
1123
1118
|
},
|
1124
1119
|
"RawConfig": {
|
@@ -1253,6 +1248,9 @@
|
|
1253
1248
|
},
|
1254
1249
|
"type": "array"
|
1255
1250
|
},
|
1251
|
+
"configPath": {
|
1252
|
+
"type": "string"
|
1253
|
+
},
|
1256
1254
|
"d1_databases": {
|
1257
1255
|
"default": "`[]`",
|
1258
1256
|
"description": "Specifies D1 databases that are bound to this Worker environment.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.93.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -62,16 +62,16 @@
|
|
62
62
|
"resolve": "^1.22.8",
|
63
63
|
"selfsigned": "^2.0.1",
|
64
64
|
"source-map": "^0.6.1",
|
65
|
-
"unenv": "npm:unenv-nightly@2.0.0-
|
66
|
-
"workerd": "1.
|
65
|
+
"unenv": "npm:unenv-nightly@2.0.0-20241204-140205-a5d5190",
|
66
|
+
"workerd": "1.20241205.0",
|
67
67
|
"xxhash-wasm": "^1.0.1",
|
68
68
|
"@cloudflare/kv-asset-handler": "0.3.4",
|
69
|
-
"
|
70
|
-
"
|
69
|
+
"miniflare": "3.20241205.0",
|
70
|
+
"@cloudflare/workers-shared": "0.10.0"
|
71
71
|
},
|
72
72
|
"devDependencies": {
|
73
73
|
"@cloudflare/types": "6.18.4",
|
74
|
-
"@cloudflare/workers-types": "^4.
|
74
|
+
"@cloudflare/workers-types": "^4.20241205.0",
|
75
75
|
"@cspotcode/source-map-support": "0.8.1",
|
76
76
|
"@iarna/toml": "^3.0.0",
|
77
77
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"@types/supports-color": "^8.1.1",
|
94
94
|
"@types/ws": "^8.5.7",
|
95
95
|
"@types/yargs": "^17.0.22",
|
96
|
-
"@vitest/ui": "~2.1.
|
96
|
+
"@vitest/ui": "~2.1.8",
|
97
97
|
"@webcontainer/env": "^1.1.0",
|
98
98
|
"body-parser": "^1.20.0",
|
99
99
|
"chalk": "^5.2.0",
|
@@ -133,18 +133,18 @@
|
|
133
133
|
"ts-json-schema-generator": "^1.5.0",
|
134
134
|
"undici": "^5.28.4",
|
135
135
|
"update-check": "^1.5.4",
|
136
|
-
"vitest": "~2.1.
|
136
|
+
"vitest": "~2.1.8",
|
137
137
|
"vitest-websocket-mock": "^0.4.0",
|
138
138
|
"ws": "^8.18.0",
|
139
139
|
"xdg-app-paths": "^8.3.0",
|
140
140
|
"yargs": "^17.7.2",
|
141
141
|
"@cloudflare/cli": "1.1.1",
|
142
142
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
143
|
-
"@cloudflare/pages-shared": "^0.11.
|
143
|
+
"@cloudflare/pages-shared": "^0.11.71",
|
144
144
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
145
145
|
},
|
146
146
|
"peerDependencies": {
|
147
|
-
"@cloudflare/workers-types": "^4.
|
147
|
+
"@cloudflare/workers-types": "^4.20241205.0"
|
148
148
|
},
|
149
149
|
"peerDependenciesMeta": {
|
150
150
|
"@cloudflare/workers-types": {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
2
2
|
import { unstable_dev } from "wrangler";
|
3
|
-
import type {
|
3
|
+
import type { Unstable_DevWorker } from "wrangler";
|
4
4
|
|
5
5
|
describe("Worker", () => {
|
6
|
-
let worker:
|
6
|
+
let worker: Unstable_DevWorker;
|
7
7
|
|
8
8
|
beforeAll(async () => {
|
9
9
|
worker = await unstable_dev("src/index.ts", {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -92,14 +92,23 @@ declare const AssetConfigSchema: z.ZodObject<{
|
|
92
92
|
|
93
93
|
declare type Assets = {
|
94
94
|
/** Absolute path to assets directory */
|
95
|
-
directory
|
95
|
+
directory?: string;
|
96
|
+
/** Name of `env` binding property in the User Worker. */
|
96
97
|
binding?: string;
|
98
|
+
/** How to handle HTML requests. */
|
97
99
|
html_handling?: "auto-trailing-slash" | "force-trailing-slash" | "drop-trailing-slash" | "none";
|
100
|
+
/** How to handle requests that do not match an asset. */
|
98
101
|
not_found_handling?: "single-page-application" | "404-page" | "none";
|
102
|
+
/**
|
103
|
+
* If true, then respond to requests that match an asset with that asset directly.
|
104
|
+
* If false, route every request to the User Worker, whether or not it matches an asset.
|
105
|
+
* */
|
99
106
|
experimental_serve_directly?: boolean;
|
100
107
|
};
|
101
108
|
|
102
|
-
declare type AssetsOptions =
|
109
|
+
declare type AssetsOptions = {
|
110
|
+
directory: string;
|
111
|
+
binding?: string;
|
103
112
|
routingConfig: RoutingConfig;
|
104
113
|
assetConfig: AssetConfig;
|
105
114
|
};
|
@@ -453,7 +462,7 @@ declare type CfCapnp = {
|
|
453
462
|
|
454
463
|
declare interface CfD1Database {
|
455
464
|
binding: string;
|
456
|
-
database_id?: string;
|
465
|
+
database_id?: string | typeof INHERIT_SYMBOL;
|
457
466
|
database_name?: string;
|
458
467
|
preview_database_id?: string;
|
459
468
|
database_internal_env?: string;
|
@@ -492,7 +501,7 @@ declare interface CfHyperdrive {
|
|
492
501
|
*/
|
493
502
|
declare interface CfKvNamespace {
|
494
503
|
binding: string;
|
495
|
-
id?: string;
|
504
|
+
id?: string | typeof INHERIT_SYMBOL;
|
496
505
|
}
|
497
506
|
|
498
507
|
declare interface CfLogfwdrBinding {
|
@@ -568,7 +577,7 @@ declare interface CfQueue {
|
|
568
577
|
|
569
578
|
declare interface CfR2Bucket {
|
570
579
|
binding: string;
|
571
|
-
bucket_name?: string;
|
580
|
+
bucket_name?: string | typeof INHERIT_SYMBOL;
|
572
581
|
jurisdiction?: string;
|
573
582
|
}
|
574
583
|
|
@@ -763,36 +772,6 @@ declare type CloudchamberConfig = {
|
|
763
772
|
ipv4?: boolean;
|
764
773
|
};
|
765
774
|
|
766
|
-
declare interface ComputedConfigFields {
|
767
|
-
/** Path to the configuration file (e.g. wrangler.toml/json), if one was provided. */
|
768
|
-
configPath: string | undefined;
|
769
|
-
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
770
|
-
projectRoot: string;
|
771
|
-
}
|
772
|
-
|
773
|
-
/**
|
774
|
-
* This is the static type definition for the configuration object.
|
775
|
-
*
|
776
|
-
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
777
|
-
* and optionally augment with arguments passed directly to wrangler.
|
778
|
-
*
|
779
|
-
* For more information about the configuration object, see the
|
780
|
-
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
781
|
-
*
|
782
|
-
* Notes:
|
783
|
-
*
|
784
|
-
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
785
|
-
* in the top level config and should not appear in any environments.
|
786
|
-
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
787
|
-
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
788
|
-
*
|
789
|
-
* Legend for the annotations:
|
790
|
-
*
|
791
|
-
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
792
|
-
* - `@todo`: there's more work to be done (with details attached).
|
793
|
-
*/
|
794
|
-
declare type Config = ComputedConfigFields & ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
795
|
-
|
796
775
|
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
797
776
|
#private;
|
798
777
|
latestInput?: StartDevWorkerInput;
|
@@ -808,6 +787,7 @@ declare type ConfigControllerEventMap = ControllerEventMap & {
|
|
808
787
|
};
|
809
788
|
|
810
789
|
declare interface ConfigFields<Dev extends RawDevConfig> {
|
790
|
+
configPath: string | undefined;
|
811
791
|
/**
|
812
792
|
* A boolean to enable "legacy" style wrangler environments (from Wrangler v1).
|
813
793
|
* These have been superseded by Services, but there may be projects that won't
|
@@ -1054,6 +1034,30 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
|
|
1054
1034
|
} | undefined;
|
1055
1035
|
}>;
|
1056
1036
|
|
1037
|
+
declare interface DeprecatedConfigFields {
|
1038
|
+
/**
|
1039
|
+
* The project "type". A holdover from Wrangler v1.x.
|
1040
|
+
* Valid values were "webpack", "javascript", and "rust".
|
1041
|
+
*
|
1042
|
+
* @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
|
1043
|
+
* @breaking
|
1044
|
+
*/
|
1045
|
+
type?: "webpack" | "javascript" | "rust";
|
1046
|
+
/**
|
1047
|
+
* Path to the webpack config to use when building your worker.
|
1048
|
+
* A holdover from Wrangler v1.x, used with `type: "webpack"`.
|
1049
|
+
*
|
1050
|
+
* @deprecated DO NOT USE THIS. Most common features now work out of the box with wrangler, including modules, jsx, typescript, etc. If you need anything more, use a custom build.
|
1051
|
+
* @breaking
|
1052
|
+
*/
|
1053
|
+
webpack_config?: string;
|
1054
|
+
/**
|
1055
|
+
* Configuration only used by a standalone use of the miniflare binary.
|
1056
|
+
* @deprecated
|
1057
|
+
*/
|
1058
|
+
miniflare?: unknown;
|
1059
|
+
}
|
1060
|
+
|
1057
1061
|
/**
|
1058
1062
|
* Deprecated upload configuration.
|
1059
1063
|
*/
|
@@ -1478,6 +1482,8 @@ declare interface EnablePagesAssetsServiceBindingOptions {
|
|
1478
1482
|
declare type Entry = {
|
1479
1483
|
/** A worker's entrypoint */
|
1480
1484
|
file: string;
|
1485
|
+
/** A worker's directory. Usually where the Wrangler configuration file is located */
|
1486
|
+
projectRoot: string;
|
1481
1487
|
/** Is this a module worker or a service worker? */
|
1482
1488
|
format: CfScriptFormat;
|
1483
1489
|
/** The directory that contains all of a `--no-bundle` worker's modules. Usually `${directory}/src`. Defaults to path.dirname(file) */
|
@@ -1499,6 +1505,39 @@ declare type Entry = {
|
|
1499
1505
|
declare interface Environment extends EnvironmentInheritable, EnvironmentNonInheritable {
|
1500
1506
|
}
|
1501
1507
|
|
1508
|
+
/**
|
1509
|
+
* The environment configuration properties that have been deprecated.
|
1510
|
+
*/
|
1511
|
+
declare interface EnvironmentDeprecated {
|
1512
|
+
/**
|
1513
|
+
* The zone ID of the zone you want to deploy to. You can find this
|
1514
|
+
* in your domain page on the dashboard.
|
1515
|
+
*
|
1516
|
+
* @deprecated This is unnecessary since we can deduce this from routes directly.
|
1517
|
+
*/
|
1518
|
+
zone_id?: string;
|
1519
|
+
/**
|
1520
|
+
* Legacy way of defining KVNamespaces that is no longer supported.
|
1521
|
+
*
|
1522
|
+
* @deprecated DO NOT USE. This was a legacy bug from Wrangler v1, that we do not want to support.
|
1523
|
+
*/
|
1524
|
+
"kv-namespaces"?: string;
|
1525
|
+
/**
|
1526
|
+
* A list of services that your Worker should be bound to.
|
1527
|
+
*
|
1528
|
+
* @default `[]`
|
1529
|
+
* @deprecated DO NOT USE. We'd added this to test the new service binding system, but the proper way to test experimental features is to use `unsafe.bindings` configuration.
|
1530
|
+
*/
|
1531
|
+
experimental_services?: {
|
1532
|
+
/** The binding name used to refer to the Service */
|
1533
|
+
name: string;
|
1534
|
+
/** The name of the Service being bound */
|
1535
|
+
service: string;
|
1536
|
+
/** The Service's environment */
|
1537
|
+
environment: string;
|
1538
|
+
}[];
|
1539
|
+
}
|
1540
|
+
|
1502
1541
|
/**
|
1503
1542
|
* The `EnvironmentInheritable` interface declares all the configuration fields for an environment
|
1504
1543
|
* that can be inherited (and overridden) from the top-level environment.
|
@@ -1785,6 +1824,24 @@ declare interface EnvironmentInheritable {
|
|
1785
1824
|
observability: Observability | undefined;
|
1786
1825
|
}
|
1787
1826
|
|
1827
|
+
declare interface EnvironmentMap {
|
1828
|
+
/**
|
1829
|
+
* The `env` section defines overrides for the configuration for different environments.
|
1830
|
+
*
|
1831
|
+
* All environment fields can be specified at the top level of the config indicating the default environment settings.
|
1832
|
+
*
|
1833
|
+
* - Some fields are inherited and overridable in each environment.
|
1834
|
+
* - But some are not inherited and must be explicitly specified in every environment, if they are specified at the top level.
|
1835
|
+
*
|
1836
|
+
* For more information, see the documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration#environments
|
1837
|
+
*
|
1838
|
+
* @default {}
|
1839
|
+
*/
|
1840
|
+
env?: {
|
1841
|
+
[envName: string]: Unstable_RawEnvironment;
|
1842
|
+
};
|
1843
|
+
}
|
1844
|
+
|
1788
1845
|
/**
|
1789
1846
|
* The `EnvironmentNonInheritable` interface declares all the configuration fields for an environment
|
1790
1847
|
* that cannot be inherited from the top-level environment, and must be defined specifically.
|
@@ -2657,6 +2714,11 @@ declare type HttpTerminator = {
|
|
2657
2714
|
*/
|
2658
2715
|
declare type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
2659
2716
|
|
2717
|
+
/**
|
2718
|
+
* A symbol to inherit a binding from the deployed worker.
|
2719
|
+
*/
|
2720
|
+
declare const INHERIT_SYMBOL: unique symbol;
|
2721
|
+
|
2660
2722
|
declare type InspectorProxyWorkerIncomingWebSocketMessage = {
|
2661
2723
|
type: ReloadStartEvent["type"];
|
2662
2724
|
} | {
|
@@ -2937,13 +2999,23 @@ declare interface MultiCacheQueryOptions extends CacheQueryOptions {
|
|
2937
2999
|
|
2938
3000
|
declare type NameOmit<T> = Omit<T, "name">;
|
2939
3001
|
|
3002
|
+
declare type NormalizeAndValidateConfigArgs = {
|
3003
|
+
name?: string;
|
3004
|
+
env?: string;
|
3005
|
+
"legacy-env"?: boolean;
|
3006
|
+
"dispatch-namespace"?: string;
|
3007
|
+
remote?: boolean;
|
3008
|
+
localProtocol?: string;
|
3009
|
+
upstreamProtocol?: string;
|
3010
|
+
};
|
3011
|
+
|
2940
3012
|
declare interface Observability {
|
2941
3013
|
/** If observability is enabled for this Worker */
|
2942
|
-
enabled
|
3014
|
+
enabled?: boolean;
|
2943
3015
|
/** The sampling rate */
|
2944
3016
|
head_sampling_rate?: number;
|
2945
3017
|
logs?: {
|
2946
|
-
enabled
|
3018
|
+
enabled?: boolean;
|
2947
3019
|
/** The sampling rate */
|
2948
3020
|
head_sampling_rate?: number;
|
2949
3021
|
/** Set to false to disable invocation logs */
|
@@ -25574,10 +25646,12 @@ declare type ProxyWorkerOutgoingRequestBody = {
|
|
25574
25646
|
args: Parameters<typeof console.debug>;
|
25575
25647
|
};
|
25576
25648
|
|
25577
|
-
declare type QueueConsumer = NonNullable<
|
25649
|
+
declare type QueueConsumer = NonNullable<Unstable_Config["queues"]["consumers"]>[number];
|
25578
25650
|
|
25579
25651
|
declare type RawDevConfig = Partial<DevConfig>;
|
25580
25652
|
|
25653
|
+
declare type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs;
|
25654
|
+
|
25581
25655
|
declare type ReadyEvent = {
|
25582
25656
|
type: "ready";
|
25583
25657
|
proxyWorker: Miniflare;
|
@@ -26003,7 +26077,7 @@ declare interface StartDevWorkerInput {
|
|
26003
26077
|
jsxFactory?: string;
|
26004
26078
|
jsxFragment?: string;
|
26005
26079
|
tsconfig?: string;
|
26006
|
-
nodejsCompatMode?: Hook<NodeJSCompatMode, [
|
26080
|
+
nodejsCompatMode?: Hook<NodeJSCompatMode, [Unstable_Config]>;
|
26007
26081
|
moduleRoot?: string;
|
26008
26082
|
};
|
26009
26083
|
/** Options applying to the worker's development preview environment. */
|
@@ -26017,7 +26091,7 @@ declare interface StartDevWorkerInput {
|
|
26017
26091
|
/** Whether the worker runs on the edge or locally. */
|
26018
26092
|
remote?: boolean;
|
26019
26093
|
/** Cloudflare Account credentials. Can be provided upfront or as a function which will be called only when required. */
|
26020
|
-
auth?: AsyncHook<CfAccount, [Pick<
|
26094
|
+
auth?: AsyncHook<CfAccount, [Pick<Unstable_Config, "account_id">]>;
|
26021
26095
|
/** Whether local storage (KV, Durable Objects, R2, D1, etc) is persisted. You can also specify the directory to persist data to. */
|
26022
26096
|
persist?: string;
|
26023
26097
|
/** Controls which logs are logged 🤙. */
|
@@ -26052,8 +26126,8 @@ declare interface StartDevWorkerInput {
|
|
26052
26126
|
multiworkerPrimary?: boolean;
|
26053
26127
|
};
|
26054
26128
|
legacy?: {
|
26055
|
-
site?: Hook<
|
26056
|
-
legacyAssets?: Hook<
|
26129
|
+
site?: Hook<Unstable_Config["site"], [Unstable_Config]>;
|
26130
|
+
legacyAssets?: Hook<Unstable_Config["legacy_assets"], [Unstable_Config]>;
|
26057
26131
|
enableServiceEnvironments?: boolean;
|
26058
26132
|
};
|
26059
26133
|
unsafe?: Omit<CfUnsafe, "bindings">;
|
@@ -26074,8 +26148,8 @@ declare type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
|
|
26074
26148
|
processEntrypoint: boolean;
|
26075
26149
|
};
|
26076
26150
|
legacy: StartDevWorkerInput["legacy"] & {
|
26077
|
-
legacyAssets?:
|
26078
|
-
site?:
|
26151
|
+
legacyAssets?: Unstable_Config["legacy_assets"];
|
26152
|
+
site?: Unstable_Config["site"];
|
26079
26153
|
};
|
26080
26154
|
dev: StartDevWorkerInput["dev"] & {
|
26081
26155
|
persist: string;
|
@@ -26255,10 +26329,39 @@ declare namespace undici {
|
|
26255
26329
|
}
|
26256
26330
|
}
|
26257
26331
|
|
26332
|
+
export declare interface Unstable_ASSETSBindingsOptions {
|
26333
|
+
log: Logger;
|
26334
|
+
proxyPort?: number;
|
26335
|
+
directory?: string;
|
26336
|
+
}
|
26337
|
+
|
26338
|
+
/**
|
26339
|
+
* This is the static type definition for the configuration object.
|
26340
|
+
*
|
26341
|
+
* It reflects a normalized and validated version of the configuration that you can write in a Wrangler configuration file,
|
26342
|
+
* and optionally augment with arguments passed directly to wrangler.
|
26343
|
+
*
|
26344
|
+
* For more information about the configuration object, see the
|
26345
|
+
* documentation at https://developers.cloudflare.com/workers/cli-wrangler/configuration
|
26346
|
+
*
|
26347
|
+
* Notes:
|
26348
|
+
*
|
26349
|
+
* - Fields that are only specified in `ConfigFields` and not `Environment` can only appear
|
26350
|
+
* in the top level config and should not appear in any environments.
|
26351
|
+
* - Fields that are specified in `PagesConfigFields` are only relevant for Pages projects
|
26352
|
+
* - All top level fields in config and environments are optional in the Wrangler configuration file.
|
26353
|
+
*
|
26354
|
+
* Legend for the annotations:
|
26355
|
+
*
|
26356
|
+
* - `@breaking`: the deprecation/optionality is a breaking change from Wrangler v1.
|
26357
|
+
* - `@todo`: there's more work to be done (with details attached).
|
26358
|
+
*/
|
26359
|
+
export declare type Unstable_Config = ConfigFields<DevConfig> & PagesConfigFields & Environment;
|
26360
|
+
|
26258
26361
|
/**
|
26259
26362
|
* unstable_dev starts a wrangler dev server, and returns a promise that resolves with utility functions to interact with it.
|
26260
26363
|
*/
|
26261
|
-
export declare function unstable_dev(script: string, options?:
|
26364
|
+
export declare function unstable_dev(script: string, options?: Unstable_DevOptions, apiOptions?: unknown): Promise<Unstable_DevWorker>;
|
26262
26365
|
|
26263
26366
|
export declare class unstable_DevEnv extends EventEmitter_2 {
|
26264
26367
|
config: ConfigController;
|
@@ -26276,37 +26379,7 @@ export declare class unstable_DevEnv extends EventEmitter_2 {
|
|
26276
26379
|
emitErrorEvent(ev: ErrorEvent): void;
|
26277
26380
|
}
|
26278
26381
|
|
26279
|
-
export declare
|
26280
|
-
|
26281
|
-
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): {
|
26282
|
-
workerOptions: SourcelessWorkerOptions;
|
26283
|
-
define: Record<string, string>;
|
26284
|
-
main?: string;
|
26285
|
-
};
|
26286
|
-
|
26287
|
-
export declare const unstable_pages: {
|
26288
|
-
deploy: typeof deploy;
|
26289
|
-
};
|
26290
|
-
|
26291
|
-
/**
|
26292
|
-
* Split an SQLQuery into an array of statements
|
26293
|
-
*/
|
26294
|
-
export declare function unstable_splitSqlQuery(sql: string): string[];
|
26295
|
-
|
26296
|
-
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
26297
|
-
|
26298
|
-
export declare const unstable_startWorkerRegistryServer: (port: number) => Promise<{
|
26299
|
-
server: Server<IncomingMessage, ServerResponse>;
|
26300
|
-
terminator: HttpTerminator;
|
26301
|
-
}>;
|
26302
|
-
|
26303
|
-
export declare interface UnstableASSETSBindingsOptions {
|
26304
|
-
log: Logger;
|
26305
|
-
proxyPort?: number;
|
26306
|
-
directory?: string;
|
26307
|
-
}
|
26308
|
-
|
26309
|
-
export declare interface UnstableDevOptions {
|
26382
|
+
export declare interface Unstable_DevOptions {
|
26310
26383
|
config?: string;
|
26311
26384
|
env?: string;
|
26312
26385
|
ip?: string;
|
@@ -26381,7 +26454,7 @@ export declare interface UnstableDevOptions {
|
|
26381
26454
|
};
|
26382
26455
|
}
|
26383
26456
|
|
26384
|
-
export declare interface
|
26457
|
+
export declare interface Unstable_DevWorker {
|
26385
26458
|
port: number;
|
26386
26459
|
address: string;
|
26387
26460
|
stop: () => Promise<void>;
|
@@ -26389,6 +26462,60 @@ export declare interface UnstableDevWorker {
|
|
26389
26462
|
waitUntilExit: () => Promise<void>;
|
26390
26463
|
}
|
26391
26464
|
|
26465
|
+
export declare const unstable_generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request_3) => Promise<Response_3>;
|
26466
|
+
|
26467
|
+
export declare function unstable_getMiniflareWorkerOptions(configPath: string, env?: string): Unstable_MiniflareWorkerOptions;
|
26468
|
+
|
26469
|
+
export declare function unstable_getMiniflareWorkerOptions(config: Unstable_Config): Unstable_MiniflareWorkerOptions;
|
26470
|
+
|
26471
|
+
export declare interface Unstable_MiniflareWorkerOptions {
|
26472
|
+
workerOptions: SourcelessWorkerOptions;
|
26473
|
+
define: Record<string, string>;
|
26474
|
+
main?: string;
|
26475
|
+
}
|
26476
|
+
|
26477
|
+
export declare const unstable_pages: {
|
26478
|
+
deploy: typeof deploy;
|
26479
|
+
};
|
26480
|
+
|
26481
|
+
export declare type Unstable_RawConfig = Partial<ConfigFields<RawDevConfig>> & PagesConfigFields & Unstable_RawEnvironment & DeprecatedConfigFields & EnvironmentMap & {
|
26482
|
+
$schema?: string;
|
26483
|
+
};
|
26484
|
+
|
26485
|
+
/**
|
26486
|
+
* The raw environment configuration that we read from the config file.
|
26487
|
+
*
|
26488
|
+
* All the properties are optional, and will be replaced with defaults in the configuration that
|
26489
|
+
* is used in the rest of the codebase.
|
26490
|
+
*/
|
26491
|
+
export declare type Unstable_RawEnvironment = Partial<Environment> & EnvironmentDeprecated;
|
26492
|
+
|
26493
|
+
/**
|
26494
|
+
* Get the Wrangler configuration; read it from the give `configPath` if available.
|
26495
|
+
*/
|
26496
|
+
export declare function unstable_readConfig(configPath: string | undefined, args: ReadConfigCommandArgs, options: {
|
26497
|
+
requirePagesConfig: true;
|
26498
|
+
}): Omit<Unstable_Config, "pages_build_output_dir"> & {
|
26499
|
+
pages_build_output_dir: string;
|
26500
|
+
};
|
26501
|
+
|
26502
|
+
export declare function unstable_readConfig(configPath: string | undefined, args: ReadConfigCommandArgs, options?: {
|
26503
|
+
requirePagesConfig?: boolean;
|
26504
|
+
hideWarnings?: boolean;
|
26505
|
+
}): Unstable_Config;
|
26506
|
+
|
26507
|
+
/**
|
26508
|
+
* Split an SQLQuery into an array of statements
|
26509
|
+
*/
|
26510
|
+
export declare function unstable_splitSqlQuery(sql: string): string[];
|
26511
|
+
|
26512
|
+
export declare function unstable_startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
26513
|
+
|
26514
|
+
export declare const unstable_startWorkerRegistryServer: (port: number) => Promise<{
|
26515
|
+
server: Server<IncomingMessage, ServerResponse>;
|
26516
|
+
terminator: HttpTerminator;
|
26517
|
+
}>;
|
26518
|
+
|
26392
26519
|
/** Upgrade to a different protocol. */
|
26393
26520
|
declare function upgrade(
|
26394
26521
|
url: string | URL_2 | UrlObject,
|