wrangler 4.48.0 → 4.49.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 +29 -0
- package/package.json +11 -11
- package/templates/startDevWorker/ProxyWorker.ts +24 -19
- package/wrangler-dist/ProxyWorker.js +15 -13
- package/wrangler-dist/cli.d.ts +69 -54
- package/wrangler-dist/cli.js +6693 -7863
- package/wrangler-dist/metafile-cjs.json +1 -1
package/config-schema.json
CHANGED
|
@@ -915,6 +915,14 @@
|
|
|
915
915
|
"description": "Specifies a list of Tail Workers 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.",
|
|
916
916
|
"default": []
|
|
917
917
|
},
|
|
918
|
+
"streaming_tail_consumers": {
|
|
919
|
+
"type": "array",
|
|
920
|
+
"items": {
|
|
921
|
+
"$ref": "#/definitions/StreamingTailConsumer"
|
|
922
|
+
},
|
|
923
|
+
"description": "Specifies a list of Streaming Tail Workers 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.",
|
|
924
|
+
"default": []
|
|
925
|
+
},
|
|
918
926
|
"dispatch_namespaces": {
|
|
919
927
|
"type": "array",
|
|
920
928
|
"items": {
|
|
@@ -2102,6 +2110,14 @@
|
|
|
2102
2110
|
"description": "Specifies a list of Tail Workers 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.",
|
|
2103
2111
|
"default": []
|
|
2104
2112
|
},
|
|
2113
|
+
"streaming_tail_consumers": {
|
|
2114
|
+
"type": "array",
|
|
2115
|
+
"items": {
|
|
2116
|
+
"$ref": "#/definitions/StreamingTailConsumer"
|
|
2117
|
+
},
|
|
2118
|
+
"description": "Specifies a list of Streaming Tail Workers 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.",
|
|
2119
|
+
"default": []
|
|
2120
|
+
},
|
|
2105
2121
|
"dispatch_namespaces": {
|
|
2106
2122
|
"type": "array",
|
|
2107
2123
|
"items": {
|
|
@@ -2861,6 +2877,19 @@
|
|
|
2861
2877
|
],
|
|
2862
2878
|
"additionalProperties": false
|
|
2863
2879
|
},
|
|
2880
|
+
"StreamingTailConsumer": {
|
|
2881
|
+
"type": "object",
|
|
2882
|
+
"properties": {
|
|
2883
|
+
"service": {
|
|
2884
|
+
"type": "string",
|
|
2885
|
+
"description": "The name of the service streaming tail events will be forwarded to."
|
|
2886
|
+
}
|
|
2887
|
+
},
|
|
2888
|
+
"required": [
|
|
2889
|
+
"service"
|
|
2890
|
+
],
|
|
2891
|
+
"additionalProperties": false
|
|
2892
|
+
},
|
|
2864
2893
|
"DispatchNamespaceOutbound": {
|
|
2865
2894
|
"type": "object",
|
|
2866
2895
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.49.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wrangler",
|
|
@@ -54,17 +54,16 @@
|
|
|
54
54
|
"esbuild": "0.25.4",
|
|
55
55
|
"path-to-regexp": "6.3.0",
|
|
56
56
|
"unenv": "2.0.0-rc.24",
|
|
57
|
-
"workerd": "1.
|
|
57
|
+
"workerd": "1.20251113.0",
|
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
|
59
59
|
"@cloudflare/unenv-preset": "2.7.10",
|
|
60
|
-
"miniflare": "4.
|
|
60
|
+
"miniflare": "4.20251113.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@aws-sdk/client-s3": "^3.721.0",
|
|
64
64
|
"@cloudflare/types": "6.18.4",
|
|
65
|
-
"@cloudflare/workers-types": "^4.
|
|
65
|
+
"@cloudflare/workers-types": "^4.20251113.0",
|
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
|
67
|
-
"@iarna/toml": "^3.0.0",
|
|
68
67
|
"@netlify/build-info": "^10.0.9",
|
|
69
68
|
"@sentry/node": "^7.86.0",
|
|
70
69
|
"@sentry/types": "^7.86.0",
|
|
@@ -119,7 +118,7 @@
|
|
|
119
118
|
"msw": "2.4.3",
|
|
120
119
|
"node-forge": "^1.3.1",
|
|
121
120
|
"open": "^8.4.0",
|
|
122
|
-
"p-queue": "^
|
|
121
|
+
"p-queue": "^9.0.0",
|
|
123
122
|
"patch-console": "^1.0.0",
|
|
124
123
|
"pretty-bytes": "^6.0.0",
|
|
125
124
|
"prompts": "^2.4.2",
|
|
@@ -129,6 +128,7 @@
|
|
|
129
128
|
"semiver": "^1.1.0",
|
|
130
129
|
"shell-quote": "^1.8.1",
|
|
131
130
|
"signal-exit": "^3.0.7",
|
|
131
|
+
"smol-toml": "^1.5.2",
|
|
132
132
|
"source-map": "^0.6.1",
|
|
133
133
|
"strip-ansi": "^7.1.0",
|
|
134
134
|
"supports-color": "^9.2.2",
|
|
@@ -146,17 +146,17 @@
|
|
|
146
146
|
"xxhash-wasm": "^1.0.1",
|
|
147
147
|
"yaml": "^2.8.1",
|
|
148
148
|
"yargs": "^17.7.2",
|
|
149
|
-
"@cloudflare/cli": "1.1.3",
|
|
150
149
|
"@cloudflare/containers-shared": "0.3.0",
|
|
150
|
+
"@cloudflare/cli": "1.1.3",
|
|
151
151
|
"@cloudflare/eslint-config-shared": "1.1.0",
|
|
152
|
-
"@cloudflare/pages-shared": "^0.13.
|
|
152
|
+
"@cloudflare/pages-shared": "^0.13.86",
|
|
153
153
|
"@cloudflare/workers-shared": "0.18.8",
|
|
154
|
+
"@cloudflare/workers-utils": "0.1.1",
|
|
154
155
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
155
|
-
"@cloudflare/workers-utils": "0.1.0",
|
|
156
156
|
"@cloudflare/workflows-shared": "0.3.8"
|
|
157
157
|
},
|
|
158
158
|
"peerDependencies": {
|
|
159
|
-
"@cloudflare/workers-types": "^4.
|
|
159
|
+
"@cloudflare/workers-types": "^4.20251113.0"
|
|
160
160
|
},
|
|
161
161
|
"peerDependenciesMeta": {
|
|
162
162
|
"@cloudflare/workers-types": {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"fsevents": "~2.3.2"
|
|
168
168
|
},
|
|
169
169
|
"engines": {
|
|
170
|
-
"node": ">=
|
|
170
|
+
"node": ">=20.0.0"
|
|
171
171
|
},
|
|
172
172
|
"volta": {
|
|
173
173
|
"extends": "../../package.json"
|
|
@@ -151,11 +151,12 @@ export class ProxyWorker implements DurableObject {
|
|
|
151
151
|
|
|
152
152
|
// explicitly NOT await-ing this promise, we are in a loop and want to process the whole queue quickly + synchronously
|
|
153
153
|
void fetch(userWorkerUrl, new Request(request, { headers }))
|
|
154
|
-
.then((res) => {
|
|
154
|
+
.then(async (res) => {
|
|
155
155
|
res = new Response(res.body, res);
|
|
156
156
|
rewriteUrlRelatedHeaders(res.headers, innerUrl, outerUrl);
|
|
157
157
|
|
|
158
158
|
if (isHtmlResponse(res)) {
|
|
159
|
+
await checkForPreviewTokenError(res, this.env, proxyData);
|
|
159
160
|
res = insertLiveReloadScript(request, res, this.env, proxyData);
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -242,6 +243,28 @@ function sendMessageToProxyController(
|
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
|
|
246
|
+
async function checkForPreviewTokenError(
|
|
247
|
+
response: Response,
|
|
248
|
+
env: Env,
|
|
249
|
+
proxyData: ProxyData
|
|
250
|
+
) {
|
|
251
|
+
if (response.status !== 400) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// At this point HTMLRewriter tries to parse the compressed stream,
|
|
256
|
+
// so we clone and read the text instead.
|
|
257
|
+
const clone = response.clone();
|
|
258
|
+
const text = await clone.text();
|
|
259
|
+
// Naive string match should be good enough when combined with status code check
|
|
260
|
+
if (text.includes("Invalid Workers Preview configuration")) {
|
|
261
|
+
void sendMessageToProxyController(env, {
|
|
262
|
+
type: "previewTokenExpired",
|
|
263
|
+
proxyData,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
245
268
|
function insertLiveReloadScript(
|
|
246
269
|
request: Request,
|
|
247
270
|
response: Response,
|
|
@@ -250,26 +273,8 @@ function insertLiveReloadScript(
|
|
|
250
273
|
) {
|
|
251
274
|
const htmlRewriter = new HTMLRewriter();
|
|
252
275
|
|
|
253
|
-
// if preview-token-expired response, errorDetails will contain "Invalid Workers Preview configuration"
|
|
254
|
-
let errorDetails = "";
|
|
255
|
-
htmlRewriter.on("#cf-error-details", {
|
|
256
|
-
text(element) {
|
|
257
|
-
errorDetails += element.text;
|
|
258
|
-
},
|
|
259
|
-
});
|
|
260
|
-
|
|
261
276
|
htmlRewriter.onDocument({
|
|
262
277
|
end(end) {
|
|
263
|
-
if (
|
|
264
|
-
response.status === 400 &&
|
|
265
|
-
errorDetails.includes("Invalid Workers Preview configuration")
|
|
266
|
-
) {
|
|
267
|
-
void sendMessageToProxyController(env, {
|
|
268
|
-
type: "previewTokenExpired",
|
|
269
|
-
proxyData,
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
|
|
273
278
|
// if liveReload enabled, append a script tag
|
|
274
279
|
// TODO: compare to existing nodejs implementation
|
|
275
280
|
if (proxyData.liveReload) {
|
|
@@ -110,10 +110,11 @@ var ProxyWorker = class {
|
|
|
110
110
|
headers.set(key, value);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
void fetch(userWorkerUrl, new Request(request, { headers })).then((res) => {
|
|
113
|
+
void fetch(userWorkerUrl, new Request(request, { headers })).then(async (res) => {
|
|
114
114
|
res = new Response(res.body, res);
|
|
115
115
|
rewriteUrlRelatedHeaders(res.headers, innerUrl, outerUrl);
|
|
116
116
|
if (isHtmlResponse(res)) {
|
|
117
|
+
await checkForPreviewTokenError(res, this.env, proxyData);
|
|
117
118
|
res = insertLiveReloadScript(request, res, this.env, proxyData);
|
|
118
119
|
}
|
|
119
120
|
deferredResponse.resolve(res);
|
|
@@ -164,22 +165,23 @@ function sendMessageToProxyController(env, message) {
|
|
|
164
165
|
body: JSON.stringify(message)
|
|
165
166
|
});
|
|
166
167
|
}
|
|
168
|
+
async function checkForPreviewTokenError(response, env, proxyData) {
|
|
169
|
+
if (response.status !== 400) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const clone = response.clone();
|
|
173
|
+
const text = await clone.text();
|
|
174
|
+
if (text.includes("Invalid Workers Preview configuration")) {
|
|
175
|
+
void sendMessageToProxyController(env, {
|
|
176
|
+
type: "previewTokenExpired",
|
|
177
|
+
proxyData
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
167
181
|
function insertLiveReloadScript(request, response, env, proxyData) {
|
|
168
182
|
const htmlRewriter = new HTMLRewriter();
|
|
169
|
-
let errorDetails = "";
|
|
170
|
-
htmlRewriter.on("#cf-error-details", {
|
|
171
|
-
text(element) {
|
|
172
|
-
errorDetails += element.text;
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
183
|
htmlRewriter.onDocument({
|
|
176
184
|
end(end) {
|
|
177
|
-
if (response.status === 400 && errorDetails.includes("Invalid Workers Preview configuration")) {
|
|
178
|
-
void sendMessageToProxyController(env, {
|
|
179
|
-
type: "previewTokenExpired",
|
|
180
|
-
proxyData
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
185
|
if (proxyData.liveReload) {
|
|
184
186
|
const websocketUrl = new URL(request.url);
|
|
185
187
|
websocketUrl.protocol = websocketUrl.protocol === "http:" ? "ws:" : "wss:";
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import * as undici from 'undici';
|
|
|
5
5
|
import { RequestInfo, RequestInit, Response, FormData } from 'undici';
|
|
6
6
|
import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
|
|
7
7
|
import { Metafile } from 'esbuild';
|
|
8
|
-
import { EventEmitter } from 'node:events';
|
|
9
8
|
import Protocol from 'devtools-protocol/types/protocol-mapping';
|
|
9
|
+
import { EventEmitter } from 'node:events';
|
|
10
10
|
import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
|
|
11
11
|
import { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
|
|
12
12
|
import { URLSearchParams } from 'node:url';
|
|
@@ -328,10 +328,7 @@ interface CfAccount {
|
|
|
328
328
|
accountId: string;
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
|
|
332
|
-
configUpdate: [ConfigUpdateEvent];
|
|
333
|
-
};
|
|
334
|
-
declare class ConfigController extends Controller<ConfigControllerEventMap> {
|
|
331
|
+
declare class ConfigController extends Controller {
|
|
335
332
|
#private;
|
|
336
333
|
latestInput?: StartDevWorkerInput;
|
|
337
334
|
latestConfig?: StartDevWorkerOptions;
|
|
@@ -392,6 +389,7 @@ interface StartDevWorkerInput {
|
|
|
392
389
|
/** The triggers which will cause the worker's exported default handlers to be called. */
|
|
393
390
|
triggers?: Trigger[];
|
|
394
391
|
tailConsumers?: CfTailConsumer[];
|
|
392
|
+
streamingTailConsumers?: CfTailConsumer[];
|
|
395
393
|
/**
|
|
396
394
|
* Whether Wrangler should send usage metrics to Cloudflare for this project.
|
|
397
395
|
*
|
|
@@ -734,49 +732,27 @@ type ProxyData = {
|
|
|
734
732
|
proxyLogsToController?: boolean;
|
|
735
733
|
};
|
|
736
734
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
once<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
741
|
-
removeListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
742
|
-
off<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
743
|
-
removeAllListeners(event?: keyof EventMap): this;
|
|
744
|
-
listeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
745
|
-
rawListeners<Name extends keyof EventMap>(eventName: Name): ((...args: EventMap[Name]) => void)[];
|
|
746
|
-
emit<Name extends keyof EventMap>(eventName: Name, ...args: EventMap[Name]): boolean;
|
|
747
|
-
listenerCount<Name extends keyof EventMap>(eventName: Name, listener?: (...args: EventMap[Name]) => void): number;
|
|
748
|
-
prependListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
749
|
-
prependOnceListener<Name extends keyof EventMap>(eventName: Name, listener: (...args: EventMap[Name]) => void): this;
|
|
735
|
+
type ControllerEvent = ErrorEvent | ConfigUpdateEvent | BundleStartEvent | BundleCompleteEvent | ReloadStartEvent | ReloadCompleteEvent | DevRegistryUpdateEvent | PreviewTokenExpiredEvent;
|
|
736
|
+
interface ControllerBus {
|
|
737
|
+
dispatch(event: ControllerEvent): void;
|
|
750
738
|
}
|
|
751
|
-
declare
|
|
752
|
-
new <EventMap extends Record<string | symbol, unknown[]>>(): TypedEventEmitter<EventMap>;
|
|
753
|
-
};
|
|
754
|
-
type ControllerEventMap = {
|
|
755
|
-
error: [ErrorEvent];
|
|
756
|
-
};
|
|
757
|
-
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
739
|
+
declare abstract class Controller {
|
|
758
740
|
#private;
|
|
741
|
+
protected bus: ControllerBus;
|
|
742
|
+
constructor(bus: ControllerBus);
|
|
759
743
|
teardown(): Promise<void>;
|
|
760
|
-
emitErrorEvent(event: ErrorEvent): void;
|
|
744
|
+
protected emitErrorEvent(event: ErrorEvent): void;
|
|
761
745
|
}
|
|
762
|
-
|
|
763
|
-
reloadStart: [ReloadStartEvent];
|
|
764
|
-
reloadComplete: [ReloadCompleteEvent];
|
|
765
|
-
devRegistryUpdate: [DevRegistryUpdateEvent];
|
|
766
|
-
};
|
|
767
|
-
declare abstract class RuntimeController extends Controller<RuntimeControllerEventMap> {
|
|
746
|
+
declare abstract class RuntimeController extends Controller {
|
|
768
747
|
abstract onBundleStart(_: BundleStartEvent): void;
|
|
769
748
|
abstract onBundleComplete(_: BundleCompleteEvent): void;
|
|
770
749
|
abstract onPreviewTokenExpired(_: PreviewTokenExpiredEvent): void;
|
|
771
|
-
|
|
772
|
-
|
|
750
|
+
protected emitReloadStartEvent(data: ReloadStartEvent): void;
|
|
751
|
+
protected emitReloadCompleteEvent(data: ReloadCompleteEvent): void;
|
|
752
|
+
protected emitDevRegistryUpdateEvent(data: DevRegistryUpdateEvent): void;
|
|
773
753
|
}
|
|
774
754
|
|
|
775
|
-
|
|
776
|
-
bundleStart: [BundleStartEvent];
|
|
777
|
-
bundleComplete: [BundleCompleteEvent];
|
|
778
|
-
};
|
|
779
|
-
declare class BundlerController extends Controller<BundlerControllerEventMap> {
|
|
755
|
+
declare class BundlerController extends Controller {
|
|
780
756
|
#private;
|
|
781
757
|
onConfigUpdate(event: ConfigUpdateEvent): void;
|
|
782
758
|
teardown(): Promise<void>;
|
|
@@ -792,11 +768,7 @@ type DeferredPromise<T> = {
|
|
|
792
768
|
};
|
|
793
769
|
declare function convertConfigBindingsToStartWorkerBindings(configBindings: ConfigBindingOptions): StartDevWorkerOptions["bindings"];
|
|
794
770
|
|
|
795
|
-
|
|
796
|
-
ready: [ReadyEvent];
|
|
797
|
-
previewTokenExpired: [PreviewTokenExpiredEvent];
|
|
798
|
-
};
|
|
799
|
-
declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
771
|
+
declare class ProxyController extends Controller {
|
|
800
772
|
ready: DeferredPromise<ReadyEvent>;
|
|
801
773
|
localServerReady: DeferredPromise<void>;
|
|
802
774
|
proxyWorker?: Miniflare;
|
|
@@ -826,20 +798,36 @@ declare class ProxyController extends Controller<ProxyControllerEventMap> {
|
|
|
826
798
|
emitErrorEvent(reason: string, cause?: Error | SerializedError): void;
|
|
827
799
|
}
|
|
828
800
|
|
|
829
|
-
|
|
801
|
+
type ControllerFactory<C extends Controller> = (devEnv: DevEnv) => C;
|
|
802
|
+
declare class DevEnv extends EventEmitter implements ControllerBus {
|
|
830
803
|
config: ConfigController;
|
|
831
804
|
bundler: BundlerController;
|
|
832
805
|
runtimes: RuntimeController[];
|
|
833
806
|
proxy: ProxyController;
|
|
834
807
|
startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
835
|
-
constructor({
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
808
|
+
constructor({ configFactory, bundlerFactory, runtimeFactories, proxyFactory, }?: {
|
|
809
|
+
configFactory?: ControllerFactory<ConfigController>;
|
|
810
|
+
bundlerFactory?: ControllerFactory<BundlerController>;
|
|
811
|
+
runtimeFactories?: ControllerFactory<RuntimeController>[];
|
|
812
|
+
proxyFactory?: ControllerFactory<ProxyController>;
|
|
840
813
|
});
|
|
814
|
+
/**
|
|
815
|
+
* Central message bus dispatch method.
|
|
816
|
+
* All events from controllers flow through here, making the event routing explicit and traceable.
|
|
817
|
+
*
|
|
818
|
+
* Event flow:
|
|
819
|
+
* - ConfigController emits configUpdate → BundlerController, ProxyController
|
|
820
|
+
* - BundlerController emits bundleStart → ProxyController, RuntimeControllers
|
|
821
|
+
* - BundlerController emits bundleComplete → RuntimeControllers
|
|
822
|
+
* - RuntimeController emits reloadStart → ProxyController
|
|
823
|
+
* - RuntimeController emits reloadComplete → ProxyController
|
|
824
|
+
* - RuntimeController emits devRegistryUpdate → ConfigController
|
|
825
|
+
* - ProxyController emits previewTokenExpired → RuntimeControllers
|
|
826
|
+
* - Any controller emits error → DevEnv error handler
|
|
827
|
+
*/
|
|
828
|
+
dispatch(event: ControllerEvent): void;
|
|
829
|
+
private handleErrorEvent;
|
|
841
830
|
teardown(): Promise<void>;
|
|
842
|
-
emitErrorEvent(ev: ErrorEvent): void;
|
|
843
831
|
}
|
|
844
832
|
|
|
845
833
|
declare function startWorker(options: StartDevWorkerInput): Promise<Worker>;
|
|
@@ -857,6 +845,8 @@ type ReadConfigOptions = ResolveConfigPathOptions & {
|
|
|
857
845
|
*/
|
|
858
846
|
declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config;
|
|
859
847
|
|
|
848
|
+
declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config["migrations"] | undefined): Map<string, boolean>;
|
|
849
|
+
|
|
860
850
|
/**
|
|
861
851
|
* Note about this file:
|
|
862
852
|
*
|
|
@@ -1138,11 +1128,20 @@ declare class Logger {
|
|
|
1138
1128
|
*/
|
|
1139
1129
|
declare function splitSqlQuery(sql: string): string[];
|
|
1140
1130
|
|
|
1131
|
+
type ConfigurationOptions = {
|
|
1132
|
+
outputDir: string;
|
|
1133
|
+
projectPath: string;
|
|
1134
|
+
workerName: string;
|
|
1135
|
+
dryRun: boolean;
|
|
1136
|
+
};
|
|
1141
1137
|
declare abstract class Framework {
|
|
1142
1138
|
abstract name: string;
|
|
1139
|
+
preview?: string;
|
|
1140
|
+
deploy?: string;
|
|
1141
|
+
typegen?: string;
|
|
1143
1142
|
/** Some frameworks (i.e. Nuxt) don't need additional configuration */
|
|
1144
1143
|
get configured(): boolean;
|
|
1145
|
-
abstract configure(
|
|
1144
|
+
abstract configure(options: ConfigurationOptions): Promise<RawConfig> | RawConfig;
|
|
1146
1145
|
configurationDescription?: string;
|
|
1147
1146
|
}
|
|
1148
1147
|
|
|
@@ -1162,13 +1161,29 @@ type AutoConfigDetails = {
|
|
|
1162
1161
|
/** The output directory (if no framework is used, points to the raw asset files) */
|
|
1163
1162
|
outputDir?: string;
|
|
1164
1163
|
};
|
|
1164
|
+
type AutoConfigOptions = {
|
|
1165
|
+
/** Whether to run autoconfig without actually applying any filesystem modification (default: false) */
|
|
1166
|
+
dryRun?: boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Whether the build command should be run (default: true)
|
|
1169
|
+
*
|
|
1170
|
+
* Note: When `dryRun` is `true` the build command is never run.
|
|
1171
|
+
*/
|
|
1172
|
+
runBuild?: boolean;
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether the confirmation prompts should be skipped (default: false)
|
|
1175
|
+
*
|
|
1176
|
+
* Note: When `dryRun` is `true` the the confirmation prompts are always skipped.
|
|
1177
|
+
*/
|
|
1178
|
+
skipConfirmations?: boolean;
|
|
1179
|
+
};
|
|
1165
1180
|
|
|
1166
1181
|
declare function getDetailsForAutoConfig({ projectPath, wranglerConfig, }?: {
|
|
1167
1182
|
projectPath?: string;
|
|
1168
1183
|
wranglerConfig?: Config;
|
|
1169
1184
|
}): Promise<AutoConfigDetails>;
|
|
1170
1185
|
|
|
1171
|
-
declare function runAutoConfig(autoConfigDetails: AutoConfigDetails): Promise<void>;
|
|
1186
|
+
declare function runAutoConfig(autoConfigDetails: AutoConfigDetails, autoConfigOptions?: AutoConfigOptions): Promise<void>;
|
|
1172
1187
|
|
|
1173
1188
|
/**
|
|
1174
1189
|
* Make a fetch request, and extract the `result` from the JSON response.
|
|
@@ -1488,4 +1503,4 @@ interface Unstable_ASSETSBindingsOptions {
|
|
|
1488
1503
|
}
|
|
1489
1504
|
declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
|
|
1490
1505
|
|
|
1491
|
-
export { type Binding, type GetPlatformProxyOptions, type PlatformProxy, type RemoteProxySession, type SourcelessWorkerOptions, type StartRemoteProxySessionOptions, type Unstable_ASSETSBindingsOptions, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, Framework as experimental_AutoConfigFramework, getDetailsForAutoConfig as experimental_getDetailsForAutoConfig, experimental_getWranglerCommands, runAutoConfig as experimental_runAutoConfig, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
|
|
1506
|
+
export { type Binding, type GetPlatformProxyOptions, type PlatformProxy, type RemoteProxySession, type SourcelessWorkerOptions, type StartRemoteProxySessionOptions, type Unstable_ASSETSBindingsOptions, type Unstable_DevOptions, type Unstable_DevWorker, type Unstable_MiniflareWorkerOptions, Framework as experimental_AutoConfigFramework, getDetailsForAutoConfig as experimental_getDetailsForAutoConfig, experimental_getWranglerCommands, runAutoConfig as experimental_runAutoConfig, getPlatformProxy, maybeStartOrUpdateRemoteProxySession, startRemoteProxySession, DevEnv as unstable_DevEnv, convertConfigBindingsToStartWorkerBindings as unstable_convertConfigBindingsToStartWorkerBindings, unstable_dev, generateASSETSBinding as unstable_generateASSETSBinding, getDurableObjectClassNameToUseSQLiteMap as unstable_getDurableObjectClassNameToUseSQLiteMap, unstable_getMiniflareWorkerOptions, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
|