wrangler 4.11.1 → 4.12.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/package.json +11 -11
- package/wrangler-dist/cli.js +262 -7
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.12.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.20250416.0",
|
59
|
+
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
+
"miniflare": "4.20250416.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.20250415.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",
|
@@ -84,7 +84,7 @@
|
|
84
84
|
"@types/supports-color": "^8.1.1",
|
85
85
|
"@types/ws": "^8.5.7",
|
86
86
|
"@types/yargs": "^17.0.22",
|
87
|
-
"@vitest/ui": "~3.
|
87
|
+
"@vitest/ui": "~3.1.1",
|
88
88
|
"@webcontainer/env": "^1.1.0",
|
89
89
|
"chalk": "^5.2.0",
|
90
90
|
"chokidar": "^4.0.1",
|
@@ -129,7 +129,7 @@
|
|
129
129
|
"typescript": "^5.7.2",
|
130
130
|
"undici": "^5.28.5",
|
131
131
|
"update-check": "^1.5.4",
|
132
|
-
"vitest": "~3.
|
132
|
+
"vitest": "~3.1.1",
|
133
133
|
"vitest-websocket-mock": "^0.4.0",
|
134
134
|
"ws": "8.18.0",
|
135
135
|
"xdg-app-paths": "^8.3.0",
|
@@ -137,12 +137,12 @@
|
|
137
137
|
"yargs": "^17.7.2",
|
138
138
|
"@cloudflare/cli": "1.1.1",
|
139
139
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
-
"@cloudflare/pages-shared": "^0.13.
|
141
|
-
"@cloudflare/workers-
|
142
|
-
"@cloudflare/workers-
|
140
|
+
"@cloudflare/pages-shared": "^0.13.29",
|
141
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
142
|
+
"@cloudflare/workers-shared": "0.17.2"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
|
-
"@cloudflare/workers-types": "^4.
|
145
|
+
"@cloudflare/workers-types": "^4.20250415.0"
|
146
146
|
},
|
147
147
|
"peerDependenciesMeta": {
|
148
148
|
"@cloudflare/workers-types": {
|
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.12.0";
|
81189
81189
|
|
81190
81190
|
// src/environment-variables/misc-variables.ts
|
81191
81191
|
init_import_meta_url();
|
@@ -90797,7 +90797,12 @@ async function getOauthToken(options33) {
|
|
90797
90797
|
}
|
90798
90798
|
}
|
90799
90799
|
});
|
90800
|
-
|
90800
|
+
if (options33.callbackHost !== "localhost" || options33.callbackPort !== 8976) {
|
90801
|
+
logger.log(
|
90802
|
+
`Temporary login server listening on ${options33.callbackHost}:${options33.callbackPort}`
|
90803
|
+
);
|
90804
|
+
}
|
90805
|
+
server.listen(options33.callbackPort, options33.callbackHost);
|
90801
90806
|
});
|
90802
90807
|
if (options33.browser) {
|
90803
90808
|
logger.log(`Opening a link in your default browser: ${urlToOpen}`);
|
@@ -90808,7 +90813,11 @@ async function getOauthToken(options33) {
|
|
90808
90813
|
return Promise.race([timerPromise, loginPromise]);
|
90809
90814
|
}
|
90810
90815
|
__name(getOauthToken, "getOauthToken");
|
90811
|
-
async function login(props = {
|
90816
|
+
async function login(props = {
|
90817
|
+
browser: true,
|
90818
|
+
callbackHost: "localhost",
|
90819
|
+
callbackPort: 8976
|
90820
|
+
}) {
|
90812
90821
|
const authFromEnv = getAuthFromEnv();
|
90813
90822
|
if (authFromEnv) {
|
90814
90823
|
logger.error(
|
@@ -90827,7 +90836,9 @@ async function login(props = { browser: true }) {
|
|
90827
90836
|
},
|
90828
90837
|
granted: {
|
90829
90838
|
url: "https://welcome.developers.workers.dev/wrangler-oauth-consent-granted"
|
90830
|
-
}
|
90839
|
+
},
|
90840
|
+
callbackHost: props.callbackHost,
|
90841
|
+
callbackPort: props.callbackPort
|
90831
90842
|
});
|
90832
90843
|
writeAuthConfigFile({
|
90833
90844
|
oauth_token: oauth.token?.value ?? "",
|
@@ -110657,7 +110668,7 @@ function handleFailure(cb2) {
|
|
110657
110668
|
await fillOpenAPIConfiguration(config, args.json);
|
110658
110669
|
await cb2(args, config);
|
110659
110670
|
} catch (err) {
|
110660
|
-
if (!args.json) {
|
110671
|
+
if (!args.json || !isNonInteractiveOrCI()) {
|
110661
110672
|
throw err;
|
110662
110673
|
}
|
110663
110674
|
if (err instanceof ApiError) {
|
@@ -114002,6 +114013,208 @@ var cloudchamber = /* @__PURE__ */ __name((yargs, subHelp) => {
|
|
114002
114013
|
|
114003
114014
|
// src/containers/index.ts
|
114004
114015
|
init_import_meta_url();
|
114016
|
+
|
114017
|
+
// src/containers/containers.ts
|
114018
|
+
init_import_meta_url();
|
114019
|
+
function deleteYargs(args) {
|
114020
|
+
return args.positional("ID", {
|
114021
|
+
describe: "id of the containers to delete",
|
114022
|
+
type: "string"
|
114023
|
+
});
|
114024
|
+
}
|
114025
|
+
__name(deleteYargs, "deleteYargs");
|
114026
|
+
async function deleteCommand2(deleteArgs, _config) {
|
114027
|
+
await loadAccountSpinner(deleteArgs);
|
114028
|
+
if (!deleteArgs.ID) {
|
114029
|
+
throw new Error(
|
114030
|
+
"You must provide an ID. Use 'wrangler containers list` to view your containers."
|
114031
|
+
);
|
114032
|
+
}
|
114033
|
+
if (deleteArgs.json || !isInteractive2()) {
|
114034
|
+
const container = await ApplicationsService.deleteApplication(
|
114035
|
+
deleteArgs.ID
|
114036
|
+
);
|
114037
|
+
console.log(JSON.stringify(container, null, 4));
|
114038
|
+
return;
|
114039
|
+
}
|
114040
|
+
startSection("Delete your container");
|
114041
|
+
const yes = await inputPrompt({
|
114042
|
+
question: "Are you sure that you want to delete these containers? The associated DO container will lose access to the containers.",
|
114043
|
+
type: "confirm",
|
114044
|
+
label: ""
|
114045
|
+
});
|
114046
|
+
if (!yes) {
|
114047
|
+
cancel("The operation has been cancelled");
|
114048
|
+
return;
|
114049
|
+
}
|
114050
|
+
const [, err] = await wrap2(
|
114051
|
+
ApplicationsService.deleteApplication(deleteArgs.ID)
|
114052
|
+
);
|
114053
|
+
if (err) {
|
114054
|
+
crash(
|
114055
|
+
`There has been an internal error deleting your containers.
|
114056
|
+
${err.message}`
|
114057
|
+
);
|
114058
|
+
return;
|
114059
|
+
}
|
114060
|
+
endSection("Your container has been deleted");
|
114061
|
+
}
|
114062
|
+
__name(deleteCommand2, "deleteCommand");
|
114063
|
+
function infoYargs(args) {
|
114064
|
+
return args.positional("ID", {
|
114065
|
+
describe: "id of the containers to view",
|
114066
|
+
type: "string"
|
114067
|
+
});
|
114068
|
+
}
|
114069
|
+
__name(infoYargs, "infoYargs");
|
114070
|
+
async function infoCommand(infoArgs, _config) {
|
114071
|
+
if (!infoArgs.ID) {
|
114072
|
+
throw new Error(
|
114073
|
+
"You must provide an ID. Use 'wrangler containers list` to view your containers."
|
114074
|
+
);
|
114075
|
+
}
|
114076
|
+
if (infoArgs.json || !isInteractive2()) {
|
114077
|
+
const application2 = ApplicationsService.getApplication(infoArgs.ID);
|
114078
|
+
console.log(JSON.stringify(application2, null, 4));
|
114079
|
+
return;
|
114080
|
+
}
|
114081
|
+
await loadAccountSpinner(infoArgs);
|
114082
|
+
const [application, err] = await wrap2(
|
114083
|
+
ApplicationsService.getApplication(infoArgs.ID)
|
114084
|
+
);
|
114085
|
+
if (err) {
|
114086
|
+
crash(
|
114087
|
+
`There has been an internal error requesting your containers.
|
114088
|
+
${err.message}`
|
114089
|
+
);
|
114090
|
+
return;
|
114091
|
+
}
|
114092
|
+
const details = flatDetails(application);
|
114093
|
+
const applicationDetails = {
|
114094
|
+
label: `${application.name} (${application.created_at})`,
|
114095
|
+
details,
|
114096
|
+
value: application.id
|
114097
|
+
};
|
114098
|
+
await inputPrompt({
|
114099
|
+
type: "list",
|
114100
|
+
question: "Container",
|
114101
|
+
options: [applicationDetails],
|
114102
|
+
label: "Exiting"
|
114103
|
+
});
|
114104
|
+
}
|
114105
|
+
__name(infoCommand, "infoCommand");
|
114106
|
+
function listYargs(args) {
|
114107
|
+
return args;
|
114108
|
+
}
|
114109
|
+
__name(listYargs, "listYargs");
|
114110
|
+
async function listCommand2(listArgs, config) {
|
114111
|
+
if (listArgs.json || !isInteractive2()) {
|
114112
|
+
const applications = await ApplicationsService.listApplications();
|
114113
|
+
console.log(JSON.stringify(applications, null, 4));
|
114114
|
+
return;
|
114115
|
+
}
|
114116
|
+
await listCommandHandle2(listArgs, config);
|
114117
|
+
}
|
114118
|
+
__name(listCommand2, "listCommand");
|
114119
|
+
function flatDetails(obj, indentLevel = 0) {
|
114120
|
+
const indent = " ".repeat(indentLevel);
|
114121
|
+
return Object.entries(obj).reduce((acc, [key, value]) => {
|
114122
|
+
if (value !== void 0 && value !== null && typeof value === "object" && !Array.isArray(value)) {
|
114123
|
+
acc.push(`${indent}${key}:`);
|
114124
|
+
acc.push(
|
114125
|
+
...flatDetails(value, indentLevel + 1)
|
114126
|
+
);
|
114127
|
+
} else if (value !== void 0) {
|
114128
|
+
acc.push(`${indent}${key}: ${value}`);
|
114129
|
+
}
|
114130
|
+
return acc;
|
114131
|
+
}, []);
|
114132
|
+
}
|
114133
|
+
__name(flatDetails, "flatDetails");
|
114134
|
+
async function listCommandHandle2(_args, _config) {
|
114135
|
+
const keepListIter = true;
|
114136
|
+
while (keepListIter) {
|
114137
|
+
logRaw(gray(shapes.bar));
|
114138
|
+
const { start, stop } = spinner();
|
114139
|
+
start("Loading Containers");
|
114140
|
+
const [applications, err] = await wrap2(
|
114141
|
+
ApplicationsService.listApplications()
|
114142
|
+
);
|
114143
|
+
stop();
|
114144
|
+
if (err) {
|
114145
|
+
crash(
|
114146
|
+
`There has been an internal error listing your containers.
|
114147
|
+
${err.message}`
|
114148
|
+
);
|
114149
|
+
return;
|
114150
|
+
}
|
114151
|
+
const applicationDetails = /* @__PURE__ */ __name((a5) => {
|
114152
|
+
const details = flatDetails(a5);
|
114153
|
+
return {
|
114154
|
+
label: `${a5.name} (${a5.created_at})`,
|
114155
|
+
details,
|
114156
|
+
value: a5.id
|
114157
|
+
};
|
114158
|
+
}, "applicationDetails");
|
114159
|
+
const application = await listContainersAndChoose(applications);
|
114160
|
+
let refresh = false;
|
114161
|
+
await inputPrompt({
|
114162
|
+
type: "list",
|
114163
|
+
question: "Containers",
|
114164
|
+
helpText: "Hit enter to return to your containers or 'r' to refresh",
|
114165
|
+
options: [applicationDetails(application)],
|
114166
|
+
label: "going back",
|
114167
|
+
onRefresh: /* @__PURE__ */ __name(async () => {
|
114168
|
+
start("Refreshing application");
|
114169
|
+
const app = await ApplicationsService.getApplication(application.id);
|
114170
|
+
if (refresh) {
|
114171
|
+
return [];
|
114172
|
+
}
|
114173
|
+
stop();
|
114174
|
+
if (app) {
|
114175
|
+
const details = applicationDetails(app);
|
114176
|
+
details.label += ", last refresh: " + (/* @__PURE__ */ new Date()).toLocaleString();
|
114177
|
+
return [details];
|
114178
|
+
}
|
114179
|
+
return app;
|
114180
|
+
}, "onRefresh")
|
114181
|
+
});
|
114182
|
+
refresh = true;
|
114183
|
+
stop();
|
114184
|
+
}
|
114185
|
+
}
|
114186
|
+
__name(listCommandHandle2, "listCommandHandle");
|
114187
|
+
async function listContainersAndChoose(applications) {
|
114188
|
+
const getLabels = /* @__PURE__ */ __name((a5) => {
|
114189
|
+
const labels = a5.configuration.labels ?? [];
|
114190
|
+
if (!labels || labels.length == 0) {
|
114191
|
+
return [];
|
114192
|
+
}
|
114193
|
+
const out = labels.map((l6) => ` ${dim(l6.name)}: ${dim(l6.value)}`);
|
114194
|
+
return `Labels:
|
114195
|
+
` + out.join(",\n");
|
114196
|
+
}, "getLabels");
|
114197
|
+
const application = await processArgument({}, "applicationId", {
|
114198
|
+
type: "list",
|
114199
|
+
question: "Your Containers",
|
114200
|
+
helpText: "Get more information by selecting a container with the enter/return key",
|
114201
|
+
options: applications.map((i5) => ({
|
114202
|
+
label: i5.name,
|
114203
|
+
value: i5.id,
|
114204
|
+
details: [
|
114205
|
+
`Id: ${dim(`${i5.id}`)}`,
|
114206
|
+
`Instances: ${dim(`${i5.instances}`)}`,
|
114207
|
+
`Image: ${dim(i5.configuration.image)}`,
|
114208
|
+
...getLabels(i5) ?? []
|
114209
|
+
]
|
114210
|
+
})),
|
114211
|
+
label: "container"
|
114212
|
+
});
|
114213
|
+
return applications.find((a5) => a5.id === application);
|
114214
|
+
}
|
114215
|
+
__name(listContainersAndChoose, "listContainersAndChoose");
|
114216
|
+
|
114217
|
+
// src/containers/index.ts
|
114005
114218
|
var containers = /* @__PURE__ */ __name((yargs, subHelp) => {
|
114006
114219
|
return yargs.command(
|
114007
114220
|
"build [PATH]",
|
@@ -114017,6 +114230,21 @@ var containers = /* @__PURE__ */ __name((yargs, subHelp) => {
|
|
114017
114230
|
"images",
|
114018
114231
|
"perform operations on images in your Cloudflare managed registry",
|
114019
114232
|
(args) => imagesCommand(args).command(subHelp)
|
114233
|
+
).command(
|
114234
|
+
"info [ID]",
|
114235
|
+
"get information about a specific container",
|
114236
|
+
(args) => infoYargs(args),
|
114237
|
+
(args) => handleFailure(infoCommand)(args)
|
114238
|
+
).command(
|
114239
|
+
"list",
|
114240
|
+
"list containers",
|
114241
|
+
(args) => listYargs(args),
|
114242
|
+
(args) => handleFailure(listCommand2)(args)
|
114243
|
+
).command(
|
114244
|
+
"delete [ID]",
|
114245
|
+
"delete a container",
|
114246
|
+
(args) => deleteYargs(args),
|
114247
|
+
(args) => handleFailure(deleteCommand2)(args)
|
114020
114248
|
);
|
114021
114249
|
}, "containers");
|
114022
114250
|
|
@@ -144685,6 +144913,18 @@ var loginCommand = createCommand({
|
|
144685
144913
|
array: true,
|
144686
144914
|
type: "string",
|
144687
144915
|
requiresArg: true
|
144916
|
+
},
|
144917
|
+
"callback-host": {
|
144918
|
+
describe: "Use the ip or host address for the temporary login callback server.",
|
144919
|
+
type: "string",
|
144920
|
+
requiresArg: false,
|
144921
|
+
default: "localhost"
|
144922
|
+
},
|
144923
|
+
"callback-port": {
|
144924
|
+
describe: "Use the port for the temporary login callback server.",
|
144925
|
+
type: "number",
|
144926
|
+
requiresArg: false,
|
144927
|
+
default: 8976
|
144688
144928
|
}
|
144689
144929
|
},
|
144690
144930
|
async handler(args, { config }) {
|
@@ -144702,10 +144942,19 @@ var loginCommand = createCommand({
|
|
144702
144942
|
`One of ${args.scopes} is not a valid authentication scope. Run "wrangler login --scopes-list" to see the valid scopes.`
|
144703
144943
|
);
|
144704
144944
|
}
|
144705
|
-
await login({
|
144945
|
+
await login({
|
144946
|
+
scopes: args.scopes,
|
144947
|
+
browser: args.browser,
|
144948
|
+
callbackHost: args.callbackHost,
|
144949
|
+
callbackPort: args.callbackPort
|
144950
|
+
});
|
144706
144951
|
return;
|
144707
144952
|
}
|
144708
|
-
await login({
|
144953
|
+
await login({
|
144954
|
+
browser: args.browser,
|
144955
|
+
callbackHost: args.callbackHost,
|
144956
|
+
callbackPort: args.callbackPort
|
144957
|
+
});
|
144709
144958
|
sendMetricsEvent("login user", {
|
144710
144959
|
sendMetrics: config.send_metrics
|
144711
144960
|
});
|
@@ -144753,6 +145002,12 @@ var whoamiCommand = createCommand({
|
|
144753
145002
|
// src/utils/logPossibleBugMessage.ts
|
144754
145003
|
init_import_meta_url();
|
144755
145004
|
async function logPossibleBugMessage() {
|
145005
|
+
if (process.versions.bun) {
|
145006
|
+
logger.warn(
|
145007
|
+
`Wrangler does not support the Bun runtime. Please try this command again using Node.js via \`npm\` or \`pnpm\`. Alternatively, make sure you're not passing the \`--bun\` flag when running \`bun run wrangler ...\``
|
145008
|
+
);
|
145009
|
+
return;
|
145010
|
+
}
|
144756
145011
|
logger.log(
|
144757
145012
|
`${fgGreenColor}%s${resetColor}`,
|
144758
145013
|
"If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose"
|