@nightintelligence/cloudflare-workers-utils 0.35.0-patch3 → 0.35.0-patch4

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.
Files changed (49) hide show
  1. package/dist/browser.mjs +2 -2
  2. package/dist/browser.mjs.map +1 -1
  3. package/dist/chunk-47QFQIPP.mjs +180 -0
  4. package/dist/chunk-47QFQIPP.mjs.map +1 -0
  5. package/dist/chunk-555CCIJE.mjs +75 -0
  6. package/dist/chunk-555CCIJE.mjs.map +1 -0
  7. package/dist/chunk-CGILA3WO.mjs +12 -0
  8. package/dist/{chunk-PAWJFY3S.mjs.map → chunk-CGILA3WO.mjs.map} +1 -1
  9. package/dist/chunk-FEHWZI5W.mjs +54 -0
  10. package/dist/chunk-FEHWZI5W.mjs.map +1 -0
  11. package/dist/chunk-KAEJMITB.mjs +64 -0
  12. package/dist/chunk-KAEJMITB.mjs.map +1 -0
  13. package/dist/chunk-T6I7NOR4.mjs +35 -0
  14. package/dist/chunk-T6I7NOR4.mjs.map +1 -0
  15. package/dist/chunk-VTOON473.mjs +237 -0
  16. package/dist/chunk-VTOON473.mjs.map +1 -0
  17. package/dist/chunk-W4SU7D4X.mjs +575 -0
  18. package/dist/chunk-W4SU7D4X.mjs.map +1 -0
  19. package/dist/chunk-YTEYGQOX.mjs +157 -0
  20. package/dist/chunk-YTEYGQOX.mjs.map +1 -0
  21. package/dist/chunk-Z7Q743IF.mjs +477 -0
  22. package/dist/chunk-Z7Q743IF.mjs.map +1 -0
  23. package/dist/chunk-ZZBYXY7A.mjs +44 -0
  24. package/dist/chunk-ZZBYXY7A.mjs.map +1 -0
  25. package/dist/compatibility-date.mjs +2 -42
  26. package/dist/compatibility-date.mjs.map +1 -1
  27. package/dist/compliance.mjs +6 -2
  28. package/dist/compliance.mjs.map +1 -1
  29. package/dist/docker-path.mjs +3 -11
  30. package/dist/docker-path.mjs.map +1 -1
  31. package/dist/errors.mjs +2 -61
  32. package/dist/errors.mjs.map +1 -1
  33. package/dist/fs-helpers.mjs +2 -33
  34. package/dist/fs-helpers.mjs.map +1 -1
  35. package/dist/global-wrangler-config-path.mjs +3 -28
  36. package/dist/global-wrangler-config-path.mjs.map +1 -1
  37. package/dist/index.mjs +9398 -54
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/local-env.mjs +3 -3
  40. package/dist/local-env.mjs.map +1 -1
  41. package/dist/metafile-esm.json +1 -1
  42. package/dist/prometheus-metrics.mjs +2 -51
  43. package/dist/prometheus-metrics.mjs.map +1 -1
  44. package/dist/test-helpers/index.mjs +307 -7
  45. package/dist/test-helpers/index.mjs.map +1 -1
  46. package/dist/zod-format.mjs +2 -235
  47. package/dist/zod-format.mjs.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/chunk-PAWJFY3S.mjs +0 -6
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/default-compat-date.ts","../src/assert-never.ts","../src/map-worker-metadata-bindings.ts","../src/construct-wrangler-config.ts"],"names":[],"mappings":";;;AAqBO,IAAM,mBAAA,GAAkC;;;ACrBxC,SAAS,YAAY,MAAA,EAAe;AAAC;AAA5B,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA;;;ACYT,SAAS,0BACf,QAAA,EACY;AACZ,EAAA,OACC,QAAA,CACE,MAAA,CAAO,CAAC,OAAA,KAAa,OAAA,CAAQ,IAAA,KAAoB,aAAa,CAAA,CAE9D,MAAA,CAAO,CAAC,SAAA,EAAW,OAAA,KAAY;AAI/B,IAAA,QAAQ,QAAQ,IAAA;AAAM,MACrB,KAAK,YAAA;AACJ,QAAA;AACC,UAAA,SAAA,CAAU,IAAA,GAAO;AAAA,YAChB,GAAI,SAAA,CAAU,IAAA,IAAQ,EAAC;AAAA,YACvB,CAAC,OAAA,CAAQ,IAAI,GAAG,OAAA,CAAQ;AAAA,WACzB;AAAA,QACD;AACA,QAAA;AAAA,MACD,KAAK,MAAA;AACJ,QAAA;AACC,UAAA,SAAA,CAAU,IAAA,GAAO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A,EAAQ,SAAA,KAAc,EAAC;AAAA,IAChD,SAAA,EACC,OAAO,SAAA,EAAW,IAAA,KAAS,UAAU,EAAE,IAAA,EAAM,SAAQ,GAAI,MAAA;AAAA,IAC1D,QAAQ,MAAA,CAAO,MAAA;AAAA,IACf,GAAI,uBAAA,CAAwB,MAAA,IAAU,MAAA,CAAO,aAAA,GAC1C;AAAA,MACA,UAAA,EAAY;AAAA,QACX;AAAA,UACC,KAAK,MAAA,CAAO,aAAA;AAAA,UACZ,WAAA,EAAa;AAAA;AACd;AACD,QAEA,EAAC;AAAA,IACJ,GAAI,MAAA,CAAO,SAAA,CAAU,MAAA,GAClB;AAAA,MACA,QAAA,EAAU;AAAA,QACT,OAAO,MAAA,CAAO,SAAA,CAAU,IAAI,CAAC,SAAA,KAAc,UAAU,IAAI;AAAA;AAC1D,QAEA,EAAC;AAAA,IACJ,cAAA,EAAgB,OAAO,cAAA,IAAkB,MAAA;AAAA,IACzC,eAAe,MAAA,CAAO,aAAA;AAAA,IACtB,GAAG;AAAA,GACJ;AACD;AA5DgB,MAAA,CAAA,uBAAA,EAAA,yBAAA,CAAA","file":"chunk-Z7Q743IF.mjs","sourcesContent":["import type { CompatDate } from \"./compatibility-date\";\n\n/**\n * The compatibility date to use when the user has not specified one.\n *\n * This is the release date of the `workerd` version pinned in the pnpm catalog,\n * so it is fixed for a given release of workers-sdk and updated whenever\n * `workerd` is upgraded.\n *\n * It deliberately tracks `workerd` rather than the current date, because\n * workerd rejects a compatibility date later than either of:\n *\n * - its `MAXIMUM_COMPATIBILITY_DATE`, which is its release date plus 7 days, or\n * - today's date (UTC).\n *\n * Run `pnpm update:compat-date` to refresh this value; `pnpm check:compat-date`\n * asserts that it matches the pinned `workerd` version.\n *\n * @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/BUILD.bazel\n * @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/compatibility-date.c%2B%2B\n */\nexport const DEFAULT_COMPAT_DATE: CompatDate = \"2026-09-02\";\n","export function assertNever(_value: never) {}\n","import { assertNever } from \"./assert-never\";\nimport type { RawConfig } from \"./config\";\nimport type { WorkerMetadataBinding } from \"./types\";\n\n/**\n * Maps a set of bindings defined as worker metadata bindings (straight from the Cloudflare API) to bindings defined in the local format.\n *\n * @param bindings The set of worker metadata bindings to convert\n * @param accountId The ID of the account\n * @param complianceConfig The compliance region configuration\n * @returns A RawConfig object with its bindings populated based on the provided bindings\n */\nexport function mapWorkerMetadataBindings(\n\tbindings: WorkerMetadataBinding[]\n): RawConfig {\n\treturn (\n\t\tbindings\n\t\t\t.filter((binding) => (binding.type as string) !== \"secret_text\")\n\t\t\t// Combine the same types into {[type]: [binding]}\n\t\t\t.reduce((configObj, binding) => {\n\t\t\t\t// Some types have different names in wrangler.toml\n\t\t\t\t// I want the type safety of the binding being destructured after the case narrowing the union but type is unused\n\n\t\t\t\tswitch (binding.type) {\n\t\t\t\t\tcase \"plain_text\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.vars = {\n\t\t\t\t\t\t\t\t...(configObj.vars ?? {}),\n\t\t\t\t\t\t\t\t[binding.name]: binding.text,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.vars = {\n\t\t\t\t\t\t\t\t...(configObj.vars ?? {}),\n\t\t\t\t\t\t\t\t[binding.name]: binding.json,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"kv_namespace\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.kv_namespaces = [\n\t\t\t\t\t\t\t\t...(configObj.kv_namespaces ?? []),\n\t\t\t\t\t\t\t\t{ id: binding.namespace_id, binding: binding.name },\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"durable_object_namespace\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.durable_objects = {\n\t\t\t\t\t\t\t\tbindings: [\n\t\t\t\t\t\t\t\t\t...(configObj.durable_objects?.bindings ?? []),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tname: binding.name,\n\t\t\t\t\t\t\t\t\t\tclass_name: binding.class_name,\n\t\t\t\t\t\t\t\t\t\tscript_name: binding.script_name,\n\t\t\t\t\t\t\t\t\t\tenvironment: binding.environment,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"d1\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.d1_databases = [\n\t\t\t\t\t\t\t\t...(configObj.d1_databases ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tdatabase_id: binding.id,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"browser\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.browser = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"ai\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.ai = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"images\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.images = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"stream\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.stream = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"media\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.media = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"r2_bucket\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.r2_buckets = [\n\t\t\t\t\t\t\t\t...(configObj.r2_buckets ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tbucket_name: binding.bucket_name,\n\t\t\t\t\t\t\t\t\tjurisdiction: binding.jurisdiction,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"secrets_store_secret\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.secrets_store_secrets = [\n\t\t\t\t\t\t\t\t...(configObj.secrets_store_secrets ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tstore_id: binding.store_id,\n\t\t\t\t\t\t\t\t\tsecret_name: binding.secret_name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"artifacts\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.artifacts = [\n\t\t\t\t\t\t\t\t...(configObj.artifacts ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tnamespace: binding.namespace,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"unsafe_hello_world\": {\n\t\t\t\t\t\tconfigObj.unsafe_hello_world = [\n\t\t\t\t\t\t\t...(configObj.unsafe_hello_world ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tenable_timer: binding.enable_timer,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"flagship\": {\n\t\t\t\t\t\tconfigObj.flagship = [\n\t\t\t\t\t\t\t...(configObj.flagship ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tapp_id: binding.app_id,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"service\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.services = [\n\t\t\t\t\t\t\t\t...(configObj.services ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tservice: binding.service,\n\t\t\t\t\t\t\t\t\tenvironment: binding.environment,\n\t\t\t\t\t\t\t\t\tentrypoint: binding.entrypoint,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"analytics_engine\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.analytics_engine_datasets = [\n\t\t\t\t\t\t\t\t...(configObj.analytics_engine_datasets ?? []),\n\t\t\t\t\t\t\t\t{ binding: binding.name, dataset: binding.dataset },\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"dispatch_namespace\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.dispatch_namespaces = [\n\t\t\t\t\t\t\t\t...(configObj.dispatch_namespaces ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tnamespace: binding.namespace,\n\t\t\t\t\t\t\t\t\t...(binding.outbound && {\n\t\t\t\t\t\t\t\t\t\toutbound: {\n\t\t\t\t\t\t\t\t\t\t\tservice: binding.outbound.worker.service,\n\t\t\t\t\t\t\t\t\t\t\tenvironment: binding.outbound.worker.environment,\n\t\t\t\t\t\t\t\t\t\t\tparameters:\n\t\t\t\t\t\t\t\t\t\t\t\tbinding.outbound.params?.map((p) => p.name) ?? [],\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"logfwdr\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.logfwdr = {\n\t\t\t\t\t\t\t\tbindings: [\n\t\t\t\t\t\t\t\t\t...(configObj.logfwdr?.bindings ?? []),\n\t\t\t\t\t\t\t\t\t{ name: binding.name, destination: binding.destination },\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"wasm_module\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.wasm_modules = {\n\t\t\t\t\t\t\t\t...(configObj.wasm_modules ?? {}),\n\t\t\t\t\t\t\t\t[binding.name]: binding.part,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"text_blob\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.text_blobs = {\n\t\t\t\t\t\t\t\t...(configObj.text_blobs ?? {}),\n\t\t\t\t\t\t\t\t[binding.name]: binding.part,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"data_blob\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.data_blobs = {\n\t\t\t\t\t\t\t\t...(configObj.data_blobs ?? {}),\n\t\t\t\t\t\t\t\t[binding.name]: binding.part,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"secret_text\":\n\t\t\t\t\t\t// Ignore secrets\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"version_metadata\": {\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.version_metadata = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"send_email\": {\n\t\t\t\t\t\tconfigObj.send_email = [\n\t\t\t\t\t\t\t...(configObj.send_email ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: binding.name,\n\t\t\t\t\t\t\t\tdestination_address: binding.destination_address,\n\t\t\t\t\t\t\t\tallowed_destination_addresses:\n\t\t\t\t\t\t\t\t\tbinding.allowed_destination_addresses,\n\t\t\t\t\t\t\t\tallowed_sender_addresses: binding.allowed_sender_addresses,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"queue\":\n\t\t\t\t\t\tconfigObj.queues ??= { producers: [] };\n\t\t\t\t\t\tconfigObj.queues.producers = [\n\t\t\t\t\t\t\t...(configObj.queues.producers ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tqueue: binding.queue_name,\n\t\t\t\t\t\t\t\tdelivery_delay: binding.delivery_delay,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vectorize\":\n\t\t\t\t\t\tconfigObj.vectorize = [\n\t\t\t\t\t\t\t...(configObj.vectorize ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tindex_name: binding.index_name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"ai_search_namespace\":\n\t\t\t\t\t\tconfigObj.ai_search_namespaces = [\n\t\t\t\t\t\t\t...(configObj.ai_search_namespaces ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tnamespace: binding.namespace,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"ai_search\":\n\t\t\t\t\t\tconfigObj.ai_search = [\n\t\t\t\t\t\t\t...(configObj.ai_search ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tinstance_name: binding.instance_name,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"websearch\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.websearch = {\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"agent_memory\": {\n\t\t\t\t\t\tconfigObj.agent_memory = [\n\t\t\t\t\t\t\t...(configObj.agent_memory ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tnamespace: binding.namespace,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"hyperdrive\":\n\t\t\t\t\t\tconfigObj.hyperdrive = [\n\t\t\t\t\t\t\t...(configObj.hyperdrive ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tid: binding.id,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"mtls_certificate\":\n\t\t\t\t\t\tconfigObj.mtls_certificates = [\n\t\t\t\t\t\t\t...(configObj.mtls_certificates ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\tcertificate_id: binding.certificate_id,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pipelines\":\n\t\t\t\t\t\tconfigObj.pipelines = [\n\t\t\t\t\t\t\t...(configObj.pipelines ?? []),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t// NOTE: stream is the primary field, but we also support pipeline for backward compatibility\n\t\t\t\t\t\t\t\t...(binding.stream && { stream: binding.stream }),\n\n\t\t\t\t\t\t\t\t...(binding.pipeline && { pipeline: binding.pipeline }),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"assets\":\n\t\t\t\t\t\tconfigObj.assets = {\n\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t// Note: we currently don't get all the assets information from the\n\t\t\t\t\t\t\t// API, so here we are only able to set the name of the binding\n\t\t\t\t\t\t\t// hopefully in the future we can properly fully support the binding\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"inherit\":\n\t\t\t\t\t\tconfigObj.unsafe = {\n\t\t\t\t\t\t\tbindings: [...(configObj.unsafe?.bindings ?? []), binding],\n\t\t\t\t\t\t\tmetadata: configObj.unsafe?.metadata ?? undefined,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"workflow\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.workflows = [\n\t\t\t\t\t\t\t\t...(configObj.workflows ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tname: binding.workflow_name,\n\t\t\t\t\t\t\t\t\tclass_name: binding.class_name,\n\t\t\t\t\t\t\t\t\tscript_name: binding.script_name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"worker_loader\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.worker_loaders = [\n\t\t\t\t\t\t\t\t...(configObj.worker_loaders ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"ratelimit\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.ratelimits = [\n\t\t\t\t\t\t\t\t...(configObj.ratelimits ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tname: binding.name,\n\t\t\t\t\t\t\t\t\tnamespace_id: binding.namespace_id,\n\t\t\t\t\t\t\t\t\tsimple: {\n\t\t\t\t\t\t\t\t\t\tlimit: binding.simple.limit,\n\t\t\t\t\t\t\t\t\t\tperiod: binding.simple.period,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vpc_service\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconfigObj.vpc_services = [\n\t\t\t\t\t\t\t\t...(configObj.vpc_services ?? []),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbinding: binding.name,\n\t\t\t\t\t\t\t\t\tservice_id: binding.service_id,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vpc_network\":\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (binding.tunnel_id !== undefined) {\n\t\t\t\t\t\t\t\tconfigObj.vpc_networks = [\n\t\t\t\t\t\t\t\t\t...(configObj.vpc_networks ?? []),\n\t\t\t\t\t\t\t\t\t{ binding: binding.name, tunnel_id: binding.tunnel_id },\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t} else if (binding.network_id !== undefined) {\n\t\t\t\t\t\t\t\tconfigObj.vpc_networks = [\n\t\t\t\t\t\t\t\t\t...(configObj.vpc_networks ?? []),\n\t\t\t\t\t\t\t\t\t{ binding: binding.name, network_id: binding.network_id },\n\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\tconfigObj.unsafe = {\n\t\t\t\t\t\t\tbindings: [...(configObj.unsafe?.bindings ?? []), binding],\n\t\t\t\t\t\t\tmetadata: configObj.unsafe?.metadata ?? undefined,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tassertNever(binding);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn configObj;\n\t\t\t}, {} as RawConfig)\n\t);\n}\n","import { DEFAULT_COMPAT_DATE } from \"./default-compat-date\";\nimport { mapWorkerMetadataBindings } from \"./map-worker-metadata-bindings\";\nimport type { RawConfig } from \"./config\";\nimport type {\n\tCustomDomainRoute,\n\tRoute,\n\tTailConsumer,\n\tZoneNameRoute,\n} from \"./config/environment\";\nimport type { WorkerMetadata } from \"./types\";\nimport type { AssetConfig } from \"@cloudflare/workers-shared\";\nimport type { Cloudflare } from \"cloudflare\";\n\ntype RoutesRes = {\n\tid: string;\n\tpattern: string;\n\tzone_name: string;\n\tscript: string;\n}[];\n\ninterface APIWorkerConfig {\n\t/* sourced from https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/list/ */\n\tname: string; // property renamed from `id`...\n\tentrypoint: string;\n\ttags: string[] | null;\n\tcompatibility_date: string;\n\tcompatibility_flags: string[];\n\tlogpush: boolean | undefined;\n\troutes: RoutesRes;\n\ttail_consumers: TailConsumer[] | undefined | null;\n\tmigration_tag?: string;\n\n\t/* sourced from https://developers.cloudflare.com/api/resources/workers/subresources/domains/methods/list/ */\n\tdomains: Cloudflare.Workers.Domain[];\n\t/* sourced from https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/schedules/methods/get/ */\n\tschedules: Cloudflare.Workers.Scripts.Schedules.ScheduleGetResponse.Schedule[];\n\n\t/* sourced from https://developers.cloudflare.com/api/resources/workers/subresources/beta/subresources/workers/subresources/versions/methods/get/ using `{version_id}` of `latest` */\n\tassets?: AssetConfig;\n\tbindings: WorkerMetadata[\"bindings\"];\n\tobservability: Cloudflare.Workers.Beta.Worker.Observability | undefined;\n\tlimits: { cpu_ms?: number; subrequests?: number } | undefined;\n\tplacement: Cloudflare.Workers.Beta.Workers.Version.Placement | undefined;\n\tsubdomain: {\n\t\tenabled: boolean;\n\t\tpreviews_enabled: boolean;\n\t};\n}\n\n/**\n * Given information about a Worker,\n * construct a Wrangler config file for the application.\n *\n * @param config - The Worker configuration sourced from the Cloudflare API\n * @returns A Wrangler-compatible raw config object\n */\nexport function constructWranglerConfig(config: APIWorkerConfig): RawConfig {\n\tconst mappedBindings = mapWorkerMetadataBindings(config.bindings);\n\n\tconst durableObjectClassNames = config.bindings\n\t\t.filter(\n\t\t\t(binding) =>\n\t\t\t\tbinding.type === \"durable_object_namespace\" &&\n\t\t\t\tbinding.script_name === config.name\n\t\t)\n\t\t.map(\n\t\t\t(durableObject) => (durableObject as { class_name: string }).class_name\n\t\t);\n\n\tconst allRoutes: Route[] = [\n\t\t...config.routes.map<ZoneNameRoute>((r) => ({\n\t\t\tpattern: r.pattern,\n\t\t\tzone_name: r.zone_name,\n\t\t})),\n\t\t...config.domains.map<CustomDomainRoute>((c) => ({\n\t\t\tpattern: c.hostname as string,\n\t\t\tzone_name: c.zone_name,\n\t\t\tcustom_domain: true,\n\t\t\tenabled: (c as typeof c & { enabled: boolean }).enabled,\n\t\t\tpreviews_enabled: (c as typeof c & { previews_enabled: boolean })\n\t\t\t\t.previews_enabled,\n\t\t})),\n\t];\n\n\treturn {\n\t\tname: config.name,\n\t\tmain: config.entrypoint,\n\t\tworkers_dev: config.subdomain.enabled,\n\t\tpreview_urls: config.subdomain.previews_enabled,\n\t\tcompatibility_date: config.compatibility_date ?? DEFAULT_COMPAT_DATE,\n\t\tcompatibility_flags: config.compatibility_flags,\n\t\t...(allRoutes.length ? { routes: allRoutes } : {}),\n\t\tplacement:\n\t\t\tconfig.placement?.mode === \"smart\" ? { mode: \"smart\" } : undefined,\n\t\tlimits: config.limits,\n\t\t...(durableObjectClassNames.length && config.migration_tag\n\t\t\t? {\n\t\t\t\t\tmigrations: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttag: config.migration_tag,\n\t\t\t\t\t\t\tnew_classes: durableObjectClassNames,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t: {}),\n\t\t...(config.schedules.length\n\t\t\t? {\n\t\t\t\t\ttriggers: {\n\t\t\t\t\t\tcrons: config.schedules.map((scheduled) => scheduled.cron),\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: {}),\n\t\ttail_consumers: config.tail_consumers ?? undefined,\n\t\tobservability: config.observability,\n\t\t...mappedBindings,\n\t};\n}\n"]}
@@ -0,0 +1,44 @@
1
+ import { __name } from './chunk-CGILA3WO.mjs';
2
+ import assert from 'node:assert';
3
+
4
+ function isCompatDate(str) {
5
+ return /^\d{4}-\d{2}-\d{2}$/.test(str);
6
+ }
7
+ __name(isCompatDate, "isCompatDate");
8
+ function formatCompatibilityDate(date) {
9
+ const compatDate = date.toISOString().slice(0, 10);
10
+ assert(isCompatDate(compatDate));
11
+ return compatDate;
12
+ }
13
+ __name(formatCompatibilityDate, "formatCompatibilityDate");
14
+ function getTodaysCompatDate() {
15
+ return formatCompatibilityDate(/* @__PURE__ */ new Date());
16
+ }
17
+ __name(getTodaysCompatDate, "getTodaysCompatDate");
18
+ var NODEJS_COMPAT_DEFAULT_ON_DATE = "2026-08-04";
19
+ function isNodejsCompatDefaultOn(compatibilityDate) {
20
+ return compatibilityDate !== void 0 && compatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE;
21
+ }
22
+ __name(isNodejsCompatDefaultOn, "isNodejsCompatDefaultOn");
23
+ var NODEJS_COMPAT_V2_SWITCH_OVER_DATE = "2024-09-23";
24
+ function resolveNodejsCompat(compatibilityDate, compatibilityFlags) {
25
+ const isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);
26
+ const isNodejsCompatEnabled = compatibilityFlags.includes("nodejs_compat") || isDefaultOn && !compatibilityFlags.includes("no_nodejs_compat");
27
+ const isNodejsCompatV2Enabled = compatibilityFlags.includes("nodejs_compat_v2") || !compatibilityFlags.includes("no_nodejs_compat_v2") && (isDefaultOn || isNodejsCompatEnabled && compatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE);
28
+ return { isNodejsCompatEnabled, isNodejsCompatV2Enabled };
29
+ }
30
+ __name(resolveNodejsCompat, "resolveNodejsCompat");
31
+ function stripRedundantNodejsCompatFlags(compatibilityDate, compatibilityFlags) {
32
+ if (!isNodejsCompatDefaultOn(compatibilityDate)) {
33
+ return compatibilityFlags;
34
+ }
35
+ const redundantFlags = ["nodejs_compat", "nodejs_compat_v2"].filter(
36
+ (flag) => !compatibilityFlags.includes(`no_${flag}`)
37
+ );
38
+ return compatibilityFlags.filter((flag) => !redundantFlags.includes(flag));
39
+ }
40
+ __name(stripRedundantNodejsCompatFlags, "stripRedundantNodejsCompatFlags");
41
+
42
+ export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags };
43
+ //# sourceMappingURL=chunk-ZZBYXY7A.mjs.map
44
+ //# sourceMappingURL=chunk-ZZBYXY7A.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/compatibility-date.ts"],"names":[],"mappings":";;;AAiBO,SAAS,aAAa,GAAA,EAAgC;AAC5D,EAAA,OAAO,qBAAA,CAAsB,KAAK,GAAG,CAAA;AACtC;AAFgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;AAUhB,SAAS,wBAAwB,IAAA,EAAwB;AACxD,EAAA,MAAM,aAAa,IAAA,CAAK,WAAA,EAAY,CAAE,KAAA,CAAM,GAAG,EAAE,CAAA;AACjD,EAAA,MAAA,CAAO,YAAA,CAAa,UAAU,CAAC,CAAA;AAC/B,EAAA,OAAO,UAAA;AACR;AAJS,MAAA,CAAA,uBAAA,EAAA,yBAAA,CAAA;AASF,SAAS,mBAAA,GAAkC;AACjD,EAAA,OAAO,uBAAA,iBAAwB,IAAI,IAAA,EAAM,CAAA;AAC1C;AAFgB,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA;AAeT,IAAM,6BAAA,GAAgC;AAStC,SAAS,wBACf,iBAAA,EACU;AACV,EAAA,OACC,iBAAA,KAAsB,UACtB,iBAAA,IAAqB,6BAAA;AAEvB;AAPgB,MAAA,CAAA,uBAAA,EAAA,yBAAA,CAAA;AAaT,IAAM,iCAAA,GAAoC;AAe1C,SAAS,mBAAA,CACf,mBACA,kBAAA,EACuE;AACvE,EAAA,MAAM,WAAA,GAAc,wBAAwB,iBAAiB,CAAA;AAE7D,EAAA,MAAM,qBAAA,GACL,mBAAmB,QAAA,CAAS,eAAe,KAC1C,WAAA,IAAe,CAAC,kBAAA,CAAmB,QAAA,CAAS,kBAAkB,CAAA;AAEhE,EAAA,MAAM,uBAAA,GACL,kBAAA,CAAmB,QAAA,CAAS,kBAAkB,CAAA,IAC7C,CAAC,kBAAA,CAAmB,QAAA,CAAS,qBAAqB,CAAA,KACjD,WAAA,IACC,qBAAA,IACA,iBAAA,IAAqB,iCAAA,CAAA;AAEzB,EAAA,OAAO,EAAE,uBAAuB,uBAAA,EAAwB;AACzD;AAlBgB,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA;AAsCT,SAAS,+BAAA,CACf,mBACA,kBAAA,EACW;AACX,EAAA,IAAI,CAAC,uBAAA,CAAwB,iBAAiB,CAAA,EAAG;AAChD,IAAA,OAAO,kBAAA;AAAA,EACR;AAEA,EAAA,MAAM,cAAA,GAAiB,CAAC,eAAA,EAAiB,kBAAkB,CAAA,CAAE,MAAA;AAAA,IAC5D,CAAC,IAAA,KAAS,CAAC,mBAAmB,QAAA,CAAS,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE;AAAA,GACpD;AAEA,EAAA,OAAO,kBAAA,CAAmB,OAAO,CAAC,IAAA,KAAS,CAAC,cAAA,CAAe,QAAA,CAAS,IAAI,CAAC,CAAA;AAC1E;AAbgB,MAAA,CAAA,+BAAA,EAAA,iCAAA,CAAA","file":"chunk-ZZBYXY7A.mjs","sourcesContent":["import assert from \"node:assert\";\n\ntype YYYY = `${number}${number}${number}${number}`;\ntype MM = `${number}${number}`;\ntype DD = `${number}${number}`;\n\n/**\n * Represents a valid compatibility date, a string such as `2025-09-27`\n */\nexport type CompatDate = `${YYYY}-${MM}-${DD}`;\n\n/**\n * Discern whether a string represents a compatibility date (`YYYY-MM-DD`)\n *\n * @param str The target string\n * @returns true if the string represents a compatibility date, false otherwise\n */\nexport function isCompatDate(str: string): str is CompatDate {\n\treturn /^\\d{4}-\\d{2}-\\d{2}$/.test(str);\n}\n\n/**\n * Returns the date formatted as a compatibility date\n *\n * @param date The target date to convert\n * @returns The date as a CompatDate string (a string following the format `YYYY-MM-DD`)\n */\nfunction formatCompatibilityDate(date: Date): CompatDate {\n\tconst compatDate = date.toISOString().slice(0, 10);\n\tassert(isCompatDate(compatDate));\n\treturn compatDate;\n}\n\n/**\n * Returns today's date as a compatibility date string (`YYYY-MM-DD`).\n */\nexport function getTodaysCompatDate(): CompatDate {\n\treturn formatCompatibilityDate(new Date());\n}\n\n/**\n * The compatibility date on which the `nodejs_compat` and `nodejs_compat_v2`\n * compatibility flags became enabled by default in workerd.\n *\n * From this date onwards, specifying either flag explicitly is a validation\n * error (\"The compatibility flag nodejs_compat became the default as of\n * 2026-08-04 so does not need to be specified anymore\"), so tooling must not\n * add them to configurations using such a compatibility date.\n *\n * @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/compatibility-date.capnp\n */\nexport const NODEJS_COMPAT_DEFAULT_ON_DATE = \"2026-08-04\";\n\n/**\n * Whether workerd enables Node.js compatibility by default for the given\n * compatibility date, i.e. without the `nodejs_compat` flag being specified.\n *\n * @param compatibilityDate The compatibility date to check\n * @returns true if the date is on or after {@link NODEJS_COMPAT_DEFAULT_ON_DATE}\n */\nexport function isNodejsCompatDefaultOn(\n\tcompatibilityDate: string | undefined\n): boolean {\n\treturn (\n\t\tcompatibilityDate !== undefined &&\n\t\tcompatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE\n\t);\n}\n\n/**\n * The compatibility date on which `nodejs_compat` started implying\n * `nodejs_compat_v2`.\n */\nexport const NODEJS_COMPAT_V2_SWITCH_OVER_DATE = \"2024-09-23\";\n\n/**\n * Resolves whether workerd will enable the `nodejs_compat` and\n * `nodejs_compat_v2` features, mirroring how workerd itself resolves them from\n * the compatibility date and flags:\n * - Both are enabled by default from {@link NODEJS_COMPAT_DEFAULT_ON_DATE}\n * onwards, and each must be turned off separately from that date, with\n * `no_nodejs_compat` and `no_nodejs_compat_v2` respectively.\n * - Before that date, `nodejs_compat` implies `nodejs_compat_v2` from\n * {@link NODEJS_COMPAT_V2_SWITCH_OVER_DATE} onwards.\n *\n * @param compatibilityDate The compatibility date\n * @param compatibilityFlags The compatibility flags\n */\nexport function resolveNodejsCompat(\n\tcompatibilityDate: string,\n\tcompatibilityFlags: string[]\n): { isNodejsCompatEnabled: boolean; isNodejsCompatV2Enabled: boolean } {\n\tconst isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);\n\n\tconst isNodejsCompatEnabled =\n\t\tcompatibilityFlags.includes(\"nodejs_compat\") ||\n\t\t(isDefaultOn && !compatibilityFlags.includes(\"no_nodejs_compat\"));\n\n\tconst isNodejsCompatV2Enabled =\n\t\tcompatibilityFlags.includes(\"nodejs_compat_v2\") ||\n\t\t(!compatibilityFlags.includes(\"no_nodejs_compat_v2\") &&\n\t\t\t(isDefaultOn ||\n\t\t\t\t(isNodejsCompatEnabled &&\n\t\t\t\t\tcompatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE)));\n\n\treturn { isNodejsCompatEnabled, isNodejsCompatV2Enabled };\n}\n\n// TODO: remove when workerd no longer errors\n/**\n * Removes the `nodejs_compat` and `nodejs_compat_v2` flags from a list of\n * compatibility flags when the compatibility date already enables them.\n *\n * workerd rejects a compatibility flag that its compatibility date enables by\n * default, so from {@link NODEJS_COMPAT_DEFAULT_ON_DATE} onwards specifying\n * either flag stops a Worker from starting up. Removing them is a no-op for\n * such a date, so tooling can accept the redundant flags rather than failing.\n *\n * A flag is kept when its matching opt-out is specified too, since workerd\n * reports those as contradictory and the enable flag wins there - dropping it\n * would silently switch Node.js compatibility off instead.\n *\n * @param compatibilityDate The compatibility date\n * @param compatibilityFlags The compatibility flags\n * @returns The flags, without the ones the date makes redundant\n */\nexport function stripRedundantNodejsCompatFlags(\n\tcompatibilityDate: string | undefined,\n\tcompatibilityFlags: string[]\n): string[] {\n\tif (!isNodejsCompatDefaultOn(compatibilityDate)) {\n\t\treturn compatibilityFlags;\n\t}\n\n\tconst redundantFlags = [\"nodejs_compat\", \"nodejs_compat_v2\"].filter(\n\t\t(flag) => !compatibilityFlags.includes(`no_${flag}`)\n\t);\n\n\treturn compatibilityFlags.filter((flag) => !redundantFlags.includes(flag));\n}\n"]}
@@ -1,44 +1,4 @@
1
- import { __name } from './chunk-PAWJFY3S.mjs';
2
- import assert from 'node:assert';
3
-
4
- function isCompatDate(str) {
5
- return /^\d{4}-\d{2}-\d{2}$/.test(str);
6
- }
7
- __name(isCompatDate, "isCompatDate");
8
- function formatCompatibilityDate(date) {
9
- const compatDate = date.toISOString().slice(0, 10);
10
- assert(isCompatDate(compatDate));
11
- return compatDate;
12
- }
13
- __name(formatCompatibilityDate, "formatCompatibilityDate");
14
- function getTodaysCompatDate() {
15
- return formatCompatibilityDate(/* @__PURE__ */ new Date());
16
- }
17
- __name(getTodaysCompatDate, "getTodaysCompatDate");
18
- const NODEJS_COMPAT_DEFAULT_ON_DATE = "2026-08-04";
19
- function isNodejsCompatDefaultOn(compatibilityDate) {
20
- return compatibilityDate !== void 0 && compatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE;
21
- }
22
- __name(isNodejsCompatDefaultOn, "isNodejsCompatDefaultOn");
23
- const NODEJS_COMPAT_V2_SWITCH_OVER_DATE = "2024-09-23";
24
- function resolveNodejsCompat(compatibilityDate, compatibilityFlags) {
25
- const isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);
26
- const isNodejsCompatEnabled = compatibilityFlags.includes("nodejs_compat") || isDefaultOn && !compatibilityFlags.includes("no_nodejs_compat");
27
- const isNodejsCompatV2Enabled = compatibilityFlags.includes("nodejs_compat_v2") || !compatibilityFlags.includes("no_nodejs_compat_v2") && (isDefaultOn || isNodejsCompatEnabled && compatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE);
28
- return { isNodejsCompatEnabled, isNodejsCompatV2Enabled };
29
- }
30
- __name(resolveNodejsCompat, "resolveNodejsCompat");
31
- function stripRedundantNodejsCompatFlags(compatibilityDate, compatibilityFlags) {
32
- if (!isNodejsCompatDefaultOn(compatibilityDate)) {
33
- return compatibilityFlags;
34
- }
35
- const redundantFlags = ["nodejs_compat", "nodejs_compat_v2"].filter(
36
- (flag) => !compatibilityFlags.includes(`no_${flag}`)
37
- );
38
- return compatibilityFlags.filter((flag) => !redundantFlags.includes(flag));
39
- }
40
- __name(stripRedundantNodejsCompatFlags, "stripRedundantNodejsCompatFlags");
41
-
42
- export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags };
1
+ export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags } from './chunk-ZZBYXY7A.mjs';
2
+ import './chunk-CGILA3WO.mjs';
43
3
  //# sourceMappingURL=compatibility-date.mjs.map
44
4
  //# sourceMappingURL=compatibility-date.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compatibility-date.ts"],"names":[],"mappings":";;;AAiBO,SAAS,aAAa,GAAA,EAAgC;AAC5D,EAAA,OAAO,qBAAA,CAAsB,KAAK,GAAG,CAAA;AACtC;AAFgB,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA;AAUhB,SAAS,wBAAwB,IAAA,EAAwB;AACxD,EAAA,MAAM,aAAa,IAAA,CAAK,WAAA,EAAY,CAAE,KAAA,CAAM,GAAG,EAAE,CAAA;AACjD,EAAA,MAAA,CAAO,YAAA,CAAa,UAAU,CAAC,CAAA;AAC/B,EAAA,OAAO,UAAA;AACR;AAJS,MAAA,CAAA,uBAAA,EAAA,yBAAA,CAAA;AASF,SAAS,mBAAA,GAAkC;AACjD,EAAA,OAAO,uBAAA,iBAAwB,IAAI,IAAA,EAAM,CAAA;AAC1C;AA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mjs","sourcesContent":["import assert from \"node:assert\";\n\ntype YYYY = `${number}${number}${number}${number}`;\ntype MM = `${number}${number}`;\ntype DD = `${number}${number}`;\n\n/**\n * Represents a valid compatibility date, a string such as `2025-09-27`\n */\nexport type CompatDate = `${YYYY}-${MM}-${DD}`;\n\n/**\n * Discern whether a string represents a compatibility date (`YYYY-MM-DD`)\n *\n * @param str The target string\n * @returns true if the string represents a compatibility date, false otherwise\n */\nexport function isCompatDate(str: string): str is CompatDate {\n\treturn /^\\d{4}-\\d{2}-\\d{2}$/.test(str);\n}\n\n/**\n * Returns the date formatted as a compatibility date\n *\n * @param date The target date to convert\n * @returns The date as a CompatDate string (a string following the format `YYYY-MM-DD`)\n */\nfunction formatCompatibilityDate(date: Date): CompatDate {\n\tconst compatDate = date.toISOString().slice(0, 10);\n\tassert(isCompatDate(compatDate));\n\treturn compatDate;\n}\n\n/**\n * Returns today's date as a compatibility date string (`YYYY-MM-DD`).\n */\nexport function getTodaysCompatDate(): CompatDate {\n\treturn formatCompatibilityDate(new Date());\n}\n\n/**\n * The compatibility date on which the `nodejs_compat` and `nodejs_compat_v2`\n * compatibility flags became enabled by default in workerd.\n *\n * From this date onwards, specifying either flag explicitly is a validation\n * error (\"The compatibility flag nodejs_compat became the default as of\n * 2026-08-04 so does not need to be specified anymore\"), so tooling must not\n * add them to configurations using such a compatibility date.\n *\n * @see https://github.com/cloudflare/workerd/blob/main/src/workerd/io/compatibility-date.capnp\n */\nexport const NODEJS_COMPAT_DEFAULT_ON_DATE = \"2026-08-04\";\n\n/**\n * Whether workerd enables Node.js compatibility by default for the given\n * compatibility date, i.e. without the `nodejs_compat` flag being specified.\n *\n * @param compatibilityDate The compatibility date to check\n * @returns true if the date is on or after {@link NODEJS_COMPAT_DEFAULT_ON_DATE}\n */\nexport function isNodejsCompatDefaultOn(\n\tcompatibilityDate: string | undefined\n): boolean {\n\treturn (\n\t\tcompatibilityDate !== undefined &&\n\t\tcompatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE\n\t);\n}\n\n/**\n * The compatibility date on which `nodejs_compat` started implying\n * `nodejs_compat_v2`.\n */\nexport const NODEJS_COMPAT_V2_SWITCH_OVER_DATE = \"2024-09-23\";\n\n/**\n * Resolves whether workerd will enable the `nodejs_compat` and\n * `nodejs_compat_v2` features, mirroring how workerd itself resolves them from\n * the compatibility date and flags:\n * - Both are enabled by default from {@link NODEJS_COMPAT_DEFAULT_ON_DATE}\n * onwards, and each must be turned off separately from that date, with\n * `no_nodejs_compat` and `no_nodejs_compat_v2` respectively.\n * - Before that date, `nodejs_compat` implies `nodejs_compat_v2` from\n * {@link NODEJS_COMPAT_V2_SWITCH_OVER_DATE} onwards.\n *\n * @param compatibilityDate The compatibility date\n * @param compatibilityFlags The compatibility flags\n */\nexport function resolveNodejsCompat(\n\tcompatibilityDate: string,\n\tcompatibilityFlags: string[]\n): { isNodejsCompatEnabled: boolean; isNodejsCompatV2Enabled: boolean } {\n\tconst isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);\n\n\tconst isNodejsCompatEnabled =\n\t\tcompatibilityFlags.includes(\"nodejs_compat\") ||\n\t\t(isDefaultOn && !compatibilityFlags.includes(\"no_nodejs_compat\"));\n\n\tconst isNodejsCompatV2Enabled =\n\t\tcompatibilityFlags.includes(\"nodejs_compat_v2\") ||\n\t\t(!compatibilityFlags.includes(\"no_nodejs_compat_v2\") &&\n\t\t\t(isDefaultOn ||\n\t\t\t\t(isNodejsCompatEnabled &&\n\t\t\t\t\tcompatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE)));\n\n\treturn { isNodejsCompatEnabled, isNodejsCompatV2Enabled };\n}\n\n// TODO: remove when workerd no longer errors\n/**\n * Removes the `nodejs_compat` and `nodejs_compat_v2` flags from a list of\n * compatibility flags when the compatibility date already enables them.\n *\n * workerd rejects a compatibility flag that its compatibility date enables by\n * default, so from {@link NODEJS_COMPAT_DEFAULT_ON_DATE} onwards specifying\n * either flag stops a Worker from starting up. Removing them is a no-op for\n * such a date, so tooling can accept the redundant flags rather than failing.\n *\n * A flag is kept when its matching opt-out is specified too, since workerd\n * reports those as contradictory and the enable flag wins there - dropping it\n * would silently switch Node.js compatibility off instead.\n *\n * @param compatibilityDate The compatibility date\n * @param compatibilityFlags The compatibility flags\n * @returns The flags, without the ones the date makes redundant\n */\nexport function stripRedundantNodejsCompatFlags(\n\tcompatibilityDate: string | undefined,\n\tcompatibilityFlags: string[]\n): string[] {\n\tif (!isNodejsCompatDefaultOn(compatibilityDate)) {\n\t\treturn compatibilityFlags;\n\t}\n\n\tconst redundantFlags = [\"nodejs_compat\", \"nodejs_compat_v2\"].filter(\n\t\t(flag) => !compatibilityFlags.includes(`no_${flag}`)\n\t);\n\n\treturn compatibilityFlags.filter((flag) => !redundantFlags.includes(flag));\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compatibility-date.mjs"}
@@ -1,4 +1,8 @@
1
- import './chunk-PAWJFY3S.mjs';
2
- export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareApiBaseUrl, getCloudflareComplianceRegion, getComplianceRegionSubdomain } from './environment-variables/misc-variables';
1
+ export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareApiBaseUrl, getCloudflareComplianceRegion, getComplianceRegionSubdomain } from './chunk-47QFQIPP.mjs';
2
+ import './chunk-555CCIJE.mjs';
3
+ import './chunk-KAEJMITB.mjs';
4
+ import './chunk-YTEYGQOX.mjs';
5
+ import './chunk-T6I7NOR4.mjs';
6
+ import './chunk-CGILA3WO.mjs';
3
7
  //# sourceMappingURL=compliance.mjs.map
4
8
  //# sourceMappingURL=compliance.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"compliance.mjs","sourcesContent":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"compliance.mjs"}
@@ -1,13 +1,5 @@
1
- import './chunk-PAWJFY3S.mjs';
2
- import { getEnvironmentVariableFactory } from './environment-variables/factory';
3
-
4
- const getDockerPath = getEnvironmentVariableFactory({
5
- variableName: "WRANGLER_DOCKER_BIN",
6
- defaultValue() {
7
- return "docker";
8
- }
9
- });
10
-
11
- export { getDockerPath };
1
+ export { getDockerPath } from './chunk-555CCIJE.mjs';
2
+ import './chunk-KAEJMITB.mjs';
3
+ import './chunk-CGILA3WO.mjs';
12
4
  //# sourceMappingURL=docker-path.mjs.map
13
5
  //# sourceMappingURL=docker-path.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/docker-path.ts"],"names":[],"mappings":";;;AAOO,MAAM,gBAAgB,6BAAA,CAA8B;AAAA,EAC1D,YAAA,EAAc,qBAAA;AAAA,EACd,YAAA,GAAe;AACd,IAAA,OAAO,QAAA;AAAA,EACR;AACD,CAAC","file":"docker-path.mjs","sourcesContent":["import { getEnvironmentVariableFactory } from \"./environment-variables/factory\";\n\n/**\n * Returns the configured path to the Docker binary.\n *\n * @returns The value of `WRANGLER_DOCKER_BIN`, or `docker` when unset.\n */\nexport const getDockerPath = getEnvironmentVariableFactory({\n\tvariableName: \"WRANGLER_DOCKER_BIN\",\n\tdefaultValue() {\n\t\treturn \"docker\";\n\t},\n});\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"docker-path.mjs"}
package/dist/errors.mjs CHANGED
@@ -1,63 +1,4 @@
1
- import { __name } from './chunk-PAWJFY3S.mjs';
2
-
3
- class UserError extends Error {
4
- static {
5
- __name(this, "UserError");
6
- }
7
- telemetryMessage;
8
- constructor(message, options) {
9
- super(message, options);
10
- Object.setPrototypeOf(this, new.target.prototype);
11
- this.telemetryMessage = typeof options?.telemetryMessage === "string" ? options.telemetryMessage : options?.telemetryMessage ? message : void 0;
12
- }
13
- }
14
- class DeprecationError extends UserError {
15
- static {
16
- __name(this, "DeprecationError");
17
- }
18
- constructor(message, options) {
19
- super(`Deprecation:
20
- ${message}`, options);
21
- }
22
- }
23
- class FatalError extends UserError {
24
- static {
25
- __name(this, "FatalError");
26
- }
27
- code;
28
- constructor(message, options) {
29
- super(message, options);
30
- this.code = options.code;
31
- }
32
- }
33
- class CommandLineArgsError extends UserError {
34
- static {
35
- __name(this, "CommandLineArgsError");
36
- }
37
- }
38
- class JsonFriendlyFatalError extends FatalError {
39
- static {
40
- __name(this, "JsonFriendlyFatalError");
41
- }
42
- }
43
- class MissingConfigError extends Error {
44
- static {
45
- __name(this, "MissingConfigError");
46
- }
47
- telemetryMessage;
48
- constructor(key) {
49
- super(`Missing config value for ${key}`);
50
- this.telemetryMessage = `Missing config value for ${key}`;
51
- }
52
- }
53
- function createFatalError(message, isJson, options) {
54
- if (isJson) {
55
- return new JsonFriendlyFatalError(JSON.stringify(message), options);
56
- }
57
- return new FatalError(`${message}`, options);
58
- }
59
- __name(createFatalError, "createFatalError");
60
-
61
- export { CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, UserError, createFatalError };
1
+ export { CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, UserError, createFatalError } from './chunk-KAEJMITB.mjs';
2
+ import './chunk-CGILA3WO.mjs';
62
3
  //# sourceMappingURL=errors.mjs.map
63
4
  //# sourceMappingURL=errors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts"],"names":[],"mappings":";;AAoBO,MAAM,kBAAkB,KAAA,CAAM;AAAA,EApBrC;AAoBqC,IAAA,MAAA,CAAA,IAAA,EAAA,WAAA,CAAA;AAAA;AAAA,EACpC,gBAAA;AAAA,EACA,WAAA,CAAY,SAAiB,OAAA,EAA2B;AACvD,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAGtB,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,GAAA,CAAA,MAAA,CAAW,SAAS,CAAA;AAChD,IAAA,IAAA,CAAK,gBAAA,GACJ,OAAO,OAAA,EAAS,gBAAA,KAAqB,WAClC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AA,CAAuB,IAAA,CAAK,SAAA,CAAU,OAAO,GAAG,OAAO,CAAA;AAAA,EACnE;AAEA,EAAA,OAAO,IAAI,UAAA,CAAW,CAAA,EAAG,OAAO,IAAI,OAAO,CAAA;AAC5C;AAVgB,MAAA,CAAA,gBAAA,EAAA,kBAAA,CAAA","file":"errors.mjs","sourcesContent":["/**\n * This is used to provide telemetry with a sanitised error\n * message that could not have any user-identifying information.\n * Set to `true` to duplicate `message`.\n * */\nexport type TelemetryMessage = {\n\ttelemetryMessage: string | boolean;\n};\n\ntype UserErrorOptions = ErrorOptions & TelemetryMessage;\n\ntype FatalErrorOptions = UserErrorOptions & {\n\tcode?: number;\n};\n/**\n * Base class for errors where the user has done something wrong. These are not\n * reported to Sentry. API errors are intentionally *not* `UserError`s, and are\n * reported to Sentry. This will help us understand which API errors need better\n * messaging.\n */\nexport class UserError extends Error {\n\ttelemetryMessage: string | undefined;\n\tconstructor(message: string, options: UserErrorOptions) {\n\t\tsuper(message, options);\n\t\t// Restore prototype chain:\n\t\t// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html#support-for-newtarget\n\t\tObject.setPrototypeOf(this, new.target.prototype);\n\t\tthis.telemetryMessage =\n\t\t\ttypeof options?.telemetryMessage === \"string\"\n\t\t\t\t? options.telemetryMessage\n\t\t\t\t: options?.telemetryMessage\n\t\t\t\t\t? message\n\t\t\t\t\t: undefined;\n\t}\n}\n\nexport class DeprecationError extends UserError {\n\tconstructor(message: string, options: TelemetryMessage) {\n\t\tsuper(`Deprecation:\\n${message}`, options);\n\t}\n}\n\nexport class FatalError extends UserError {\n\treadonly code: number | undefined;\n\n\tconstructor(message: string, options: FatalErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.code = options.code;\n\t}\n}\n\nexport class CommandLineArgsError extends UserError {}\n\n/**\n * JsonFriendlyFatalError is used to output JSON when wrangler crashes, useful for --json mode.\n *\n * To use, pass stringify'd json into the constructor like so:\n * ```js\n * throw new JsonFriendlyFatalError(JSON.stringify({ error: messageToDisplay }), {\n * telemetryMessage: false,\n * });\n * ```\n */\nexport class JsonFriendlyFatalError extends FatalError {}\n\nexport class MissingConfigError extends Error {\n\ttelemetryMessage: string | undefined;\n\tconstructor(key: string) {\n\t\tsuper(`Missing config value for ${key}`);\n\t\tthis.telemetryMessage = `Missing config value for ${key}`;\n\t}\n}\n\n/**\n * Create either a FatalError or JsonFriendlyFatalError depending upon `isJson` parameter.\n *\n * If `isJson` is true, then the `message` is JSON stringified.\n */\nexport function createFatalError(\n\tmessage: unknown,\n\tisJson: boolean,\n\toptions: FatalErrorOptions\n): Error {\n\tif (isJson) {\n\t\treturn new JsonFriendlyFatalError(JSON.stringify(message), options);\n\t}\n\n\treturn new FatalError(`${message}`, options);\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"errors.mjs"}
@@ -1,35 +1,4 @@
1
- import { __name } from './chunk-PAWJFY3S.mjs';
2
- import fs from 'node:fs';
3
-
4
- function isDirectory(path) {
5
- return fs.statSync(path, { throwIfNoEntry: false })?.isDirectory() ?? false;
6
- }
7
- __name(isDirectory, "isDirectory");
8
- function removeDir(dirPath, { fireAndForget = false } = {}) {
9
- const result = fs.promises.rm(dirPath, {
10
- recursive: true,
11
- force: true,
12
- maxRetries: 5,
13
- retryDelay: 100
14
- });
15
- if (fireAndForget) {
16
- void result.catch(() => {
17
- });
18
- } else {
19
- return result;
20
- }
21
- }
22
- __name(removeDir, "removeDir");
23
- function removeDirSync(dirPath) {
24
- fs.rmSync(dirPath, {
25
- recursive: true,
26
- force: true,
27
- maxRetries: 5,
28
- retryDelay: 100
29
- });
30
- }
31
- __name(removeDirSync, "removeDirSync");
32
-
33
- export { isDirectory, removeDir, removeDirSync };
1
+ export { isDirectory, removeDir, removeDirSync } from './chunk-T6I7NOR4.mjs';
2
+ import './chunk-CGILA3WO.mjs';
34
3
  //# sourceMappingURL=fs-helpers.mjs.map
35
4
  //# sourceMappingURL=fs-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/fs-helpers.ts"],"names":[],"mappings":";;;AAUO,SAAS,YAAY,IAAA,EAAc;AACzC,EAAA,OAAO,EAAA,CAAG,SAAS,IAAA,EAAM,EAAE,gBAAgB,KAAA,EAAO,CAAA,EAAG,WAAA,EAAY,IAAK,KAAA;AACvE;AAFgB,MAAA,CAAA,WAAA,EAAA,aAAA,CAAA;AA4BT,SAAS,UACf,OAAA,EACA,EAAE,gBAAgB,KAAA,EAAM,GAAiC,EAAC,EACnC;AAOvB,EAAA,MAAM,MAAA,GAAS,EAAA,CAAG,QAAA,CAAS,EAAA,CAAG,OAAA,EAAS;AAAA,IACtC,SAAA,EAAW,IAAA;AAAA,IACX,KAAA,EAAO,IAAA;AAAA,IACP,UAAA,EAAY,CAAA;AAAA,IACZ,UAAA,EAAY;AAAA,GACZ,CAAA;AACD,EAAA,IAAI,aAAA,EAAe;AAElB,IAAA,KAAK,MAAA,CAAO,MAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AAAA,EAC3B,CAAA,MAAO;AACN,IAAA,OAAO,MAAA;AAAA,EACR;AACD;AAtBgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA;AAgCT,SAAS,cAAc,OAAA,EAAuB;AAEpD,EAAA,EAAA,CAAG,OAAO,OAAA,EAAS;AAAA,IAClB,SAAA,EAAW,IAAA;AAAA,IACX,KAAA,EAAO,IAAA;AAAA,IACP,UAAA,EAAY,CAAA;AAAA,IACZ,UAAA,EAAY;AAAA,GACZ,CAAA;AACF;AARgB,MAAA,CAAA,aAAA,EAAA,eAAA,CAAA","file":"fs-helpers.mjs","sourcesContent":["import fs from \"node:fs\";\n\n/**\n * Returns whether the given path is a directory\n *\n * Note: this function never throws; if the path does not exist or is inaccessible, it returns false.\n *\n * @param path The file system path to check\n * @returns `true` if the path is a directory, `false` otherwise\n */\nexport function isDirectory(path: string) {\n\treturn fs.statSync(path, { throwIfNoEntry: false })?.isDirectory() ?? false;\n}\n\n/**\n * Recursively remove a directory without waiting for completion or throwing any errors.\n *\n * @param dirPath The directory path to remove\n * @param options An object with a `fireAndForget` property set to `true`\n * @return `void` - the removal is fire-and-forget with errors suppressed\n */\nexport function removeDir(\n\tdirPath: string,\n\t{ fireAndForget }: { fireAndForget: true }\n): void;\n\n/**\n * Recursively remove a directory with retries for Windows compatibility.\n *\n * @param dirPath The directory path to remove\n * @param options An optional object with a `fireAndForget` property set to `false`, if defined\n * @return `Promise<void>` - resolves when the removal is complete, or rejects if the removal fails\n */\nexport function removeDir(\n\tdirPath: string,\n\toptions?: { fireAndForget?: false }\n): Promise<void>;\n\nexport function removeDir(\n\tdirPath: string,\n\t{ fireAndForget = false }: { fireAndForget?: boolean } = {}\n): Promise<void> | void {\n\t// On Windows, `workerd` (and other processes) may not release file handles\n\t// immediately after disposal, causing `EBUSY` errors. Node.js's built-in\n\t// `maxRetries` option handles `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`,\n\t// and `EPERM` errors with automatic backoff retries.\n\n\t// eslint-disable-next-line workers-sdk/no-direct-recursive-rm -- this is the helper itself\n\tconst result = fs.promises.rm(dirPath, {\n\t\trecursive: true,\n\t\tforce: true,\n\t\tmaxRetries: 5,\n\t\tretryDelay: 100,\n\t});\n\tif (fireAndForget) {\n\t\t// Don't wait for the promise, and silently swallow errors by handling if rejected\n\t\tvoid result.catch(() => {});\n\t} else {\n\t\treturn result;\n\t}\n}\n\n/**\n * Synchronously and recursively remove a directory, with retries for Windows compatibility.\n *\n * @see {@link removeDir} for the async version and rationale.\n *\n * @param dirPath The directory path to remove\n * @throws If the removal fails after retries, an error will be thrown\n */\nexport function removeDirSync(dirPath: string): void {\n\t// eslint-disable-next-line workers-sdk/no-direct-recursive-rm -- this is the helper itself\n\tfs.rmSync(dirPath, {\n\t\trecursive: true,\n\t\tforce: true,\n\t\tmaxRetries: 5,\n\t\tretryDelay: 100,\n\t});\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"fs-helpers.mjs"}
@@ -1,30 +1,5 @@
1
- import { __name } from './chunk-PAWJFY3S.mjs';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { isDirectory } from './fs-helpers';
5
- import { xdgAppPaths } from './xdg-app-paths';
6
-
7
- function getGlobalConfigPath({
8
- appName = "wrangler",
9
- leadingDot = true,
10
- useLegacyHomeDir = true
11
- } = {}) {
12
- const dirName = `${leadingDot ? "." : ""}${appName}`;
13
- const configDir = xdgAppPaths(dirName).config();
14
- if (useLegacyHomeDir) {
15
- const legacyConfigDir = path.join(os.homedir(), dirName);
16
- if (isDirectory(legacyConfigDir)) {
17
- return legacyConfigDir;
18
- }
19
- }
20
- return configDir;
21
- }
22
- __name(getGlobalConfigPath, "getGlobalConfigPath");
23
- function getGlobalWranglerCachePath() {
24
- return xdgAppPaths(".wrangler").cache();
25
- }
26
- __name(getGlobalWranglerCachePath, "getGlobalWranglerCachePath");
27
-
28
- export { getGlobalConfigPath, getGlobalWranglerCachePath };
1
+ export { getGlobalConfigPath, getGlobalWranglerCachePath } from './chunk-YTEYGQOX.mjs';
2
+ import './chunk-T6I7NOR4.mjs';
3
+ import './chunk-CGILA3WO.mjs';
29
4
  //# sourceMappingURL=global-wrangler-config-path.mjs.map
30
5
  //# sourceMappingURL=global-wrangler-config-path.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/global-wrangler-config-path.ts"],"names":[],"mappings":";;;;;;AA+BO,SAAS,mBAAA,CAAoB;AAAA,EACnC,OAAA,GAAU,UAAA;AAAA,EACV,UAAA,GAAa,IAAA;AAAA,EACb,gBAAA,GAAmB;AACpB,CAAA,GAAgC,EAAC,EAAG;AAEnC,EAAA,MAAM,UAAU,CAAA,EAAG,UAAA,GAAa,GAAA,GAAM,EAAE,GAAG,OAAO,CAAA,CAAA;AAClD,EAAA,MAAM,SAAA,GAAY,WAAA,CAAY,OAAO,CAAA,CAAE,MAAA,EAAO;AAE9C,EAAA,IAAI,gBAAA,EAAkB;AACrB,IAAA,MAAM,kBAAkB,IAAA,CAAK,IAAA,CAAK,EAAA,CAAG,OAAA,IAAW,OAAO,CAAA;AAGvD,IAAA,IAAI,WAAA,CAAY,eAAe,CAAA,EAAG;AACjC,MAAA,OAAO,eAAA;AAAA,IACR;AAAA,EACD;AAEA,EAAA,OAAO,SAAA;AACR;AAnBgB,MAAA,CAAA,mBAAA,EAAA,qBAAA,CAAA;AA2BT,SAAS,0BAAA,GAA6B;AAC5C,EAAA,OAAO,WAAA,CAAY,WAAW,CAAA,CAAE,KAAA,EAAM;AACvC;AAFgB,MAAA,CAAA,0BAAA,EAAA,4BAAA,CAAA","file":"global-wrangler-config-path.mjs","sourcesContent":["import os from \"node:os\";\nimport path from \"node:path\";\nimport { isDirectory } from \"./fs-helpers\";\nimport { xdgAppPaths } from \"./xdg-app-paths\";\n\nexport interface GetGlobalConfigPathOptions {\n\t/**\n\t * The application namespace. Defaults to `\"wrangler\"`.\n\t */\n\tappName?: string;\n\t/**\n\t * Whether to prepend a `.` to `appName` when resolving the XDG path and the\n\t * legacy `$HOME` directory. Defaults to `true` to match wrangler's\n\t * historical behaviour (`.wrangler`).\n\t */\n\tleadingDot?: boolean;\n\t/**\n\t * When `true` (the default, matching wrangler's historical behaviour), a\n\t * pre-existing `~/.<appName>` directory takes precedence over the XDG path.\n\t * Pass `false` to always use the XDG-compliant path.\n\t */\n\tuseLegacyHomeDir?: boolean;\n}\n\n/**\n * Resolve the global config directory for a Cloudflare CLI.\n *\n * Defaults to wrangler's directory (`.wrangler`) so existing callers are\n * unaffected, but accepts an `appName` so other first-party CLIs (e.g. `cf`)\n * can reuse the same XDG-compliant resolution under their own namespace.\n */\nexport function getGlobalConfigPath({\n\tappName = \"wrangler\",\n\tleadingDot = true,\n\tuseLegacyHomeDir = true,\n}: GetGlobalConfigPathOptions = {}) {\n\t//TODO: We should implement a custom path --global-config and/or the WRANGLER_HOME type environment variable\n\tconst dirName = `${leadingDot ? \".\" : \"\"}${appName}`;\n\tconst configDir = xdgAppPaths(dirName).config(); // New XDG compliant config path\n\n\tif (useLegacyHomeDir) {\n\t\tconst legacyConfigDir = path.join(os.homedir(), dirName); // Legacy config in user's home directory\n\t\t// Check for the legacy directory in $HOME; if it is not there then use the\n\t\t// XDG compliant path.\n\t\tif (isDirectory(legacyConfigDir)) {\n\t\t\treturn legacyConfigDir;\n\t\t}\n\t}\n\n\treturn configDir;\n}\n\n/**\n * Resolve the XDG-compliant global cache directory for wrangler (`.wrangler`).\n *\n * Unlike {@link getGlobalConfigPath}, this never falls back to a legacy\n * `~/.wrangler` directory.\n */\nexport function getGlobalWranglerCachePath() {\n\treturn xdgAppPaths(\".wrangler\").cache();\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"global-wrangler-config-path.mjs"}