miniflare 0.0.0-eec2a7074 → 0.0.0-eef649c82

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/src/index.js CHANGED
@@ -2456,7 +2456,6 @@ __export(src_exports, {
2456
2456
  DispatchFetchDispatcher: () => DispatchFetchDispatcher,
2457
2457
  DurableObjectsOptionsSchema: () => DurableObjectsOptionsSchema,
2458
2458
  DurableObjectsSharedOptionsSchema: () => DurableObjectsSharedOptionsSchema,
2459
- ENTRY_SOCKET_HTTP_OPTIONS: () => ENTRY_SOCKET_HTTP_OPTIONS,
2460
2459
  ErrorEvent: () => ErrorEvent,
2461
2460
  File: () => import_undici4.File,
2462
2461
  FormData: () => import_undici4.FormData,
@@ -3788,7 +3787,7 @@ var QueueConsumerOptionsSchema = /* @__PURE__ */ import_zod2.z.object({
3788
3787
  // https://developers.cloudflare.com/queues/platform/configuration/#consumer
3789
3788
  // https://developers.cloudflare.com/queues/platform/limits/
3790
3789
  maxBatchSize: import_zod2.z.number().min(0).max(100).optional(),
3791
- maxBatchTimeout: import_zod2.z.number().min(0).max(30).optional(),
3790
+ maxBatchTimeout: import_zod2.z.number().min(0).max(60).optional(),
3792
3791
  // seconds
3793
3792
  maxRetires: import_zod2.z.number().min(0).max(100).optional(),
3794
3793
  // deprecated
@@ -4540,11 +4539,6 @@ ez/dHA==
4540
4539
  `;
4541
4540
 
4542
4541
  // src/http/server.ts
4543
- var ENTRY_SOCKET_HTTP_OPTIONS = {
4544
- // Even though we inject a `cf` object in the entry worker, allow it to
4545
- // be customised via `dispatchFetch`
4546
- cfBlobHeader: CoreHeaders.CF_BLOB
4547
- };
4548
4542
  async function getEntrySocketHttpOptions(coreOpts) {
4549
4543
  let privateKey = void 0;
4550
4544
  let certificateChain = void 0;
@@ -4561,7 +4555,6 @@ async function getEntrySocketHttpOptions(coreOpts) {
4561
4555
  if (privateKey && certificateChain) {
4562
4556
  return {
4563
4557
  https: {
4564
- options: ENTRY_SOCKET_HTTP_OPTIONS,
4565
4558
  tlsOptions: {
4566
4559
  keypair: {
4567
4560
  privateKey,
@@ -4571,7 +4564,7 @@ async function getEntrySocketHttpOptions(coreOpts) {
4571
4564
  }
4572
4565
  };
4573
4566
  } else {
4574
- return { http: ENTRY_SOCKET_HTTP_OPTIONS };
4567
+ return { http: {} };
4575
4568
  }
4576
4569
  }
4577
4570
  function valueOrFile(value, filePath) {
@@ -4616,7 +4609,8 @@ var MAX_ASSET_SIZE = 25 * 1024 * 1024;
4616
4609
  // ../workers-shared/utils/types.ts
4617
4610
  var import_zod4 = require("zod");
4618
4611
  var RoutingConfigSchema = import_zod4.z.object({
4619
- has_user_worker: import_zod4.z.boolean().optional()
4612
+ has_user_worker: import_zod4.z.boolean().optional(),
4613
+ invoke_user_worker_ahead_of_assets: import_zod4.z.boolean().optional()
4620
4614
  });
4621
4615
  var AssetConfigSchema = import_zod4.z.object({
4622
4616
  html_handling: import_zod4.z.enum([
@@ -4625,7 +4619,8 @@ var AssetConfigSchema = import_zod4.z.object({
4625
4619
  "drop-trailing-slash",
4626
4620
  "none"
4627
4621
  ]).optional(),
4628
- not_found_handling: import_zod4.z.enum(["single-page-application", "404-page", "none"]).optional()
4622
+ not_found_handling: import_zod4.z.enum(["single-page-application", "404-page", "none"]).optional(),
4623
+ serve_directly: import_zod4.z.boolean().optional()
4629
4624
  });
4630
4625
 
4631
4626
  // ../workers-shared/utils/helpers.ts
@@ -4645,7 +4640,7 @@ var getContentType = (absFilePath) => {
4645
4640
  return contentType;
4646
4641
  };
4647
4642
 
4648
- // ../../node_modules/.pnpm/pretty-bytes@6.0.0/node_modules/pretty-bytes/index.js
4643
+ // ../../node_modules/.pnpm/pretty-bytes@6.1.1/node_modules/pretty-bytes/index.js
4649
4644
  var BYTE_UNITS = [
4650
4645
  "B",
4651
4646
  "kB",
@@ -4659,7 +4654,7 @@ var BYTE_UNITS = [
4659
4654
  ];
4660
4655
  var BIBYTE_UNITS = [
4661
4656
  "B",
4662
- "kiB",
4657
+ "KiB",
4663
4658
  "MiB",
4664
4659
  "GiB",
4665
4660
  "TiB",
@@ -4706,11 +4701,13 @@ function prettyBytes(number, options) {
4706
4701
  options = {
4707
4702
  bits: false,
4708
4703
  binary: false,
4704
+ space: true,
4709
4705
  ...options
4710
4706
  };
4711
4707
  const UNITS = options.bits ? options.binary ? BIBIT_UNITS : BIT_UNITS : options.binary ? BIBYTE_UNITS : BYTE_UNITS;
4708
+ const separator = options.space ? " " : "";
4712
4709
  if (options.signed && number === 0) {
4713
- return ` 0 ${UNITS[0]}`;
4710
+ return ` 0${separator}${UNITS[0]}`;
4714
4711
  }
4715
4712
  const isNegative = number < 0;
4716
4713
  const prefix = isNegative ? "-" : options.signed ? "+" : "";
@@ -4726,7 +4723,7 @@ function prettyBytes(number, options) {
4726
4723
  }
4727
4724
  if (number < 1) {
4728
4725
  const numberString2 = toLocaleString(number, options.locale, localeOptions);
4729
- return prefix + numberString2 + " " + UNITS[0];
4726
+ return prefix + numberString2 + separator + UNITS[0];
4730
4727
  }
4731
4728
  const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
4732
4729
  number /= (options.binary ? 1024 : 1e3) ** exponent;
@@ -4735,7 +4732,7 @@ function prettyBytes(number, options) {
4735
4732
  }
4736
4733
  const numberString = toLocaleString(Number(number), options.locale, localeOptions);
4737
4734
  const unit = UNITS[exponent];
4738
- return prefix + numberString + " " + unit;
4735
+ return prefix + numberString + separator + unit;
4739
4736
  }
4740
4737
 
4741
4738
  // embed-worker:/home/runner/work/workers-sdk/workers-sdk/packages/miniflare/src/workers/assets/assets.worker.ts
@@ -8666,13 +8663,15 @@ var WORKFLOWS_PLUGIN = {
8666
8663
  sharedOptions.workflowsPersist
8667
8664
  );
8668
8665
  await import_promises12.default.mkdir(persistPath, { recursive: true });
8669
- const storageService = {
8670
- name: WORKFLOWS_STORAGE_SERVICE_NAME,
8666
+ const storageServices = Object.entries(
8667
+ options.workflows ?? {}
8668
+ ).map(([_, workflow]) => ({
8669
+ name: `${WORKFLOWS_STORAGE_SERVICE_NAME}-${workflow.name}`,
8671
8670
  disk: { path: persistPath, writable: true }
8672
- };
8671
+ }));
8673
8672
  const services = Object.entries(options.workflows ?? {}).map(
8674
8673
  ([_bindingName, workflow]) => {
8675
- const uniqueKey = `miniflare-workflows`;
8674
+ const uniqueKey = `miniflare-workflows-${workflow.name}`;
8676
8675
  const workflowsBinding = {
8677
8676
  name: `${WORKFLOWS_PLUGIN_NAME}:${workflow.name}`,
8678
8677
  worker: {
@@ -8691,8 +8690,9 @@ var WORKFLOWS_PLUGIN = {
8691
8690
  preventEviction: true
8692
8691
  }
8693
8692
  ],
8694
- // this might conflict between workflows
8695
- durableObjectStorage: { localDisk: WORKFLOWS_STORAGE_SERVICE_NAME },
8693
+ durableObjectStorage: {
8694
+ localDisk: `${WORKFLOWS_STORAGE_SERVICE_NAME}-${workflow.name}`
8695
+ },
8696
8696
  bindings: [
8697
8697
  {
8698
8698
  name: "ENGINE",
@@ -8714,7 +8714,7 @@ var WORKFLOWS_PLUGIN = {
8714
8714
  if (services.length === 0) {
8715
8715
  return [];
8716
8716
  }
8717
- return [storageService, ...services];
8717
+ return [...storageServices, ...services];
8718
8718
  },
8719
8719
  getPersistPath({ workflowsPersist }, tmpPath) {
8720
8720
  return getPersistPath(WORKFLOWS_PLUGIN_NAME, tmpPath, workflowsPersist);
@@ -9761,7 +9761,7 @@ var Miniflare2 = class {
9761
9761
  sockets.push({
9762
9762
  name: SOCKET_ENTRY_LOCAL,
9763
9763
  service: { name: SERVICE_ENTRY },
9764
- http: ENTRY_SOCKET_HTTP_OPTIONS,
9764
+ http: {},
9765
9765
  address: "127.0.0.1:0"
9766
9766
  });
9767
9767
  }
@@ -10315,7 +10315,6 @@ var Miniflare2 = class {
10315
10315
  DispatchFetchDispatcher,
10316
10316
  DurableObjectsOptionsSchema,
10317
10317
  DurableObjectsSharedOptionsSchema,
10318
- ENTRY_SOCKET_HTTP_OPTIONS,
10319
10318
  ErrorEvent,
10320
10319
  File,
10321
10320
  FormData,