@cloudflare/workers-utils 0.40.1 → 0.41.1

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,9 +1,9 @@
1
1
  export { MetricsRegistry } from './chunk-Z62CVNHJ.mjs';
2
2
  export { _forceColour, formatZodError } from './chunk-7AX24RFK.mjs';
3
- import { isRedirectedRawConfig, configFileName, formatConfigSnippet, getDurableObjectExports, getContainerNameToClassNameMap, parsePackageJSON, readFileSync, ParseError, parseJSON, APIError, CONTAINER_IMAGES_BINDING, dir, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-JGKSDUFK.mjs';
4
- export { APIError, CONTAINER_IMAGES_BINDING, ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, configFileName, configFormat, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectClassNameToUseSQLiteMap, getDurableObjectContainerApps, getDurableObjectExports, getResolvedDurableObjectContainerApps, hasDurableObjectExports, indexLocation, isDurableObjectContainerApp, isRedirectedConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveWranglerConfigPath, searchLocation, validateDurableObjectContainerApplications } from './chunk-JGKSDUFK.mjs';
5
- import { assertNever } from './chunk-S6ZAI5DC.mjs';
6
- export { DEFAULT_COMPAT_DATE, assertNever, constructWranglerConfig, mapWorkerMetadataBindings } from './chunk-S6ZAI5DC.mjs';
3
+ import { isRedirectedRawConfig, configFileName, formatConfigSnippet, getDurableObjectExports, getContainerNameToClassNameMap, parsePackageJSON, readFileSync, ParseError, parseJSON, APIError, dir, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-IKXB77SR.mjs';
4
+ export { APIError, ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, ParseError, SERVICE_TAG_PREFIX, configFileName, configFormat, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, getContainerDurableObjectClassNames, getContainerNameToClassNameMap, getDurableObjectClassNameToUseSQLiteMap, getDurableObjectContainerApps, getDurableObjectExports, getResolvedDurableObjectContainerApps, hasDurableObjectExports, indexLocation, isDurableObjectContainerApp, isRedirectedConfig, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, partitionExports, readFileSync, readFileSyncToBuffer, resolveContainerClassName, resolveWranglerConfigPath, searchLocation, validateDurableObjectContainerApplications } from './chunk-IKXB77SR.mjs';
5
+ import { assertNever } from './chunk-4PNP2TCS.mjs';
6
+ export { DEFAULT_COMPAT_DATE, assertNever, constructWranglerConfig, mapWorkerMetadataBindings } from './chunk-4PNP2TCS.mjs';
7
7
  export { NODEJS_COMPAT_DEFAULT_ON_DATE, NODEJS_COMPAT_V2_SWITCH_OVER_DATE, getTodaysCompatDate, isCompatDate, isNodejsCompatDefaultOn, resolveNodejsCompat, stripRedundantNodejsCompatFlags } from './chunk-C6O4ION7.mjs';
8
8
  import { getCloudflareEnv, getCloudflareContainerRegistry, getCloudflareApiBaseUrl, getTraceHeader, getCloudflaredPathFromEnv, getOutputFilePathFromEnv, getOutputFileDirectoryFromEnv, getCIOverrideName, getWranglerCacheDirFromEnv } from './chunk-IYSONYTF.mjs';
9
9
  export { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareContainerRegistry, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getLocalExplorerEnabledFromEnv, getLocalObservabilityEnabledFromEnv, getNoSkillsUpdatePromptsFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, isDoNotTrackEnabled } from './chunk-IYSONYTF.mjs';
@@ -486,11 +486,11 @@ var require_command_exists = __commonJS({
486
486
  "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$1, module) {
487
487
  var exec = __require("child_process").exec;
488
488
  var execSync = __require("child_process").execSync;
489
- var fs3 = __require("fs");
490
- var path5 = __require("path");
491
- var access = fs3.access;
492
- var accessSync2 = fs3.accessSync;
493
- var constants2 = fs3.constants || fs3;
489
+ var fs4 = __require("fs");
490
+ var path6 = __require("path");
491
+ var access = fs4.access;
492
+ var accessSync2 = fs4.accessSync;
493
+ var constants2 = fs4.constants || fs4;
494
494
  var isUsingWindows = process.platform == "win32";
495
495
  var fileNotExists = /* @__PURE__ */ __name(function(commandName, callback) {
496
496
  access(
@@ -591,8 +591,8 @@ var require_command_exists = __commonJS({
591
591
  cleanInput = /* @__PURE__ */ __name(function(s) {
592
592
  var isPathName = /[\\]/.test(s);
593
593
  if (isPathName) {
594
- var dirname4 = '"' + path5.dirname(s) + '"';
595
- var basename2 = '"' + path5.basename(s) + '"';
594
+ var dirname4 = '"' + path6.dirname(s) + '"';
595
+ var basename2 = '"' + path6.basename(s) + '"';
596
596
  return dirname4 + ":" + basename2;
597
597
  }
598
598
  return '"' + s + '"';
@@ -874,9 +874,9 @@ var require_strip_json_comments = __commonJS({
874
874
  // ../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js
875
875
  var require_utils = __commonJS({
876
876
  "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$1) {
877
- var fs3 = __require("fs");
877
+ var fs4 = __require("fs");
878
878
  var ini = require_ini();
879
- var path5 = __require("path");
879
+ var path6 = __require("path");
880
880
  var stripJsonComments = require_strip_json_comments();
881
881
  var parse3 = exports$1.parse = function(content) {
882
882
  if (/^\s*{/.test(content))
@@ -890,9 +890,9 @@ var require_utils = __commonJS({
890
890
  for (var i in args)
891
891
  if ("string" !== typeof args[i])
892
892
  return;
893
- var file3 = path5.join.apply(null, args);
893
+ var file3 = path6.join.apply(null, args);
894
894
  try {
895
- return fs3.readFileSync(file3, "utf-8");
895
+ return fs4.readFileSync(file3, "utf-8");
896
896
  } catch (err) {
897
897
  return;
898
898
  }
@@ -927,15 +927,15 @@ var require_utils = __commonJS({
927
927
  return obj;
928
928
  };
929
929
  exports$1.find = function() {
930
- var rel = path5.join.apply(null, [].slice.call(arguments));
930
+ var rel = path6.join.apply(null, [].slice.call(arguments));
931
931
  function find2(start, rel2) {
932
- var file3 = path5.join(start, rel2);
932
+ var file3 = path6.join(start, rel2);
933
933
  try {
934
- fs3.statSync(file3);
934
+ fs4.statSync(file3);
935
935
  return file3;
936
936
  } catch (err) {
937
- if (path5.dirname(start) !== start)
938
- return find2(path5.dirname(start), rel2);
937
+ if (path6.dirname(start) !== start)
938
+ return find2(path6.dirname(start), rel2);
939
939
  }
940
940
  }
941
941
  __name(find2, "find");
@@ -1425,8 +1425,8 @@ var require_registry_auth_token = __commonJS({
1425
1425
  return void 0;
1426
1426
  }
1427
1427
  __name(getLegacyAuthInfo, "getLegacyAuthInfo");
1428
- function normalizePath(path5) {
1429
- return path5[path5.length - 1] === "/" ? path5 : path5 + "/";
1428
+ function normalizePath(path6) {
1429
+ return path6[path6.length - 1] === "/" ? path6 : path6 + "/";
1430
1430
  }
1431
1431
  __name(normalizePath, "normalizePath");
1432
1432
  function getAuthInfoForUrl(regUrl, npmrc) {
@@ -1477,19 +1477,19 @@ var require_update_check = __commonJS({
1477
1477
  "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$1, module) {
1478
1478
  var { URL: URL2 } = __require("url");
1479
1479
  var { join: join3 } = __require("path");
1480
- var fs3 = __require("fs");
1480
+ var fs4 = __require("fs");
1481
1481
  var { promisify } = __require("util");
1482
1482
  var { tmpdir } = __require("os");
1483
1483
  var registryUrl = require_registry_url();
1484
- var writeFile = promisify(fs3.writeFile);
1485
- var mkdir = promisify(fs3.mkdir);
1486
- var readFile = promisify(fs3.readFile);
1484
+ var writeFile = promisify(fs4.writeFile);
1485
+ var mkdir = promisify(fs4.mkdir);
1486
+ var readFile = promisify(fs4.readFile);
1487
1487
  var compareVersions = /* @__PURE__ */ __name((a, b) => a.localeCompare(b, "en-US", { numeric: true }), "compareVersions");
1488
1488
  var encode3 = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/^%40/, "@"), "encode");
1489
1489
  var getFile = /* @__PURE__ */ __name(async (details, distTag) => {
1490
1490
  const rootDir = tmpdir();
1491
1491
  const subDir = join3(rootDir, "update-check");
1492
- if (!fs3.existsSync(subDir)) {
1492
+ if (!fs4.existsSync(subDir)) {
1493
1493
  await mkdir(subDir);
1494
1494
  }
1495
1495
  let name = `${details.name}-${distTag}.json`;
@@ -1499,7 +1499,7 @@ var require_update_check = __commonJS({
1499
1499
  return join3(subDir, name);
1500
1500
  }, "getFile");
1501
1501
  var evaluateCache = /* @__PURE__ */ __name(async (file2, time3, interval) => {
1502
- if (fs3.existsSync(file2)) {
1502
+ if (fs4.existsSync(file2)) {
1503
1503
  const content = await readFile(file2, "utf8");
1504
1504
  const { lastUpdate, latest } = JSON.parse(content);
1505
1505
  const nextCheck = lastUpdate + interval;
@@ -1626,6 +1626,796 @@ var require_update_check = __commonJS({
1626
1626
  }
1627
1627
  });
1628
1628
 
1629
+ // ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js
1630
+ var require_path = __commonJS({
1631
+ "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports$1, module) {
1632
+ var isWindows = typeof process === "object" && process && process.platform === "win32";
1633
+ module.exports = isWindows ? { sep: "\\" } : { sep: "/" };
1634
+ }
1635
+ });
1636
+
1637
+ // ../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
1638
+ var require_balanced_match = __commonJS({
1639
+ "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports$1, module) {
1640
+ module.exports = balanced;
1641
+ function balanced(a, b, str) {
1642
+ if (a instanceof RegExp) a = maybeMatch(a, str);
1643
+ if (b instanceof RegExp) b = maybeMatch(b, str);
1644
+ var r2 = range(a, b, str);
1645
+ return r2 && {
1646
+ start: r2[0],
1647
+ end: r2[1],
1648
+ pre: str.slice(0, r2[0]),
1649
+ body: str.slice(r2[0] + a.length, r2[1]),
1650
+ post: str.slice(r2[1] + b.length)
1651
+ };
1652
+ }
1653
+ __name(balanced, "balanced");
1654
+ function maybeMatch(reg, str) {
1655
+ var m = str.match(reg);
1656
+ return m ? m[0] : null;
1657
+ }
1658
+ __name(maybeMatch, "maybeMatch");
1659
+ balanced.range = range;
1660
+ function range(a, b, str) {
1661
+ var begs, beg, left, right, result;
1662
+ var ai = str.indexOf(a);
1663
+ var bi = str.indexOf(b, ai + 1);
1664
+ var i = ai;
1665
+ if (ai >= 0 && bi > 0) {
1666
+ if (a === b) {
1667
+ return [ai, bi];
1668
+ }
1669
+ begs = [];
1670
+ left = str.length;
1671
+ while (i >= 0 && !result) {
1672
+ if (i == ai) {
1673
+ begs.push(i);
1674
+ ai = str.indexOf(a, i + 1);
1675
+ } else if (begs.length == 1) {
1676
+ result = [begs.pop(), bi];
1677
+ } else {
1678
+ beg = begs.pop();
1679
+ if (beg < left) {
1680
+ left = beg;
1681
+ right = bi;
1682
+ }
1683
+ bi = str.indexOf(b, i + 1);
1684
+ }
1685
+ i = ai < bi && ai >= 0 ? ai : bi;
1686
+ }
1687
+ if (begs.length) {
1688
+ result = [left, right];
1689
+ }
1690
+ }
1691
+ return result;
1692
+ }
1693
+ __name(range, "range");
1694
+ }
1695
+ });
1696
+
1697
+ // ../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
1698
+ var require_brace_expansion = __commonJS({
1699
+ "../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports$1, module) {
1700
+ var balanced = require_balanced_match();
1701
+ module.exports = expandTop;
1702
+ var escSlash = "\0SLASH" + Math.random() + "\0";
1703
+ var escOpen = "\0OPEN" + Math.random() + "\0";
1704
+ var escClose = "\0CLOSE" + Math.random() + "\0";
1705
+ var escComma = "\0COMMA" + Math.random() + "\0";
1706
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
1707
+ function numeric(str) {
1708
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
1709
+ }
1710
+ __name(numeric, "numeric");
1711
+ function escapeBraces(str) {
1712
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
1713
+ }
1714
+ __name(escapeBraces, "escapeBraces");
1715
+ function unescapeBraces(str) {
1716
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
1717
+ }
1718
+ __name(unescapeBraces, "unescapeBraces");
1719
+ function parseCommaParts(str) {
1720
+ if (!str)
1721
+ return [""];
1722
+ var parts = [];
1723
+ var m = balanced("{", "}", str);
1724
+ if (!m)
1725
+ return str.split(",");
1726
+ var pre = m.pre;
1727
+ var body = m.body;
1728
+ var post = m.post;
1729
+ var p = pre.split(",");
1730
+ p[p.length - 1] += "{" + body + "}";
1731
+ var postParts = parseCommaParts(post);
1732
+ if (post.length) {
1733
+ p[p.length - 1] += postParts.shift();
1734
+ p.push.apply(p, postParts);
1735
+ }
1736
+ parts.push.apply(parts, p);
1737
+ return parts;
1738
+ }
1739
+ __name(parseCommaParts, "parseCommaParts");
1740
+ function expandTop(str) {
1741
+ if (!str)
1742
+ return [];
1743
+ if (str.substr(0, 2) === "{}") {
1744
+ str = "\\{\\}" + str.substr(2);
1745
+ }
1746
+ return expand(escapeBraces(str), true).map(unescapeBraces);
1747
+ }
1748
+ __name(expandTop, "expandTop");
1749
+ function embrace(str) {
1750
+ return "{" + str + "}";
1751
+ }
1752
+ __name(embrace, "embrace");
1753
+ function isPadded(el) {
1754
+ return /^-?0\d/.test(el);
1755
+ }
1756
+ __name(isPadded, "isPadded");
1757
+ function lte(i, y) {
1758
+ return i <= y;
1759
+ }
1760
+ __name(lte, "lte");
1761
+ function gte(i, y) {
1762
+ return i >= y;
1763
+ }
1764
+ __name(gte, "gte");
1765
+ function expand(str, isTop) {
1766
+ var expansions = [];
1767
+ var m = balanced("{", "}", str);
1768
+ if (!m) return [str];
1769
+ var pre = m.pre;
1770
+ var post = m.post.length ? expand(m.post, false) : [""];
1771
+ if (/\$$/.test(m.pre)) {
1772
+ for (var k = 0; k < post.length; k++) {
1773
+ var expansion = pre + "{" + m.body + "}" + post[k];
1774
+ expansions.push(expansion);
1775
+ }
1776
+ } else {
1777
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
1778
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
1779
+ var isSequence = isNumericSequence || isAlphaSequence;
1780
+ var isOptions = m.body.indexOf(",") >= 0;
1781
+ if (!isSequence && !isOptions) {
1782
+ if (m.post.match(/,.*\}/)) {
1783
+ str = m.pre + "{" + m.body + escClose + m.post;
1784
+ return expand(str);
1785
+ }
1786
+ return [str];
1787
+ }
1788
+ var n2;
1789
+ if (isSequence) {
1790
+ n2 = m.body.split(/\.\./);
1791
+ } else {
1792
+ n2 = parseCommaParts(m.body);
1793
+ if (n2.length === 1) {
1794
+ n2 = expand(n2[0], false).map(embrace);
1795
+ if (n2.length === 1) {
1796
+ return post.map(function(p) {
1797
+ return m.pre + n2[0] + p;
1798
+ });
1799
+ }
1800
+ }
1801
+ }
1802
+ var N;
1803
+ if (isSequence) {
1804
+ var x = numeric(n2[0]);
1805
+ var y = numeric(n2[1]);
1806
+ var width = Math.max(n2[0].length, n2[1].length);
1807
+ var incr = n2.length == 3 ? Math.abs(numeric(n2[2])) : 1;
1808
+ var test = lte;
1809
+ var reverse = y < x;
1810
+ if (reverse) {
1811
+ incr *= -1;
1812
+ test = gte;
1813
+ }
1814
+ var pad = n2.some(isPadded);
1815
+ N = [];
1816
+ for (var i = x; test(i, y); i += incr) {
1817
+ var c;
1818
+ if (isAlphaSequence) {
1819
+ c = String.fromCharCode(i);
1820
+ if (c === "\\")
1821
+ c = "";
1822
+ } else {
1823
+ c = String(i);
1824
+ if (pad) {
1825
+ var need = width - c.length;
1826
+ if (need > 0) {
1827
+ var z2 = new Array(need + 1).join("0");
1828
+ if (i < 0)
1829
+ c = "-" + z2 + c.slice(1);
1830
+ else
1831
+ c = z2 + c;
1832
+ }
1833
+ }
1834
+ }
1835
+ N.push(c);
1836
+ }
1837
+ } else {
1838
+ N = [];
1839
+ for (var j = 0; j < n2.length; j++) {
1840
+ N.push.apply(N, expand(n2[j], false));
1841
+ }
1842
+ }
1843
+ for (var j = 0; j < N.length; j++) {
1844
+ for (var k = 0; k < post.length; k++) {
1845
+ var expansion = pre + N[j] + post[k];
1846
+ if (!isTop || isSequence || expansion)
1847
+ expansions.push(expansion);
1848
+ }
1849
+ }
1850
+ }
1851
+ return expansions;
1852
+ }
1853
+ __name(expand, "expand");
1854
+ }
1855
+ });
1856
+
1857
+ // ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
1858
+ var require_minimatch = __commonJS({
1859
+ "../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports$1, module) {
1860
+ var minimatch = module.exports = (p, pattern, options = {}) => {
1861
+ assertValidPattern(pattern);
1862
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1863
+ return false;
1864
+ }
1865
+ return new Minimatch2(pattern, options).match(p);
1866
+ };
1867
+ module.exports = minimatch;
1868
+ var path6 = require_path();
1869
+ minimatch.sep = path6.sep;
1870
+ var GLOBSTAR = Symbol("globstar **");
1871
+ minimatch.GLOBSTAR = GLOBSTAR;
1872
+ var expand = require_brace_expansion();
1873
+ var plTypes = {
1874
+ "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
1875
+ "?": { open: "(?:", close: ")?" },
1876
+ "+": { open: "(?:", close: ")+" },
1877
+ "*": { open: "(?:", close: ")*" },
1878
+ "@": { open: "(?:", close: ")" }
1879
+ };
1880
+ var qmark = "[^/]";
1881
+ var star = qmark + "*?";
1882
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
1883
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
1884
+ var charSet = /* @__PURE__ */ __name((s) => s.split("").reduce((set2, c) => {
1885
+ set2[c] = true;
1886
+ return set2;
1887
+ }, {}), "charSet");
1888
+ var reSpecials = charSet("().*{}+?[]^$\\!");
1889
+ var addPatternStartSet = charSet("[.(");
1890
+ var slashSplit = /\/+/;
1891
+ minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
1892
+ var ext = /* @__PURE__ */ __name((a, b = {}) => {
1893
+ const t2 = {};
1894
+ Object.keys(a).forEach((k) => t2[k] = a[k]);
1895
+ Object.keys(b).forEach((k) => t2[k] = b[k]);
1896
+ return t2;
1897
+ }, "ext");
1898
+ minimatch.defaults = (def) => {
1899
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
1900
+ return minimatch;
1901
+ }
1902
+ const orig = minimatch;
1903
+ const m = /* @__PURE__ */ __name((p, pattern, options) => orig(p, pattern, ext(def, options)), "m");
1904
+ m.Minimatch = class Minimatch extends orig.Minimatch {
1905
+ static {
1906
+ __name(this, "Minimatch");
1907
+ }
1908
+ constructor(pattern, options) {
1909
+ super(pattern, ext(def, options));
1910
+ }
1911
+ };
1912
+ m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch;
1913
+ m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
1914
+ m.defaults = (options) => orig.defaults(ext(def, options));
1915
+ m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
1916
+ m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
1917
+ m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
1918
+ return m;
1919
+ };
1920
+ minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
1921
+ var braceExpand = /* @__PURE__ */ __name((pattern, options = {}) => {
1922
+ assertValidPattern(pattern);
1923
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1924
+ return [pattern];
1925
+ }
1926
+ return expand(pattern);
1927
+ }, "braceExpand");
1928
+ var MAX_PATTERN_LENGTH = 1024 * 64;
1929
+ var assertValidPattern = /* @__PURE__ */ __name((pattern) => {
1930
+ if (typeof pattern !== "string") {
1931
+ throw new TypeError("invalid pattern");
1932
+ }
1933
+ if (pattern.length > MAX_PATTERN_LENGTH) {
1934
+ throw new TypeError("pattern is too long");
1935
+ }
1936
+ }, "assertValidPattern");
1937
+ var SUBPARSE = Symbol("subparse");
1938
+ minimatch.makeRe = (pattern, options) => new Minimatch2(pattern, options || {}).makeRe();
1939
+ minimatch.match = (list, pattern, options = {}) => {
1940
+ const mm = new Minimatch2(pattern, options);
1941
+ list = list.filter((f) => mm.match(f));
1942
+ if (mm.options.nonull && !list.length) {
1943
+ list.push(pattern);
1944
+ }
1945
+ return list;
1946
+ };
1947
+ var globUnescape = /* @__PURE__ */ __name((s) => s.replace(/\\(.)/g, "$1"), "globUnescape");
1948
+ var charUnescape = /* @__PURE__ */ __name((s) => s.replace(/\\([^-\]])/g, "$1"), "charUnescape");
1949
+ var regExpEscape = /* @__PURE__ */ __name((s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), "regExpEscape");
1950
+ var braExpEscape = /* @__PURE__ */ __name((s) => s.replace(/[[\]\\]/g, "\\$&"), "braExpEscape");
1951
+ var Minimatch2 = class {
1952
+ static {
1953
+ __name(this, "Minimatch");
1954
+ }
1955
+ constructor(pattern, options) {
1956
+ assertValidPattern(pattern);
1957
+ if (!options) options = {};
1958
+ this.options = options;
1959
+ this.set = [];
1960
+ this.pattern = pattern;
1961
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
1962
+ if (this.windowsPathsNoEscape) {
1963
+ this.pattern = this.pattern.replace(/\\/g, "/");
1964
+ }
1965
+ this.regexp = null;
1966
+ this.negate = false;
1967
+ this.comment = false;
1968
+ this.empty = false;
1969
+ this.partial = !!options.partial;
1970
+ this.make();
1971
+ }
1972
+ debug() {
1973
+ }
1974
+ make() {
1975
+ const pattern = this.pattern;
1976
+ const options = this.options;
1977
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1978
+ this.comment = true;
1979
+ return;
1980
+ }
1981
+ if (!pattern) {
1982
+ this.empty = true;
1983
+ return;
1984
+ }
1985
+ this.parseNegate();
1986
+ let set2 = this.globSet = this.braceExpand();
1987
+ if (options.debug) this.debug = (...args) => console.error(...args);
1988
+ this.debug(this.pattern, set2);
1989
+ set2 = this.globParts = set2.map((s) => s.split(slashSplit));
1990
+ this.debug(this.pattern, set2);
1991
+ set2 = set2.map((s, si, set3) => s.map(this.parse, this));
1992
+ this.debug(this.pattern, set2);
1993
+ set2 = set2.filter((s) => s.indexOf(false) === -1);
1994
+ this.debug(this.pattern, set2);
1995
+ this.set = set2;
1996
+ }
1997
+ parseNegate() {
1998
+ if (this.options.nonegate) return;
1999
+ const pattern = this.pattern;
2000
+ let negate = false;
2001
+ let negateOffset = 0;
2002
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
2003
+ negate = !negate;
2004
+ negateOffset++;
2005
+ }
2006
+ if (negateOffset) this.pattern = pattern.slice(negateOffset);
2007
+ this.negate = negate;
2008
+ }
2009
+ // set partial to true to test if, for example,
2010
+ // "/a/b" matches the start of "/*/b/*/d"
2011
+ // Partial means, if you run out of file before you run
2012
+ // out of pattern, then that's fine, as long as all
2013
+ // the parts match.
2014
+ matchOne(file2, pattern, partial2) {
2015
+ var options = this.options;
2016
+ this.debug(
2017
+ "matchOne",
2018
+ { "this": this, file: file2, pattern }
2019
+ );
2020
+ this.debug("matchOne", file2.length, pattern.length);
2021
+ for (var fi = 0, pi = 0, fl = file2.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
2022
+ this.debug("matchOne loop");
2023
+ var p = pattern[pi];
2024
+ var f = file2[fi];
2025
+ this.debug(pattern, p, f);
2026
+ if (p === false) return false;
2027
+ if (p === GLOBSTAR) {
2028
+ this.debug("GLOBSTAR", [pattern, p, f]);
2029
+ var fr = fi;
2030
+ var pr = pi + 1;
2031
+ if (pr === pl) {
2032
+ this.debug("** at the end");
2033
+ for (; fi < fl; fi++) {
2034
+ if (file2[fi] === "." || file2[fi] === ".." || !options.dot && file2[fi].charAt(0) === ".") return false;
2035
+ }
2036
+ return true;
2037
+ }
2038
+ while (fr < fl) {
2039
+ var swallowee = file2[fr];
2040
+ this.debug("\nglobstar while", file2, fr, pattern, pr, swallowee);
2041
+ if (this.matchOne(file2.slice(fr), pattern.slice(pr), partial2)) {
2042
+ this.debug("globstar found match!", fr, fl, swallowee);
2043
+ return true;
2044
+ } else {
2045
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
2046
+ this.debug("dot detected!", file2, fr, pattern, pr);
2047
+ break;
2048
+ }
2049
+ this.debug("globstar swallow a segment, and continue");
2050
+ fr++;
2051
+ }
2052
+ }
2053
+ if (partial2) {
2054
+ this.debug("\n>>> no match, partial?", file2, fr, pattern, pr);
2055
+ if (fr === fl) return true;
2056
+ }
2057
+ return false;
2058
+ }
2059
+ var hit;
2060
+ if (typeof p === "string") {
2061
+ hit = f === p;
2062
+ this.debug("string match", p, f, hit);
2063
+ } else {
2064
+ hit = f.match(p);
2065
+ this.debug("pattern match", p, f, hit);
2066
+ }
2067
+ if (!hit) return false;
2068
+ }
2069
+ if (fi === fl && pi === pl) {
2070
+ return true;
2071
+ } else if (fi === fl) {
2072
+ return partial2;
2073
+ } else if (pi === pl) {
2074
+ return fi === fl - 1 && file2[fi] === "";
2075
+ }
2076
+ throw new Error("wtf?");
2077
+ }
2078
+ braceExpand() {
2079
+ return braceExpand(this.pattern, this.options);
2080
+ }
2081
+ parse(pattern, isSub) {
2082
+ assertValidPattern(pattern);
2083
+ const options = this.options;
2084
+ if (pattern === "**") {
2085
+ if (!options.noglobstar)
2086
+ return GLOBSTAR;
2087
+ else
2088
+ pattern = "*";
2089
+ }
2090
+ if (pattern === "") return "";
2091
+ let re = "";
2092
+ let hasMagic = false;
2093
+ let escaping = false;
2094
+ const patternListStack = [];
2095
+ const negativeLists = [];
2096
+ let stateChar;
2097
+ let inClass = false;
2098
+ let reClassStart = -1;
2099
+ let classStart = -1;
2100
+ let cs;
2101
+ let pl;
2102
+ let sp;
2103
+ let dotTravAllowed = pattern.charAt(0) === ".";
2104
+ let dotFileAllowed = options.dot || dotTravAllowed;
2105
+ const patternStart = /* @__PURE__ */ __name(() => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "patternStart");
2106
+ const subPatternStart = /* @__PURE__ */ __name((p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)", "subPatternStart");
2107
+ const clearStateChar = /* @__PURE__ */ __name(() => {
2108
+ if (stateChar) {
2109
+ switch (stateChar) {
2110
+ case "*":
2111
+ re += star;
2112
+ hasMagic = true;
2113
+ break;
2114
+ case "?":
2115
+ re += qmark;
2116
+ hasMagic = true;
2117
+ break;
2118
+ default:
2119
+ re += "\\" + stateChar;
2120
+ break;
2121
+ }
2122
+ this.debug("clearStateChar %j %j", stateChar, re);
2123
+ stateChar = false;
2124
+ }
2125
+ }, "clearStateChar");
2126
+ for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
2127
+ this.debug("%s %s %s %j", pattern, i, re, c);
2128
+ if (escaping) {
2129
+ if (c === "/") {
2130
+ return false;
2131
+ }
2132
+ if (reSpecials[c]) {
2133
+ re += "\\";
2134
+ }
2135
+ re += c;
2136
+ escaping = false;
2137
+ continue;
2138
+ }
2139
+ switch (c) {
2140
+ /* istanbul ignore next */
2141
+ case "/": {
2142
+ return false;
2143
+ }
2144
+ case "\\":
2145
+ if (inClass && pattern.charAt(i + 1) === "-") {
2146
+ re += c;
2147
+ continue;
2148
+ }
2149
+ clearStateChar();
2150
+ escaping = true;
2151
+ continue;
2152
+ // the various stateChar values
2153
+ // for the "extglob" stuff.
2154
+ case "?":
2155
+ case "*":
2156
+ case "+":
2157
+ case "@":
2158
+ case "!":
2159
+ this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
2160
+ if (inClass) {
2161
+ this.debug(" in class");
2162
+ if (c === "!" && i === classStart + 1) c = "^";
2163
+ re += c;
2164
+ continue;
2165
+ }
2166
+ this.debug("call clearStateChar %j", stateChar);
2167
+ clearStateChar();
2168
+ stateChar = c;
2169
+ if (options.noext) clearStateChar();
2170
+ continue;
2171
+ case "(": {
2172
+ if (inClass) {
2173
+ re += "(";
2174
+ continue;
2175
+ }
2176
+ if (!stateChar) {
2177
+ re += "\\(";
2178
+ continue;
2179
+ }
2180
+ const plEntry = {
2181
+ type: stateChar,
2182
+ start: i - 1,
2183
+ reStart: re.length,
2184
+ open: plTypes[stateChar].open,
2185
+ close: plTypes[stateChar].close
2186
+ };
2187
+ this.debug(this.pattern, " ", plEntry);
2188
+ patternListStack.push(plEntry);
2189
+ re += plEntry.open;
2190
+ if (plEntry.start === 0 && plEntry.type !== "!") {
2191
+ dotTravAllowed = true;
2192
+ re += subPatternStart(pattern.slice(i + 1));
2193
+ }
2194
+ this.debug("plType %j %j", stateChar, re);
2195
+ stateChar = false;
2196
+ continue;
2197
+ }
2198
+ case ")": {
2199
+ const plEntry = patternListStack[patternListStack.length - 1];
2200
+ if (inClass || !plEntry) {
2201
+ re += "\\)";
2202
+ continue;
2203
+ }
2204
+ patternListStack.pop();
2205
+ clearStateChar();
2206
+ hasMagic = true;
2207
+ pl = plEntry;
2208
+ re += pl.close;
2209
+ if (pl.type === "!") {
2210
+ negativeLists.push(Object.assign(pl, { reEnd: re.length }));
2211
+ }
2212
+ continue;
2213
+ }
2214
+ case "|": {
2215
+ const plEntry = patternListStack[patternListStack.length - 1];
2216
+ if (inClass || !plEntry) {
2217
+ re += "\\|";
2218
+ continue;
2219
+ }
2220
+ clearStateChar();
2221
+ re += "|";
2222
+ if (plEntry.start === 0 && plEntry.type !== "!") {
2223
+ dotTravAllowed = true;
2224
+ re += subPatternStart(pattern.slice(i + 1));
2225
+ }
2226
+ continue;
2227
+ }
2228
+ // these are mostly the same in regexp and glob
2229
+ case "[":
2230
+ clearStateChar();
2231
+ if (inClass) {
2232
+ re += "\\" + c;
2233
+ continue;
2234
+ }
2235
+ inClass = true;
2236
+ classStart = i;
2237
+ reClassStart = re.length;
2238
+ re += c;
2239
+ continue;
2240
+ case "]":
2241
+ if (i === classStart + 1 || !inClass) {
2242
+ re += "\\" + c;
2243
+ continue;
2244
+ }
2245
+ cs = pattern.substring(classStart + 1, i);
2246
+ try {
2247
+ RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
2248
+ re += c;
2249
+ } catch (er) {
2250
+ re = re.substring(0, reClassStart) + "(?:$.)";
2251
+ }
2252
+ hasMagic = true;
2253
+ inClass = false;
2254
+ continue;
2255
+ default:
2256
+ clearStateChar();
2257
+ if (reSpecials[c] && !(c === "^" && inClass)) {
2258
+ re += "\\";
2259
+ }
2260
+ re += c;
2261
+ break;
2262
+ }
2263
+ }
2264
+ if (inClass) {
2265
+ cs = pattern.slice(classStart + 1);
2266
+ sp = this.parse(cs, SUBPARSE);
2267
+ re = re.substring(0, reClassStart) + "\\[" + sp[0];
2268
+ hasMagic = hasMagic || sp[1];
2269
+ }
2270
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
2271
+ let tail;
2272
+ tail = re.slice(pl.reStart + pl.open.length);
2273
+ this.debug("setting tail", re, pl);
2274
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
2275
+ if (!$2) {
2276
+ $2 = "\\";
2277
+ }
2278
+ return $1 + $1 + $2 + "|";
2279
+ });
2280
+ this.debug("tail=%j\n %s", tail, tail, pl, re);
2281
+ const t2 = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
2282
+ hasMagic = true;
2283
+ re = re.slice(0, pl.reStart) + t2 + "\\(" + tail;
2284
+ }
2285
+ clearStateChar();
2286
+ if (escaping) {
2287
+ re += "\\\\";
2288
+ }
2289
+ const addPatternStart = addPatternStartSet[re.charAt(0)];
2290
+ for (let n2 = negativeLists.length - 1; n2 > -1; n2--) {
2291
+ const nl = negativeLists[n2];
2292
+ const nlBefore = re.slice(0, nl.reStart);
2293
+ const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
2294
+ let nlAfter = re.slice(nl.reEnd);
2295
+ const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
2296
+ const closeParensBefore = nlBefore.split(")").length;
2297
+ const openParensBefore = nlBefore.split("(").length - closeParensBefore;
2298
+ let cleanAfter = nlAfter;
2299
+ for (let i = 0; i < openParensBefore; i++) {
2300
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
2301
+ }
2302
+ nlAfter = cleanAfter;
2303
+ const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : "";
2304
+ re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
2305
+ }
2306
+ if (re !== "" && hasMagic) {
2307
+ re = "(?=.)" + re;
2308
+ }
2309
+ if (addPatternStart) {
2310
+ re = patternStart() + re;
2311
+ }
2312
+ if (isSub === SUBPARSE) {
2313
+ return [re, hasMagic];
2314
+ }
2315
+ if (options.nocase && !hasMagic) {
2316
+ hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
2317
+ }
2318
+ if (!hasMagic) {
2319
+ return globUnescape(pattern);
2320
+ }
2321
+ const flags = options.nocase ? "i" : "";
2322
+ try {
2323
+ return Object.assign(new RegExp("^" + re + "$", flags), {
2324
+ _glob: pattern,
2325
+ _src: re
2326
+ });
2327
+ } catch (er) {
2328
+ return new RegExp("$.");
2329
+ }
2330
+ }
2331
+ makeRe() {
2332
+ if (this.regexp || this.regexp === false) return this.regexp;
2333
+ const set2 = this.set;
2334
+ if (!set2.length) {
2335
+ this.regexp = false;
2336
+ return this.regexp;
2337
+ }
2338
+ const options = this.options;
2339
+ const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
2340
+ const flags = options.nocase ? "i" : "";
2341
+ let re = set2.map((pattern) => {
2342
+ pattern = pattern.map(
2343
+ (p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src
2344
+ ).reduce((set3, p) => {
2345
+ if (!(set3[set3.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
2346
+ set3.push(p);
2347
+ }
2348
+ return set3;
2349
+ }, []);
2350
+ pattern.forEach((p, i) => {
2351
+ if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
2352
+ return;
2353
+ }
2354
+ if (i === 0) {
2355
+ if (pattern.length > 1) {
2356
+ pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1];
2357
+ } else {
2358
+ pattern[i] = twoStar;
2359
+ }
2360
+ } else if (i === pattern.length - 1) {
2361
+ pattern[i - 1] += "(?:\\/|" + twoStar + ")?";
2362
+ } else {
2363
+ pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1];
2364
+ pattern[i + 1] = GLOBSTAR;
2365
+ }
2366
+ });
2367
+ return pattern.filter((p) => p !== GLOBSTAR).join("/");
2368
+ }).join("|");
2369
+ re = "^(?:" + re + ")$";
2370
+ if (this.negate) re = "^(?!" + re + ").*$";
2371
+ try {
2372
+ this.regexp = new RegExp(re, flags);
2373
+ } catch (ex) {
2374
+ this.regexp = false;
2375
+ }
2376
+ return this.regexp;
2377
+ }
2378
+ match(f, partial2 = this.partial) {
2379
+ this.debug("match", f, this.pattern);
2380
+ if (this.comment) return false;
2381
+ if (this.empty) return f === "";
2382
+ if (f === "/" && partial2) return true;
2383
+ const options = this.options;
2384
+ if (path6.sep !== "/") {
2385
+ f = f.split(path6.sep).join("/");
2386
+ }
2387
+ f = f.split(slashSplit);
2388
+ this.debug(this.pattern, "split", f);
2389
+ const set2 = this.set;
2390
+ this.debug(this.pattern, "set", set2);
2391
+ let filename;
2392
+ for (let i = f.length - 1; i >= 0; i--) {
2393
+ filename = f[i];
2394
+ if (filename) break;
2395
+ }
2396
+ for (let i = 0; i < set2.length; i++) {
2397
+ const pattern = set2[i];
2398
+ let file2 = f;
2399
+ if (options.matchBase && pattern.length === 1) {
2400
+ file2 = [filename];
2401
+ }
2402
+ const hit = this.matchOne(file2, pattern, partial2);
2403
+ if (hit) {
2404
+ if (options.flipNegate) return true;
2405
+ return !this.negate;
2406
+ }
2407
+ }
2408
+ if (options.flipNegate) return false;
2409
+ return this.negate;
2410
+ }
2411
+ static defaults(def) {
2412
+ return minimatch.defaults(def).Minimatch;
2413
+ }
2414
+ };
2415
+ minimatch.Minimatch = Minimatch2;
2416
+ }
2417
+ });
2418
+
1629
2419
  // src/config/environment.ts
1630
2420
  var ARTIFACTS_EVENT_TYPES = [
1631
2421
  "cf.artifacts.repo.created",
@@ -2625,10 +3415,10 @@ function cloneDef(schema) {
2625
3415
  return mergeDefs(schema._zod.def);
2626
3416
  }
2627
3417
  __name(cloneDef, "cloneDef");
2628
- function getElementAtPath(obj, path5) {
2629
- if (!path5)
3418
+ function getElementAtPath(obj, path6) {
3419
+ if (!path6)
2630
3420
  return obj;
2631
- return path5.reduce((acc, key) => acc?.[key], obj);
3421
+ return path6.reduce((acc, key) => acc?.[key], obj);
2632
3422
  }
2633
3423
  __name(getElementAtPath, "getElementAtPath");
2634
3424
  function promiseAllObject(promisesObj) {
@@ -3061,11 +3851,11 @@ function explicitlyAborted(x, startIndex = 0) {
3061
3851
  return false;
3062
3852
  }
3063
3853
  __name(explicitlyAborted, "explicitlyAborted");
3064
- function prefixIssues(path5, issues) {
3854
+ function prefixIssues(path6, issues) {
3065
3855
  return issues.map((iss) => {
3066
3856
  var _a3;
3067
3857
  (_a3 = iss).path ?? (_a3.path = []);
3068
- iss.path.unshift(path5);
3858
+ iss.path.unshift(path6);
3069
3859
  return iss;
3070
3860
  });
3071
3861
  }
@@ -3230,16 +4020,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
3230
4020
  __name(flattenError, "flattenError");
3231
4021
  function formatError(error51, mapper = (issue2) => issue2.message) {
3232
4022
  const fieldErrors = { _errors: [] };
3233
- const processError = /* @__PURE__ */ __name((error52, path5 = []) => {
4023
+ const processError = /* @__PURE__ */ __name((error52, path6 = []) => {
3234
4024
  for (const issue2 of error52.issues) {
3235
4025
  if (issue2.code === "invalid_union" && issue2.errors.length) {
3236
- issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
4026
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
3237
4027
  } else if (issue2.code === "invalid_key") {
3238
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
4028
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
3239
4029
  } else if (issue2.code === "invalid_element") {
3240
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
4030
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
3241
4031
  } else {
3242
- const fullpath = [...path5, ...issue2.path];
4032
+ const fullpath = [...path6, ...issue2.path];
3243
4033
  if (fullpath.length === 0) {
3244
4034
  fieldErrors._errors.push(mapper(issue2));
3245
4035
  } else {
@@ -3267,17 +4057,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
3267
4057
  __name(formatError, "formatError");
3268
4058
  function treeifyError(error51, mapper = (issue2) => issue2.message) {
3269
4059
  const result = { errors: [] };
3270
- const processError = /* @__PURE__ */ __name((error52, path5 = []) => {
4060
+ const processError = /* @__PURE__ */ __name((error52, path6 = []) => {
3271
4061
  var _a3, _b;
3272
4062
  for (const issue2 of error52.issues) {
3273
4063
  if (issue2.code === "invalid_union" && issue2.errors.length) {
3274
- issue2.errors.map((issues) => processError({ issues }, [...path5, ...issue2.path]));
4064
+ issue2.errors.map((issues) => processError({ issues }, [...path6, ...issue2.path]));
3275
4065
  } else if (issue2.code === "invalid_key") {
3276
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
4066
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
3277
4067
  } else if (issue2.code === "invalid_element") {
3278
- processError({ issues: issue2.issues }, [...path5, ...issue2.path]);
4068
+ processError({ issues: issue2.issues }, [...path6, ...issue2.path]);
3279
4069
  } else {
3280
- const fullpath = [...path5, ...issue2.path];
4070
+ const fullpath = [...path6, ...issue2.path];
3281
4071
  if (fullpath.length === 0) {
3282
4072
  result.errors.push(mapper(issue2));
3283
4073
  continue;
@@ -3310,8 +4100,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
3310
4100
  __name(treeifyError, "treeifyError");
3311
4101
  function toDotPath(_path) {
3312
4102
  const segs = [];
3313
- const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
3314
- for (const seg of path5) {
4103
+ const path6 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
4104
+ for (const seg of path6) {
3315
4105
  if (typeof seg === "number")
3316
4106
  segs.push(`[${seg}]`);
3317
4107
  else if (typeof seg === "symbol")
@@ -16367,13 +17157,13 @@ function resolveRef(ref, ctx) {
16367
17157
  if (!ref.startsWith("#")) {
16368
17158
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
16369
17159
  }
16370
- const path5 = ref.slice(1).split("/").filter(Boolean);
16371
- if (path5.length === 0) {
17160
+ const path6 = ref.slice(1).split("/").filter(Boolean);
17161
+ if (path6.length === 0) {
16372
17162
  return ctx.rootSchema;
16373
17163
  }
16374
17164
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
16375
- if (path5[0] === defsKey) {
16376
- const key = path5[1];
17165
+ if (path6[0] === defsKey) {
17166
+ const key = path6[1];
16377
17167
  if (!key || !ctx.defs[key]) {
16378
17168
  throw new Error(`Reference not found: ${ref}`);
16379
17169
  }
@@ -16945,9 +17735,9 @@ Please add "${field}" to "env.${envName}".`
16945
17735
  return rawEnv[field] ?? defaultValue;
16946
17736
  }
16947
17737
  __name(notInheritable, "notInheritable");
16948
- function unwindPropertyPath(root, path5) {
17738
+ function unwindPropertyPath(root, path6) {
16949
17739
  let container = root;
16950
- const parts = path5.split(".");
17740
+ const parts = path6.split(".");
16951
17741
  for (let i = 0; i < parts.length - 1; i++) {
16952
17742
  if (!hasProperty(container, parts[i])) {
16953
17743
  return;
@@ -21170,7 +21960,6 @@ var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, confi
21170
21960
  ])
21171
21961
  );
21172
21962
  bindingsGroupedByType["Secret"] = config2.secrets?.required ?? [];
21173
- bindingsGroupedByType["Container images"] = [CONTAINER_IMAGES_BINDING];
21174
21963
  const bindingsGroupedByName = {};
21175
21964
  for (const bindingType in bindingsGroupedByType) {
21176
21965
  const bindingNames = bindingsGroupedByType[bindingType];
@@ -26730,6 +27519,126 @@ function toUrlPath(filePath) {
26730
27519
  }
26731
27520
  __name(toUrlPath, "toUrlPath");
26732
27521
 
27522
+ // src/d1-migrations.ts
27523
+ var import_minimatch = __toESM(require_minimatch());
27524
+ var DEFAULT_MIGRATIONS_DIR = "./migrations";
27525
+ function getD1MigrationFiles(options) {
27526
+ const migrationsDir = normalizeRelativePath(
27527
+ options.migrationsDir ?? DEFAULT_MIGRATIONS_DIR
27528
+ );
27529
+ const migrationsPattern = normalizeRelativePath(
27530
+ options.migrationsPattern ?? `${migrationsDir}/*.sql`
27531
+ );
27532
+ const dirRelativePattern = stripDirPrefix(migrationsPattern, migrationsDir);
27533
+ const walkRoot = path__default.resolve(options.projectPath, migrationsDir);
27534
+ const names = listFilesRelative(
27535
+ walkRoot,
27536
+ new import_minimatch.Minimatch(dirRelativePattern, { dot: false })
27537
+ );
27538
+ return names.map((name) => ({
27539
+ name,
27540
+ filePath: path__default.join(walkRoot, ...name.split("/"))
27541
+ }));
27542
+ }
27543
+ __name(getD1MigrationFiles, "getD1MigrationFiles");
27544
+ function normalizeRelativePath(p) {
27545
+ const forwardSlashed = p.replace(/\\/g, "/");
27546
+ const normalized = path__default.posix.normalize(forwardSlashed);
27547
+ if (normalized.endsWith("/")) {
27548
+ return normalized.slice(0, -1);
27549
+ }
27550
+ return normalized;
27551
+ }
27552
+ __name(normalizeRelativePath, "normalizeRelativePath");
27553
+ function stripDirPrefix(pattern, dir2) {
27554
+ if (dir2 === ".") {
27555
+ return pattern;
27556
+ }
27557
+ const prefix = `${dir2}/`;
27558
+ if (!pattern.startsWith(prefix)) {
27559
+ throw new Error(
27560
+ `Expected migrations pattern ${JSON.stringify(pattern)} to start with ${JSON.stringify(prefix)}`
27561
+ );
27562
+ }
27563
+ return pattern.slice(prefix.length);
27564
+ }
27565
+ __name(stripDirPrefix, "stripDirPrefix");
27566
+ function listFilesRelative(dir2, matcher) {
27567
+ const out = [];
27568
+ const stack = [{ abs: dir2, rel: "" }];
27569
+ while (stack.length > 0) {
27570
+ const { abs, rel } = stack.pop();
27571
+ let entries;
27572
+ try {
27573
+ entries = fs2.readdirSync(abs, { withFileTypes: true });
27574
+ } catch {
27575
+ continue;
27576
+ }
27577
+ for (const entry of entries) {
27578
+ const childRel = rel === "" ? entry.name : `${rel}/${entry.name}`;
27579
+ if (entry.isDirectory()) {
27580
+ if (matcher.match(
27581
+ childRel,
27582
+ true
27583
+ /* partial */
27584
+ )) {
27585
+ stack.push({ abs: path__default.join(abs, entry.name), rel: childRel });
27586
+ }
27587
+ } else if (entry.isFile() && matcher.match(childRel)) {
27588
+ out.push(childRel);
27589
+ }
27590
+ }
27591
+ }
27592
+ return out.sort(compareMigrationPaths);
27593
+ }
27594
+ __name(listFilesRelative, "listFilesRelative");
27595
+ function compareMigrationPaths(a, b) {
27596
+ const aSegments = a.split("/");
27597
+ const bSegments = b.split("/");
27598
+ const shared = Math.min(aSegments.length, bSegments.length);
27599
+ for (let i = 0; i < shared; i++) {
27600
+ const aSegment = aSegments[i];
27601
+ const bSegment = bSegments[i];
27602
+ if (aSegment === void 0 || bSegment === void 0) {
27603
+ break;
27604
+ }
27605
+ const cmp = compareSegments(aSegment, bSegment);
27606
+ if (cmp !== 0) {
27607
+ return cmp;
27608
+ }
27609
+ }
27610
+ return aSegments.length - bSegments.length;
27611
+ }
27612
+ __name(compareMigrationPaths, "compareMigrationPaths");
27613
+ function compareSegments(a, b) {
27614
+ const aNum = leadingMigrationNumber(a);
27615
+ const bNum = leadingMigrationNumber(b);
27616
+ if (aNum !== bNum) {
27617
+ if (Number.isFinite(aNum) && Number.isFinite(bNum)) {
27618
+ return aNum - bNum;
27619
+ }
27620
+ if (Number.isFinite(aNum)) {
27621
+ return -1;
27622
+ }
27623
+ if (Number.isFinite(bNum)) {
27624
+ return 1;
27625
+ }
27626
+ }
27627
+ if (a < b) {
27628
+ return -1;
27629
+ }
27630
+ if (a > b) {
27631
+ return 1;
27632
+ }
27633
+ return 0;
27634
+ }
27635
+ __name(compareSegments, "compareSegments");
27636
+ function leadingMigrationNumber(relativePath) {
27637
+ const firstSegment = relativePath.split("/")[0];
27638
+ return parseInt(firstSegment.split("_")[0], 10);
27639
+ }
27640
+ __name(leadingMigrationNumber, "leadingMigrationNumber");
27641
+
26733
27642
  // src/index.ts
26734
27643
  var friendlyBindingNames2 = friendlyBindingNames;
26735
27644
  /*! Bundled license information:
@@ -26766,4 +27675,4 @@ safe-buffer/index.js:
26766
27675
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
26767
27676
  */
26768
27677
 
26769
- export { ARTIFACTS_EVENT_TYPES, BunPackageManager, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, convertConfigToBindings, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractBindingsOfType, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, printBindings, renderError, resolveNamedTunnel, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validateBindingRemoteSetting, validatePagesConfig, writeOutput };
27678
+ export { ARTIFACTS_EVENT_TYPES, BunPackageManager, Diagnostics, LOGGER_LEVELS, NpmPackageManager, NubPackageManager, PatchConfigError, PnpmPackageManager, YarnPackageManager, addAuthorizationHeader, bucketFormatMessage, checkWorkerNameValidity, clearOutputFilePath, compareMigrationPaths, convertConfigToBindings, createConfigCache, defaultWranglerConfig, experimental_patchConfig, extractAccountTag, extractBindingsOfType, extractWAFBlockRayId, fetchInternalBase, fetchKVGetValueBase, fetchLatestNpmVersion, fetchListResultBase, fetchResultBase, formatTime, friendlyBindingNames2 as friendlyBindingNames, getBindingLocalSupport, getBindingTypeFriendlyName, getBindings, getD1MigrationFiles, getHostFromRoute, getHostFromUrl, getInstalledPackageVersion, getPackagePath, getWorkerName, getWorkerNameFromProject, getWranglerHiddenDirPath, getWranglerTmpDir, getZoneFromRoute, hasCursor, hasMorePages, hasProperty, isCI, isDockerfile, isInteractive, isNonInteractiveOrCI, isOptionalProperty, isPackageInstalled, isPagesConfig, isRequiredProperty, isUnsafeBindingType, isValidR2BucketName, isWAFBlockResponse, maybeAddTraceHeader, normalizeAndValidateConfig, normalizeRelativePath, openInBrowser, parseRetryAfterMs, parseRetryAfterValue, performApiFetchBase, printBindings, renderError, resolveNamedTunnel, retryOnAPIFailure, spawnCloudflared, startTunnel, sweepStaleWranglerTmpDirs, throwFetchError, toUrlPath, toValidWorkerName, truncate, validateBindingRemoteSetting, validatePagesConfig, writeOutput };