wrangler 4.103.0 → 4.104.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 +9 -9
- package/wrangler-dist/cli.d.ts +9 -37
- package/wrangler-dist/cli.js +57 -58
- 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.104.0",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assembly",
|
|
@@ -66,16 +66,16 @@
|
|
|
66
66
|
"esbuild": "0.28.1",
|
|
67
67
|
"path-to-regexp": "6.3.0",
|
|
68
68
|
"unenv": "2.0.0-rc.24",
|
|
69
|
-
"workerd": "1.
|
|
69
|
+
"workerd": "1.20260623.1",
|
|
70
70
|
"@cloudflare/kv-asset-handler": "0.5.0",
|
|
71
71
|
"@cloudflare/unenv-preset": "2.16.1",
|
|
72
|
-
"miniflare": "4.
|
|
72
|
+
"miniflare": "4.20260623.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@aws-sdk/client-s3": "^3.721.0",
|
|
76
76
|
"@bomb.sh/tab": "^0.0.12",
|
|
77
77
|
"@cloudflare/types": "6.18.4",
|
|
78
|
-
"@cloudflare/workers-types": "^4.
|
|
78
|
+
"@cloudflare/workers-types": "^4.20260623.1",
|
|
79
79
|
"@cspotcode/source-map-support": "0.8.1",
|
|
80
80
|
"@netlify/build-info": "^10.5.1",
|
|
81
81
|
"@sentry/node": "^7.86.0",
|
|
@@ -156,21 +156,21 @@
|
|
|
156
156
|
"yaml": "^2.8.1",
|
|
157
157
|
"yargs": "^17.7.2",
|
|
158
158
|
"zod": "^4.4.3",
|
|
159
|
-
"@cloudflare/autoconfig": "0.1.
|
|
160
|
-
"@cloudflare/cli-shared-helpers": "0.1.10",
|
|
159
|
+
"@cloudflare/autoconfig": "0.1.1",
|
|
161
160
|
"@cloudflare/codemod": "1.1.0",
|
|
162
161
|
"@cloudflare/config": "0.0.0",
|
|
162
|
+
"@cloudflare/cli-shared-helpers": "0.1.10",
|
|
163
163
|
"@cloudflare/containers-shared": "0.15.1",
|
|
164
|
-
"@cloudflare/
|
|
164
|
+
"@cloudflare/pages-shared": "^0.13.149",
|
|
165
|
+
"@cloudflare/deploy-helpers": "0.2.3",
|
|
165
166
|
"@cloudflare/workers-auth": "0.3.2",
|
|
166
|
-
"@cloudflare/pages-shared": "^0.13.148",
|
|
167
167
|
"@cloudflare/workers-shared": "0.19.7",
|
|
168
168
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
169
169
|
"@cloudflare/workers-utils": "0.24.0",
|
|
170
170
|
"@cloudflare/workflows-shared": "0.11.2"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
|
-
"@cloudflare/workers-types": "^4.
|
|
173
|
+
"@cloudflare/workers-types": "^4.20260623.1"
|
|
174
174
|
},
|
|
175
175
|
"peerDependenciesMeta": {
|
|
176
176
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -738,7 +738,7 @@ type TestHarnessOptions = {
|
|
|
738
738
|
*/
|
|
739
739
|
workers: WorkerInput[];
|
|
740
740
|
};
|
|
741
|
-
type WorkerHandle = {
|
|
741
|
+
type WorkerHandle<Env = Record<string, any>> = {
|
|
742
742
|
/**
|
|
743
743
|
* Dispatches a fetch event directly to this worker.
|
|
744
744
|
* Relative URL inputs are resolved against the URL returned by `listen()`.
|
|
@@ -765,46 +765,18 @@ type WorkerHandle = {
|
|
|
765
765
|
*/
|
|
766
766
|
scheduled(options: FetcherScheduledOptions): Promise<FetcherScheduledResult>;
|
|
767
767
|
/**
|
|
768
|
-
* Returns
|
|
768
|
+
* Returns the full environment object configured on this Worker, including
|
|
769
|
+
* vars, secrets, and bindings.
|
|
769
770
|
*
|
|
770
771
|
* @example
|
|
771
772
|
* ```ts
|
|
772
|
-
*
|
|
773
|
-
* const
|
|
773
|
+
* type Env = { GREETING: string; STORE: KVNamespace };
|
|
774
|
+
* const worker = server.getWorker<Env>();
|
|
775
|
+
* const env = await worker.getEnv();
|
|
776
|
+
* await env.STORE.put("key", env.GREETING);
|
|
774
777
|
* ```
|
|
775
778
|
*/
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* Returns an R2 bucket binding configured on this Worker.
|
|
779
|
-
*
|
|
780
|
-
* @example
|
|
781
|
-
* ```ts
|
|
782
|
-
* const bucket = await worker.getR2Bucket("BUCKET");
|
|
783
|
-
* const object = await bucket.get("key");
|
|
784
|
-
* ```
|
|
785
|
-
*/
|
|
786
|
-
getR2Bucket(bindingName: string): ReturnType<Miniflare["getR2Bucket"]>;
|
|
787
|
-
/**
|
|
788
|
-
* Returns a D1 database binding configured on this Worker.
|
|
789
|
-
*
|
|
790
|
-
* @example
|
|
791
|
-
* ```ts
|
|
792
|
-
* const db = await worker.getD1Database("DB");
|
|
793
|
-
* const value = await db.prepare("SELECT value FROM entries").first("value");
|
|
794
|
-
* ```
|
|
795
|
-
*/
|
|
796
|
-
getD1Database(bindingName: string): ReturnType<Miniflare["getD1Database"]>;
|
|
797
|
-
/**
|
|
798
|
-
* Returns a Durable Object namespace binding configured on this Worker.
|
|
799
|
-
*
|
|
800
|
-
* @example
|
|
801
|
-
* ```ts
|
|
802
|
-
* const namespace = await worker.getDurableObjectNamespace("OBJECT");
|
|
803
|
-
* const stub = namespace.getByName("counter");
|
|
804
|
-
* const response = await stub.fetch("http://example.com/");
|
|
805
|
-
* ```
|
|
806
|
-
*/
|
|
807
|
-
getDurableObjectNamespace(bindingName: string): ReturnType<Miniflare["getDurableObjectNamespace"]>;
|
|
779
|
+
getEnv(): Promise<Env>;
|
|
808
780
|
};
|
|
809
781
|
type TestHarness = {
|
|
810
782
|
/**
|
|
@@ -853,7 +825,7 @@ type TestHarness = {
|
|
|
853
825
|
* When no name is provided, this returns the primary Worker, which is the first
|
|
854
826
|
* Worker in the server's `workers` options.
|
|
855
827
|
*/
|
|
856
|
-
getWorker(name?: string): WorkerHandle
|
|
828
|
+
getWorker<Env = Record<string, any>>(name?: string): WorkerHandle<Env>;
|
|
857
829
|
/**
|
|
858
830
|
* Returns captured Workers runtime logs since the current server session
|
|
859
831
|
* started or `clearLogs()` was last called.
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -44488,7 +44488,7 @@ var name, version;
|
|
|
44488
44488
|
var init_package = __esm({
|
|
44489
44489
|
"package.json"() {
|
|
44490
44490
|
name = "wrangler";
|
|
44491
|
-
version = "4.
|
|
44491
|
+
version = "4.104.0";
|
|
44492
44492
|
}
|
|
44493
44493
|
});
|
|
44494
44494
|
|
|
@@ -124740,12 +124740,20 @@ var init_types = __esm({
|
|
|
124740
124740
|
});
|
|
124741
124741
|
|
|
124742
124742
|
// ../containers-shared/src/images.ts
|
|
124743
|
+
function getEgressInterceptorPlatform() {
|
|
124744
|
+
return process.env.MINIFLARE_CONTAINER_EGRESS_IMAGE_PLATFORM;
|
|
124745
|
+
}
|
|
124743
124746
|
function getEgressInterceptorImage() {
|
|
124744
124747
|
return process.env.MINIFLARE_CONTAINER_EGRESS_IMAGE ?? DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE;
|
|
124745
124748
|
}
|
|
124746
124749
|
async function pullEgressInterceptorImage(dockerPath) {
|
|
124747
124750
|
const image = getEgressInterceptorImage();
|
|
124748
|
-
|
|
124751
|
+
const platform4 = getEgressInterceptorPlatform();
|
|
124752
|
+
const args = ["pull", image];
|
|
124753
|
+
if (platform4 !== void 0) {
|
|
124754
|
+
args.push("--platform", platform4);
|
|
124755
|
+
}
|
|
124756
|
+
await runDockerCmd(dockerPath, args);
|
|
124749
124757
|
}
|
|
124750
124758
|
async function pullImage(dockerPath, options, logger5) {
|
|
124751
124759
|
const domain3 = new URL(`http://${options.image_uri}`).hostname;
|
|
@@ -124880,6 +124888,7 @@ var init_images2 = __esm({
|
|
|
124880
124888
|
init_registry2();
|
|
124881
124889
|
init_utils3();
|
|
124882
124890
|
DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE = "cloudflare/proxy-everything:3cb1195@sha256:0ef6716c52430096900b150d84a3302057d6cd2319dae7987128c85d0733e3c8";
|
|
124891
|
+
__name(getEgressInterceptorPlatform, "getEgressInterceptorPlatform");
|
|
124883
124892
|
__name(getEgressInterceptorImage, "getEgressInterceptorImage");
|
|
124884
124893
|
__name(pullEgressInterceptorImage, "pullEgressInterceptorImage");
|
|
124885
124894
|
__name(pullImage, "pullImage");
|
|
@@ -158887,16 +158896,19 @@ async function matchFiles(files, relativeTo, { rules, removedRules }) {
|
|
|
158887
158896
|
}
|
|
158888
158897
|
}
|
|
158889
158898
|
}
|
|
158890
|
-
|
|
158891
|
-
for (const
|
|
158892
|
-
const
|
|
158893
|
-
|
|
158894
|
-
|
|
158895
|
-
|
|
158896
|
-
|
|
158897
|
-
|
|
158898
|
-
|
|
158899
|
-
|
|
158899
|
+
if (!moduleNames.has(filePath)) {
|
|
158900
|
+
for (const rule of removedRules) {
|
|
158901
|
+
for (const glob of rule.globs) {
|
|
158902
|
+
const regexp = (0, import_glob_to_regexp.default)(glob, {
|
|
158903
|
+
globstar: true
|
|
158904
|
+
});
|
|
158905
|
+
if (regexp.test(filePath)) {
|
|
158906
|
+
logger2.debug(
|
|
158907
|
+
`Skipping discovered file ${filePath} \u2014 it only matches a shadowed module rule (${JSON.stringify(
|
|
158908
|
+
rule
|
|
158909
|
+
)}). To include this file, add \`fallthrough = true\` to the earlier rule of the same type, or broaden your rule's globs.`
|
|
158910
|
+
);
|
|
158911
|
+
}
|
|
158900
158912
|
}
|
|
158901
158913
|
}
|
|
158902
158914
|
}
|
|
@@ -198494,15 +198506,9 @@ async function registryConfigureCommand(configureArgs, config2) {
|
|
|
198494
198506
|
}
|
|
198495
198507
|
}
|
|
198496
198508
|
let secretStoreId = configureArgs.secretStoreId;
|
|
198497
|
-
let secretName = configureArgs.secretName;
|
|
198498
198509
|
if (configureArgs.secretName) {
|
|
198499
198510
|
validateSecretName(configureArgs.secretName);
|
|
198500
198511
|
}
|
|
198501
|
-
log(`Getting ${registryType.secretType}...
|
|
198502
|
-
`);
|
|
198503
|
-
const privateCredential = await promptForRegistryPrivateCredential(
|
|
198504
|
-
registryType.secretType
|
|
198505
|
-
);
|
|
198506
198512
|
let private_credential;
|
|
198507
198513
|
if (!isFedRAMPHigh) {
|
|
198508
198514
|
log("\nSetting up integration with Secrets Store...\n");
|
|
@@ -198540,20 +198546,42 @@ async function registryConfigureCommand(configureArgs, config2) {
|
|
|
198540
198546
|
}
|
|
198541
198547
|
}
|
|
198542
198548
|
log("\n");
|
|
198543
|
-
secretName = await
|
|
198549
|
+
const { secretName, secretExists } = await resolveSecretSelection({
|
|
198544
198550
|
configureArgs,
|
|
198545
198551
|
config: config2,
|
|
198546
198552
|
accountId,
|
|
198547
198553
|
storeId: secretStoreId,
|
|
198548
|
-
privateCredential,
|
|
198549
198554
|
secretType: registryType.secretType
|
|
198550
198555
|
});
|
|
198556
|
+
if (!secretExists) {
|
|
198557
|
+
log(`Getting ${registryType.secretType}...
|
|
198558
|
+
`);
|
|
198559
|
+
const privateCredential = await promptForRegistryPrivateCredential(
|
|
198560
|
+
registryType.secretType
|
|
198561
|
+
);
|
|
198562
|
+
await promiseSpinner(
|
|
198563
|
+
createSecret(config2, accountId, secretStoreId, {
|
|
198564
|
+
name: secretName,
|
|
198565
|
+
value: privateCredential,
|
|
198566
|
+
scopes: ["containers"],
|
|
198567
|
+
comment: `Created by Wrangler: credentials for image registry ${configureArgs.DOMAIN}`
|
|
198568
|
+
})
|
|
198569
|
+
);
|
|
198570
|
+
log(
|
|
198571
|
+
`Container-scoped secret "${secretName}" created in Secrets Store.
|
|
198572
|
+
`
|
|
198573
|
+
);
|
|
198574
|
+
}
|
|
198551
198575
|
private_credential = {
|
|
198552
198576
|
store_id: secretStoreId,
|
|
198553
198577
|
secret_name: secretName
|
|
198554
198578
|
};
|
|
198555
198579
|
} else {
|
|
198556
|
-
|
|
198580
|
+
log(`Getting ${registryType.secretType}...
|
|
198581
|
+
`);
|
|
198582
|
+
private_credential = await promptForRegistryPrivateCredential(
|
|
198583
|
+
registryType.secretType
|
|
198584
|
+
);
|
|
198557
198585
|
}
|
|
198558
198586
|
try {
|
|
198559
198587
|
await promiseSpinner(
|
|
@@ -198602,7 +198630,7 @@ async function promptForSecretName(secretType) {
|
|
|
198602
198630
|
}
|
|
198603
198631
|
}
|
|
198604
198632
|
}
|
|
198605
|
-
async function
|
|
198633
|
+
async function resolveSecretSelection(options) {
|
|
198606
198634
|
let secretName = options.configureArgs.secretName ?? await promptForSecretName(options.secretType);
|
|
198607
198635
|
while (true) {
|
|
198608
198636
|
const existingSecretId = await getSecretByName(
|
|
@@ -198612,26 +198640,14 @@ async function getOrCreateSecret(options) {
|
|
|
198612
198640
|
secretName
|
|
198613
198641
|
);
|
|
198614
198642
|
if (!existingSecretId) {
|
|
198615
|
-
|
|
198616
|
-
createSecret(options.config, options.accountId, options.storeId, {
|
|
198617
|
-
name: secretName,
|
|
198618
|
-
value: options.privateCredential,
|
|
198619
|
-
scopes: ["containers"],
|
|
198620
|
-
comment: `Created by Wrangler: credentials for image registry ${options.configureArgs.DOMAIN}`
|
|
198621
|
-
})
|
|
198622
|
-
);
|
|
198623
|
-
log(
|
|
198624
|
-
`Container-scoped secret "${secretName}" created in Secrets Store.
|
|
198625
|
-
`
|
|
198626
|
-
);
|
|
198627
|
-
return secretName;
|
|
198643
|
+
return { secretName, secretExists: false };
|
|
198628
198644
|
}
|
|
198629
198645
|
if (options.configureArgs.skipConfirmation) {
|
|
198630
198646
|
log(
|
|
198631
198647
|
`Using existing secret "${secretName}" from secret store with id: ${options.storeId}.
|
|
198632
198648
|
`
|
|
198633
198649
|
);
|
|
198634
|
-
return secretName;
|
|
198650
|
+
return { secretName, secretExists: true };
|
|
198635
198651
|
}
|
|
198636
198652
|
startSection(
|
|
198637
198653
|
`The provided secret name "${secretName}" is already in-use within the secret store. (Store ID: ${options.storeId})`
|
|
@@ -198644,7 +198660,7 @@ async function getOrCreateSecret(options) {
|
|
|
198644
198660
|
`Using existing secret "${secretName}" from secret store with id: ${options.storeId}.
|
|
198645
198661
|
`
|
|
198646
198662
|
);
|
|
198647
|
-
return secretName;
|
|
198663
|
+
return { secretName, secretExists: true };
|
|
198648
198664
|
}
|
|
198649
198665
|
secretName = await promptForSecretName(options.secretType);
|
|
198650
198666
|
}
|
|
@@ -198882,7 +198898,7 @@ var init_registries2 = __esm({
|
|
|
198882
198898
|
};
|
|
198883
198899
|
__name(registryConfigureCommand, "registryConfigureCommand");
|
|
198884
198900
|
__name(promptForSecretName, "promptForSecretName");
|
|
198885
|
-
__name(
|
|
198901
|
+
__name(resolveSecretSelection, "resolveSecretSelection");
|
|
198886
198902
|
__name(promptForRegistryPrivateCredential, "promptForRegistryPrivateCredential");
|
|
198887
198903
|
registryListArgs = {
|
|
198888
198904
|
json: {
|
|
@@ -360786,6 +360802,7 @@ function createTestHarness(options) {
|
|
|
360786
360802
|
);
|
|
360787
360803
|
return dispatchFetch(miniflare, input, init4);
|
|
360788
360804
|
},
|
|
360805
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Untyped test code should be able to use env bindings without casting every property
|
|
360789
360806
|
getWorker(name2) {
|
|
360790
360807
|
return {
|
|
360791
360808
|
async fetch(input, init4) {
|
|
@@ -360820,29 +360837,11 @@ function createTestHarness(options) {
|
|
|
360820
360837
|
const result = await response.json();
|
|
360821
360838
|
return result;
|
|
360822
360839
|
},
|
|
360823
|
-
async
|
|
360824
|
-
const session = await resolveSession();
|
|
360825
|
-
const miniflare = await getRuntimeMiniflare(session);
|
|
360826
|
-
const workerName = resolveWorkerName2(session, name2);
|
|
360827
|
-
return miniflare.getKVNamespace(bindingName, workerName);
|
|
360828
|
-
},
|
|
360829
|
-
async getR2Bucket(bindingName) {
|
|
360830
|
-
const session = await resolveSession();
|
|
360831
|
-
const miniflare = await getRuntimeMiniflare(session);
|
|
360832
|
-
const workerName = resolveWorkerName2(session, name2);
|
|
360833
|
-
return miniflare.getR2Bucket(bindingName, workerName);
|
|
360834
|
-
},
|
|
360835
|
-
async getD1Database(bindingName) {
|
|
360836
|
-
const session = await resolveSession();
|
|
360837
|
-
const miniflare = await getRuntimeMiniflare(session);
|
|
360838
|
-
const workerName = resolveWorkerName2(session, name2);
|
|
360839
|
-
return miniflare.getD1Database(bindingName, workerName);
|
|
360840
|
-
},
|
|
360841
|
-
async getDurableObjectNamespace(bindingName) {
|
|
360840
|
+
async getEnv() {
|
|
360842
360841
|
const session = await resolveSession();
|
|
360843
360842
|
const miniflare = await getRuntimeMiniflare(session);
|
|
360844
360843
|
const workerName = resolveWorkerName2(session, name2);
|
|
360845
|
-
return miniflare.
|
|
360844
|
+
return miniflare.getBindings(workerName);
|
|
360846
360845
|
}
|
|
360847
360846
|
};
|
|
360848
360847
|
},
|