wrangler 4.12.1 → 4.13.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 +20 -0
- package/package.json +8 -8
- package/wrangler-dist/cli.d.ts +12 -0
- package/wrangler-dist/cli.js +36 -5
package/config-schema.json
CHANGED
@@ -166,6 +166,11 @@
|
|
166
166
|
"type": "boolean",
|
167
167
|
"description": "Minify the script before uploading."
|
168
168
|
},
|
169
|
+
"keep_names": {
|
170
|
+
"type": "boolean",
|
171
|
+
"description": "Keep function names after javascript transpilations.",
|
172
|
+
"default": "{true}"
|
173
|
+
},
|
169
174
|
"first_party_worker": {
|
170
175
|
"type": "boolean",
|
171
176
|
"description": "Designates this Worker as an internal-only \"first-party\" Worker."
|
@@ -586,6 +591,11 @@
|
|
586
591
|
"entrypoint": {
|
587
592
|
"type": "string",
|
588
593
|
"description": "Optionally, the entrypoint (named export) of the service to bind to."
|
594
|
+
},
|
595
|
+
"props": {
|
596
|
+
"type": "object",
|
597
|
+
"additionalProperties": {},
|
598
|
+
"description": "Optional properties that will be made available to the service via ctx.props."
|
589
599
|
}
|
590
600
|
},
|
591
601
|
"required": [
|
@@ -1093,6 +1103,11 @@
|
|
1093
1103
|
"type": "boolean",
|
1094
1104
|
"description": "Minify the script before uploading."
|
1095
1105
|
},
|
1106
|
+
"keep_names": {
|
1107
|
+
"type": "boolean",
|
1108
|
+
"description": "Keep function names after javascript transpilations.",
|
1109
|
+
"default": "{true}"
|
1110
|
+
},
|
1096
1111
|
"first_party_worker": {
|
1097
1112
|
"type": "boolean",
|
1098
1113
|
"description": "Designates this Worker as an internal-only \"first-party\" Worker."
|
@@ -1513,6 +1528,11 @@
|
|
1513
1528
|
"entrypoint": {
|
1514
1529
|
"type": "string",
|
1515
1530
|
"description": "Optionally, the entrypoint (named export) of the service to bind to."
|
1531
|
+
},
|
1532
|
+
"props": {
|
1533
|
+
"type": "object",
|
1534
|
+
"additionalProperties": {},
|
1535
|
+
"description": "Optional properties that will be made available to the service via ctx.props."
|
1516
1536
|
}
|
1517
1537
|
},
|
1518
1538
|
"required": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.13.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -55,14 +55,14 @@
|
|
55
55
|
"esbuild": "0.25.2",
|
56
56
|
"path-to-regexp": "6.3.0",
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
|
-
"workerd": "1.
|
59
|
-
"
|
60
|
-
"
|
58
|
+
"workerd": "1.20250422.0",
|
59
|
+
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
+
"miniflare": "4.20250422.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.20250422.0",
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
67
67
|
"@iarna/toml": "^3.0.0",
|
68
68
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -135,14 +135,14 @@
|
|
135
135
|
"xdg-app-paths": "^8.3.0",
|
136
136
|
"xxhash-wasm": "^1.0.1",
|
137
137
|
"yargs": "^17.7.2",
|
138
|
-
"@cloudflare/eslint-config-worker": "1.1.0",
|
139
|
-
"@cloudflare/pages-shared": "^0.13.30",
|
140
138
|
"@cloudflare/cli": "1.1.1",
|
139
|
+
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
+
"@cloudflare/pages-shared": "^0.13.31",
|
141
141
|
"@cloudflare/workers-shared": "0.17.2",
|
142
142
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
|
-
"@cloudflare/workers-types": "^4.
|
145
|
+
"@cloudflare/workers-types": "^4.20250422.0"
|
146
146
|
},
|
147
147
|
"peerDependenciesMeta": {
|
148
148
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -724,6 +724,7 @@ declare interface CfService {
|
|
724
724
|
service: string;
|
725
725
|
environment?: string;
|
726
726
|
entrypoint?: string;
|
727
|
+
props?: Record<string, unknown>;
|
727
728
|
}
|
728
729
|
|
729
730
|
declare interface CfUnsafe {
|
@@ -1797,6 +1798,13 @@ declare interface EnvironmentInheritable {
|
|
1797
1798
|
* @inheritable
|
1798
1799
|
*/
|
1799
1800
|
minify: boolean | undefined;
|
1801
|
+
/**
|
1802
|
+
* Keep function names after javascript transpilations.
|
1803
|
+
*
|
1804
|
+
* @default {true}
|
1805
|
+
* @inheritable
|
1806
|
+
*/
|
1807
|
+
keep_names: boolean | undefined;
|
1800
1808
|
/**
|
1801
1809
|
* Designates this Worker as an internal-only "first-party" Worker.
|
1802
1810
|
*
|
@@ -2121,6 +2129,8 @@ declare interface EnvironmentNonInheritable {
|
|
2121
2129
|
environment?: string;
|
2122
2130
|
/** Optionally, the entrypoint (named export) of the service to bind to. */
|
2123
2131
|
entrypoint?: string;
|
2132
|
+
/** Optional properties that will be made available to the service via ctx.props. */
|
2133
|
+
props?: Record<string, unknown>;
|
2124
2134
|
}[] | undefined;
|
2125
2135
|
/**
|
2126
2136
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
@@ -26141,6 +26151,8 @@ declare interface StartDevWorkerInput {
|
|
26141
26151
|
alias?: Record<string, string>;
|
26142
26152
|
/** Whether the bundled worker is minified. Only takes effect if bundle: true. */
|
26143
26153
|
minify?: boolean;
|
26154
|
+
/** Whether to keep function names after JavaScript transpilations. */
|
26155
|
+
keepNames?: boolean;
|
26144
26156
|
/** Options controlling a custom build step. */
|
26145
26157
|
custom?: {
|
26146
26158
|
/** Custom shell command to run before bundling. Runs even if bundle. */
|
package/wrangler-dist/cli.js
CHANGED
@@ -81185,7 +81185,7 @@ var import_undici3 = __toESM(require_undici());
|
|
81185
81185
|
|
81186
81186
|
// package.json
|
81187
81187
|
var name = "wrangler";
|
81188
|
-
var version = "4.
|
81188
|
+
var version = "4.13.0";
|
81189
81189
|
|
81190
81190
|
// src/environment-variables/misc-variables.ts
|
81191
81191
|
init_import_meta_url();
|
@@ -85778,6 +85778,14 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
|
|
85778
85778
|
isBoolean,
|
85779
85779
|
void 0
|
85780
85780
|
),
|
85781
|
+
keep_names: inheritable(
|
85782
|
+
diagnostics,
|
85783
|
+
topLevelEnv,
|
85784
|
+
rawEnv,
|
85785
|
+
"keep_names",
|
85786
|
+
isBoolean,
|
85787
|
+
void 0
|
85788
|
+
),
|
85781
85789
|
first_party_worker: inheritable(
|
85782
85790
|
diagnostics,
|
85783
85791
|
topLevelEnv,
|
@@ -87489,6 +87497,7 @@ var defaultWranglerConfig = {
|
|
87489
87497
|
build: { command: void 0, watch_dir: "./src", cwd: void 0 },
|
87490
87498
|
no_bundle: void 0,
|
87491
87499
|
minify: void 0,
|
87500
|
+
keep_names: void 0,
|
87492
87501
|
dispatch_namespaces: [],
|
87493
87502
|
first_party_worker: void 0,
|
87494
87503
|
logfwdr: { bindings: [] },
|
@@ -92749,7 +92758,8 @@ function buildMiniflareBindingOptions(config) {
|
|
92749
92758
|
if (service.service === config.name || config.workerDefinitions === null) {
|
92750
92759
|
serviceBindings[service.binding] = {
|
92751
92760
|
name: service.service,
|
92752
|
-
entrypoint: service.entrypoint
|
92761
|
+
entrypoint: service.entrypoint,
|
92762
|
+
props: service.props
|
92753
92763
|
};
|
92754
92764
|
continue;
|
92755
92765
|
}
|
@@ -103499,6 +103509,7 @@ async function bundleWorker(entry, destination, {
|
|
103499
103509
|
watch: watch2,
|
103500
103510
|
tsconfig,
|
103501
103511
|
minify,
|
103512
|
+
keepNames,
|
103502
103513
|
nodejsCompatMode,
|
103503
103514
|
alias,
|
103504
103515
|
define,
|
@@ -103621,7 +103632,7 @@ async function bundleWorker(entry, destination, {
|
|
103621
103632
|
bundle,
|
103622
103633
|
absWorkingDir: entry.projectRoot,
|
103623
103634
|
outdir: destination,
|
103624
|
-
keepNames
|
103635
|
+
keepNames,
|
103625
103636
|
entryNames: entryName || path28.parse(entryFile).name,
|
103626
103637
|
...isOutfile ? {
|
103627
103638
|
outdir: void 0,
|
@@ -104062,13 +104073,14 @@ function createWorkerUploadForm(worker) {
|
|
104062
104073
|
}
|
104063
104074
|
);
|
104064
104075
|
bindings.services?.forEach(
|
104065
|
-
({ binding, service, environment, entrypoint }) => {
|
104076
|
+
({ binding, service, environment, entrypoint, props }) => {
|
104066
104077
|
metadataBindings.push({
|
104067
104078
|
name: binding,
|
104068
104079
|
type: "service",
|
104069
104080
|
service,
|
104070
104081
|
...environment && { environment },
|
104071
|
-
...entrypoint && { entrypoint }
|
104082
|
+
...entrypoint && { entrypoint },
|
104083
|
+
...props && { props }
|
104072
104084
|
});
|
104073
104085
|
}
|
104074
104086
|
);
|
@@ -114144,6 +114156,12 @@ async function listCommandHandle2(_args, _config) {
|
|
114144
114156
|
);
|
114145
114157
|
return;
|
114146
114158
|
}
|
114159
|
+
if (applications === void 0 || applications === null || applications.length === 0) {
|
114160
|
+
logRaw(
|
114161
|
+
"No containers found. See https://dash.cloudflare.com/?to=/:account/workers/containers to learn more."
|
114162
|
+
);
|
114163
|
+
return;
|
114164
|
+
}
|
114147
114165
|
const applicationDetails = /* @__PURE__ */ __name((a5) => {
|
114148
114166
|
const details = flatDetails(a5);
|
114149
114167
|
return {
|
@@ -120025,6 +120043,7 @@ function buildWorkerFromFunctions({
|
|
120025
120043
|
outfile = (0, import_node_path38.join)(getPagesTmpDir(), `./functionsWorker-${Math.random()}.js`),
|
120026
120044
|
outdir,
|
120027
120045
|
minify = false,
|
120046
|
+
keepNames = true,
|
120028
120047
|
sourcemap = false,
|
120029
120048
|
fallbackService = "ASSETS",
|
120030
120049
|
watch: watch2 = false,
|
@@ -120056,6 +120075,7 @@ function buildWorkerFromFunctions({
|
|
120056
120075
|
inject: [routesModule],
|
120057
120076
|
...outdir ? { entryName: "index" } : { entryName: void 0 },
|
120058
120077
|
minify,
|
120078
|
+
keepNames,
|
120059
120079
|
sourcemap,
|
120060
120080
|
watch: watch2,
|
120061
120081
|
nodejsCompatMode,
|
@@ -120090,6 +120110,7 @@ function buildRawWorker({
|
|
120090
120110
|
bundle = true,
|
120091
120111
|
externalModules,
|
120092
120112
|
minify = false,
|
120113
|
+
keepNames = true,
|
120093
120114
|
sourcemap = false,
|
120094
120115
|
watch: watch2 = false,
|
120095
120116
|
plugins = [],
|
@@ -120115,6 +120136,7 @@ function buildRawWorker({
|
|
120115
120136
|
moduleCollector,
|
120116
120137
|
additionalModules,
|
120117
120138
|
minify,
|
120139
|
+
keepNames,
|
120118
120140
|
sourcemap,
|
120119
120141
|
watch: watch2,
|
120120
120142
|
nodejsCompatMode,
|
@@ -120355,6 +120377,7 @@ function buildPluginFromFunctions({
|
|
120355
120377
|
routesModule,
|
120356
120378
|
outdir,
|
120357
120379
|
minify = false,
|
120380
|
+
keepNames = true,
|
120358
120381
|
sourcemap = false,
|
120359
120382
|
watch: watch2 = false,
|
120360
120383
|
onEnd = /* @__PURE__ */ __name(() => {
|
@@ -120384,6 +120407,7 @@ function buildPluginFromFunctions({
|
|
120384
120407
|
inject: [routesModule],
|
120385
120408
|
entryName: "index",
|
120386
120409
|
minify,
|
120410
|
+
keepNames,
|
120387
120411
|
sourcemap,
|
120388
120412
|
watch: watch2,
|
120389
120413
|
// We don't currently have a mechanism for Plugins 'requiring' a specific compat date/flag,
|
@@ -148094,6 +148118,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
148094
148118
|
jsxFragment,
|
148095
148119
|
tsconfig: props.tsconfig ?? config.tsconfig,
|
148096
148120
|
minify,
|
148121
|
+
keepNames: config.keep_names ?? true,
|
148097
148122
|
sourcemap: uploadSourceMaps,
|
148098
148123
|
nodejsCompatMode,
|
148099
148124
|
define: { ...config.define, ...props.defines },
|
@@ -151400,6 +151425,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
151400
151425
|
jsxFragment,
|
151401
151426
|
tsconfig: props.tsconfig ?? config.tsconfig,
|
151402
151427
|
minify,
|
151428
|
+
keepNames: config.keep_names ?? true,
|
151403
151429
|
sourcemap: uploadSourceMaps,
|
151404
151430
|
nodejsCompatMode,
|
151405
151431
|
define: { ...config.define, ...props.defines },
|
@@ -153658,6 +153684,7 @@ function runBuild({
|
|
153658
153684
|
rules,
|
153659
153685
|
tsconfig,
|
153660
153686
|
minify,
|
153687
|
+
keepNames,
|
153661
153688
|
nodejsCompatMode,
|
153662
153689
|
define,
|
153663
153690
|
alias,
|
@@ -153724,6 +153751,7 @@ function runBuild({
|
|
153724
153751
|
watch: true,
|
153725
153752
|
tsconfig,
|
153726
153753
|
minify,
|
153754
|
+
keepNames,
|
153727
153755
|
nodejsCompatMode,
|
153728
153756
|
doBindings: durableObjects.bindings,
|
153729
153757
|
workflowBindings: workflows,
|
@@ -153853,6 +153881,7 @@ var BundlerController = class extends Controller {
|
|
153853
153881
|
jsxFragment: config.build.jsxFactory,
|
153854
153882
|
tsconfig: config.build.tsconfig,
|
153855
153883
|
minify: config.build.minify,
|
153884
|
+
keepNames: config.build.keepNames ?? true,
|
153856
153885
|
nodejsCompatMode: config.build.nodejsCompatMode,
|
153857
153886
|
define: config.build.define,
|
153858
153887
|
checkFetch: shouldCheckFetch(
|
@@ -153963,6 +153992,7 @@ var BundlerController = class extends Controller {
|
|
153963
153992
|
rules: config.build.moduleRules,
|
153964
153993
|
tsconfig: config.build?.tsconfig,
|
153965
153994
|
minify: config.build?.minify,
|
153995
|
+
keepNames: config.build?.keepNames ?? true,
|
153966
153996
|
nodejsCompatMode: config.build.nodejsCompatMode,
|
153967
153997
|
define: config.build.define,
|
153968
153998
|
alias: config.build.alias,
|
@@ -154467,6 +154497,7 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
|
|
154467
154497
|
moduleRoot: entry.moduleRoot,
|
154468
154498
|
moduleRules: input.build?.moduleRules ?? getRules(config),
|
154469
154499
|
minify: input.build?.minify ?? config.minify,
|
154500
|
+
keepNames: input.build?.keepNames ?? config.keep_names,
|
154470
154501
|
define: { ...config.define, ...input.build?.define },
|
154471
154502
|
custom: {
|
154472
154503
|
command: input.build?.custom?.command ?? config.build?.command,
|