@cloudflare/deploy-helpers 0.9.1 → 0.10.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/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { fetchResult, fetchPagedListResult, logger, confirm, fetchListResult, prompt, select } from './chunk-Z4LB73IF.mjs';
2
2
  export { initDeployHelpersContext } from './chunk-Z4LB73IF.mjs';
3
- import { extractBindingsOfType, isUnsafeBindingType, getBindings, createWorkerUploadForm, moduleTypeMimeType } from './chunk-ZV7SJ2MZ.mjs';
4
- export { convertConfigToBindings, createWorkerUploadForm, extractBindingsOfType, fromMimeType, getBindings, handleUnsafeCapnp, isUnsafeBindingType, moduleTypeMimeType } from './chunk-ZV7SJ2MZ.mjs';
3
+ import { createWorkerUploadForm, moduleTypeMimeType } from './chunk-PXVCTRCA.mjs';
4
+ export { createWorkerUploadForm, fromMimeType, handleUnsafeCapnp, moduleTypeMimeType } from './chunk-PXVCTRCA.mjs';
5
5
  import { __commonJS, __name, __require, __toESM, __export } from './chunk-Q72B4Q5Z.mjs';
6
6
  import assert4 from 'node:assert';
7
7
  import { readFileSync, mkdirSync, writeFileSync, createReadStream } from 'node:fs';
@@ -10,8 +10,10 @@ import path__default, { resolve, isAbsolute, sep, extname } from 'node:path';
10
10
  import url2, { URLSearchParams as URLSearchParams$1 } from 'node:url';
11
11
  import * as cli from '@cloudflare/cli-shared-helpers';
12
12
  import { cancel } from '@cloudflare/cli-shared-helpers';
13
- import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, getBindingTypeFriendlyName, getBindingLocalSupport, assertNever, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, hasDurableObjectExports, getDockerPath, parseNonHyphenedUuid, getWorkersCIBranchName } from '@cloudflare/workers-utils';
13
+ import { UserError as UserError$1 } from '@cloudflare/workers-utils/errors';
14
14
  import { execSync, spawn } from 'node:child_process';
15
+ import '@cloudflare/workers-utils/compliance';
16
+ import { INHERIT_SYMBOL, APIError, UserError, getEnvironmentVariableFactory, isNonInteractiveOrCI, getHostFromRoute, retryOnAPIFailure, ParseError, getComplianceRegionSubdomain, configFileName, formatTime, getSubdomainMixedStateCheckDisabled, LOGGER_LEVELS, SERVICE_TAG_PREFIX, ENVIRONMENT_TAG_PREFIX, getDurableObjectExports, partitionExports, getWranglerTmpDir, parsePackageJSON, getInstalledPackageVersion, FatalError, readFileSync as readFileSync$1, parseJSON, printBindings, experimental_readRawConfig, experimental_patchConfig, PatchConfigError, COMPLIANCE_REGION_CONFIG_UNKNOWN, constructWranglerConfig, getCIMatchTag, formatConfigSnippet, DEFAULT_COMPAT_DATE, writeOutput, getBindings, hasDurableObjectExports, getDockerPath, parseNonHyphenedUuid, getWorkersCIBranchName, getBindingTypeFriendlyName } from '@cloudflare/workers-utils';
15
17
  import { Response, FormData } from 'undici';
16
18
  import chalk6 from 'chalk';
17
19
  import PQueue from 'p-queue';
@@ -24,7 +26,6 @@ import { gzipSync } from 'node:zlib';
24
26
  import { brandColor, white, gray, bold, yellow, dim, red, blue } from '@cloudflare/cli-shared-helpers/colors';
25
27
  import readline from 'node:readline';
26
28
  import { parse as parse$1 } from 'dotenv';
27
- import { stripVTControlCharacters } from 'node:util';
28
29
  import { getFreshSourceMapSupport, getNodeCompat } from 'miniflare';
29
30
  import { createHash } from 'node:crypto';
30
31
 
@@ -2939,7 +2940,7 @@ var runDockerCmd = /* @__PURE__ */ __name((dockerPath, args, stdio) => {
2939
2940
  } else if (!errorHandled) {
2940
2941
  errorHandled = true;
2941
2942
  reject(
2942
- new UserError(`Docker command exited with code: ${code}`, {
2943
+ new UserError$1(`Docker command exited with code: ${code}`, {
2943
2944
  telemetryMessage: false
2944
2945
  })
2945
2946
  );
@@ -2949,7 +2950,7 @@ var runDockerCmd = /* @__PURE__ */ __name((dockerPath, args, stdio) => {
2949
2950
  if (!errorHandled) {
2950
2951
  errorHandled = true;
2951
2952
  reject(
2952
- new UserError(`Docker command failed: ${err.message}`, {
2953
+ new UserError$1(`Docker command failed: ${err.message}`, {
2953
2954
  telemetryMessage: false
2954
2955
  })
2955
2956
  );
@@ -2987,7 +2988,7 @@ var verifyDockerInstalled = /* @__PURE__ */ __name(async ({
2987
2988
  }) => {
2988
2989
  const dockerIsRunning = await isDockerRunning(dockerPath);
2989
2990
  if (!dockerIsRunning) {
2990
- throw new UserError(
2991
+ throw new UserError$1(
2991
2992
  getFailedToRunDockerErrorMessage({
2992
2993
  operation,
2993
2994
  imageNoun,
@@ -6546,8 +6547,7 @@ async function getSize(modules) {
6546
6547
  return { size: aggregateSize, gzipSize };
6547
6548
  }
6548
6549
  __name(getSize, "getSize");
6549
- async function printBundleSize(main, modules) {
6550
- const { size, gzipSize } = await getSize([...modules, main]);
6550
+ function printBundleSize({ size, gzipSize }) {
6551
6551
  const bundleReport = `${(size / ONE_KIB_BYTES).toFixed(2)} KiB / gzip: ${(gzipSize / ONE_KIB_BYTES).toFixed(2)} KiB`;
6552
6552
  const percentage = gzipSize / MAX_GZIP_SIZE_BYTES * 100;
6553
6553
  const colorizedReport = percentage > 90 ? chalk6.red(bundleReport) : percentage > 70 ? chalk6.yellow(bundleReport) : chalk6.green(bundleReport);
@@ -7281,839 +7281,6 @@ function parseConfigPlacement(config2) {
7281
7281
  }
7282
7282
  }
7283
7283
  __name(parseConfigPlacement, "parseConfigPlacement");
7284
- var isConnectedStatusExplained = false;
7285
- function printBindings(bindings, tailConsumers = [], streamingTailConsumers = [], containers = [], context = {}) {
7286
- let hasConnectionStatus = false;
7287
- const log2 = context.log ?? logger.log;
7288
- const isMultiWorker = context.isMultiWorker ?? false;
7289
- const getMode = createGetMode({
7290
- isProvisioning: context.provisioning,
7291
- isLocalDev: context.local
7292
- });
7293
- const truncate = /* @__PURE__ */ __name((item, maxLength = 40) => {
7294
- const s = typeof item === "string" ? item : JSON.stringify(item);
7295
- if (s.length < maxLength) {
7296
- return s;
7297
- }
7298
- return `${s.substring(0, maxLength - 3)}...`;
7299
- }, "truncate");
7300
- const output = [];
7301
- const data_blobs = extractBindingsOfType("data_blob", bindings);
7302
- const durable_objects = extractBindingsOfType(
7303
- "durable_object_namespace",
7304
- bindings
7305
- );
7306
- const workflows = extractBindingsOfType("workflow", bindings);
7307
- const kv_namespaces = extractBindingsOfType("kv_namespace", bindings);
7308
- const send_email = extractBindingsOfType("send_email", bindings);
7309
- const queues = extractBindingsOfType("queue", bindings);
7310
- const d1_databases = extractBindingsOfType("d1", bindings);
7311
- const vectorize = extractBindingsOfType("vectorize", bindings);
7312
- const ai_search_namespaces = extractBindingsOfType(
7313
- "ai_search_namespace",
7314
- bindings
7315
- );
7316
- const ai_search = extractBindingsOfType("ai_search", bindings);
7317
- const websearch = extractBindingsOfType("websearch", bindings);
7318
- const agent_memory = extractBindingsOfType("agent_memory", bindings);
7319
- const hyperdrive = extractBindingsOfType("hyperdrive", bindings);
7320
- const r2_buckets = extractBindingsOfType("r2_bucket", bindings);
7321
- const logfwdr = extractBindingsOfType("logfwdr", bindings);
7322
- const secrets_store_secrets = extractBindingsOfType(
7323
- "secrets_store_secret",
7324
- bindings
7325
- );
7326
- const artifacts = extractBindingsOfType("artifacts", bindings);
7327
- const services = extractBindingsOfType("service", bindings);
7328
- const vpc_services = extractBindingsOfType("vpc_service", bindings);
7329
- const vpc_networks = extractBindingsOfType("vpc_network", bindings);
7330
- const analytics_engine_datasets = extractBindingsOfType(
7331
- "analytics_engine",
7332
- bindings
7333
- );
7334
- const text_blobs = extractBindingsOfType("text_blob", bindings);
7335
- const browser = extractBindingsOfType("browser", bindings);
7336
- const images = extractBindingsOfType("images", bindings);
7337
- const stream = extractBindingsOfType("stream", bindings);
7338
- const ai = extractBindingsOfType("ai", bindings);
7339
- const version_metadata = extractBindingsOfType("version_metadata", bindings);
7340
- const vars = Object.entries(bindings ?? {}).filter(
7341
- ([_, binding]) => binding.type === "plain_text" || binding.type === "json" || binding.type === "secret_text"
7342
- ).map(([name, binding]) => ({
7343
- binding: name,
7344
- ...binding
7345
- }));
7346
- const wasm_modules = extractBindingsOfType("wasm_module", bindings);
7347
- const dispatch_namespaces = extractBindingsOfType(
7348
- "dispatch_namespace",
7349
- bindings
7350
- );
7351
- const mtls_certificates = extractBindingsOfType("mtls_certificate", bindings);
7352
- const pipelines = extractBindingsOfType("pipeline", bindings);
7353
- const ratelimits = extractBindingsOfType("ratelimit", bindings);
7354
- const assets = extractBindingsOfType("assets", bindings);
7355
- const unsafe_hello_world = extractBindingsOfType(
7356
- "unsafe_hello_world",
7357
- bindings
7358
- );
7359
- const flagship = extractBindingsOfType("flagship", bindings);
7360
- const media = extractBindingsOfType("media", bindings);
7361
- const worker_loaders = extractBindingsOfType("worker_loader", bindings);
7362
- const unsafe_bindings = Object.entries(bindings ?? {}).filter(
7363
- ([_, binding]) => isUnsafeBindingType(binding.type) && binding.type !== "unsafe_hello_world"
7364
- ).map(([name, binding]) => ({ name, ...binding }));
7365
- if (data_blobs.length > 0) {
7366
- output.push(
7367
- ...data_blobs.map(({ binding, source }) => ({
7368
- name: binding,
7369
- type: getBindingTypeFriendlyName("data_blob"),
7370
- value: "contents" in source ? "<Buffer>" : truncate(source.path),
7371
- mode: getMode({ isSimulatedLocally: true })
7372
- }))
7373
- );
7374
- }
7375
- if (durable_objects.length > 0) {
7376
- output.push(
7377
- ...durable_objects.map(({ name, class_name, script_name }) => {
7378
- let value = class_name;
7379
- let mode = void 0;
7380
- if (script_name) {
7381
- if (context.local && context.registry !== null) {
7382
- const registryDefinition = context.registry?.[script_name];
7383
- hasConnectionStatus = true;
7384
- if (registryDefinition && registryDefinition.debugPortAddress) {
7385
- value += `, defined in ${script_name}`;
7386
- mode = getMode({ isSimulatedLocally: true, connected: true });
7387
- } else {
7388
- value += `, defined in ${script_name}`;
7389
- mode = getMode({ isSimulatedLocally: true, connected: false });
7390
- }
7391
- } else {
7392
- value += `, defined in ${script_name}`;
7393
- mode = getMode({ isSimulatedLocally: true });
7394
- }
7395
- } else {
7396
- mode = getMode({ isSimulatedLocally: true });
7397
- }
7398
- return {
7399
- name,
7400
- type: getBindingTypeFriendlyName("durable_object_namespace"),
7401
- value,
7402
- mode
7403
- };
7404
- })
7405
- );
7406
- }
7407
- if (workflows.length > 0) {
7408
- output.push(
7409
- ...workflows.map(({ class_name, script_name, binding }) => {
7410
- let value = class_name;
7411
- if (script_name) {
7412
- value += ` (defined in ${script_name})`;
7413
- }
7414
- return {
7415
- name: binding,
7416
- type: getBindingTypeFriendlyName("workflow"),
7417
- value,
7418
- mode: getMode({
7419
- isSimulatedLocally: true
7420
- })
7421
- };
7422
- })
7423
- );
7424
- }
7425
- if (kv_namespaces.length > 0) {
7426
- output.push(
7427
- ...kv_namespaces.map(({ binding, id, remote }) => {
7428
- return {
7429
- name: binding,
7430
- type: getBindingTypeFriendlyName("kv_namespace"),
7431
- value: id,
7432
- mode: getMode({
7433
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7434
- })
7435
- };
7436
- })
7437
- );
7438
- }
7439
- if (send_email.length > 0) {
7440
- output.push(
7441
- ...send_email.map((emailBinding) => {
7442
- const destination_address = "destination_address" in emailBinding ? emailBinding.destination_address : void 0;
7443
- const allowed_destination_addresses = "allowed_destination_addresses" in emailBinding ? emailBinding.allowed_destination_addresses : void 0;
7444
- const allowed_sender_addresses = "allowed_sender_addresses" in emailBinding ? emailBinding.allowed_sender_addresses : void 0;
7445
- let value = destination_address || allowed_destination_addresses?.join(", ") || "unrestricted";
7446
- if (allowed_sender_addresses) {
7447
- value += ` - senders: ${allowed_sender_addresses.join(", ")}`;
7448
- }
7449
- return {
7450
- name: emailBinding.name,
7451
- type: getBindingTypeFriendlyName("send_email"),
7452
- value,
7453
- mode: getMode({
7454
- isSimulatedLocally: context.remoteBindingsDisabled || !emailBinding.remote
7455
- })
7456
- };
7457
- })
7458
- );
7459
- }
7460
- if (queues.length > 0) {
7461
- output.push(
7462
- ...queues.map(({ binding, queue_name, remote }) => {
7463
- return {
7464
- name: binding,
7465
- type: getBindingTypeFriendlyName("queue"),
7466
- value: queue_name,
7467
- mode: getMode({
7468
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7469
- })
7470
- };
7471
- })
7472
- );
7473
- }
7474
- if (d1_databases.length > 0) {
7475
- output.push(
7476
- ...d1_databases.map(
7477
- ({
7478
- binding,
7479
- database_name,
7480
- database_id,
7481
- preview_database_id,
7482
- remote
7483
- }) => {
7484
- const value = typeof database_id == "symbol" ? database_id : preview_database_id ?? database_name ?? database_id;
7485
- return {
7486
- name: binding,
7487
- type: getBindingTypeFriendlyName("d1"),
7488
- mode: getMode({
7489
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7490
- }),
7491
- value
7492
- };
7493
- }
7494
- )
7495
- );
7496
- }
7497
- if (vectorize.length > 0) {
7498
- output.push(
7499
- ...vectorize.map(({ binding, index_name, remote }) => {
7500
- return {
7501
- name: binding,
7502
- type: getBindingTypeFriendlyName("vectorize"),
7503
- value: index_name,
7504
- mode: getMode({
7505
- isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
7506
- })
7507
- };
7508
- })
7509
- );
7510
- }
7511
- if (ai_search_namespaces.length > 0) {
7512
- output.push(
7513
- ...ai_search_namespaces.map(({ binding, namespace }) => ({
7514
- name: binding,
7515
- type: getBindingTypeFriendlyName("ai_search_namespace"),
7516
- // Preserve `namespace` as-is so `typeof === "symbol"` handling
7517
- // downstream can render INHERIT_SYMBOL as `"inherited"`. Using
7518
- // `String(namespace)` would stringify it to
7519
- // `"Symbol(inherit_binding)"` and defeat that check.
7520
- value: namespace ?? void 0,
7521
- mode: getMode({ isSimulatedLocally: false })
7522
- }))
7523
- );
7524
- }
7525
- if (ai_search.length > 0) {
7526
- output.push(
7527
- ...ai_search.map(({ binding, instance_name }) => ({
7528
- name: binding,
7529
- type: getBindingTypeFriendlyName("ai_search"),
7530
- value: instance_name ? String(instance_name) : void 0,
7531
- mode: getMode({ isSimulatedLocally: false })
7532
- }))
7533
- );
7534
- }
7535
- if (websearch.length > 0) {
7536
- output.push(
7537
- ...websearch.map(({ binding }) => ({
7538
- name: binding,
7539
- type: getBindingTypeFriendlyName("websearch"),
7540
- value: void 0,
7541
- mode: getMode({ isSimulatedLocally: false })
7542
- }))
7543
- );
7544
- }
7545
- if (agent_memory.length > 0) {
7546
- output.push(
7547
- ...agent_memory.map(({ binding, namespace }) => ({
7548
- name: binding,
7549
- type: getBindingTypeFriendlyName("agent_memory"),
7550
- value: namespace ?? void 0,
7551
- mode: getMode({ isSimulatedLocally: false })
7552
- }))
7553
- );
7554
- }
7555
- if (hyperdrive.length > 0) {
7556
- output.push(
7557
- ...hyperdrive.map(({ binding, id }) => {
7558
- return {
7559
- name: binding,
7560
- type: getBindingTypeFriendlyName("hyperdrive"),
7561
- value: id,
7562
- mode: getMode({ isSimulatedLocally: true })
7563
- };
7564
- })
7565
- );
7566
- }
7567
- if (vpc_services.length > 0) {
7568
- output.push(
7569
- ...vpc_services.map(({ binding, service_id, remote }) => {
7570
- return {
7571
- name: binding,
7572
- type: getBindingTypeFriendlyName("vpc_service"),
7573
- value: service_id,
7574
- mode: getMode({
7575
- isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
7576
- })
7577
- };
7578
- })
7579
- );
7580
- }
7581
- if (vpc_networks.length > 0) {
7582
- output.push(
7583
- ...vpc_networks.map(({ binding, tunnel_id, network_id, remote }) => {
7584
- return {
7585
- name: binding,
7586
- type: getBindingTypeFriendlyName("vpc_network"),
7587
- value: tunnel_id ?? network_id,
7588
- mode: getMode({
7589
- isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
7590
- })
7591
- };
7592
- })
7593
- );
7594
- }
7595
- if (r2_buckets.length > 0) {
7596
- output.push(
7597
- ...r2_buckets.map(({ binding, bucket_name, jurisdiction, remote }) => {
7598
- const value = typeof bucket_name === "symbol" ? bucket_name : bucket_name ? `${bucket_name}${jurisdiction ? ` (${jurisdiction})` : ""}` : void 0;
7599
- return {
7600
- name: binding,
7601
- type: getBindingTypeFriendlyName("r2_bucket"),
7602
- value,
7603
- mode: getMode({
7604
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7605
- })
7606
- };
7607
- })
7608
- );
7609
- }
7610
- if (logfwdr.length > 0) {
7611
- output.push(
7612
- ...logfwdr.map(({ name, destination }) => {
7613
- return {
7614
- name,
7615
- type: getBindingTypeFriendlyName("logfwdr"),
7616
- value: destination,
7617
- mode: getMode()
7618
- };
7619
- })
7620
- );
7621
- }
7622
- if (secrets_store_secrets.length > 0) {
7623
- output.push(
7624
- ...secrets_store_secrets.map(({ binding, store_id, secret_name }) => {
7625
- return {
7626
- name: binding,
7627
- type: getBindingTypeFriendlyName("secrets_store_secret"),
7628
- value: `${store_id}/${secret_name}`,
7629
- mode: getMode({ isSimulatedLocally: true })
7630
- };
7631
- })
7632
- );
7633
- }
7634
- if (artifacts.length > 0) {
7635
- output.push(
7636
- ...artifacts.map(({ binding, namespace }) => {
7637
- return {
7638
- name: binding,
7639
- type: getBindingTypeFriendlyName("artifacts"),
7640
- value: namespace,
7641
- mode: getMode({ isSimulatedLocally: false })
7642
- };
7643
- })
7644
- );
7645
- }
7646
- if (unsafe_hello_world.length > 0) {
7647
- output.push(
7648
- ...unsafe_hello_world.map(({ binding, enable_timer }) => {
7649
- return {
7650
- name: binding,
7651
- type: getBindingTypeFriendlyName("unsafe_hello_world"),
7652
- value: enable_timer ? `Timer enabled` : `Timer disabled`,
7653
- mode: getMode({ isSimulatedLocally: true })
7654
- };
7655
- })
7656
- );
7657
- }
7658
- if (flagship.length > 0) {
7659
- output.push(
7660
- ...flagship.map(({ binding, app_id }) => {
7661
- return {
7662
- name: binding,
7663
- type: getBindingTypeFriendlyName("flagship"),
7664
- value: app_id,
7665
- mode: getMode({
7666
- isSimulatedLocally: !context.remoteBindingsDisabled ? false : void 0
7667
- })
7668
- };
7669
- })
7670
- );
7671
- }
7672
- if (services.length > 0) {
7673
- output.push(
7674
- ...services.map(({ binding, service, entrypoint, remote, dev }) => {
7675
- let value = service;
7676
- let mode = void 0;
7677
- if (entrypoint) {
7678
- value += `#${entrypoint}`;
7679
- }
7680
- if (dev !== void 0 && context.local) {
7681
- mode = getMode({ isSimulatedLocally: true });
7682
- } else if (remote) {
7683
- mode = getMode({ isSimulatedLocally: false });
7684
- } else if (context.local && context.registry !== null) {
7685
- const isSelfBinding = service === context.name;
7686
- if (isSelfBinding) {
7687
- hasConnectionStatus = true;
7688
- mode = getMode({ isSimulatedLocally: true, connected: true });
7689
- } else {
7690
- const registryDefinition = context.registry?.[service];
7691
- hasConnectionStatus = true;
7692
- if (registryDefinition && registryDefinition.debugPortAddress) {
7693
- mode = getMode({ isSimulatedLocally: true, connected: true });
7694
- } else {
7695
- mode = getMode({ isSimulatedLocally: true, connected: false });
7696
- }
7697
- }
7698
- }
7699
- return {
7700
- name: binding,
7701
- type: getBindingTypeFriendlyName("service"),
7702
- value,
7703
- mode
7704
- };
7705
- })
7706
- );
7707
- }
7708
- if (analytics_engine_datasets.length > 0) {
7709
- output.push(
7710
- ...analytics_engine_datasets.map(({ binding, dataset }) => {
7711
- return {
7712
- name: binding,
7713
- type: getBindingTypeFriendlyName("analytics_engine"),
7714
- value: dataset ?? binding,
7715
- mode: getMode({ isSimulatedLocally: true })
7716
- };
7717
- })
7718
- );
7719
- }
7720
- if (text_blobs.length > 0) {
7721
- output.push(
7722
- ...text_blobs.map(({ binding, source }) => ({
7723
- name: binding,
7724
- type: getBindingTypeFriendlyName("text_blob"),
7725
- value: "contents" in source ? truncate(source.contents) : "path" in source ? truncate(source.path) : void 0,
7726
- mode: getMode({ isSimulatedLocally: true })
7727
- }))
7728
- );
7729
- }
7730
- if (browser.length > 0) {
7731
- output.push(
7732
- ...browser.map(({ binding, remote }) => ({
7733
- name: binding,
7734
- type: getBindingTypeFriendlyName("browser"),
7735
- value: void 0,
7736
- mode: getMode({
7737
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7738
- })
7739
- }))
7740
- );
7741
- }
7742
- if (images.length > 0) {
7743
- output.push(
7744
- ...images.map(({ binding, remote }) => ({
7745
- name: binding,
7746
- type: getBindingTypeFriendlyName("images"),
7747
- value: void 0,
7748
- mode: getMode({
7749
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7750
- })
7751
- }))
7752
- );
7753
- }
7754
- if (stream.length > 0) {
7755
- output.push(
7756
- ...stream.map(({ binding, remote }) => ({
7757
- name: binding,
7758
- type: getBindingTypeFriendlyName("stream"),
7759
- value: void 0,
7760
- mode: getMode({
7761
- isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
7762
- })
7763
- }))
7764
- );
7765
- }
7766
- if (media.length > 0) {
7767
- output.push(
7768
- ...media.map(({ binding, remote }) => ({
7769
- name: binding,
7770
- type: getBindingTypeFriendlyName("media"),
7771
- value: void 0,
7772
- mode: getMode({
7773
- isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
7774
- })
7775
- }))
7776
- );
7777
- }
7778
- if (ai.length > 0) {
7779
- output.push(
7780
- ...ai.map(({ binding, staging, remote }) => ({
7781
- name: binding,
7782
- type: getBindingTypeFriendlyName("ai"),
7783
- value: staging ? `staging` : void 0,
7784
- mode: getMode({
7785
- isSimulatedLocally: (remote === true || remote === void 0) && !context.remoteBindingsDisabled ? false : void 0
7786
- })
7787
- }))
7788
- );
7789
- }
7790
- if (pipelines.length > 0) {
7791
- output.push(
7792
- ...pipelines.map(
7793
- ({ binding, stream: pipelineStream, pipeline, remote }) => ({
7794
- name: binding,
7795
- type: getBindingTypeFriendlyName("pipeline"),
7796
- value: pipelineStream || pipeline,
7797
- mode: getMode({
7798
- isSimulatedLocally: context.remoteBindingsDisabled || !remote
7799
- })
7800
- })
7801
- )
7802
- );
7803
- }
7804
- if (ratelimits.length > 0) {
7805
- output.push(
7806
- ...ratelimits.map(({ name, simple }) => ({
7807
- name,
7808
- type: getBindingTypeFriendlyName("ratelimit"),
7809
- value: `${simple.limit} requests/${simple.period}s`,
7810
- mode: getMode({ isSimulatedLocally: true })
7811
- }))
7812
- );
7813
- }
7814
- if (assets.length > 0) {
7815
- output.push(
7816
- ...assets.map(({ binding }) => ({
7817
- name: binding,
7818
- type: getBindingTypeFriendlyName("assets"),
7819
- value: void 0,
7820
- mode: getMode({ isSimulatedLocally: true })
7821
- }))
7822
- );
7823
- }
7824
- if (version_metadata.length > 0) {
7825
- output.push(
7826
- ...version_metadata.map(({ binding }) => ({
7827
- name: binding,
7828
- type: getBindingTypeFriendlyName("version_metadata"),
7829
- value: void 0,
7830
- mode: getMode({ isSimulatedLocally: true })
7831
- }))
7832
- );
7833
- }
7834
- if (unsafe_bindings.length > 0) {
7835
- output.push(
7836
- ...unsafe_bindings.map((binding) => {
7837
- const dev = "dev" in binding ? binding.dev : void 0;
7838
- const originalType = binding.type.slice("unsafe_".length);
7839
- return {
7840
- name: binding.name,
7841
- type: dev ? dev.plugin.name : getBindingTypeFriendlyName(binding.type),
7842
- value: originalType,
7843
- mode: getMode({
7844
- isSimulatedLocally: !!dev
7845
- })
7846
- };
7847
- })
7848
- );
7849
- }
7850
- if (vars.length > 0) {
7851
- output.push(
7852
- ...vars.map((variable) => {
7853
- const { binding, type: varType, value: varValue } = variable;
7854
- let parsedValue;
7855
- if (varType === "plain_text" && variable.hidden !== true) {
7856
- parsedValue = `"${truncate(varValue)}"`;
7857
- } else if (varType === "json") {
7858
- parsedValue = truncate(JSON.stringify(varValue));
7859
- } else {
7860
- parsedValue = `"(hidden)"`;
7861
- }
7862
- return {
7863
- name: binding,
7864
- type: getBindingTypeFriendlyName(varType),
7865
- value: parsedValue,
7866
- mode: getMode({ isSimulatedLocally: true })
7867
- };
7868
- })
7869
- );
7870
- }
7871
- if (wasm_modules.length > 0) {
7872
- output.push(
7873
- ...wasm_modules.map(({ binding, source }) => ({
7874
- name: binding,
7875
- type: getBindingTypeFriendlyName("wasm_module"),
7876
- value: "contents" in source ? "<Wasm>" : truncate(source.path),
7877
- mode: getMode({ isSimulatedLocally: true })
7878
- }))
7879
- );
7880
- }
7881
- if (dispatch_namespaces.length > 0) {
7882
- output.push(
7883
- ...dispatch_namespaces.map(({ binding, namespace, outbound, remote }) => {
7884
- return {
7885
- name: binding,
7886
- type: getBindingTypeFriendlyName("dispatch_namespace"),
7887
- value: typeof namespace === "symbol" ? namespace : outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace,
7888
- mode: getMode({
7889
- isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
7890
- })
7891
- };
7892
- })
7893
- );
7894
- }
7895
- if (mtls_certificates.length > 0) {
7896
- output.push(
7897
- ...mtls_certificates.map(({ binding, certificate_id, remote }) => {
7898
- return {
7899
- name: binding,
7900
- type: getBindingTypeFriendlyName("mtls_certificate"),
7901
- value: certificate_id,
7902
- mode: getMode({
7903
- isSimulatedLocally: remote && !context.remoteBindingsDisabled ? false : void 0
7904
- })
7905
- };
7906
- })
7907
- );
7908
- }
7909
- if (worker_loaders.length > 0) {
7910
- output.push(
7911
- ...worker_loaders.map(({ binding }) => ({
7912
- name: binding,
7913
- type: getBindingTypeFriendlyName("worker_loader"),
7914
- value: void 0,
7915
- mode: getMode({ isSimulatedLocally: true })
7916
- }))
7917
- );
7918
- }
7919
- if (output.length === 0) {
7920
- if (context.warnIfNoBindings) {
7921
- if (context.name && isMultiWorker) {
7922
- log2(`No bindings found for ${chalk6.blue(context.name)}`);
7923
- } else {
7924
- log2("No bindings found.");
7925
- }
7926
- }
7927
- } else {
7928
- let title2;
7929
- if (context.provisioning) {
7930
- title2 = "The following bindings need to be provisioned:";
7931
- } else if (context.name && isMultiWorker) {
7932
- title2 = `${chalk6.blue(context.name)} has access to the following bindings:`;
7933
- } else {
7934
- title2 = "Your Worker has access to the following bindings:";
7935
- }
7936
- const headings = {
7937
- binding: "Binding",
7938
- resource: "Resource",
7939
- mode: "Mode"
7940
- };
7941
- const maxValueLength = Math.max(
7942
- ...output.map(
7943
- (b) => typeof b.value === "symbol" ? "inherited".length : b.value?.length ?? 0
7944
- )
7945
- );
7946
- const maxNameLength = Math.max(...output.map((b) => b.name.length));
7947
- const maxTypeLength = Math.max(
7948
- ...output.map((b) => b.type.length),
7949
- headings.resource.length
7950
- );
7951
- const maxModeLength = Math.max(
7952
- ...output.map(
7953
- (b) => b.mode ? stripVTControlCharacters(b.mode).length : headings.mode.length
7954
- )
7955
- );
7956
- const hasMode = output.some((b) => b.mode);
7957
- const bindingPrefix = `env.`;
7958
- const bindingLength = bindingPrefix.length + maxNameLength + " (".length + maxValueLength + ")".length;
7959
- const columnGapSpaces = 6;
7960
- const columnGapSpacesWrapped = 4;
7961
- const shouldWrap = bindingLength + columnGapSpaces + maxTypeLength + columnGapSpaces + maxModeLength >= process.stdout.columns;
7962
- log2(title2);
7963
- const columnGap = shouldWrap ? " ".repeat(columnGapSpacesWrapped) : " ".repeat(columnGapSpaces);
7964
- log2(
7965
- `${padEndAnsi(dim(headings.binding), shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength)}${columnGap}${padEndAnsi(dim(headings.resource), maxTypeLength)}${columnGap}${hasMode ? dim(headings.mode) : ""}`
7966
- );
7967
- for (const binding of output) {
7968
- const bindingValue = dim(
7969
- typeof binding.value === "symbol" ? chalk6.italic("inherited") : binding.value ?? ""
7970
- );
7971
- const bindingString = padEndAnsi(
7972
- `${white(`env.${binding.name}`)}${binding.value && !shouldWrap ? ` (${bindingValue})` : ""}`,
7973
- shouldWrap ? bindingPrefix.length + maxNameLength : bindingLength
7974
- );
7975
- const suffix = shouldWrap ? binding.value ? `
7976
- ${bindingValue}` : "" : "";
7977
- log2(
7978
- `${bindingString}${columnGap}${brandColor(binding.type.padEnd(maxTypeLength))}${columnGap}${hasMode ? binding.mode : ""}${suffix}`
7979
- );
7980
- }
7981
- log2("");
7982
- }
7983
- let title;
7984
- if (context.name && isMultiWorker) {
7985
- title = `${chalk6.blue(context.name)} is sending Tail events to the following Workers:`;
7986
- } else {
7987
- title = "Your Worker is sending Tail events to the following Workers:";
7988
- }
7989
- const allTailConsumers = [
7990
- ...(tailConsumers ?? []).map((c) => ({
7991
- service: c.service,
7992
- streaming: false
7993
- })),
7994
- ...(streamingTailConsumers ?? []).map((c) => ({
7995
- service: c.service,
7996
- streaming: true
7997
- }))
7998
- ];
7999
- if (allTailConsumers.length > 0) {
8000
- log2(
8001
- `${title}
8002
- ${allTailConsumers.map(({ service, streaming }) => {
8003
- const displayName = `${service}${streaming ? ` (streaming)` : ""}`;
8004
- if (context.local && context.registry !== null) {
8005
- const registryDefinition = context.registry?.[service];
8006
- hasConnectionStatus = true;
8007
- if (registryDefinition) {
8008
- return `- ${displayName} ${chalk6.green("[connected]")}`;
8009
- } else {
8010
- return `- ${displayName} ${chalk6.red("[not connected]")}`;
8011
- }
8012
- } else {
8013
- return `- ${displayName}`;
8014
- }
8015
- }).join("\n")}`
8016
- );
8017
- }
8018
- if (containers.length > 0 && !context.provisioning) {
8019
- let containersTitle = "The following containers are available:";
8020
- if (context.name && isMultiWorker) {
8021
- containersTitle = `The following containers are available from ${chalk6.blue(context.name)}:`;
8022
- }
8023
- log2(
8024
- `${containersTitle}
8025
- ${containers.map((c) => `- ${c.name} (${c.image})`).join("\n")}`
8026
- );
8027
- log2("");
8028
- }
8029
- if (context.unsafeMetadata) {
8030
- log2("The following unsafe metadata will be attached to your Worker:");
8031
- log2(JSON.stringify(context.unsafeMetadata, null, 2));
8032
- }
8033
- if (hasConnectionStatus && !isConnectedStatusExplained) {
8034
- log2(
8035
- dim(
8036
- `
8037
- Service bindings, Durable Object bindings, and Tail consumers connect to other Wrangler or Vite dev processes running locally, with their connection status indicated by ${chalk6.green("[connected]")} or ${chalk6.red("[not connected]")}. For more details, refer to https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#local-development
8038
- `
8039
- )
8040
- );
8041
- isConnectedStatusExplained = true;
8042
- }
8043
- }
8044
- __name(printBindings, "printBindings");
8045
- function padEndAnsi(str, length) {
8046
- return str + " ".repeat(Math.max(0, length - stripVTControlCharacters(str).length));
8047
- }
8048
- __name(padEndAnsi, "padEndAnsi");
8049
- function createGetMode({
8050
- isProvisioning = false,
8051
- isLocalDev = false
8052
- }) {
8053
- return /* @__PURE__ */ __name(function bindingMode({
8054
- isSimulatedLocally,
8055
- connected
8056
- } = {}) {
8057
- if (isProvisioning || !isLocalDev) {
8058
- return void 0;
8059
- }
8060
- if (isSimulatedLocally === void 0) {
8061
- return dim("not supported");
8062
- }
8063
- return `${isSimulatedLocally ? chalk6.blue("local") : chalk6.yellow("remote")}${connected === void 0 ? "" : connected ? chalk6.green(" [connected]") : chalk6.red(" [not connected]")}`;
8064
- }, "bindingMode");
8065
- }
8066
- __name(createGetMode, "createGetMode");
8067
- function warnOrError(type, remote) {
8068
- const support = getBindingLocalSupport(type);
8069
- switch (support) {
8070
- case "local-and-remote":
8071
- return;
8072
- case "local-only":
8073
- if (remote === true) {
8074
- throw new UserError(
8075
- `${getBindingTypeFriendlyName(type)} bindings do not support accessing remote resources.`,
8076
- {
8077
- telemetryMessage: "utils bindings unsupported remote resources"
8078
- }
8079
- );
8080
- }
8081
- return;
8082
- case "remote":
8083
- if (remote === false) {
8084
- throw new UserError(
8085
- `${getBindingTypeFriendlyName(type)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
8086
- {
8087
- telemetryMessage: "utils bindings unsupported local development"
8088
- }
8089
- );
8090
- }
8091
- if (remote === void 0) {
8092
- logger.warn(
8093
- `${getBindingTypeFriendlyName(type)} bindings do not support local development, and so parts of your Worker may not work correctly. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
8094
- );
8095
- }
8096
- return;
8097
- case "DO-NOT-USE-this-resource-will-never-have-a-local-simulator":
8098
- if (remote === false) {
8099
- throw new UserError(
8100
- `${getBindingTypeFriendlyName(type)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
8101
- {
8102
- telemetryMessage: "utils bindings unsupported local development always remote"
8103
- }
8104
- );
8105
- }
8106
- if (remote === void 0) {
8107
- logger.warn(
8108
- `${getBindingTypeFriendlyName(type)} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`
8109
- );
8110
- }
8111
- return;
8112
- default:
8113
- assertNever(support);
8114
- }
8115
- }
8116
- __name(warnOrError, "warnOrError");
8117
7284
  var ProvisionResourceHandler = class {
8118
7285
  constructor(type, bindingName, binding, idField, complianceConfig, accountId) {
8119
7286
  this.type = type;
@@ -8871,10 +8038,13 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
8871
8038
  { type: resource.resourceType }
8872
8039
  ])
8873
8040
  ),
8874
- config2.tail_consumers,
8875
- config2.streaming_tail_consumers,
8876
- config2.containers,
8877
- { provisioning: true }
8041
+ {
8042
+ log: logger.log,
8043
+ tailConsumers: config2.tail_consumers,
8044
+ streamingTailConsumers: config2.streaming_tail_consumers,
8045
+ containers: config2.containers,
8046
+ provisioning: true
8047
+ }
8878
8048
  );
8879
8049
  logger.log();
8880
8050
  const existingResources = {};
@@ -9940,7 +9110,7 @@ __export(util_exports, {
9940
9110
  assert: () => assert5,
9941
9111
  assertEqual: () => assertEqual,
9942
9112
  assertIs: () => assertIs,
9943
- assertNever: () => assertNever2,
9113
+ assertNever: () => assertNever,
9944
9114
  assertNotEqual: () => assertNotEqual,
9945
9115
  assignProp: () => assignProp,
9946
9116
  base64ToUint8Array: () => base64ToUint8Array,
@@ -10007,10 +9177,10 @@ __name(assertNotEqual, "assertNotEqual");
10007
9177
  function assertIs(_arg) {
10008
9178
  }
10009
9179
  __name(assertIs, "assertIs");
10010
- function assertNever2(_x) {
9180
+ function assertNever(_x) {
10011
9181
  throw new Error("Unexpected value in exhaustive check");
10012
9182
  }
10013
- __name(assertNever2, "assertNever");
9183
+ __name(assertNever, "assertNever");
10014
9184
  function assert5(_) {
10015
9185
  }
10016
9186
  __name(assert5, "assert");
@@ -24997,6 +24167,7 @@ function normalizeObservability(obs) {
24997
24167
  const fullObservabilityDefaults = {
24998
24168
  enabled,
24999
24169
  head_sampling_rate: 1,
24170
+ redact_query_string: false,
25000
24171
  logs: {
25001
24172
  enabled,
25002
24173
  head_sampling_rate: 1,
@@ -25698,7 +24869,11 @@ async function deploy(props, config2, buildResult, callbacks) {
25698
24869
  version_id: result.versionId,
25699
24870
  targets: result.targets,
25700
24871
  wrangler_environment: props.env,
25701
- worker_name_overridden: props.workerNameOverridden ?? false
24872
+ worker_name_overridden: props.workerNameOverridden ?? false,
24873
+ bundle_size: result.bundleSize ? {
24874
+ raw_bytes: result.bundleSize.size,
24875
+ gzip_bytes: result.bundleSize.gzipSize
24876
+ } : void 0
25702
24877
  });
25703
24878
  return result;
25704
24879
  }
@@ -25851,10 +25026,8 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25851
25026
  (acc, m) => acc + m.content.length,
25852
25027
  0
25853
25028
  );
25854
- await printBundleSize(
25855
- { name: path__default.basename(resolvedEntryPointPath), content },
25856
- modules
25857
- );
25029
+ const bundleSize = await getSize([...modules, { content }]);
25030
+ printBundleSize(bundleSize);
25858
25031
  const canUseNewVersionsDeploymentsApi = workerExists && props.dispatchNamespace === void 0 && format === "modules" && migrations === void 0 && !hasDurableObjectExports(config2.exports) && !config2.first_party_worker && config2.containers === void 0;
25859
25032
  let workerBundle;
25860
25033
  const dockerPath = getDockerPath();
@@ -25898,13 +25071,14 @@ async function deployWorker(props, config2, buildResult, callbacks) {
25898
25071
  unsafe: config2.unsafe
25899
25072
  }
25900
25073
  );
25901
- printBindings(
25902
- bindings,
25903
- config2.tail_consumers,
25904
- config2.streaming_tail_consumers,
25905
- config2.containers,
25906
- { warnIfNoBindings: true, unsafeMetadata: config2.unsafe?.metadata }
25907
- );
25074
+ printBindings(bindings, {
25075
+ log: logger.log,
25076
+ tailConsumers: config2.tail_consumers,
25077
+ streamingTailConsumers: config2.streaming_tail_consumers,
25078
+ containers: config2.containers,
25079
+ warnIfNoBindings: true,
25080
+ unsafeMetadata: config2.unsafe?.metadata
25081
+ });
25908
25082
  } else {
25909
25083
  assert4(accountId, "Missing accountId");
25910
25084
  if (assetsOptions?.routerConfig.has_user_worker === false) {
@@ -26031,13 +25205,13 @@ async function deployWorker(props, config2, buildResult, callbacks) {
26031
25205
  logger.log("Worker Startup Time:", result.startup_time_ms, "ms");
26032
25206
  }
26033
25207
  bindingsPrinted = true;
26034
- printBindings(
26035
- bindings,
26036
- config2.tail_consumers,
26037
- config2.streaming_tail_consumers,
26038
- config2.containers,
26039
- { unsafeMetadata: config2.unsafe?.metadata }
26040
- );
25208
+ printBindings(bindings, {
25209
+ log: logger.log,
25210
+ tailConsumers: config2.tail_consumers,
25211
+ streamingTailConsumers: config2.streaming_tail_consumers,
25212
+ containers: config2.containers,
25213
+ unsafeMetadata: config2.unsafe?.metadata
25214
+ });
26041
25215
  versionId = parseNonHyphenedUuid(result.deployment_id);
26042
25216
  if (config2.first_party_worker) {
26043
25217
  if (result.id) {
@@ -26058,13 +25232,13 @@ async function deployWorker(props, config2, buildResult, callbacks) {
26058
25232
  }
26059
25233
  } catch (err) {
26060
25234
  if (!bindingsPrinted) {
26061
- printBindings(
26062
- bindings,
26063
- config2.tail_consumers,
26064
- config2.streaming_tail_consumers,
26065
- config2.containers,
26066
- { unsafeMetadata: config2.unsafe?.metadata }
26067
- );
25235
+ printBindings(bindings, {
25236
+ log: logger.log,
25237
+ tailConsumers: config2.tail_consumers,
25238
+ streamingTailConsumers: config2.streaming_tail_consumers,
25239
+ containers: config2.containers,
25240
+ unsafeMetadata: config2.unsafe?.metadata
25241
+ });
26068
25242
  }
26069
25243
  if (err instanceof APIError && err.code === EXPORTS_RECONCILIATION_ERROR_CODE && isExportsReconciliationErrorDetails(err.meta?.details)) {
26070
25244
  err.preventReport();
@@ -26122,7 +25296,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
26122
25296
  }
26123
25297
  if (isDryRun) {
26124
25298
  logger.log(`--dry-run: exiting now.`);
26125
- return { versionId, workerTag };
25299
+ return { versionId, workerTag, bundleSize };
26126
25300
  }
26127
25301
  const uploadMs = Date.now() - start;
26128
25302
  logger.log("Uploaded", workerName, formatTime(uploadMs));
@@ -26136,7 +25310,7 @@ async function deployWorker(props, config2, buildResult, callbacks) {
26136
25310
  }
26137
25311
  if (props.dispatchNamespace !== void 0) {
26138
25312
  deployWfpUserWorker(props.dispatchNamespace, versionId);
26139
- return { versionId, workerTag, assetUploadStats };
25313
+ return { versionId, workerTag, assetUploadStats, bundleSize };
26140
25314
  }
26141
25315
  assert4(accountId);
26142
25316
  const targets = await triggersDeploy({
@@ -26156,7 +25330,8 @@ async function deployWorker(props, config2, buildResult, callbacks) {
26156
25330
  versionId,
26157
25331
  workerTag,
26158
25332
  assetUploadStats,
26159
- targets: targets ?? []
25333
+ targets: targets ?? [],
25334
+ bundleSize
26160
25335
  };
26161
25336
  }
26162
25337
  __name(deployWorker, "deployWorker");
@@ -26188,7 +25363,11 @@ async function versionsUpload(props, config2, buildResult, callbacks) {
26188
25363
  preview_url: result.versionPreviewUrl,
26189
25364
  preview_alias_url: result.versionPreviewAliasUrl,
26190
25365
  wrangler_environment: props.env,
26191
- worker_name_overridden: props.workerNameOverridden ?? false
25366
+ worker_name_overridden: props.workerNameOverridden ?? false,
25367
+ bundle_size: result.bundleSize ? {
25368
+ raw_bytes: result.bundleSize.size,
25369
+ gzip_bytes: result.bundleSize.gzipSize
25370
+ } : void 0
26192
25371
  });
26193
25372
  return result;
26194
25373
  }
@@ -26295,23 +25474,20 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
26295
25474
  config2.dependencies_instrumentation?.exclude_packages
26296
25475
  ) : void 0
26297
25476
  };
26298
- await printBundleSize(
26299
- { name: path__default.basename(resolvedEntryPointPath), content },
26300
- modules
26301
- );
25477
+ const bundleSize = await getSize([...modules, { content }]);
25478
+ printBundleSize(bundleSize);
26302
25479
  let workerBundle;
26303
25480
  if (props.dryRun) {
26304
25481
  workerBundle = createWorkerUploadForm(worker, bindings, {
26305
25482
  dryRun: true,
26306
25483
  unsafe: config2.unsafe
26307
25484
  });
26308
- printBindings(
26309
- bindings,
26310
- config2.tail_consumers,
26311
- config2.streaming_tail_consumers,
26312
- void 0,
26313
- { unsafeMetadata: config2.unsafe?.metadata }
26314
- );
25485
+ printBindings(bindings, {
25486
+ log: logger.log,
25487
+ tailConsumers: config2.tail_consumers,
25488
+ streamingTailConsumers: config2.streaming_tail_consumers,
25489
+ unsafeMetadata: config2.unsafe?.metadata
25490
+ });
26315
25491
  } else {
26316
25492
  assert4(accountId, "Missing accountId");
26317
25493
  if (assetsOptions?.routerConfig.has_user_worker === false) {
@@ -26348,24 +25524,22 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
26348
25524
  );
26349
25525
  logger.log("Worker Startup Time:", result.startup_time_ms, "ms");
26350
25526
  bindingsPrinted = true;
26351
- printBindings(
26352
- bindings,
26353
- config2.tail_consumers,
26354
- config2.streaming_tail_consumers,
26355
- void 0,
26356
- { unsafeMetadata: config2.unsafe?.metadata }
26357
- );
25527
+ printBindings(bindings, {
25528
+ log: logger.log,
25529
+ tailConsumers: config2.tail_consumers,
25530
+ streamingTailConsumers: config2.streaming_tail_consumers,
25531
+ unsafeMetadata: config2.unsafe?.metadata
25532
+ });
26358
25533
  versionId = result.id;
26359
25534
  hasPreview = result.metadata.has_preview;
26360
25535
  } catch (err) {
26361
25536
  if (!bindingsPrinted) {
26362
- printBindings(
26363
- bindings,
26364
- config2.tail_consumers,
26365
- config2.streaming_tail_consumers,
26366
- void 0,
26367
- { unsafeMetadata: config2.unsafe?.metadata }
26368
- );
25537
+ printBindings(bindings, {
25538
+ log: logger.log,
25539
+ tailConsumers: config2.tail_consumers,
25540
+ streamingTailConsumers: config2.streaming_tail_consumers,
25541
+ unsafeMetadata: config2.unsafe?.metadata
25542
+ });
26369
25543
  }
26370
25544
  if (err instanceof APIError && err.code === ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE) {
26371
25545
  err.preventReport();
@@ -26425,7 +25599,7 @@ async function uploadWorkerVersion(props, config2, buildResult, callbacks) {
26425
25599
  }
26426
25600
  if (props.dryRun) {
26427
25601
  logger.log(`--dry-run: exiting now.`);
26428
- return { versionId, workerTag };
25602
+ return { versionId, workerTag, bundleSize };
26429
25603
  }
26430
25604
  assert4(accountId);
26431
25605
  const uploadMs = Date.now() - start;
@@ -26464,7 +25638,8 @@ Changes to triggers (routes, custom domains, cron schedules, etc) must be applie
26464
25638
  workerTag,
26465
25639
  assetUploadStats: assetsUploadResult?.assetUploadStats,
26466
25640
  versionPreviewUrl,
26467
- versionPreviewAliasUrl
25641
+ versionPreviewAliasUrl,
25642
+ bundleSize
26468
25643
  };
26469
25644
  }
26470
25645
  __name(uploadWorkerVersion, "uploadWorkerVersion");
@@ -28057,4 +27232,4 @@ __name(previewSettingsUpdate, "previewSettingsUpdate");
28057
27232
  * THE SOFTWARE.
28058
27233
  */
28059
27234
 
28060
- export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, editWorkerPreviewDefaults, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatPreviewsSettings, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkerPreviewDefaults, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, mergeDeep, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, preview, previewContainerAppName, previewDelete, previewSettingsGet, previewSettingsUpdate, printBindings, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, warnOrError, workerNotFoundErrorMessage };
27235
+ export { ACTOR_BINDING_DEPENDS_ON_EXPORT_CODE, EXPORTS_RECONCILIATION_ERROR_CODE, INCONSISTENT_EXPORTS_ACROSS_VERSIONS_CODE, INVALID_INHERIT_BINDING_CODE, NO_ACTIVE_PREVIEW_URLS_MESSAGE, NoInputError, WORKER_LEGACY_ENVIRONMENT_NOT_FOUND_ERR_CODE, WORKER_NOT_FOUND_ERR_CODE, WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE, WORKFLOW_NOT_FOUND_CODE, addRequiredSecretsInheritBindings, addWorkersSitesBindings, applyServiceAndEnvironmentTags, assemblePreviewDefaults, assemblePreviewScriptSettings, buildAssetManifest, checkRemoteSecretsOverride, checkWorkflowConflicts, collectPackageDependencies, confirmLatestDeploymentOverwrite, createDeployment, createPreview, createPreviewDeployment, createPreviewDeploymentForm, createPreviewParentWorker, createTruncatedAlias, decodeJwtPayload, deletePreview, deletePullConsumer, deleteWorkerConsumer, deploy, deployWfpUserWorker, diagnoseScriptSizeError, diagnoseStartupError, diffJsonObjects, downloadWorkerConfig, drawBox, drawConnectedChildBox, editPreview, editWorkerPreviewDefaults, ensureQueuesExistByConfig, extractConfigBindings, fetchDeployableVersions, fetchDeploymentVersions, fetchLatestDeployment, fetchLatestDeployments, fetchSecrets, fetchVersion, fetchVersions, fetchWorkerConfig, formatAlignedRows, formatBindings, formatPreviewsSettings, generatePreviewAlias, getBindingValue, getBranchName2 as getBranchName, getCommitSha, getConfigPatch, getDeployConfirmFunction, getEdgeKvUploadConcurrency, getHeadCommitMessage, getHeadCommitRef, getMigrationsToUpload, getPreview, getPreviewBaseConfig, getPreviewDeployment, getPreviewOwnedContainerClassNames, getPullRequestMetadata, getQueue, getRemoteConfigDiff, getRepositoryUrl, getSettings, getSize, getSourceMappedStack, getSourceMappedString, getSubdomainValues, getSubdomainValuesAPIMock, getWorkerPreviewDefaults, getWorkersDevSubdomain, getZoneForRoute, getZoneIdFromHost, handleMissingSecretsError, hasDefinedEnvironments, hashFile, helpIfErrorIsSizeOrScriptStartup, isExportsReconciliationErrorDetails, isJwtExpired, isModifiedDiffValue, isNonDestructive, isWorkerNotFoundError, listConsumers, listQueues, maybeRetrieveFileSourceMap, mergeDeep, padToVisibleWidth, parseBulkInputToObject, parseConfigPlacement, patchNonVersionedScriptSettings, patchPreviewBaseConfig, patchPreviewDeployment, postConsumer, preview, previewContainerAppName, previewDelete, previewSettingsGet, previewSettingsUpdate, printBundleSize, printVersions, provisionBindings, publishCustomDomains, publishRoutes, putConsumer, putConsumerById, renderBindingDependsOnExportError, renderExportsReconciliationError, renderExportsReconciliationSuccess, renderInconsistentExportsAcrossVersionsError, renderRoute, resolveAssetOptions, resolveDoLifecyclePayload, resolveExportsUploadPayload, resolveWorkerName, sanitizeBranchName, shouldUseCIMetadataFallback, stripAnsi, syncAssets, tagsAreEqual, triggersDeploy, updateQueueConsumers, validateEventTriggerTargets, validateFileSecrets, validateNodeCompatMode, validateRoutes, verifyWorkerMatchesCITag, versionsUpload, visibleLength, warnOnErrorUpdatingServiceAndEnvironmentTags, workerNotFoundErrorMessage };