wrangler 4.28.1 → 4.29.1
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/package.json +10 -10
- package/wrangler-dist/cli.d.ts +236 -2
- package/wrangler-dist/cli.js +296 -257
- package/wrangler-dist/metafile-cjs.json +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.29.1",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -54,15 +54,15 @@
|
|
54
54
|
"esbuild": "0.25.4",
|
55
55
|
"path-to-regexp": "6.3.0",
|
56
56
|
"unenv": "2.0.0-rc.19",
|
57
|
-
"workerd": "1.
|
57
|
+
"workerd": "1.20250813.0",
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
59
|
-
"@cloudflare/unenv-preset": "2.6.
|
60
|
-
"miniflare": "4.
|
59
|
+
"@cloudflare/unenv-preset": "2.6.1",
|
60
|
+
"miniflare": "4.20250813.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.20250813.0",
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
67
67
|
"@iarna/toml": "^3.0.0",
|
68
68
|
"@sentry/node": "^7.86.0",
|
@@ -136,15 +136,15 @@
|
|
136
136
|
"xdg-app-paths": "^8.3.0",
|
137
137
|
"xxhash-wasm": "^1.0.1",
|
138
138
|
"yargs": "^17.7.2",
|
139
|
-
"@cloudflare/containers-shared": "0.2.
|
140
|
-
"@cloudflare/cli": "1.1.1",
|
139
|
+
"@cloudflare/containers-shared": "0.2.9",
|
141
140
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
142
|
-
"@cloudflare/pages-shared": "^0.13.
|
141
|
+
"@cloudflare/pages-shared": "^0.13.62",
|
143
142
|
"@cloudflare/workers-shared": "0.18.5",
|
144
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
143
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
144
|
+
"@cloudflare/cli": "1.1.1"
|
145
145
|
},
|
146
146
|
"peerDependencies": {
|
147
|
-
"@cloudflare/workers-types": "^4.
|
147
|
+
"@cloudflare/workers-types": "^4.20250813.0"
|
148
148
|
},
|
149
149
|
"peerDependenciesMeta": {
|
150
150
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
import { Json, Request, Response as Response$1, DispatchFetch, NodeJSCompatMode, Miniflare, MiniflareOptions, Mutex, WorkerOptions, ModuleRule, RemoteProxyConnectionString } from 'miniflare';
|
2
2
|
import * as undici from 'undici';
|
3
3
|
import { RequestInfo, RequestInit, Response, FormData } from 'undici';
|
4
|
+
import { CamelCaseKey, ArgumentsCamelCase, InferredOptionTypes, Alias, PositionalOptions, Options } from 'yargs';
|
4
5
|
import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
|
5
6
|
import { EventEmitter } from 'node:events';
|
6
7
|
import Protocol from 'devtools-protocol/types/protocol-mapping';
|
7
8
|
import { Metafile } from 'esbuild';
|
8
9
|
import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
|
9
10
|
import { IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
|
11
|
+
import { URLSearchParams } from 'node:url';
|
10
12
|
|
11
13
|
/**
|
12
14
|
* The `Environment` interface declares all the configuration fields that
|
@@ -1284,6 +1286,25 @@ interface EnvironmentMap {
|
|
1284
1286
|
[envName: string]: RawEnvironment;
|
1285
1287
|
};
|
1286
1288
|
}
|
1289
|
+
type OnlyCamelCase<T = Record<string, never>> = {
|
1290
|
+
[key in keyof T as CamelCaseKey<key>]: T[key];
|
1291
|
+
};
|
1292
|
+
|
1293
|
+
/**
|
1294
|
+
* Yargs options included in every wrangler command.
|
1295
|
+
*/
|
1296
|
+
interface CommonYargsOptions {
|
1297
|
+
v: boolean | undefined;
|
1298
|
+
cwd: string | undefined;
|
1299
|
+
config: string | undefined;
|
1300
|
+
env: string | undefined;
|
1301
|
+
"env-file": string[] | undefined;
|
1302
|
+
"experimental-provision": boolean | undefined;
|
1303
|
+
"experimental-remote-bindings": boolean | undefined;
|
1304
|
+
}
|
1305
|
+
type RemoveIndex<T> = {
|
1306
|
+
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
|
1307
|
+
};
|
1287
1308
|
|
1288
1309
|
type ResolveConfigPathOptions = {
|
1289
1310
|
useRedirectIfAvailable?: boolean;
|
@@ -1709,8 +1730,8 @@ interface PagesDeployOptions {
|
|
1709
1730
|
*/
|
1710
1731
|
declare function deploy({ directory, accountId, projectName, branch, skipCaching, commitMessage, commitHash, commitDirty, functionsDirectory: customFunctionsDirectory, bundle, sourceMaps, args, }: PagesDeployOptions): Promise<{
|
1711
1732
|
deploymentResponse: {
|
1712
|
-
url: string;
|
1713
1733
|
id: string;
|
1734
|
+
url: string;
|
1714
1735
|
environment: "production" | "preview";
|
1715
1736
|
build_config: {
|
1716
1737
|
build_command: string;
|
@@ -1777,6 +1798,11 @@ declare const unstable_pages: {
|
|
1777
1798
|
deploy: typeof deploy;
|
1778
1799
|
};
|
1779
1800
|
|
1801
|
+
/**
|
1802
|
+
* The compliance region to use for the API requests.
|
1803
|
+
*/
|
1804
|
+
type ComplianceConfig = Partial<Pick<Config, "compliance_region">>;
|
1805
|
+
|
1780
1806
|
type WorkerRegistry = Record<string, WorkerDefinition>;
|
1781
1807
|
type WorkerEntrypointsDefinition = Record<"default" | string, {
|
1782
1808
|
host: string;
|
@@ -1804,6 +1830,29 @@ type DevToolsEvent<Method extends _EventMethods> = Method extends unknown ? {
|
|
1804
1830
|
params: _Params<Protocol.Events[Method]>;
|
1805
1831
|
} : never;
|
1806
1832
|
|
1833
|
+
/**
|
1834
|
+
* This is used to provide telemetry with a sanitised error
|
1835
|
+
* message that could not have any user-identifying information.
|
1836
|
+
* Set to `true` to duplicate `message`.
|
1837
|
+
* */
|
1838
|
+
type TelemetryMessage = {
|
1839
|
+
telemetryMessage?: string | true;
|
1840
|
+
};
|
1841
|
+
/**
|
1842
|
+
* Base class for errors where the user has done something wrong. These are not
|
1843
|
+
* reported to Sentry. API errors are intentionally *not* `UserError`s, and are
|
1844
|
+
* reported to Sentry. This will help us understand which API errors need better
|
1845
|
+
* messaging.
|
1846
|
+
*/
|
1847
|
+
declare class UserError extends Error {
|
1848
|
+
telemetryMessage: string | undefined;
|
1849
|
+
constructor(message?: string | undefined, options?: (ErrorOptions & TelemetryMessage) | undefined);
|
1850
|
+
}
|
1851
|
+
declare class FatalError extends UserError {
|
1852
|
+
readonly code?: number | undefined;
|
1853
|
+
constructor(message?: string, code?: number | undefined, options?: TelemetryMessage);
|
1854
|
+
}
|
1855
|
+
|
1807
1856
|
type AssetsOptions = {
|
1808
1857
|
directory: string;
|
1809
1858
|
binding?: string;
|
@@ -2676,6 +2725,191 @@ declare const experimental_patchConfig: (configPath: string,
|
|
2676
2725
|
*/
|
2677
2726
|
patch: RawConfig, isArrayInsertion?: boolean) => string;
|
2678
2727
|
|
2728
|
+
/**
|
2729
|
+
* Make a fetch request, and extract the `result` from the JSON response.
|
2730
|
+
*/
|
2731
|
+
declare function fetchResult<ResponseType>(complianceConfig: ComplianceConfig, resource: string, init?: RequestInit, queryParams?: URLSearchParams, abortSignal?: AbortSignal, apiToken?: ApiCredentials): Promise<ResponseType>;
|
2732
|
+
|
2733
|
+
type ExperimentalFlags = {
|
2734
|
+
MULTIWORKER: boolean;
|
2735
|
+
RESOURCES_PROVISION: boolean;
|
2736
|
+
REMOTE_BINDINGS: boolean;
|
2737
|
+
};
|
2738
|
+
|
2739
|
+
// Team names from https://wiki.cfdata.org/display/EW/Developer+Platform+Components+and+Pillar+Ownership
|
2740
|
+
type Teams =
|
2741
|
+
| "Workers: Onboarding & Integrations"
|
2742
|
+
| "Workers: Builds and Automation"
|
2743
|
+
| "Workers: Deploy and Config"
|
2744
|
+
| "Workers: Authoring and Testing"
|
2745
|
+
| "Workers: Frameworks and Runtime APIs"
|
2746
|
+
| "Workers: Runtime Platform"
|
2747
|
+
| "Workers: Workers Observability"
|
2748
|
+
| "Product: KV"
|
2749
|
+
| "Product: R2"
|
2750
|
+
| "Product: R2 Data Catalog"
|
2751
|
+
| "Product: D1"
|
2752
|
+
| "Product: Queues"
|
2753
|
+
| "Product: AI"
|
2754
|
+
| "Product: Hyperdrive"
|
2755
|
+
| "Product: Pipelines"
|
2756
|
+
| "Product: Vectorize"
|
2757
|
+
| "Product: Workflows"
|
2758
|
+
| "Product: Cloudchamber"
|
2759
|
+
| "Product: SSL";
|
2760
|
+
|
2761
|
+
type StringKeyOf<T> = Extract<keyof T, string>;
|
2762
|
+
type DeepFlatten<T> = T extends object ? {
|
2763
|
+
[K in keyof T]: DeepFlatten<T[K]>;
|
2764
|
+
} : T;
|
2765
|
+
type Command = `wrangler${string}`;
|
2766
|
+
type Metadata = {
|
2767
|
+
description: string;
|
2768
|
+
status: "experimental" | "alpha" | "private-beta" | "open-beta" | "stable";
|
2769
|
+
statusMessage?: string;
|
2770
|
+
deprecated?: boolean;
|
2771
|
+
deprecatedMessage?: string;
|
2772
|
+
hidden?: boolean;
|
2773
|
+
owner: Teams;
|
2774
|
+
/** Prints something at the bottom of the help */
|
2775
|
+
epilogue?: string;
|
2776
|
+
examples?: {
|
2777
|
+
command: string;
|
2778
|
+
description: string;
|
2779
|
+
}[];
|
2780
|
+
hideGlobalFlags?: string[];
|
2781
|
+
};
|
2782
|
+
type ArgDefinition = Omit<PositionalOptions, "type"> & Pick<Options, "hidden" | "requiresArg" | "deprecated" | "type">;
|
2783
|
+
type NamedArgDefinitions = {
|
2784
|
+
[key: string]: ArgDefinition;
|
2785
|
+
};
|
2786
|
+
type HandlerArgs<Args extends NamedArgDefinitions> = DeepFlatten<OnlyCamelCase<RemoveIndex<ArgumentsCamelCase<CommonYargsOptions & InferredOptionTypes<Args> & Alias<Args>>>>>;
|
2787
|
+
type HandlerContext = {
|
2788
|
+
/**
|
2789
|
+
* The wrangler config file read from disk and parsed.
|
2790
|
+
*/
|
2791
|
+
config: Config;
|
2792
|
+
/**
|
2793
|
+
* The logger instance provided to the command implementor as a convenience.
|
2794
|
+
*/
|
2795
|
+
logger: Logger;
|
2796
|
+
/**
|
2797
|
+
* Use fetchResult to make *auth'd* requests to the Cloudflare API.
|
2798
|
+
*/
|
2799
|
+
fetchResult: typeof fetchResult;
|
2800
|
+
/**
|
2801
|
+
* Error classes provided to the command implementor as a convenience
|
2802
|
+
* to aid discoverability and to encourage their usage.
|
2803
|
+
*/
|
2804
|
+
errors: {
|
2805
|
+
UserError: typeof UserError;
|
2806
|
+
FatalError: typeof FatalError;
|
2807
|
+
};
|
2808
|
+
};
|
2809
|
+
type CommandDefinition<NamedArgDefs extends NamedArgDefinitions = NamedArgDefinitions> = {
|
2810
|
+
/**
|
2811
|
+
* Descriptive information about the command which does not affect behaviour.
|
2812
|
+
* This is used for the CLI --help and subcommand --help output.
|
2813
|
+
* This should be used as the source-of-truth for status and ownership.
|
2814
|
+
*/
|
2815
|
+
metadata: Metadata;
|
2816
|
+
/**
|
2817
|
+
* Controls shared behaviour across all commands.
|
2818
|
+
* This will allow wrangler commands to remain consistent and only diverge intentionally.
|
2819
|
+
*/
|
2820
|
+
behaviour?: {
|
2821
|
+
/**
|
2822
|
+
* By default, wrangler's version banner will be printed before the handler is executed.
|
2823
|
+
* Set this value to `false` to skip printing the banner.
|
2824
|
+
*
|
2825
|
+
* @default true
|
2826
|
+
*/
|
2827
|
+
printBanner?: boolean | ((args: HandlerArgs<NamedArgDefs>) => boolean);
|
2828
|
+
/**
|
2829
|
+
* By default, wrangler will print warnings about the Wrangler configuration file.
|
2830
|
+
* Set this value to `false` to skip printing these warnings.
|
2831
|
+
*/
|
2832
|
+
printConfigWarnings?: boolean;
|
2833
|
+
/**
|
2834
|
+
* By default, wrangler will read & provide the wrangler.toml/wrangler.json configuration.
|
2835
|
+
* Set this value to `false` to skip this.
|
2836
|
+
*/
|
2837
|
+
provideConfig?: boolean;
|
2838
|
+
/**
|
2839
|
+
* By default, wrangler will provide experimental flags in the handler context,
|
2840
|
+
* according to the default values in register-yargs.command.ts
|
2841
|
+
* Use this to override those defaults per command.
|
2842
|
+
*/
|
2843
|
+
overrideExperimentalFlags?: (args: HandlerArgs<NamedArgDefs>) => ExperimentalFlags;
|
2844
|
+
/**
|
2845
|
+
* If true, then look for a redirect file at `.wrangler/deploy/config.json` and use that to find the Wrangler configuration file.
|
2846
|
+
*/
|
2847
|
+
useConfigRedirectIfAvailable?: boolean;
|
2848
|
+
/**
|
2849
|
+
* If true, print a message about whether the command is operating on a local or remote resource
|
2850
|
+
*/
|
2851
|
+
printResourceLocation?: ((args?: HandlerArgs<NamedArgDefs>) => boolean) | boolean;
|
2852
|
+
/**
|
2853
|
+
* If true, check for environments in the wrangler config, if there are some and the user hasn't specified an environment
|
2854
|
+
* using the `-e|--env` cli flag, show a warning suggesting that one should instead be specified.
|
2855
|
+
*/
|
2856
|
+
warnIfMultipleEnvsConfiguredButNoneSpecified?: boolean;
|
2857
|
+
};
|
2858
|
+
/**
|
2859
|
+
* A plain key-value object describing the CLI args for this command.
|
2860
|
+
* Shared args can be defined as another plain object and spread into this.
|
2861
|
+
*/
|
2862
|
+
args?: NamedArgDefs;
|
2863
|
+
/**
|
2864
|
+
* Optionally declare some of the named args as positional args.
|
2865
|
+
* The order of this array is the order they are expected in the command.
|
2866
|
+
* Use args[key].demandOption and args[key].array to declare required and variadic
|
2867
|
+
* positional args, respectively.
|
2868
|
+
*/
|
2869
|
+
positionalArgs?: Array<StringKeyOf<NamedArgDefs>>;
|
2870
|
+
/**
|
2871
|
+
* A hook to implement custom validation of the args before the handler is called.
|
2872
|
+
* Throw `CommandLineArgsError` with actionable error message if args are invalid.
|
2873
|
+
* The return value is ignored.
|
2874
|
+
*/
|
2875
|
+
validateArgs?: (args: HandlerArgs<NamedArgDefs>) => void | Promise<void>;
|
2876
|
+
/**
|
2877
|
+
* The implementation of the command which is given camelCase'd args
|
2878
|
+
* and a ctx object of convenience properties
|
2879
|
+
*/
|
2880
|
+
handler: (args: HandlerArgs<NamedArgDefs>, ctx: HandlerContext) => void | Promise<void>;
|
2881
|
+
};
|
2882
|
+
type NamespaceDefinition = {
|
2883
|
+
metadata: Metadata;
|
2884
|
+
};
|
2885
|
+
type AliasDefinition = {
|
2886
|
+
aliasOf: Command;
|
2887
|
+
metadata?: Partial<Metadata>;
|
2888
|
+
};
|
2889
|
+
type InternalDefinition = ({
|
2890
|
+
type: "command";
|
2891
|
+
command: Command;
|
2892
|
+
} & CommandDefinition) | ({
|
2893
|
+
type: "namespace";
|
2894
|
+
command: Command;
|
2895
|
+
} & NamespaceDefinition) | ({
|
2896
|
+
type: "alias";
|
2897
|
+
command: Command;
|
2898
|
+
} & AliasDefinition);
|
2899
|
+
type DefinitionTreeNode = {
|
2900
|
+
definition?: InternalDefinition;
|
2901
|
+
subtree: DefinitionTree;
|
2902
|
+
};
|
2903
|
+
type DefinitionTree = Map<string, DefinitionTreeNode>;
|
2904
|
+
|
2905
|
+
/**
|
2906
|
+
* EXPERIMENTAL: Get all registered Wrangler commands for documentation generation.
|
2907
|
+
* This API is experimental and may change without notice.
|
2908
|
+
*
|
2909
|
+
* @returns The complete command tree structure with all metadata
|
2910
|
+
*/
|
2911
|
+
declare function experimental_getWranglerCommands(): DefinitionTreeNode;
|
2912
|
+
|
2679
2913
|
interface Unstable_ASSETSBindingsOptions {
|
2680
2914
|
log: Logger;
|
2681
2915
|
proxyPort?: number;
|
@@ -2683,4 +2917,4 @@ interface Unstable_ASSETSBindingsOptions {
|
|
2683
2917
|
}
|
2684
2918
|
declare const generateASSETSBinding: (opts: Unstable_ASSETSBindingsOptions) => (request: Request) => Promise<Response$1>;
|
2685
2919
|
|
2686
|
-
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, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
|
2920
|
+
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, experimental_getWranglerCommands, 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, getVarsForDev as unstable_getVarsForDev, unstable_pages, readConfig as unstable_readConfig, splitSqlQuery as unstable_splitSqlQuery, startWorker as unstable_startWorker };
|