create-cloudflare 0.0.0-91135e02 → 0.0.0-977b3a99

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/cli.js CHANGED
@@ -1759,6 +1759,2414 @@ var require_cross_spawn = __commonJS({
1759
1759
  }
1760
1760
  });
1761
1761
 
1762
+ // node_modules/semver/internal/constants.js
1763
+ var require_constants = __commonJS({
1764
+ "node_modules/semver/internal/constants.js"(exports, module2) {
1765
+ var SEMVER_SPEC_VERSION = "2.0.0";
1766
+ var MAX_LENGTH = 256;
1767
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
1768
+ 9007199254740991;
1769
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
1770
+ var RELEASE_TYPES = [
1771
+ "major",
1772
+ "premajor",
1773
+ "minor",
1774
+ "preminor",
1775
+ "patch",
1776
+ "prepatch",
1777
+ "prerelease"
1778
+ ];
1779
+ module2.exports = {
1780
+ MAX_LENGTH,
1781
+ MAX_SAFE_COMPONENT_LENGTH,
1782
+ MAX_SAFE_INTEGER,
1783
+ RELEASE_TYPES,
1784
+ SEMVER_SPEC_VERSION,
1785
+ FLAG_INCLUDE_PRERELEASE: 1,
1786
+ FLAG_LOOSE: 2
1787
+ };
1788
+ }
1789
+ });
1790
+
1791
+ // node_modules/semver/internal/debug.js
1792
+ var require_debug = __commonJS({
1793
+ "node_modules/semver/internal/debug.js"(exports, module2) {
1794
+ var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
1795
+ };
1796
+ module2.exports = debug;
1797
+ }
1798
+ });
1799
+
1800
+ // node_modules/semver/internal/re.js
1801
+ var require_re = __commonJS({
1802
+ "node_modules/semver/internal/re.js"(exports, module2) {
1803
+ var { MAX_SAFE_COMPONENT_LENGTH } = require_constants();
1804
+ var debug = require_debug();
1805
+ exports = module2.exports = {};
1806
+ var re = exports.re = [];
1807
+ var src = exports.src = [];
1808
+ var t = exports.t = {};
1809
+ var R3 = 0;
1810
+ var createToken = (name, value, isGlobal) => {
1811
+ const index = R3++;
1812
+ debug(name, index, value);
1813
+ t[name] = index;
1814
+ src[index] = value;
1815
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
1816
+ };
1817
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
1818
+ createToken("NUMERICIDENTIFIERLOOSE", "[0-9]+");
1819
+ createToken("NONNUMERICIDENTIFIER", "\\d*[a-zA-Z-][a-zA-Z0-9-]*");
1820
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
1821
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
1822
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
1823
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
1824
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
1825
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
1826
+ createToken("BUILDIDENTIFIER", "[0-9A-Za-z-]+");
1827
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
1828
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
1829
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
1830
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
1831
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
1832
+ createToken("GTLT", "((?:<|>)?=?)");
1833
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
1834
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
1835
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
1836
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
1837
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
1838
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
1839
+ createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
1840
+ createToken("COERCERTL", src[t.COERCE], true);
1841
+ createToken("LONETILDE", "(?:~>?)");
1842
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
1843
+ exports.tildeTrimReplace = "$1~";
1844
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
1845
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
1846
+ createToken("LONECARET", "(?:\\^)");
1847
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
1848
+ exports.caretTrimReplace = "$1^";
1849
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
1850
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
1851
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
1852
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
1853
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
1854
+ exports.comparatorTrimReplace = "$1$2$3";
1855
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
1856
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
1857
+ createToken("STAR", "(<|>)?=?\\s*\\*");
1858
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
1859
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
1860
+ }
1861
+ });
1862
+
1863
+ // node_modules/semver/internal/parse-options.js
1864
+ var require_parse_options = __commonJS({
1865
+ "node_modules/semver/internal/parse-options.js"(exports, module2) {
1866
+ var looseOption = Object.freeze({ loose: true });
1867
+ var emptyOpts = Object.freeze({});
1868
+ var parseOptions = (options) => {
1869
+ if (!options) {
1870
+ return emptyOpts;
1871
+ }
1872
+ if (typeof options !== "object") {
1873
+ return looseOption;
1874
+ }
1875
+ return options;
1876
+ };
1877
+ module2.exports = parseOptions;
1878
+ }
1879
+ });
1880
+
1881
+ // node_modules/semver/internal/identifiers.js
1882
+ var require_identifiers = __commonJS({
1883
+ "node_modules/semver/internal/identifiers.js"(exports, module2) {
1884
+ var numeric = /^[0-9]+$/;
1885
+ var compareIdentifiers = (a2, b2) => {
1886
+ const anum = numeric.test(a2);
1887
+ const bnum = numeric.test(b2);
1888
+ if (anum && bnum) {
1889
+ a2 = +a2;
1890
+ b2 = +b2;
1891
+ }
1892
+ return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;
1893
+ };
1894
+ var rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);
1895
+ module2.exports = {
1896
+ compareIdentifiers,
1897
+ rcompareIdentifiers
1898
+ };
1899
+ }
1900
+ });
1901
+
1902
+ // node_modules/semver/classes/semver.js
1903
+ var require_semver = __commonJS({
1904
+ "node_modules/semver/classes/semver.js"(exports, module2) {
1905
+ var debug = require_debug();
1906
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
1907
+ var { re, t } = require_re();
1908
+ var parseOptions = require_parse_options();
1909
+ var { compareIdentifiers } = require_identifiers();
1910
+ var SemVer = class {
1911
+ constructor(version2, options) {
1912
+ options = parseOptions(options);
1913
+ if (version2 instanceof SemVer) {
1914
+ if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
1915
+ return version2;
1916
+ } else {
1917
+ version2 = version2.version;
1918
+ }
1919
+ } else if (typeof version2 !== "string") {
1920
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
1921
+ }
1922
+ if (version2.length > MAX_LENGTH) {
1923
+ throw new TypeError(
1924
+ `version is longer than ${MAX_LENGTH} characters`
1925
+ );
1926
+ }
1927
+ debug("SemVer", version2, options);
1928
+ this.options = options;
1929
+ this.loose = !!options.loose;
1930
+ this.includePrerelease = !!options.includePrerelease;
1931
+ const m2 = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
1932
+ if (!m2) {
1933
+ throw new TypeError(`Invalid Version: ${version2}`);
1934
+ }
1935
+ this.raw = version2;
1936
+ this.major = +m2[1];
1937
+ this.minor = +m2[2];
1938
+ this.patch = +m2[3];
1939
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
1940
+ throw new TypeError("Invalid major version");
1941
+ }
1942
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
1943
+ throw new TypeError("Invalid minor version");
1944
+ }
1945
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
1946
+ throw new TypeError("Invalid patch version");
1947
+ }
1948
+ if (!m2[4]) {
1949
+ this.prerelease = [];
1950
+ } else {
1951
+ this.prerelease = m2[4].split(".").map((id) => {
1952
+ if (/^[0-9]+$/.test(id)) {
1953
+ const num = +id;
1954
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
1955
+ return num;
1956
+ }
1957
+ }
1958
+ return id;
1959
+ });
1960
+ }
1961
+ this.build = m2[5] ? m2[5].split(".") : [];
1962
+ this.format();
1963
+ }
1964
+ format() {
1965
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
1966
+ if (this.prerelease.length) {
1967
+ this.version += `-${this.prerelease.join(".")}`;
1968
+ }
1969
+ return this.version;
1970
+ }
1971
+ toString() {
1972
+ return this.version;
1973
+ }
1974
+ compare(other) {
1975
+ debug("SemVer.compare", this.version, this.options, other);
1976
+ if (!(other instanceof SemVer)) {
1977
+ if (typeof other === "string" && other === this.version) {
1978
+ return 0;
1979
+ }
1980
+ other = new SemVer(other, this.options);
1981
+ }
1982
+ if (other.version === this.version) {
1983
+ return 0;
1984
+ }
1985
+ return this.compareMain(other) || this.comparePre(other);
1986
+ }
1987
+ compareMain(other) {
1988
+ if (!(other instanceof SemVer)) {
1989
+ other = new SemVer(other, this.options);
1990
+ }
1991
+ return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
1992
+ }
1993
+ comparePre(other) {
1994
+ if (!(other instanceof SemVer)) {
1995
+ other = new SemVer(other, this.options);
1996
+ }
1997
+ if (this.prerelease.length && !other.prerelease.length) {
1998
+ return -1;
1999
+ } else if (!this.prerelease.length && other.prerelease.length) {
2000
+ return 1;
2001
+ } else if (!this.prerelease.length && !other.prerelease.length) {
2002
+ return 0;
2003
+ }
2004
+ let i = 0;
2005
+ do {
2006
+ const a2 = this.prerelease[i];
2007
+ const b2 = other.prerelease[i];
2008
+ debug("prerelease compare", i, a2, b2);
2009
+ if (a2 === void 0 && b2 === void 0) {
2010
+ return 0;
2011
+ } else if (b2 === void 0) {
2012
+ return 1;
2013
+ } else if (a2 === void 0) {
2014
+ return -1;
2015
+ } else if (a2 === b2) {
2016
+ continue;
2017
+ } else {
2018
+ return compareIdentifiers(a2, b2);
2019
+ }
2020
+ } while (++i);
2021
+ }
2022
+ compareBuild(other) {
2023
+ if (!(other instanceof SemVer)) {
2024
+ other = new SemVer(other, this.options);
2025
+ }
2026
+ let i = 0;
2027
+ do {
2028
+ const a2 = this.build[i];
2029
+ const b2 = other.build[i];
2030
+ debug("prerelease compare", i, a2, b2);
2031
+ if (a2 === void 0 && b2 === void 0) {
2032
+ return 0;
2033
+ } else if (b2 === void 0) {
2034
+ return 1;
2035
+ } else if (a2 === void 0) {
2036
+ return -1;
2037
+ } else if (a2 === b2) {
2038
+ continue;
2039
+ } else {
2040
+ return compareIdentifiers(a2, b2);
2041
+ }
2042
+ } while (++i);
2043
+ }
2044
+ // preminor will bump the version up to the next minor release, and immediately
2045
+ // down to pre-release. premajor and prepatch work the same way.
2046
+ inc(release, identifier, identifierBase) {
2047
+ switch (release) {
2048
+ case "premajor":
2049
+ this.prerelease.length = 0;
2050
+ this.patch = 0;
2051
+ this.minor = 0;
2052
+ this.major++;
2053
+ this.inc("pre", identifier, identifierBase);
2054
+ break;
2055
+ case "preminor":
2056
+ this.prerelease.length = 0;
2057
+ this.patch = 0;
2058
+ this.minor++;
2059
+ this.inc("pre", identifier, identifierBase);
2060
+ break;
2061
+ case "prepatch":
2062
+ this.prerelease.length = 0;
2063
+ this.inc("patch", identifier, identifierBase);
2064
+ this.inc("pre", identifier, identifierBase);
2065
+ break;
2066
+ case "prerelease":
2067
+ if (this.prerelease.length === 0) {
2068
+ this.inc("patch", identifier, identifierBase);
2069
+ }
2070
+ this.inc("pre", identifier, identifierBase);
2071
+ break;
2072
+ case "major":
2073
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
2074
+ this.major++;
2075
+ }
2076
+ this.minor = 0;
2077
+ this.patch = 0;
2078
+ this.prerelease = [];
2079
+ break;
2080
+ case "minor":
2081
+ if (this.patch !== 0 || this.prerelease.length === 0) {
2082
+ this.minor++;
2083
+ }
2084
+ this.patch = 0;
2085
+ this.prerelease = [];
2086
+ break;
2087
+ case "patch":
2088
+ if (this.prerelease.length === 0) {
2089
+ this.patch++;
2090
+ }
2091
+ this.prerelease = [];
2092
+ break;
2093
+ case "pre": {
2094
+ const base = Number(identifierBase) ? 1 : 0;
2095
+ if (!identifier && identifierBase === false) {
2096
+ throw new Error("invalid increment argument: identifier is empty");
2097
+ }
2098
+ if (this.prerelease.length === 0) {
2099
+ this.prerelease = [base];
2100
+ } else {
2101
+ let i = this.prerelease.length;
2102
+ while (--i >= 0) {
2103
+ if (typeof this.prerelease[i] === "number") {
2104
+ this.prerelease[i]++;
2105
+ i = -2;
2106
+ }
2107
+ }
2108
+ if (i === -1) {
2109
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
2110
+ throw new Error("invalid increment argument: identifier already exists");
2111
+ }
2112
+ this.prerelease.push(base);
2113
+ }
2114
+ }
2115
+ if (identifier) {
2116
+ let prerelease = [identifier, base];
2117
+ if (identifierBase === false) {
2118
+ prerelease = [identifier];
2119
+ }
2120
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
2121
+ if (isNaN(this.prerelease[1])) {
2122
+ this.prerelease = prerelease;
2123
+ }
2124
+ } else {
2125
+ this.prerelease = prerelease;
2126
+ }
2127
+ }
2128
+ break;
2129
+ }
2130
+ default:
2131
+ throw new Error(`invalid increment argument: ${release}`);
2132
+ }
2133
+ this.format();
2134
+ this.raw = this.version;
2135
+ return this;
2136
+ }
2137
+ };
2138
+ module2.exports = SemVer;
2139
+ }
2140
+ });
2141
+
2142
+ // node_modules/semver/functions/parse.js
2143
+ var require_parse2 = __commonJS({
2144
+ "node_modules/semver/functions/parse.js"(exports, module2) {
2145
+ var SemVer = require_semver();
2146
+ var parse2 = (version2, options, throwErrors = false) => {
2147
+ if (version2 instanceof SemVer) {
2148
+ return version2;
2149
+ }
2150
+ try {
2151
+ return new SemVer(version2, options);
2152
+ } catch (er) {
2153
+ if (!throwErrors) {
2154
+ return null;
2155
+ }
2156
+ throw er;
2157
+ }
2158
+ };
2159
+ module2.exports = parse2;
2160
+ }
2161
+ });
2162
+
2163
+ // node_modules/semver/functions/valid.js
2164
+ var require_valid = __commonJS({
2165
+ "node_modules/semver/functions/valid.js"(exports, module2) {
2166
+ var parse2 = require_parse2();
2167
+ var valid = (version2, options) => {
2168
+ const v2 = parse2(version2, options);
2169
+ return v2 ? v2.version : null;
2170
+ };
2171
+ module2.exports = valid;
2172
+ }
2173
+ });
2174
+
2175
+ // node_modules/semver/functions/clean.js
2176
+ var require_clean = __commonJS({
2177
+ "node_modules/semver/functions/clean.js"(exports, module2) {
2178
+ var parse2 = require_parse2();
2179
+ var clean = (version2, options) => {
2180
+ const s = parse2(version2.trim().replace(/^[=v]+/, ""), options);
2181
+ return s ? s.version : null;
2182
+ };
2183
+ module2.exports = clean;
2184
+ }
2185
+ });
2186
+
2187
+ // node_modules/semver/functions/inc.js
2188
+ var require_inc = __commonJS({
2189
+ "node_modules/semver/functions/inc.js"(exports, module2) {
2190
+ var SemVer = require_semver();
2191
+ var inc = (version2, release, options, identifier, identifierBase) => {
2192
+ if (typeof options === "string") {
2193
+ identifierBase = identifier;
2194
+ identifier = options;
2195
+ options = void 0;
2196
+ }
2197
+ try {
2198
+ return new SemVer(
2199
+ version2 instanceof SemVer ? version2.version : version2,
2200
+ options
2201
+ ).inc(release, identifier, identifierBase).version;
2202
+ } catch (er) {
2203
+ return null;
2204
+ }
2205
+ };
2206
+ module2.exports = inc;
2207
+ }
2208
+ });
2209
+
2210
+ // node_modules/semver/functions/diff.js
2211
+ var require_diff = __commonJS({
2212
+ "node_modules/semver/functions/diff.js"(exports, module2) {
2213
+ var parse2 = require_parse2();
2214
+ var diff = (version1, version2) => {
2215
+ const v1 = parse2(version1, null, true);
2216
+ const v2 = parse2(version2, null, true);
2217
+ const comparison = v1.compare(v2);
2218
+ if (comparison === 0) {
2219
+ return null;
2220
+ }
2221
+ const v1Higher = comparison > 0;
2222
+ const highVersion = v1Higher ? v1 : v2;
2223
+ const lowVersion = v1Higher ? v2 : v1;
2224
+ const highHasPre = !!highVersion.prerelease.length;
2225
+ const prefix = highHasPre ? "pre" : "";
2226
+ if (v1.major !== v2.major) {
2227
+ return prefix + "major";
2228
+ }
2229
+ if (v1.minor !== v2.minor) {
2230
+ return prefix + "minor";
2231
+ }
2232
+ if (v1.patch !== v2.patch) {
2233
+ return prefix + "patch";
2234
+ }
2235
+ if (highHasPre) {
2236
+ return "prerelease";
2237
+ }
2238
+ if (lowVersion.patch) {
2239
+ return "patch";
2240
+ }
2241
+ if (lowVersion.minor) {
2242
+ return "minor";
2243
+ }
2244
+ return "major";
2245
+ };
2246
+ module2.exports = diff;
2247
+ }
2248
+ });
2249
+
2250
+ // node_modules/semver/functions/major.js
2251
+ var require_major = __commonJS({
2252
+ "node_modules/semver/functions/major.js"(exports, module2) {
2253
+ var SemVer = require_semver();
2254
+ var major = (a2, loose) => new SemVer(a2, loose).major;
2255
+ module2.exports = major;
2256
+ }
2257
+ });
2258
+
2259
+ // node_modules/semver/functions/minor.js
2260
+ var require_minor = __commonJS({
2261
+ "node_modules/semver/functions/minor.js"(exports, module2) {
2262
+ var SemVer = require_semver();
2263
+ var minor = (a2, loose) => new SemVer(a2, loose).minor;
2264
+ module2.exports = minor;
2265
+ }
2266
+ });
2267
+
2268
+ // node_modules/semver/functions/patch.js
2269
+ var require_patch = __commonJS({
2270
+ "node_modules/semver/functions/patch.js"(exports, module2) {
2271
+ var SemVer = require_semver();
2272
+ var patch = (a2, loose) => new SemVer(a2, loose).patch;
2273
+ module2.exports = patch;
2274
+ }
2275
+ });
2276
+
2277
+ // node_modules/semver/functions/prerelease.js
2278
+ var require_prerelease = __commonJS({
2279
+ "node_modules/semver/functions/prerelease.js"(exports, module2) {
2280
+ var parse2 = require_parse2();
2281
+ var prerelease = (version2, options) => {
2282
+ const parsed = parse2(version2, options);
2283
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
2284
+ };
2285
+ module2.exports = prerelease;
2286
+ }
2287
+ });
2288
+
2289
+ // node_modules/semver/functions/compare.js
2290
+ var require_compare = __commonJS({
2291
+ "node_modules/semver/functions/compare.js"(exports, module2) {
2292
+ var SemVer = require_semver();
2293
+ var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
2294
+ module2.exports = compare;
2295
+ }
2296
+ });
2297
+
2298
+ // node_modules/semver/functions/rcompare.js
2299
+ var require_rcompare = __commonJS({
2300
+ "node_modules/semver/functions/rcompare.js"(exports, module2) {
2301
+ var compare = require_compare();
2302
+ var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
2303
+ module2.exports = rcompare;
2304
+ }
2305
+ });
2306
+
2307
+ // node_modules/semver/functions/compare-loose.js
2308
+ var require_compare_loose = __commonJS({
2309
+ "node_modules/semver/functions/compare-loose.js"(exports, module2) {
2310
+ var compare = require_compare();
2311
+ var compareLoose = (a2, b2) => compare(a2, b2, true);
2312
+ module2.exports = compareLoose;
2313
+ }
2314
+ });
2315
+
2316
+ // node_modules/semver/functions/compare-build.js
2317
+ var require_compare_build = __commonJS({
2318
+ "node_modules/semver/functions/compare-build.js"(exports, module2) {
2319
+ var SemVer = require_semver();
2320
+ var compareBuild = (a2, b2, loose) => {
2321
+ const versionA = new SemVer(a2, loose);
2322
+ const versionB = new SemVer(b2, loose);
2323
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
2324
+ };
2325
+ module2.exports = compareBuild;
2326
+ }
2327
+ });
2328
+
2329
+ // node_modules/semver/functions/sort.js
2330
+ var require_sort = __commonJS({
2331
+ "node_modules/semver/functions/sort.js"(exports, module2) {
2332
+ var compareBuild = require_compare_build();
2333
+ var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
2334
+ module2.exports = sort;
2335
+ }
2336
+ });
2337
+
2338
+ // node_modules/semver/functions/rsort.js
2339
+ var require_rsort = __commonJS({
2340
+ "node_modules/semver/functions/rsort.js"(exports, module2) {
2341
+ var compareBuild = require_compare_build();
2342
+ var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
2343
+ module2.exports = rsort;
2344
+ }
2345
+ });
2346
+
2347
+ // node_modules/semver/functions/gt.js
2348
+ var require_gt = __commonJS({
2349
+ "node_modules/semver/functions/gt.js"(exports, module2) {
2350
+ var compare = require_compare();
2351
+ var gt = (a2, b2, loose) => compare(a2, b2, loose) > 0;
2352
+ module2.exports = gt;
2353
+ }
2354
+ });
2355
+
2356
+ // node_modules/semver/functions/lt.js
2357
+ var require_lt = __commonJS({
2358
+ "node_modules/semver/functions/lt.js"(exports, module2) {
2359
+ var compare = require_compare();
2360
+ var lt = (a2, b2, loose) => compare(a2, b2, loose) < 0;
2361
+ module2.exports = lt;
2362
+ }
2363
+ });
2364
+
2365
+ // node_modules/semver/functions/eq.js
2366
+ var require_eq = __commonJS({
2367
+ "node_modules/semver/functions/eq.js"(exports, module2) {
2368
+ var compare = require_compare();
2369
+ var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
2370
+ module2.exports = eq;
2371
+ }
2372
+ });
2373
+
2374
+ // node_modules/semver/functions/neq.js
2375
+ var require_neq = __commonJS({
2376
+ "node_modules/semver/functions/neq.js"(exports, module2) {
2377
+ var compare = require_compare();
2378
+ var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
2379
+ module2.exports = neq;
2380
+ }
2381
+ });
2382
+
2383
+ // node_modules/semver/functions/gte.js
2384
+ var require_gte = __commonJS({
2385
+ "node_modules/semver/functions/gte.js"(exports, module2) {
2386
+ var compare = require_compare();
2387
+ var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
2388
+ module2.exports = gte;
2389
+ }
2390
+ });
2391
+
2392
+ // node_modules/semver/functions/lte.js
2393
+ var require_lte = __commonJS({
2394
+ "node_modules/semver/functions/lte.js"(exports, module2) {
2395
+ var compare = require_compare();
2396
+ var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
2397
+ module2.exports = lte;
2398
+ }
2399
+ });
2400
+
2401
+ // node_modules/semver/functions/cmp.js
2402
+ var require_cmp = __commonJS({
2403
+ "node_modules/semver/functions/cmp.js"(exports, module2) {
2404
+ var eq = require_eq();
2405
+ var neq = require_neq();
2406
+ var gt = require_gt();
2407
+ var gte = require_gte();
2408
+ var lt = require_lt();
2409
+ var lte = require_lte();
2410
+ var cmp = (a2, op, b2, loose) => {
2411
+ switch (op) {
2412
+ case "===":
2413
+ if (typeof a2 === "object") {
2414
+ a2 = a2.version;
2415
+ }
2416
+ if (typeof b2 === "object") {
2417
+ b2 = b2.version;
2418
+ }
2419
+ return a2 === b2;
2420
+ case "!==":
2421
+ if (typeof a2 === "object") {
2422
+ a2 = a2.version;
2423
+ }
2424
+ if (typeof b2 === "object") {
2425
+ b2 = b2.version;
2426
+ }
2427
+ return a2 !== b2;
2428
+ case "":
2429
+ case "=":
2430
+ case "==":
2431
+ return eq(a2, b2, loose);
2432
+ case "!=":
2433
+ return neq(a2, b2, loose);
2434
+ case ">":
2435
+ return gt(a2, b2, loose);
2436
+ case ">=":
2437
+ return gte(a2, b2, loose);
2438
+ case "<":
2439
+ return lt(a2, b2, loose);
2440
+ case "<=":
2441
+ return lte(a2, b2, loose);
2442
+ default:
2443
+ throw new TypeError(`Invalid operator: ${op}`);
2444
+ }
2445
+ };
2446
+ module2.exports = cmp;
2447
+ }
2448
+ });
2449
+
2450
+ // node_modules/semver/functions/coerce.js
2451
+ var require_coerce = __commonJS({
2452
+ "node_modules/semver/functions/coerce.js"(exports, module2) {
2453
+ var SemVer = require_semver();
2454
+ var parse2 = require_parse2();
2455
+ var { re, t } = require_re();
2456
+ var coerce = (version2, options) => {
2457
+ if (version2 instanceof SemVer) {
2458
+ return version2;
2459
+ }
2460
+ if (typeof version2 === "number") {
2461
+ version2 = String(version2);
2462
+ }
2463
+ if (typeof version2 !== "string") {
2464
+ return null;
2465
+ }
2466
+ options = options || {};
2467
+ let match = null;
2468
+ if (!options.rtl) {
2469
+ match = version2.match(re[t.COERCE]);
2470
+ } else {
2471
+ let next;
2472
+ while ((next = re[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
2473
+ if (!match || next.index + next[0].length !== match.index + match[0].length) {
2474
+ match = next;
2475
+ }
2476
+ re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
2477
+ }
2478
+ re[t.COERCERTL].lastIndex = -1;
2479
+ }
2480
+ if (match === null) {
2481
+ return null;
2482
+ }
2483
+ return parse2(`${match[2]}.${match[3] || "0"}.${match[4] || "0"}`, options);
2484
+ };
2485
+ module2.exports = coerce;
2486
+ }
2487
+ });
2488
+
2489
+ // ../../node_modules/yallist/iterator.js
2490
+ var require_iterator = __commonJS({
2491
+ "../../node_modules/yallist/iterator.js"(exports, module2) {
2492
+ "use strict";
2493
+ module2.exports = function(Yallist) {
2494
+ Yallist.prototype[Symbol.iterator] = function* () {
2495
+ for (let walker = this.head; walker; walker = walker.next) {
2496
+ yield walker.value;
2497
+ }
2498
+ };
2499
+ };
2500
+ }
2501
+ });
2502
+
2503
+ // ../../node_modules/yallist/yallist.js
2504
+ var require_yallist = __commonJS({
2505
+ "../../node_modules/yallist/yallist.js"(exports, module2) {
2506
+ "use strict";
2507
+ module2.exports = Yallist;
2508
+ Yallist.Node = Node;
2509
+ Yallist.create = Yallist;
2510
+ function Yallist(list) {
2511
+ var self = this;
2512
+ if (!(self instanceof Yallist)) {
2513
+ self = new Yallist();
2514
+ }
2515
+ self.tail = null;
2516
+ self.head = null;
2517
+ self.length = 0;
2518
+ if (list && typeof list.forEach === "function") {
2519
+ list.forEach(function(item) {
2520
+ self.push(item);
2521
+ });
2522
+ } else if (arguments.length > 0) {
2523
+ for (var i = 0, l2 = arguments.length; i < l2; i++) {
2524
+ self.push(arguments[i]);
2525
+ }
2526
+ }
2527
+ return self;
2528
+ }
2529
+ Yallist.prototype.removeNode = function(node) {
2530
+ if (node.list !== this) {
2531
+ throw new Error("removing node which does not belong to this list");
2532
+ }
2533
+ var next = node.next;
2534
+ var prev = node.prev;
2535
+ if (next) {
2536
+ next.prev = prev;
2537
+ }
2538
+ if (prev) {
2539
+ prev.next = next;
2540
+ }
2541
+ if (node === this.head) {
2542
+ this.head = next;
2543
+ }
2544
+ if (node === this.tail) {
2545
+ this.tail = prev;
2546
+ }
2547
+ node.list.length--;
2548
+ node.next = null;
2549
+ node.prev = null;
2550
+ node.list = null;
2551
+ return next;
2552
+ };
2553
+ Yallist.prototype.unshiftNode = function(node) {
2554
+ if (node === this.head) {
2555
+ return;
2556
+ }
2557
+ if (node.list) {
2558
+ node.list.removeNode(node);
2559
+ }
2560
+ var head = this.head;
2561
+ node.list = this;
2562
+ node.next = head;
2563
+ if (head) {
2564
+ head.prev = node;
2565
+ }
2566
+ this.head = node;
2567
+ if (!this.tail) {
2568
+ this.tail = node;
2569
+ }
2570
+ this.length++;
2571
+ };
2572
+ Yallist.prototype.pushNode = function(node) {
2573
+ if (node === this.tail) {
2574
+ return;
2575
+ }
2576
+ if (node.list) {
2577
+ node.list.removeNode(node);
2578
+ }
2579
+ var tail = this.tail;
2580
+ node.list = this;
2581
+ node.prev = tail;
2582
+ if (tail) {
2583
+ tail.next = node;
2584
+ }
2585
+ this.tail = node;
2586
+ if (!this.head) {
2587
+ this.head = node;
2588
+ }
2589
+ this.length++;
2590
+ };
2591
+ Yallist.prototype.push = function() {
2592
+ for (var i = 0, l2 = arguments.length; i < l2; i++) {
2593
+ push(this, arguments[i]);
2594
+ }
2595
+ return this.length;
2596
+ };
2597
+ Yallist.prototype.unshift = function() {
2598
+ for (var i = 0, l2 = arguments.length; i < l2; i++) {
2599
+ unshift(this, arguments[i]);
2600
+ }
2601
+ return this.length;
2602
+ };
2603
+ Yallist.prototype.pop = function() {
2604
+ if (!this.tail) {
2605
+ return void 0;
2606
+ }
2607
+ var res = this.tail.value;
2608
+ this.tail = this.tail.prev;
2609
+ if (this.tail) {
2610
+ this.tail.next = null;
2611
+ } else {
2612
+ this.head = null;
2613
+ }
2614
+ this.length--;
2615
+ return res;
2616
+ };
2617
+ Yallist.prototype.shift = function() {
2618
+ if (!this.head) {
2619
+ return void 0;
2620
+ }
2621
+ var res = this.head.value;
2622
+ this.head = this.head.next;
2623
+ if (this.head) {
2624
+ this.head.prev = null;
2625
+ } else {
2626
+ this.tail = null;
2627
+ }
2628
+ this.length--;
2629
+ return res;
2630
+ };
2631
+ Yallist.prototype.forEach = function(fn, thisp) {
2632
+ thisp = thisp || this;
2633
+ for (var walker = this.head, i = 0; walker !== null; i++) {
2634
+ fn.call(thisp, walker.value, i, this);
2635
+ walker = walker.next;
2636
+ }
2637
+ };
2638
+ Yallist.prototype.forEachReverse = function(fn, thisp) {
2639
+ thisp = thisp || this;
2640
+ for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
2641
+ fn.call(thisp, walker.value, i, this);
2642
+ walker = walker.prev;
2643
+ }
2644
+ };
2645
+ Yallist.prototype.get = function(n) {
2646
+ for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
2647
+ walker = walker.next;
2648
+ }
2649
+ if (i === n && walker !== null) {
2650
+ return walker.value;
2651
+ }
2652
+ };
2653
+ Yallist.prototype.getReverse = function(n) {
2654
+ for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
2655
+ walker = walker.prev;
2656
+ }
2657
+ if (i === n && walker !== null) {
2658
+ return walker.value;
2659
+ }
2660
+ };
2661
+ Yallist.prototype.map = function(fn, thisp) {
2662
+ thisp = thisp || this;
2663
+ var res = new Yallist();
2664
+ for (var walker = this.head; walker !== null; ) {
2665
+ res.push(fn.call(thisp, walker.value, this));
2666
+ walker = walker.next;
2667
+ }
2668
+ return res;
2669
+ };
2670
+ Yallist.prototype.mapReverse = function(fn, thisp) {
2671
+ thisp = thisp || this;
2672
+ var res = new Yallist();
2673
+ for (var walker = this.tail; walker !== null; ) {
2674
+ res.push(fn.call(thisp, walker.value, this));
2675
+ walker = walker.prev;
2676
+ }
2677
+ return res;
2678
+ };
2679
+ Yallist.prototype.reduce = function(fn, initial) {
2680
+ var acc;
2681
+ var walker = this.head;
2682
+ if (arguments.length > 1) {
2683
+ acc = initial;
2684
+ } else if (this.head) {
2685
+ walker = this.head.next;
2686
+ acc = this.head.value;
2687
+ } else {
2688
+ throw new TypeError("Reduce of empty list with no initial value");
2689
+ }
2690
+ for (var i = 0; walker !== null; i++) {
2691
+ acc = fn(acc, walker.value, i);
2692
+ walker = walker.next;
2693
+ }
2694
+ return acc;
2695
+ };
2696
+ Yallist.prototype.reduceReverse = function(fn, initial) {
2697
+ var acc;
2698
+ var walker = this.tail;
2699
+ if (arguments.length > 1) {
2700
+ acc = initial;
2701
+ } else if (this.tail) {
2702
+ walker = this.tail.prev;
2703
+ acc = this.tail.value;
2704
+ } else {
2705
+ throw new TypeError("Reduce of empty list with no initial value");
2706
+ }
2707
+ for (var i = this.length - 1; walker !== null; i--) {
2708
+ acc = fn(acc, walker.value, i);
2709
+ walker = walker.prev;
2710
+ }
2711
+ return acc;
2712
+ };
2713
+ Yallist.prototype.toArray = function() {
2714
+ var arr = new Array(this.length);
2715
+ for (var i = 0, walker = this.head; walker !== null; i++) {
2716
+ arr[i] = walker.value;
2717
+ walker = walker.next;
2718
+ }
2719
+ return arr;
2720
+ };
2721
+ Yallist.prototype.toArrayReverse = function() {
2722
+ var arr = new Array(this.length);
2723
+ for (var i = 0, walker = this.tail; walker !== null; i++) {
2724
+ arr[i] = walker.value;
2725
+ walker = walker.prev;
2726
+ }
2727
+ return arr;
2728
+ };
2729
+ Yallist.prototype.slice = function(from, to) {
2730
+ to = to || this.length;
2731
+ if (to < 0) {
2732
+ to += this.length;
2733
+ }
2734
+ from = from || 0;
2735
+ if (from < 0) {
2736
+ from += this.length;
2737
+ }
2738
+ var ret = new Yallist();
2739
+ if (to < from || to < 0) {
2740
+ return ret;
2741
+ }
2742
+ if (from < 0) {
2743
+ from = 0;
2744
+ }
2745
+ if (to > this.length) {
2746
+ to = this.length;
2747
+ }
2748
+ for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
2749
+ walker = walker.next;
2750
+ }
2751
+ for (; walker !== null && i < to; i++, walker = walker.next) {
2752
+ ret.push(walker.value);
2753
+ }
2754
+ return ret;
2755
+ };
2756
+ Yallist.prototype.sliceReverse = function(from, to) {
2757
+ to = to || this.length;
2758
+ if (to < 0) {
2759
+ to += this.length;
2760
+ }
2761
+ from = from || 0;
2762
+ if (from < 0) {
2763
+ from += this.length;
2764
+ }
2765
+ var ret = new Yallist();
2766
+ if (to < from || to < 0) {
2767
+ return ret;
2768
+ }
2769
+ if (from < 0) {
2770
+ from = 0;
2771
+ }
2772
+ if (to > this.length) {
2773
+ to = this.length;
2774
+ }
2775
+ for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
2776
+ walker = walker.prev;
2777
+ }
2778
+ for (; walker !== null && i > from; i--, walker = walker.prev) {
2779
+ ret.push(walker.value);
2780
+ }
2781
+ return ret;
2782
+ };
2783
+ Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
2784
+ if (start > this.length) {
2785
+ start = this.length - 1;
2786
+ }
2787
+ if (start < 0) {
2788
+ start = this.length + start;
2789
+ }
2790
+ for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
2791
+ walker = walker.next;
2792
+ }
2793
+ var ret = [];
2794
+ for (var i = 0; walker && i < deleteCount; i++) {
2795
+ ret.push(walker.value);
2796
+ walker = this.removeNode(walker);
2797
+ }
2798
+ if (walker === null) {
2799
+ walker = this.tail;
2800
+ }
2801
+ if (walker !== this.head && walker !== this.tail) {
2802
+ walker = walker.prev;
2803
+ }
2804
+ for (var i = 0; i < nodes.length; i++) {
2805
+ walker = insert(this, walker, nodes[i]);
2806
+ }
2807
+ return ret;
2808
+ };
2809
+ Yallist.prototype.reverse = function() {
2810
+ var head = this.head;
2811
+ var tail = this.tail;
2812
+ for (var walker = head; walker !== null; walker = walker.prev) {
2813
+ var p3 = walker.prev;
2814
+ walker.prev = walker.next;
2815
+ walker.next = p3;
2816
+ }
2817
+ this.head = tail;
2818
+ this.tail = head;
2819
+ return this;
2820
+ };
2821
+ function insert(self, node, value) {
2822
+ var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
2823
+ if (inserted.next === null) {
2824
+ self.tail = inserted;
2825
+ }
2826
+ if (inserted.prev === null) {
2827
+ self.head = inserted;
2828
+ }
2829
+ self.length++;
2830
+ return inserted;
2831
+ }
2832
+ function push(self, item) {
2833
+ self.tail = new Node(item, self.tail, null, self);
2834
+ if (!self.head) {
2835
+ self.head = self.tail;
2836
+ }
2837
+ self.length++;
2838
+ }
2839
+ function unshift(self, item) {
2840
+ self.head = new Node(item, null, self.head, self);
2841
+ if (!self.tail) {
2842
+ self.tail = self.head;
2843
+ }
2844
+ self.length++;
2845
+ }
2846
+ function Node(value, prev, next, list) {
2847
+ if (!(this instanceof Node)) {
2848
+ return new Node(value, prev, next, list);
2849
+ }
2850
+ this.list = list;
2851
+ this.value = value;
2852
+ if (prev) {
2853
+ prev.next = this;
2854
+ this.prev = prev;
2855
+ } else {
2856
+ this.prev = null;
2857
+ }
2858
+ if (next) {
2859
+ next.prev = this;
2860
+ this.next = next;
2861
+ } else {
2862
+ this.next = null;
2863
+ }
2864
+ }
2865
+ try {
2866
+ require_iterator()(Yallist);
2867
+ } catch (er) {
2868
+ }
2869
+ }
2870
+ });
2871
+
2872
+ // ../../node_modules/lru-cache/index.js
2873
+ var require_lru_cache = __commonJS({
2874
+ "../../node_modules/lru-cache/index.js"(exports, module2) {
2875
+ "use strict";
2876
+ var Yallist = require_yallist();
2877
+ var MAX = Symbol("max");
2878
+ var LENGTH = Symbol("length");
2879
+ var LENGTH_CALCULATOR = Symbol("lengthCalculator");
2880
+ var ALLOW_STALE = Symbol("allowStale");
2881
+ var MAX_AGE = Symbol("maxAge");
2882
+ var DISPOSE = Symbol("dispose");
2883
+ var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
2884
+ var LRU_LIST = Symbol("lruList");
2885
+ var CACHE = Symbol("cache");
2886
+ var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
2887
+ var naiveLength = () => 1;
2888
+ var LRUCache = class {
2889
+ constructor(options) {
2890
+ if (typeof options === "number")
2891
+ options = { max: options };
2892
+ if (!options)
2893
+ options = {};
2894
+ if (options.max && (typeof options.max !== "number" || options.max < 0))
2895
+ throw new TypeError("max must be a non-negative number");
2896
+ const max = this[MAX] = options.max || Infinity;
2897
+ const lc = options.length || naiveLength;
2898
+ this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
2899
+ this[ALLOW_STALE] = options.stale || false;
2900
+ if (options.maxAge && typeof options.maxAge !== "number")
2901
+ throw new TypeError("maxAge must be a number");
2902
+ this[MAX_AGE] = options.maxAge || 0;
2903
+ this[DISPOSE] = options.dispose;
2904
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
2905
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
2906
+ this.reset();
2907
+ }
2908
+ // resize the cache when the max changes.
2909
+ set max(mL) {
2910
+ if (typeof mL !== "number" || mL < 0)
2911
+ throw new TypeError("max must be a non-negative number");
2912
+ this[MAX] = mL || Infinity;
2913
+ trim(this);
2914
+ }
2915
+ get max() {
2916
+ return this[MAX];
2917
+ }
2918
+ set allowStale(allowStale) {
2919
+ this[ALLOW_STALE] = !!allowStale;
2920
+ }
2921
+ get allowStale() {
2922
+ return this[ALLOW_STALE];
2923
+ }
2924
+ set maxAge(mA) {
2925
+ if (typeof mA !== "number")
2926
+ throw new TypeError("maxAge must be a non-negative number");
2927
+ this[MAX_AGE] = mA;
2928
+ trim(this);
2929
+ }
2930
+ get maxAge() {
2931
+ return this[MAX_AGE];
2932
+ }
2933
+ // resize the cache when the lengthCalculator changes.
2934
+ set lengthCalculator(lC) {
2935
+ if (typeof lC !== "function")
2936
+ lC = naiveLength;
2937
+ if (lC !== this[LENGTH_CALCULATOR]) {
2938
+ this[LENGTH_CALCULATOR] = lC;
2939
+ this[LENGTH] = 0;
2940
+ this[LRU_LIST].forEach((hit) => {
2941
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
2942
+ this[LENGTH] += hit.length;
2943
+ });
2944
+ }
2945
+ trim(this);
2946
+ }
2947
+ get lengthCalculator() {
2948
+ return this[LENGTH_CALCULATOR];
2949
+ }
2950
+ get length() {
2951
+ return this[LENGTH];
2952
+ }
2953
+ get itemCount() {
2954
+ return this[LRU_LIST].length;
2955
+ }
2956
+ rforEach(fn, thisp) {
2957
+ thisp = thisp || this;
2958
+ for (let walker = this[LRU_LIST].tail; walker !== null; ) {
2959
+ const prev = walker.prev;
2960
+ forEachStep(this, fn, walker, thisp);
2961
+ walker = prev;
2962
+ }
2963
+ }
2964
+ forEach(fn, thisp) {
2965
+ thisp = thisp || this;
2966
+ for (let walker = this[LRU_LIST].head; walker !== null; ) {
2967
+ const next = walker.next;
2968
+ forEachStep(this, fn, walker, thisp);
2969
+ walker = next;
2970
+ }
2971
+ }
2972
+ keys() {
2973
+ return this[LRU_LIST].toArray().map((k3) => k3.key);
2974
+ }
2975
+ values() {
2976
+ return this[LRU_LIST].toArray().map((k3) => k3.value);
2977
+ }
2978
+ reset() {
2979
+ if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
2980
+ this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
2981
+ }
2982
+ this[CACHE] = /* @__PURE__ */ new Map();
2983
+ this[LRU_LIST] = new Yallist();
2984
+ this[LENGTH] = 0;
2985
+ }
2986
+ dump() {
2987
+ return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
2988
+ k: hit.key,
2989
+ v: hit.value,
2990
+ e: hit.now + (hit.maxAge || 0)
2991
+ }).toArray().filter((h2) => h2);
2992
+ }
2993
+ dumpLru() {
2994
+ return this[LRU_LIST];
2995
+ }
2996
+ set(key, value, maxAge) {
2997
+ maxAge = maxAge || this[MAX_AGE];
2998
+ if (maxAge && typeof maxAge !== "number")
2999
+ throw new TypeError("maxAge must be a number");
3000
+ const now = maxAge ? Date.now() : 0;
3001
+ const len = this[LENGTH_CALCULATOR](value, key);
3002
+ if (this[CACHE].has(key)) {
3003
+ if (len > this[MAX]) {
3004
+ del(this, this[CACHE].get(key));
3005
+ return false;
3006
+ }
3007
+ const node = this[CACHE].get(key);
3008
+ const item = node.value;
3009
+ if (this[DISPOSE]) {
3010
+ if (!this[NO_DISPOSE_ON_SET])
3011
+ this[DISPOSE](key, item.value);
3012
+ }
3013
+ item.now = now;
3014
+ item.maxAge = maxAge;
3015
+ item.value = value;
3016
+ this[LENGTH] += len - item.length;
3017
+ item.length = len;
3018
+ this.get(key);
3019
+ trim(this);
3020
+ return true;
3021
+ }
3022
+ const hit = new Entry(key, value, len, now, maxAge);
3023
+ if (hit.length > this[MAX]) {
3024
+ if (this[DISPOSE])
3025
+ this[DISPOSE](key, value);
3026
+ return false;
3027
+ }
3028
+ this[LENGTH] += hit.length;
3029
+ this[LRU_LIST].unshift(hit);
3030
+ this[CACHE].set(key, this[LRU_LIST].head);
3031
+ trim(this);
3032
+ return true;
3033
+ }
3034
+ has(key) {
3035
+ if (!this[CACHE].has(key))
3036
+ return false;
3037
+ const hit = this[CACHE].get(key).value;
3038
+ return !isStale(this, hit);
3039
+ }
3040
+ get(key) {
3041
+ return get(this, key, true);
3042
+ }
3043
+ peek(key) {
3044
+ return get(this, key, false);
3045
+ }
3046
+ pop() {
3047
+ const node = this[LRU_LIST].tail;
3048
+ if (!node)
3049
+ return null;
3050
+ del(this, node);
3051
+ return node.value;
3052
+ }
3053
+ del(key) {
3054
+ del(this, this[CACHE].get(key));
3055
+ }
3056
+ load(arr) {
3057
+ this.reset();
3058
+ const now = Date.now();
3059
+ for (let l2 = arr.length - 1; l2 >= 0; l2--) {
3060
+ const hit = arr[l2];
3061
+ const expiresAt = hit.e || 0;
3062
+ if (expiresAt === 0)
3063
+ this.set(hit.k, hit.v);
3064
+ else {
3065
+ const maxAge = expiresAt - now;
3066
+ if (maxAge > 0) {
3067
+ this.set(hit.k, hit.v, maxAge);
3068
+ }
3069
+ }
3070
+ }
3071
+ }
3072
+ prune() {
3073
+ this[CACHE].forEach((value, key) => get(this, key, false));
3074
+ }
3075
+ };
3076
+ var get = (self, key, doUse) => {
3077
+ const node = self[CACHE].get(key);
3078
+ if (node) {
3079
+ const hit = node.value;
3080
+ if (isStale(self, hit)) {
3081
+ del(self, node);
3082
+ if (!self[ALLOW_STALE])
3083
+ return void 0;
3084
+ } else {
3085
+ if (doUse) {
3086
+ if (self[UPDATE_AGE_ON_GET])
3087
+ node.value.now = Date.now();
3088
+ self[LRU_LIST].unshiftNode(node);
3089
+ }
3090
+ }
3091
+ return hit.value;
3092
+ }
3093
+ };
3094
+ var isStale = (self, hit) => {
3095
+ if (!hit || !hit.maxAge && !self[MAX_AGE])
3096
+ return false;
3097
+ const diff = Date.now() - hit.now;
3098
+ return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
3099
+ };
3100
+ var trim = (self) => {
3101
+ if (self[LENGTH] > self[MAX]) {
3102
+ for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
3103
+ const prev = walker.prev;
3104
+ del(self, walker);
3105
+ walker = prev;
3106
+ }
3107
+ }
3108
+ };
3109
+ var del = (self, node) => {
3110
+ if (node) {
3111
+ const hit = node.value;
3112
+ if (self[DISPOSE])
3113
+ self[DISPOSE](hit.key, hit.value);
3114
+ self[LENGTH] -= hit.length;
3115
+ self[CACHE].delete(hit.key);
3116
+ self[LRU_LIST].removeNode(node);
3117
+ }
3118
+ };
3119
+ var Entry = class {
3120
+ constructor(key, value, length, now, maxAge) {
3121
+ this.key = key;
3122
+ this.value = value;
3123
+ this.length = length;
3124
+ this.now = now;
3125
+ this.maxAge = maxAge || 0;
3126
+ }
3127
+ };
3128
+ var forEachStep = (self, fn, node, thisp) => {
3129
+ let hit = node.value;
3130
+ if (isStale(self, hit)) {
3131
+ del(self, node);
3132
+ if (!self[ALLOW_STALE])
3133
+ hit = void 0;
3134
+ }
3135
+ if (hit)
3136
+ fn.call(thisp, hit.value, hit.key, self);
3137
+ };
3138
+ module2.exports = LRUCache;
3139
+ }
3140
+ });
3141
+
3142
+ // node_modules/semver/classes/range.js
3143
+ var require_range = __commonJS({
3144
+ "node_modules/semver/classes/range.js"(exports, module2) {
3145
+ var Range = class {
3146
+ constructor(range, options) {
3147
+ options = parseOptions(options);
3148
+ if (range instanceof Range) {
3149
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
3150
+ return range;
3151
+ } else {
3152
+ return new Range(range.raw, options);
3153
+ }
3154
+ }
3155
+ if (range instanceof Comparator) {
3156
+ this.raw = range.value;
3157
+ this.set = [[range]];
3158
+ this.format();
3159
+ return this;
3160
+ }
3161
+ this.options = options;
3162
+ this.loose = !!options.loose;
3163
+ this.includePrerelease = !!options.includePrerelease;
3164
+ this.raw = range;
3165
+ this.set = range.split("||").map((r2) => this.parseRange(r2.trim())).filter((c2) => c2.length);
3166
+ if (!this.set.length) {
3167
+ throw new TypeError(`Invalid SemVer Range: ${range}`);
3168
+ }
3169
+ if (this.set.length > 1) {
3170
+ const first = this.set[0];
3171
+ this.set = this.set.filter((c2) => !isNullSet(c2[0]));
3172
+ if (this.set.length === 0) {
3173
+ this.set = [first];
3174
+ } else if (this.set.length > 1) {
3175
+ for (const c2 of this.set) {
3176
+ if (c2.length === 1 && isAny(c2[0])) {
3177
+ this.set = [c2];
3178
+ break;
3179
+ }
3180
+ }
3181
+ }
3182
+ }
3183
+ this.format();
3184
+ }
3185
+ format() {
3186
+ this.range = this.set.map((comps) => {
3187
+ return comps.join(" ").trim();
3188
+ }).join("||").trim();
3189
+ return this.range;
3190
+ }
3191
+ toString() {
3192
+ return this.range;
3193
+ }
3194
+ parseRange(range) {
3195
+ range = range.trim();
3196
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
3197
+ const memoKey = memoOpts + ":" + range;
3198
+ const cached = cache.get(memoKey);
3199
+ if (cached) {
3200
+ return cached;
3201
+ }
3202
+ const loose = this.options.loose;
3203
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
3204
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
3205
+ debug("hyphen replace", range);
3206
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
3207
+ debug("comparator trim", range);
3208
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
3209
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
3210
+ range = range.split(/\s+/).join(" ");
3211
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
3212
+ if (loose) {
3213
+ rangeList = rangeList.filter((comp) => {
3214
+ debug("loose invalid filter", comp, this.options);
3215
+ return !!comp.match(re[t.COMPARATORLOOSE]);
3216
+ });
3217
+ }
3218
+ debug("range list", rangeList);
3219
+ const rangeMap = /* @__PURE__ */ new Map();
3220
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
3221
+ for (const comp of comparators) {
3222
+ if (isNullSet(comp)) {
3223
+ return [comp];
3224
+ }
3225
+ rangeMap.set(comp.value, comp);
3226
+ }
3227
+ if (rangeMap.size > 1 && rangeMap.has("")) {
3228
+ rangeMap.delete("");
3229
+ }
3230
+ const result = [...rangeMap.values()];
3231
+ cache.set(memoKey, result);
3232
+ return result;
3233
+ }
3234
+ intersects(range, options) {
3235
+ if (!(range instanceof Range)) {
3236
+ throw new TypeError("a Range is required");
3237
+ }
3238
+ return this.set.some((thisComparators) => {
3239
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
3240
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
3241
+ return rangeComparators.every((rangeComparator) => {
3242
+ return thisComparator.intersects(rangeComparator, options);
3243
+ });
3244
+ });
3245
+ });
3246
+ });
3247
+ }
3248
+ // if ANY of the sets match ALL of its comparators, then pass
3249
+ test(version2) {
3250
+ if (!version2) {
3251
+ return false;
3252
+ }
3253
+ if (typeof version2 === "string") {
3254
+ try {
3255
+ version2 = new SemVer(version2, this.options);
3256
+ } catch (er) {
3257
+ return false;
3258
+ }
3259
+ }
3260
+ for (let i = 0; i < this.set.length; i++) {
3261
+ if (testSet(this.set[i], version2, this.options)) {
3262
+ return true;
3263
+ }
3264
+ }
3265
+ return false;
3266
+ }
3267
+ };
3268
+ module2.exports = Range;
3269
+ var LRU = require_lru_cache();
3270
+ var cache = new LRU({ max: 1e3 });
3271
+ var parseOptions = require_parse_options();
3272
+ var Comparator = require_comparator();
3273
+ var debug = require_debug();
3274
+ var SemVer = require_semver();
3275
+ var {
3276
+ re,
3277
+ t,
3278
+ comparatorTrimReplace,
3279
+ tildeTrimReplace,
3280
+ caretTrimReplace
3281
+ } = require_re();
3282
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
3283
+ var isNullSet = (c2) => c2.value === "<0.0.0-0";
3284
+ var isAny = (c2) => c2.value === "";
3285
+ var isSatisfiable = (comparators, options) => {
3286
+ let result = true;
3287
+ const remainingComparators = comparators.slice();
3288
+ let testComparator = remainingComparators.pop();
3289
+ while (result && remainingComparators.length) {
3290
+ result = remainingComparators.every((otherComparator) => {
3291
+ return testComparator.intersects(otherComparator, options);
3292
+ });
3293
+ testComparator = remainingComparators.pop();
3294
+ }
3295
+ return result;
3296
+ };
3297
+ var parseComparator = (comp, options) => {
3298
+ debug("comp", comp, options);
3299
+ comp = replaceCarets(comp, options);
3300
+ debug("caret", comp);
3301
+ comp = replaceTildes(comp, options);
3302
+ debug("tildes", comp);
3303
+ comp = replaceXRanges(comp, options);
3304
+ debug("xrange", comp);
3305
+ comp = replaceStars(comp, options);
3306
+ debug("stars", comp);
3307
+ return comp;
3308
+ };
3309
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
3310
+ var replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c2) => {
3311
+ return replaceTilde(c2, options);
3312
+ }).join(" ");
3313
+ var replaceTilde = (comp, options) => {
3314
+ const r2 = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
3315
+ return comp.replace(r2, (_3, M2, m2, p3, pr) => {
3316
+ debug("tilde", comp, _3, M2, m2, p3, pr);
3317
+ let ret;
3318
+ if (isX(M2)) {
3319
+ ret = "";
3320
+ } else if (isX(m2)) {
3321
+ ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`;
3322
+ } else if (isX(p3)) {
3323
+ ret = `>=${M2}.${m2}.0 <${M2}.${+m2 + 1}.0-0`;
3324
+ } else if (pr) {
3325
+ debug("replaceTilde pr", pr);
3326
+ ret = `>=${M2}.${m2}.${p3}-${pr} <${M2}.${+m2 + 1}.0-0`;
3327
+ } else {
3328
+ ret = `>=${M2}.${m2}.${p3} <${M2}.${+m2 + 1}.0-0`;
3329
+ }
3330
+ debug("tilde return", ret);
3331
+ return ret;
3332
+ });
3333
+ };
3334
+ var replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c2) => {
3335
+ return replaceCaret(c2, options);
3336
+ }).join(" ");
3337
+ var replaceCaret = (comp, options) => {
3338
+ debug("caret", comp, options);
3339
+ const r2 = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
3340
+ const z3 = options.includePrerelease ? "-0" : "";
3341
+ return comp.replace(r2, (_3, M2, m2, p3, pr) => {
3342
+ debug("caret", comp, _3, M2, m2, p3, pr);
3343
+ let ret;
3344
+ if (isX(M2)) {
3345
+ ret = "";
3346
+ } else if (isX(m2)) {
3347
+ ret = `>=${M2}.0.0${z3} <${+M2 + 1}.0.0-0`;
3348
+ } else if (isX(p3)) {
3349
+ if (M2 === "0") {
3350
+ ret = `>=${M2}.${m2}.0${z3} <${M2}.${+m2 + 1}.0-0`;
3351
+ } else {
3352
+ ret = `>=${M2}.${m2}.0${z3} <${+M2 + 1}.0.0-0`;
3353
+ }
3354
+ } else if (pr) {
3355
+ debug("replaceCaret pr", pr);
3356
+ if (M2 === "0") {
3357
+ if (m2 === "0") {
3358
+ ret = `>=${M2}.${m2}.${p3}-${pr} <${M2}.${m2}.${+p3 + 1}-0`;
3359
+ } else {
3360
+ ret = `>=${M2}.${m2}.${p3}-${pr} <${M2}.${+m2 + 1}.0-0`;
3361
+ }
3362
+ } else {
3363
+ ret = `>=${M2}.${m2}.${p3}-${pr} <${+M2 + 1}.0.0-0`;
3364
+ }
3365
+ } else {
3366
+ debug("no pr");
3367
+ if (M2 === "0") {
3368
+ if (m2 === "0") {
3369
+ ret = `>=${M2}.${m2}.${p3}${z3} <${M2}.${m2}.${+p3 + 1}-0`;
3370
+ } else {
3371
+ ret = `>=${M2}.${m2}.${p3}${z3} <${M2}.${+m2 + 1}.0-0`;
3372
+ }
3373
+ } else {
3374
+ ret = `>=${M2}.${m2}.${p3} <${+M2 + 1}.0.0-0`;
3375
+ }
3376
+ }
3377
+ debug("caret return", ret);
3378
+ return ret;
3379
+ });
3380
+ };
3381
+ var replaceXRanges = (comp, options) => {
3382
+ debug("replaceXRanges", comp, options);
3383
+ return comp.split(/\s+/).map((c2) => {
3384
+ return replaceXRange(c2, options);
3385
+ }).join(" ");
3386
+ };
3387
+ var replaceXRange = (comp, options) => {
3388
+ comp = comp.trim();
3389
+ const r2 = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
3390
+ return comp.replace(r2, (ret, gtlt, M2, m2, p3, pr) => {
3391
+ debug("xRange", comp, ret, gtlt, M2, m2, p3, pr);
3392
+ const xM = isX(M2);
3393
+ const xm = xM || isX(m2);
3394
+ const xp = xm || isX(p3);
3395
+ const anyX = xp;
3396
+ if (gtlt === "=" && anyX) {
3397
+ gtlt = "";
3398
+ }
3399
+ pr = options.includePrerelease ? "-0" : "";
3400
+ if (xM) {
3401
+ if (gtlt === ">" || gtlt === "<") {
3402
+ ret = "<0.0.0-0";
3403
+ } else {
3404
+ ret = "*";
3405
+ }
3406
+ } else if (gtlt && anyX) {
3407
+ if (xm) {
3408
+ m2 = 0;
3409
+ }
3410
+ p3 = 0;
3411
+ if (gtlt === ">") {
3412
+ gtlt = ">=";
3413
+ if (xm) {
3414
+ M2 = +M2 + 1;
3415
+ m2 = 0;
3416
+ p3 = 0;
3417
+ } else {
3418
+ m2 = +m2 + 1;
3419
+ p3 = 0;
3420
+ }
3421
+ } else if (gtlt === "<=") {
3422
+ gtlt = "<";
3423
+ if (xm) {
3424
+ M2 = +M2 + 1;
3425
+ } else {
3426
+ m2 = +m2 + 1;
3427
+ }
3428
+ }
3429
+ if (gtlt === "<") {
3430
+ pr = "-0";
3431
+ }
3432
+ ret = `${gtlt + M2}.${m2}.${p3}${pr}`;
3433
+ } else if (xm) {
3434
+ ret = `>=${M2}.0.0${pr} <${+M2 + 1}.0.0-0`;
3435
+ } else if (xp) {
3436
+ ret = `>=${M2}.${m2}.0${pr} <${M2}.${+m2 + 1}.0-0`;
3437
+ }
3438
+ debug("xRange return", ret);
3439
+ return ret;
3440
+ });
3441
+ };
3442
+ var replaceStars = (comp, options) => {
3443
+ debug("replaceStars", comp, options);
3444
+ return comp.trim().replace(re[t.STAR], "");
3445
+ };
3446
+ var replaceGTE0 = (comp, options) => {
3447
+ debug("replaceGTE0", comp, options);
3448
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
3449
+ };
3450
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
3451
+ if (isX(fM)) {
3452
+ from = "";
3453
+ } else if (isX(fm)) {
3454
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
3455
+ } else if (isX(fp)) {
3456
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
3457
+ } else if (fpr) {
3458
+ from = `>=${from}`;
3459
+ } else {
3460
+ from = `>=${from}${incPr ? "-0" : ""}`;
3461
+ }
3462
+ if (isX(tM)) {
3463
+ to = "";
3464
+ } else if (isX(tm)) {
3465
+ to = `<${+tM + 1}.0.0-0`;
3466
+ } else if (isX(tp)) {
3467
+ to = `<${tM}.${+tm + 1}.0-0`;
3468
+ } else if (tpr) {
3469
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
3470
+ } else if (incPr) {
3471
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
3472
+ } else {
3473
+ to = `<=${to}`;
3474
+ }
3475
+ return `${from} ${to}`.trim();
3476
+ };
3477
+ var testSet = (set, version2, options) => {
3478
+ for (let i = 0; i < set.length; i++) {
3479
+ if (!set[i].test(version2)) {
3480
+ return false;
3481
+ }
3482
+ }
3483
+ if (version2.prerelease.length && !options.includePrerelease) {
3484
+ for (let i = 0; i < set.length; i++) {
3485
+ debug(set[i].semver);
3486
+ if (set[i].semver === Comparator.ANY) {
3487
+ continue;
3488
+ }
3489
+ if (set[i].semver.prerelease.length > 0) {
3490
+ const allowed = set[i].semver;
3491
+ if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
3492
+ return true;
3493
+ }
3494
+ }
3495
+ }
3496
+ return false;
3497
+ }
3498
+ return true;
3499
+ };
3500
+ }
3501
+ });
3502
+
3503
+ // node_modules/semver/classes/comparator.js
3504
+ var require_comparator = __commonJS({
3505
+ "node_modules/semver/classes/comparator.js"(exports, module2) {
3506
+ var ANY = Symbol("SemVer ANY");
3507
+ var Comparator = class {
3508
+ static get ANY() {
3509
+ return ANY;
3510
+ }
3511
+ constructor(comp, options) {
3512
+ options = parseOptions(options);
3513
+ if (comp instanceof Comparator) {
3514
+ if (comp.loose === !!options.loose) {
3515
+ return comp;
3516
+ } else {
3517
+ comp = comp.value;
3518
+ }
3519
+ }
3520
+ debug("comparator", comp, options);
3521
+ this.options = options;
3522
+ this.loose = !!options.loose;
3523
+ this.parse(comp);
3524
+ if (this.semver === ANY) {
3525
+ this.value = "";
3526
+ } else {
3527
+ this.value = this.operator + this.semver.version;
3528
+ }
3529
+ debug("comp", this);
3530
+ }
3531
+ parse(comp) {
3532
+ const r2 = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
3533
+ const m2 = comp.match(r2);
3534
+ if (!m2) {
3535
+ throw new TypeError(`Invalid comparator: ${comp}`);
3536
+ }
3537
+ this.operator = m2[1] !== void 0 ? m2[1] : "";
3538
+ if (this.operator === "=") {
3539
+ this.operator = "";
3540
+ }
3541
+ if (!m2[2]) {
3542
+ this.semver = ANY;
3543
+ } else {
3544
+ this.semver = new SemVer(m2[2], this.options.loose);
3545
+ }
3546
+ }
3547
+ toString() {
3548
+ return this.value;
3549
+ }
3550
+ test(version2) {
3551
+ debug("Comparator.test", version2, this.options.loose);
3552
+ if (this.semver === ANY || version2 === ANY) {
3553
+ return true;
3554
+ }
3555
+ if (typeof version2 === "string") {
3556
+ try {
3557
+ version2 = new SemVer(version2, this.options);
3558
+ } catch (er) {
3559
+ return false;
3560
+ }
3561
+ }
3562
+ return cmp(version2, this.operator, this.semver, this.options);
3563
+ }
3564
+ intersects(comp, options) {
3565
+ if (!(comp instanceof Comparator)) {
3566
+ throw new TypeError("a Comparator is required");
3567
+ }
3568
+ if (this.operator === "") {
3569
+ if (this.value === "") {
3570
+ return true;
3571
+ }
3572
+ return new Range(comp.value, options).test(this.value);
3573
+ } else if (comp.operator === "") {
3574
+ if (comp.value === "") {
3575
+ return true;
3576
+ }
3577
+ return new Range(this.value, options).test(comp.semver);
3578
+ }
3579
+ options = parseOptions(options);
3580
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
3581
+ return false;
3582
+ }
3583
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
3584
+ return false;
3585
+ }
3586
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
3587
+ return true;
3588
+ }
3589
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
3590
+ return true;
3591
+ }
3592
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
3593
+ return true;
3594
+ }
3595
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
3596
+ return true;
3597
+ }
3598
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
3599
+ return true;
3600
+ }
3601
+ return false;
3602
+ }
3603
+ };
3604
+ module2.exports = Comparator;
3605
+ var parseOptions = require_parse_options();
3606
+ var { re, t } = require_re();
3607
+ var cmp = require_cmp();
3608
+ var debug = require_debug();
3609
+ var SemVer = require_semver();
3610
+ var Range = require_range();
3611
+ }
3612
+ });
3613
+
3614
+ // node_modules/semver/functions/satisfies.js
3615
+ var require_satisfies = __commonJS({
3616
+ "node_modules/semver/functions/satisfies.js"(exports, module2) {
3617
+ var Range = require_range();
3618
+ var satisfies = (version2, range, options) => {
3619
+ try {
3620
+ range = new Range(range, options);
3621
+ } catch (er) {
3622
+ return false;
3623
+ }
3624
+ return range.test(version2);
3625
+ };
3626
+ module2.exports = satisfies;
3627
+ }
3628
+ });
3629
+
3630
+ // node_modules/semver/ranges/to-comparators.js
3631
+ var require_to_comparators = __commonJS({
3632
+ "node_modules/semver/ranges/to-comparators.js"(exports, module2) {
3633
+ var Range = require_range();
3634
+ var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c2) => c2.value).join(" ").trim().split(" "));
3635
+ module2.exports = toComparators;
3636
+ }
3637
+ });
3638
+
3639
+ // node_modules/semver/ranges/max-satisfying.js
3640
+ var require_max_satisfying = __commonJS({
3641
+ "node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
3642
+ var SemVer = require_semver();
3643
+ var Range = require_range();
3644
+ var maxSatisfying = (versions, range, options) => {
3645
+ let max = null;
3646
+ let maxSV = null;
3647
+ let rangeObj = null;
3648
+ try {
3649
+ rangeObj = new Range(range, options);
3650
+ } catch (er) {
3651
+ return null;
3652
+ }
3653
+ versions.forEach((v2) => {
3654
+ if (rangeObj.test(v2)) {
3655
+ if (!max || maxSV.compare(v2) === -1) {
3656
+ max = v2;
3657
+ maxSV = new SemVer(max, options);
3658
+ }
3659
+ }
3660
+ });
3661
+ return max;
3662
+ };
3663
+ module2.exports = maxSatisfying;
3664
+ }
3665
+ });
3666
+
3667
+ // node_modules/semver/ranges/min-satisfying.js
3668
+ var require_min_satisfying = __commonJS({
3669
+ "node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
3670
+ var SemVer = require_semver();
3671
+ var Range = require_range();
3672
+ var minSatisfying = (versions, range, options) => {
3673
+ let min = null;
3674
+ let minSV = null;
3675
+ let rangeObj = null;
3676
+ try {
3677
+ rangeObj = new Range(range, options);
3678
+ } catch (er) {
3679
+ return null;
3680
+ }
3681
+ versions.forEach((v2) => {
3682
+ if (rangeObj.test(v2)) {
3683
+ if (!min || minSV.compare(v2) === 1) {
3684
+ min = v2;
3685
+ minSV = new SemVer(min, options);
3686
+ }
3687
+ }
3688
+ });
3689
+ return min;
3690
+ };
3691
+ module2.exports = minSatisfying;
3692
+ }
3693
+ });
3694
+
3695
+ // node_modules/semver/ranges/min-version.js
3696
+ var require_min_version = __commonJS({
3697
+ "node_modules/semver/ranges/min-version.js"(exports, module2) {
3698
+ var SemVer = require_semver();
3699
+ var Range = require_range();
3700
+ var gt = require_gt();
3701
+ var minVersion = (range, loose) => {
3702
+ range = new Range(range, loose);
3703
+ let minver = new SemVer("0.0.0");
3704
+ if (range.test(minver)) {
3705
+ return minver;
3706
+ }
3707
+ minver = new SemVer("0.0.0-0");
3708
+ if (range.test(minver)) {
3709
+ return minver;
3710
+ }
3711
+ minver = null;
3712
+ for (let i = 0; i < range.set.length; ++i) {
3713
+ const comparators = range.set[i];
3714
+ let setMin = null;
3715
+ comparators.forEach((comparator) => {
3716
+ const compver = new SemVer(comparator.semver.version);
3717
+ switch (comparator.operator) {
3718
+ case ">":
3719
+ if (compver.prerelease.length === 0) {
3720
+ compver.patch++;
3721
+ } else {
3722
+ compver.prerelease.push(0);
3723
+ }
3724
+ compver.raw = compver.format();
3725
+ case "":
3726
+ case ">=":
3727
+ if (!setMin || gt(compver, setMin)) {
3728
+ setMin = compver;
3729
+ }
3730
+ break;
3731
+ case "<":
3732
+ case "<=":
3733
+ break;
3734
+ default:
3735
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
3736
+ }
3737
+ });
3738
+ if (setMin && (!minver || gt(minver, setMin))) {
3739
+ minver = setMin;
3740
+ }
3741
+ }
3742
+ if (minver && range.test(minver)) {
3743
+ return minver;
3744
+ }
3745
+ return null;
3746
+ };
3747
+ module2.exports = minVersion;
3748
+ }
3749
+ });
3750
+
3751
+ // node_modules/semver/ranges/valid.js
3752
+ var require_valid2 = __commonJS({
3753
+ "node_modules/semver/ranges/valid.js"(exports, module2) {
3754
+ var Range = require_range();
3755
+ var validRange = (range, options) => {
3756
+ try {
3757
+ return new Range(range, options).range || "*";
3758
+ } catch (er) {
3759
+ return null;
3760
+ }
3761
+ };
3762
+ module2.exports = validRange;
3763
+ }
3764
+ });
3765
+
3766
+ // node_modules/semver/ranges/outside.js
3767
+ var require_outside = __commonJS({
3768
+ "node_modules/semver/ranges/outside.js"(exports, module2) {
3769
+ var SemVer = require_semver();
3770
+ var Comparator = require_comparator();
3771
+ var { ANY } = Comparator;
3772
+ var Range = require_range();
3773
+ var satisfies = require_satisfies();
3774
+ var gt = require_gt();
3775
+ var lt = require_lt();
3776
+ var lte = require_lte();
3777
+ var gte = require_gte();
3778
+ var outside = (version2, range, hilo, options) => {
3779
+ version2 = new SemVer(version2, options);
3780
+ range = new Range(range, options);
3781
+ let gtfn, ltefn, ltfn, comp, ecomp;
3782
+ switch (hilo) {
3783
+ case ">":
3784
+ gtfn = gt;
3785
+ ltefn = lte;
3786
+ ltfn = lt;
3787
+ comp = ">";
3788
+ ecomp = ">=";
3789
+ break;
3790
+ case "<":
3791
+ gtfn = lt;
3792
+ ltefn = gte;
3793
+ ltfn = gt;
3794
+ comp = "<";
3795
+ ecomp = "<=";
3796
+ break;
3797
+ default:
3798
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
3799
+ }
3800
+ if (satisfies(version2, range, options)) {
3801
+ return false;
3802
+ }
3803
+ for (let i = 0; i < range.set.length; ++i) {
3804
+ const comparators = range.set[i];
3805
+ let high = null;
3806
+ let low = null;
3807
+ comparators.forEach((comparator) => {
3808
+ if (comparator.semver === ANY) {
3809
+ comparator = new Comparator(">=0.0.0");
3810
+ }
3811
+ high = high || comparator;
3812
+ low = low || comparator;
3813
+ if (gtfn(comparator.semver, high.semver, options)) {
3814
+ high = comparator;
3815
+ } else if (ltfn(comparator.semver, low.semver, options)) {
3816
+ low = comparator;
3817
+ }
3818
+ });
3819
+ if (high.operator === comp || high.operator === ecomp) {
3820
+ return false;
3821
+ }
3822
+ if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
3823
+ return false;
3824
+ } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
3825
+ return false;
3826
+ }
3827
+ }
3828
+ return true;
3829
+ };
3830
+ module2.exports = outside;
3831
+ }
3832
+ });
3833
+
3834
+ // node_modules/semver/ranges/gtr.js
3835
+ var require_gtr = __commonJS({
3836
+ "node_modules/semver/ranges/gtr.js"(exports, module2) {
3837
+ var outside = require_outside();
3838
+ var gtr = (version2, range, options) => outside(version2, range, ">", options);
3839
+ module2.exports = gtr;
3840
+ }
3841
+ });
3842
+
3843
+ // node_modules/semver/ranges/ltr.js
3844
+ var require_ltr = __commonJS({
3845
+ "node_modules/semver/ranges/ltr.js"(exports, module2) {
3846
+ var outside = require_outside();
3847
+ var ltr = (version2, range, options) => outside(version2, range, "<", options);
3848
+ module2.exports = ltr;
3849
+ }
3850
+ });
3851
+
3852
+ // node_modules/semver/ranges/intersects.js
3853
+ var require_intersects = __commonJS({
3854
+ "node_modules/semver/ranges/intersects.js"(exports, module2) {
3855
+ var Range = require_range();
3856
+ var intersects = (r1, r2, options) => {
3857
+ r1 = new Range(r1, options);
3858
+ r2 = new Range(r2, options);
3859
+ return r1.intersects(r2, options);
3860
+ };
3861
+ module2.exports = intersects;
3862
+ }
3863
+ });
3864
+
3865
+ // node_modules/semver/ranges/simplify.js
3866
+ var require_simplify = __commonJS({
3867
+ "node_modules/semver/ranges/simplify.js"(exports, module2) {
3868
+ var satisfies = require_satisfies();
3869
+ var compare = require_compare();
3870
+ module2.exports = (versions, range, options) => {
3871
+ const set = [];
3872
+ let first = null;
3873
+ let prev = null;
3874
+ const v2 = versions.sort((a2, b2) => compare(a2, b2, options));
3875
+ for (const version2 of v2) {
3876
+ const included = satisfies(version2, range, options);
3877
+ if (included) {
3878
+ prev = version2;
3879
+ if (!first) {
3880
+ first = version2;
3881
+ }
3882
+ } else {
3883
+ if (prev) {
3884
+ set.push([first, prev]);
3885
+ }
3886
+ prev = null;
3887
+ first = null;
3888
+ }
3889
+ }
3890
+ if (first) {
3891
+ set.push([first, null]);
3892
+ }
3893
+ const ranges = [];
3894
+ for (const [min, max] of set) {
3895
+ if (min === max) {
3896
+ ranges.push(min);
3897
+ } else if (!max && min === v2[0]) {
3898
+ ranges.push("*");
3899
+ } else if (!max) {
3900
+ ranges.push(`>=${min}`);
3901
+ } else if (min === v2[0]) {
3902
+ ranges.push(`<=${max}`);
3903
+ } else {
3904
+ ranges.push(`${min} - ${max}`);
3905
+ }
3906
+ }
3907
+ const simplified = ranges.join(" || ");
3908
+ const original = typeof range.raw === "string" ? range.raw : String(range);
3909
+ return simplified.length < original.length ? simplified : range;
3910
+ };
3911
+ }
3912
+ });
3913
+
3914
+ // node_modules/semver/ranges/subset.js
3915
+ var require_subset = __commonJS({
3916
+ "node_modules/semver/ranges/subset.js"(exports, module2) {
3917
+ var Range = require_range();
3918
+ var Comparator = require_comparator();
3919
+ var { ANY } = Comparator;
3920
+ var satisfies = require_satisfies();
3921
+ var compare = require_compare();
3922
+ var subset = (sub, dom, options = {}) => {
3923
+ if (sub === dom) {
3924
+ return true;
3925
+ }
3926
+ sub = new Range(sub, options);
3927
+ dom = new Range(dom, options);
3928
+ let sawNonNull = false;
3929
+ OUTER:
3930
+ for (const simpleSub of sub.set) {
3931
+ for (const simpleDom of dom.set) {
3932
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
3933
+ sawNonNull = sawNonNull || isSub !== null;
3934
+ if (isSub) {
3935
+ continue OUTER;
3936
+ }
3937
+ }
3938
+ if (sawNonNull) {
3939
+ return false;
3940
+ }
3941
+ }
3942
+ return true;
3943
+ };
3944
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
3945
+ var minimumVersion = [new Comparator(">=0.0.0")];
3946
+ var simpleSubset = (sub, dom, options) => {
3947
+ if (sub === dom) {
3948
+ return true;
3949
+ }
3950
+ if (sub.length === 1 && sub[0].semver === ANY) {
3951
+ if (dom.length === 1 && dom[0].semver === ANY) {
3952
+ return true;
3953
+ } else if (options.includePrerelease) {
3954
+ sub = minimumVersionWithPreRelease;
3955
+ } else {
3956
+ sub = minimumVersion;
3957
+ }
3958
+ }
3959
+ if (dom.length === 1 && dom[0].semver === ANY) {
3960
+ if (options.includePrerelease) {
3961
+ return true;
3962
+ } else {
3963
+ dom = minimumVersion;
3964
+ }
3965
+ }
3966
+ const eqSet = /* @__PURE__ */ new Set();
3967
+ let gt, lt;
3968
+ for (const c2 of sub) {
3969
+ if (c2.operator === ">" || c2.operator === ">=") {
3970
+ gt = higherGT(gt, c2, options);
3971
+ } else if (c2.operator === "<" || c2.operator === "<=") {
3972
+ lt = lowerLT(lt, c2, options);
3973
+ } else {
3974
+ eqSet.add(c2.semver);
3975
+ }
3976
+ }
3977
+ if (eqSet.size > 1) {
3978
+ return null;
3979
+ }
3980
+ let gtltComp;
3981
+ if (gt && lt) {
3982
+ gtltComp = compare(gt.semver, lt.semver, options);
3983
+ if (gtltComp > 0) {
3984
+ return null;
3985
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
3986
+ return null;
3987
+ }
3988
+ }
3989
+ for (const eq of eqSet) {
3990
+ if (gt && !satisfies(eq, String(gt), options)) {
3991
+ return null;
3992
+ }
3993
+ if (lt && !satisfies(eq, String(lt), options)) {
3994
+ return null;
3995
+ }
3996
+ for (const c2 of dom) {
3997
+ if (!satisfies(eq, String(c2), options)) {
3998
+ return false;
3999
+ }
4000
+ }
4001
+ return true;
4002
+ }
4003
+ let higher, lower;
4004
+ let hasDomLT, hasDomGT;
4005
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
4006
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
4007
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
4008
+ needDomLTPre = false;
4009
+ }
4010
+ for (const c2 of dom) {
4011
+ hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">=";
4012
+ hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<=";
4013
+ if (gt) {
4014
+ if (needDomGTPre) {
4015
+ if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) {
4016
+ needDomGTPre = false;
4017
+ }
4018
+ }
4019
+ if (c2.operator === ">" || c2.operator === ">=") {
4020
+ higher = higherGT(gt, c2, options);
4021
+ if (higher === c2 && higher !== gt) {
4022
+ return false;
4023
+ }
4024
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c2), options)) {
4025
+ return false;
4026
+ }
4027
+ }
4028
+ if (lt) {
4029
+ if (needDomLTPre) {
4030
+ if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) {
4031
+ needDomLTPre = false;
4032
+ }
4033
+ }
4034
+ if (c2.operator === "<" || c2.operator === "<=") {
4035
+ lower = lowerLT(lt, c2, options);
4036
+ if (lower === c2 && lower !== lt) {
4037
+ return false;
4038
+ }
4039
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c2), options)) {
4040
+ return false;
4041
+ }
4042
+ }
4043
+ if (!c2.operator && (lt || gt) && gtltComp !== 0) {
4044
+ return false;
4045
+ }
4046
+ }
4047
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
4048
+ return false;
4049
+ }
4050
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
4051
+ return false;
4052
+ }
4053
+ if (needDomGTPre || needDomLTPre) {
4054
+ return false;
4055
+ }
4056
+ return true;
4057
+ };
4058
+ var higherGT = (a2, b2, options) => {
4059
+ if (!a2) {
4060
+ return b2;
4061
+ }
4062
+ const comp = compare(a2.semver, b2.semver, options);
4063
+ return comp > 0 ? a2 : comp < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2;
4064
+ };
4065
+ var lowerLT = (a2, b2, options) => {
4066
+ if (!a2) {
4067
+ return b2;
4068
+ }
4069
+ const comp = compare(a2.semver, b2.semver, options);
4070
+ return comp < 0 ? a2 : comp > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2;
4071
+ };
4072
+ module2.exports = subset;
4073
+ }
4074
+ });
4075
+
4076
+ // node_modules/semver/index.js
4077
+ var require_semver2 = __commonJS({
4078
+ "node_modules/semver/index.js"(exports, module2) {
4079
+ var internalRe = require_re();
4080
+ var constants = require_constants();
4081
+ var SemVer = require_semver();
4082
+ var identifiers = require_identifiers();
4083
+ var parse2 = require_parse2();
4084
+ var valid = require_valid();
4085
+ var clean = require_clean();
4086
+ var inc = require_inc();
4087
+ var diff = require_diff();
4088
+ var major = require_major();
4089
+ var minor = require_minor();
4090
+ var patch = require_patch();
4091
+ var prerelease = require_prerelease();
4092
+ var compare = require_compare();
4093
+ var rcompare = require_rcompare();
4094
+ var compareLoose = require_compare_loose();
4095
+ var compareBuild = require_compare_build();
4096
+ var sort = require_sort();
4097
+ var rsort = require_rsort();
4098
+ var gt = require_gt();
4099
+ var lt = require_lt();
4100
+ var eq = require_eq();
4101
+ var neq = require_neq();
4102
+ var gte = require_gte();
4103
+ var lte = require_lte();
4104
+ var cmp = require_cmp();
4105
+ var coerce = require_coerce();
4106
+ var Comparator = require_comparator();
4107
+ var Range = require_range();
4108
+ var satisfies = require_satisfies();
4109
+ var toComparators = require_to_comparators();
4110
+ var maxSatisfying = require_max_satisfying();
4111
+ var minSatisfying = require_min_satisfying();
4112
+ var minVersion = require_min_version();
4113
+ var validRange = require_valid2();
4114
+ var outside = require_outside();
4115
+ var gtr = require_gtr();
4116
+ var ltr = require_ltr();
4117
+ var intersects = require_intersects();
4118
+ var simplifyRange = require_simplify();
4119
+ var subset = require_subset();
4120
+ module2.exports = {
4121
+ parse: parse2,
4122
+ valid,
4123
+ clean,
4124
+ inc,
4125
+ diff,
4126
+ major,
4127
+ minor,
4128
+ patch,
4129
+ prerelease,
4130
+ compare,
4131
+ rcompare,
4132
+ compareLoose,
4133
+ compareBuild,
4134
+ sort,
4135
+ rsort,
4136
+ gt,
4137
+ lt,
4138
+ eq,
4139
+ neq,
4140
+ gte,
4141
+ lte,
4142
+ cmp,
4143
+ coerce,
4144
+ Comparator,
4145
+ Range,
4146
+ satisfies,
4147
+ toComparators,
4148
+ maxSatisfying,
4149
+ minSatisfying,
4150
+ minVersion,
4151
+ validRange,
4152
+ outside,
4153
+ gtr,
4154
+ ltr,
4155
+ intersects,
4156
+ simplifyRange,
4157
+ subset,
4158
+ SemVer,
4159
+ re: internalRe.re,
4160
+ src: internalRe.src,
4161
+ tokens: internalRe.t,
4162
+ SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
4163
+ RELEASE_TYPES: constants.RELEASE_TYPES,
4164
+ compareIdentifiers: identifiers.compareIdentifiers,
4165
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
4166
+ };
4167
+ }
4168
+ });
4169
+
1762
4170
  // ../../node_modules/which-pm-runs/index.js
1763
4171
  var require_which_pm_runs = __commonJS({
1764
4172
  "../../node_modules/which-pm-runs/index.js"(exports, module2) {
@@ -6209,7 +8617,7 @@ var require_lib = __commonJS({
6209
8617
  });
6210
8618
 
6211
8619
  // node_modules/undici/lib/fetch/constants.js
6212
- var require_constants = __commonJS({
8620
+ var require_constants2 = __commonJS({
6213
8621
  "node_modules/undici/lib/fetch/constants.js"(exports, module2) {
6214
8622
  "use strict";
6215
8623
  var { MessageChannel, receiveMessageOnPort } = require("worker_threads");
@@ -6436,7 +8844,7 @@ var require_global = __commonJS({
6436
8844
  var require_util2 = __commonJS({
6437
8845
  "node_modules/undici/lib/fetch/util.js"(exports, module2) {
6438
8846
  "use strict";
6439
- var { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = require_constants();
8847
+ var { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = require_constants2();
6440
8848
  var { getGlobalOrigin } = require_global();
6441
8849
  var { performance: performance2 } = require("perf_hooks");
6442
8850
  var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();
@@ -7988,7 +10396,7 @@ var require_body = __commonJS({
7988
10396
  var { FormData } = require_formdata();
7989
10397
  var { kState } = require_symbols2();
7990
10398
  var { webidl } = require_webidl();
7991
- var { DOMException: DOMException2, structuredClone } = require_constants();
10399
+ var { DOMException: DOMException2, structuredClone } = require_constants2();
7992
10400
  var { Blob: Blob2, File: NativeFile } = require("buffer");
7993
10401
  var { kBodyUsed } = require_symbols();
7994
10402
  var assert = require("assert");
@@ -8968,7 +11376,7 @@ var require_utils2 = __commonJS({
8968
11376
  });
8969
11377
 
8970
11378
  // node_modules/undici/lib/llhttp/constants.js
8971
- var require_constants2 = __commonJS({
11379
+ var require_constants3 = __commonJS({
8972
11380
  "node_modules/undici/lib/llhttp/constants.js"(exports) {
8973
11381
  "use strict";
8974
11382
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9752,7 +12160,7 @@ var require_client = __commonJS({
9752
12160
  });
9753
12161
  }
9754
12162
  };
9755
- var constants = require_constants2();
12163
+ var constants = require_constants3();
9756
12164
  var createRedirectInterceptor = require_redirectInterceptor();
9757
12165
  var EMPTY_BUF = Buffer.alloc(0);
9758
12166
  async function lazyllhttp() {
@@ -13871,7 +16279,7 @@ var require_response = __commonJS({
13871
16279
  redirectStatus,
13872
16280
  nullBodyStatus,
13873
16281
  DOMException: DOMException2
13874
- } = require_constants();
16282
+ } = require_constants2();
13875
16283
  var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
13876
16284
  var { webidl } = require_webidl();
13877
16285
  var { FormData } = require_formdata();
@@ -14251,7 +16659,7 @@ var require_request2 = __commonJS({
14251
16659
  requestCredentials,
14252
16660
  requestCache,
14253
16661
  requestDuplex
14254
- } = require_constants();
16662
+ } = require_constants2();
14255
16663
  var { kEnumerableProperty } = util;
14256
16664
  var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2();
14257
16665
  var { webidl } = require_webidl();
@@ -14918,7 +17326,7 @@ var require_fetch = __commonJS({
14918
17326
  requestBodyHeader,
14919
17327
  subresource,
14920
17328
  DOMException: DOMException2
14921
- } = require_constants();
17329
+ } = require_constants2();
14922
17330
  var { kHeadersList } = require_symbols();
14923
17331
  var EE = require("events");
14924
17332
  var { Readable, pipeline } = require("stream");
@@ -16258,7 +18666,7 @@ var require_util4 = __commonJS({
16258
18666
  } = require_symbols3();
16259
18667
  var { ProgressEvent } = require_progressevent();
16260
18668
  var { getEncoding } = require_encoding();
16261
- var { DOMException: DOMException2 } = require_constants();
18669
+ var { DOMException: DOMException2 } = require_constants2();
16262
18670
  var { serializeAMimeType, parseMIMEType } = require_dataURL();
16263
18671
  var { types } = require("util");
16264
18672
  var { StringDecoder } = require("string_decoder");
@@ -17378,7 +19786,7 @@ var require_cachestorage = __commonJS({
17378
19786
  });
17379
19787
 
17380
19788
  // node_modules/undici/lib/cookies/constants.js
17381
- var require_constants3 = __commonJS({
19789
+ var require_constants4 = __commonJS({
17382
19790
  "node_modules/undici/lib/cookies/constants.js"(exports, module2) {
17383
19791
  "use strict";
17384
19792
  var maxAttributeValueSize = 1024;
@@ -17550,10 +19958,10 @@ var require_util6 = __commonJS({
17550
19958
  });
17551
19959
 
17552
19960
  // node_modules/undici/lib/cookies/parse.js
17553
- var require_parse2 = __commonJS({
19961
+ var require_parse3 = __commonJS({
17554
19962
  "node_modules/undici/lib/cookies/parse.js"(exports, module2) {
17555
19963
  "use strict";
17556
- var { maxNameValuePairSize, maxAttributeValueSize } = require_constants3();
19964
+ var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
17557
19965
  var { isCTLExcludingHtab } = require_util6();
17558
19966
  var { collectASequenceOfCodePointsFast } = require_dataURL();
17559
19967
  var assert = require("assert");
@@ -17693,7 +20101,7 @@ var require_parse2 = __commonJS({
17693
20101
  var require_cookies = __commonJS({
17694
20102
  "node_modules/undici/lib/cookies/index.js"(exports, module2) {
17695
20103
  "use strict";
17696
- var { parseSetCookie } = require_parse2();
20104
+ var { parseSetCookie } = require_parse3();
17697
20105
  var { stringify, getHeadersList } = require_util6();
17698
20106
  var { webidl } = require_webidl();
17699
20107
  var { Headers } = require_headers();
@@ -17818,7 +20226,7 @@ var require_cookies = __commonJS({
17818
20226
  });
17819
20227
 
17820
20228
  // node_modules/undici/lib/websocket/constants.js
17821
- var require_constants4 = __commonJS({
20229
+ var require_constants5 = __commonJS({
17822
20230
  "node_modules/undici/lib/websocket/constants.js"(exports, module2) {
17823
20231
  "use strict";
17824
20232
  var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
@@ -18126,7 +20534,7 @@ var require_util7 = __commonJS({
18126
20534
  "node_modules/undici/lib/websocket/util.js"(exports, module2) {
18127
20535
  "use strict";
18128
20536
  var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols5();
18129
- var { states, opcodes } = require_constants4();
20537
+ var { states, opcodes } = require_constants5();
18130
20538
  var { MessageEvent, ErrorEvent } = require_events();
18131
20539
  function isEstablished(ws) {
18132
20540
  return ws[kReadyState] === states.OPEN;
@@ -18217,7 +20625,7 @@ var require_connection = __commonJS({
18217
20625
  "use strict";
18218
20626
  var { randomBytes, createHash } = require("crypto");
18219
20627
  var diagnosticsChannel = require("diagnostics_channel");
18220
- var { uid, states } = require_constants4();
20628
+ var { uid, states } = require_constants5();
18221
20629
  var {
18222
20630
  kReadyState,
18223
20631
  kSentClose,
@@ -18360,7 +20768,7 @@ var require_frame = __commonJS({
18360
20768
  "node_modules/undici/lib/websocket/frame.js"(exports, module2) {
18361
20769
  "use strict";
18362
20770
  var { randomBytes } = require("crypto");
18363
- var { maxUnsigned16Bit } = require_constants4();
20771
+ var { maxUnsigned16Bit } = require_constants5();
18364
20772
  var WebsocketFrameSend = class {
18365
20773
  /**
18366
20774
  * @param {Buffer|undefined} data
@@ -18414,7 +20822,7 @@ var require_receiver = __commonJS({
18414
20822
  "use strict";
18415
20823
  var { Writable } = require("stream");
18416
20824
  var diagnosticsChannel = require("diagnostics_channel");
18417
- var { parserStates, opcodes, states, emptyBuffer } = require_constants4();
20825
+ var { parserStates, opcodes, states, emptyBuffer } = require_constants5();
18418
20826
  var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols5();
18419
20827
  var { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require_util7();
18420
20828
  var { WebsocketFrameSend } = require_frame();
@@ -18649,9 +21057,9 @@ var require_websocket = __commonJS({
18649
21057
  "node_modules/undici/lib/websocket/websocket.js"(exports, module2) {
18650
21058
  "use strict";
18651
21059
  var { webidl } = require_webidl();
18652
- var { DOMException: DOMException2 } = require_constants();
21060
+ var { DOMException: DOMException2 } = require_constants2();
18653
21061
  var { URLSerializer } = require_dataURL();
18654
- var { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require_constants4();
21062
+ var { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require_constants5();
18655
21063
  var {
18656
21064
  kWebSocketURL,
18657
21065
  kReadyState,
@@ -50204,7 +52612,9 @@ var require_typescript2 = __commonJS({
50204
52612
  // src/cli.ts
50205
52613
  var cli_exports = {};
50206
52614
  __export(cli_exports, {
50207
- main: () => main
52615
+ C3_DEFAULTS: () => C3_DEFAULTS,
52616
+ main: () => main,
52617
+ parseArgs: () => parseArgs
50208
52618
  });
50209
52619
  module.exports = __toCommonJS(cli_exports);
50210
52620
  var import_haikunator = __toESM(require_dist_node());
@@ -50742,11 +53152,9 @@ var status = {
50742
53152
  success: bgRed(` SUCCESS `)
50743
53153
  };
50744
53154
  var space = (n = 1) => {
50745
- return [...Array(n)].map(() => hidden("-")).join("");
53155
+ return hidden("\u200A".repeat(n));
50746
53156
  };
50747
53157
  var logRaw = (msg) => {
50748
- if (process.env.VITEST)
50749
- return;
50750
53158
  process.stdout.write(`${msg}
50751
53159
  `);
50752
53160
  };
@@ -51939,175 +54347,169 @@ var logUpdateStderr = createLogUpdate(import_node_process6.default.stderr);
51939
54347
  var grayBar = gray(shapes.bar);
51940
54348
  var blCorner = gray(shapes.corners.bl);
51941
54349
  var leftT = gray(shapes.leftT);
51942
- var textInput = async (opts) => {
51943
- const { renderSubmitted, question, defaultValue, validate, acceptDefault } = opts;
51944
- const helpText = opts.helpText || ``;
51945
- const prompt = new oD({
51946
- defaultValue,
51947
- validate,
51948
- render() {
51949
- let body = "";
51950
- switch (this.state) {
51951
- case "initial":
51952
- body += `${blCorner} ${bold(question)} ${dim(helpText)}
51953
- `;
51954
- body += `${space(2)}${gray(defaultValue)}
51955
- `;
51956
- break;
51957
- case "active":
51958
- body += `${blCorner} ${bold(question)} ${dim(helpText)}
51959
- `;
51960
- body += `${space(2)}${this.value}
51961
- `;
51962
- break;
51963
- case "submit":
51964
- body += `${leftT} ${question}
51965
- `;
51966
- body += `${grayBar} ${renderSubmitted(this.value)}
51967
- ${grayBar}`;
51968
- break;
51969
- case "error":
51970
- body += `${leftT} ${status.error} ${dim(this.error)}
51971
- `;
51972
- body += `${grayBar}
51973
- `;
51974
- body += `${blCorner} ${question} ${dim(helpText)}
51975
- `;
51976
- body += `${space(2)}${this.value}
51977
- `;
51978
- break;
51979
- default:
51980
- break;
51981
- }
51982
- return body;
51983
- }
51984
- });
51985
- let value;
51986
- if (acceptDefault) {
51987
- logRaw(`${leftT} ${question}`);
51988
- logRaw(`${grayBar} ${renderSubmitted(defaultValue)}
51989
- ${grayBar}`);
51990
- value = defaultValue;
51991
- validate?.(value);
51992
- } else {
51993
- value = await prompt.prompt();
51994
- if (eD(value)) {
51995
- cancel("Operation cancelled.");
51996
- process.exit(0);
51997
- }
51998
- }
54350
+ var processArgument = async (args, name, promptConfig) => {
54351
+ let value = args[name];
54352
+ const renderSubmitted = getRenderers(promptConfig).submit;
54353
+ if (value !== void 0) {
54354
+ promptConfig.validate?.(value);
54355
+ const lines = renderSubmitted({ value });
54356
+ logRaw(lines.join("\n"));
54357
+ return value;
54358
+ }
54359
+ value = await inputPrompt(promptConfig);
51999
54360
  return value;
52000
54361
  };
52001
- var selectInput = async (opts) => {
52002
- const { question, options, renderSubmitted, defaultValue, acceptDefault } = opts;
52003
- const helpText = opts.helpText || ``;
52004
- const prompt = new ED({
52005
- options,
52006
- initialValue: defaultValue ?? options[0].value,
52007
- render() {
52008
- const renderOption = (opt, i) => {
52009
- const { label } = opt;
52010
- const active = i === this.cursor;
52011
- const text = active ? blue.underline(label) : dim(label);
52012
- const indicator = active ? blue(shapes.radioActive) : dim(shapes.radioInactive);
52013
- return `${space(2)}${indicator} ${text}`;
52014
- };
52015
- let body = ``;
52016
- switch (this.state) {
52017
- case "submit":
52018
- body += `${leftT} ${question}
52019
- `;
52020
- body += `${grayBar} ${renderSubmitted(options[this.cursor])}`;
52021
- body += `
52022
- ${grayBar}`;
52023
- break;
52024
- default:
52025
- body += `${blCorner} ${bold(question)} ${dim(helpText)}
52026
- `;
52027
- body += `${options.map(renderOption).join(`
52028
- `)}
52029
- `;
52030
- break;
54362
+ var inputPrompt = async (promptConfig) => {
54363
+ const renderers = getRenderers(promptConfig);
54364
+ let prompt;
54365
+ const dispatchRender = (props) => {
54366
+ const renderedLines = renderers[props.state](props);
54367
+ return renderedLines.join("\n");
54368
+ };
54369
+ if (promptConfig.type === "select") {
54370
+ prompt = new ED({
54371
+ ...promptConfig,
54372
+ options: promptConfig.options,
54373
+ initialValue: String(promptConfig.defaultValue),
54374
+ render() {
54375
+ return dispatchRender(this);
52031
54376
  }
52032
- return body;
52033
- }
52034
- });
52035
- let value;
52036
- if (acceptDefault) {
52037
- logRaw(`${leftT} ${question}`);
52038
- logRaw(
52039
- `${grayBar} ${renderSubmitted({
52040
- label: defaultValue,
52041
- value: defaultValue
52042
- })}`
52043
- );
52044
- logRaw(`${grayBar}`);
52045
- value = defaultValue;
54377
+ });
54378
+ } else if (promptConfig.type === "confirm") {
54379
+ prompt = new sD({
54380
+ ...promptConfig,
54381
+ initialValue: Boolean(promptConfig.defaultValue),
54382
+ active: promptConfig.activeText || "",
54383
+ inactive: promptConfig.inactiveText || "",
54384
+ render() {
54385
+ return dispatchRender(this);
54386
+ }
54387
+ });
52046
54388
  } else {
52047
- value = await prompt.prompt();
52048
- if (eD(value)) {
52049
- cancel("Operation cancelled.");
52050
- process.exit(0);
52051
- }
54389
+ prompt = new oD({
54390
+ ...promptConfig,
54391
+ defaultValue: String(promptConfig.defaultValue),
54392
+ render() {
54393
+ return dispatchRender(this);
54394
+ }
54395
+ });
54396
+ }
54397
+ const input = await prompt.prompt();
54398
+ if (eD(input)) {
54399
+ cancel("Operation cancelled.");
54400
+ process.exit(0);
54401
+ }
54402
+ return input;
54403
+ };
54404
+ var renderSubmit = (config14, value) => {
54405
+ const { question, label } = config14;
54406
+ const content = config14.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
54407
+ return [`${leftT} ${question}`, content, `${grayBar}`];
54408
+ };
54409
+ var handleCancel = () => {
54410
+ cancel("Operation cancelled.");
54411
+ process.exit(0);
54412
+ };
54413
+ var getRenderers = (config14) => {
54414
+ switch (config14.type) {
54415
+ case "select":
54416
+ return getSelectRenderers(config14);
54417
+ case "confirm":
54418
+ return getConfirmRenderers(config14);
54419
+ case "text":
54420
+ return getTextRenderers(config14);
52052
54421
  }
52053
- return value;
52054
54422
  };
52055
- var confirmInput = async (opts) => {
54423
+ var getTextRenderers = (config14) => {
52056
54424
  const {
52057
- activeText,
52058
- inactiveText,
54425
+ defaultValue,
52059
54426
  question,
52060
- renderSubmitted,
52061
- defaultValue = true,
52062
- acceptDefault
52063
- } = opts;
52064
- const helpText = opts.helpText || `(y/n)`;
54427
+ helpText: _helpText,
54428
+ format: _format
54429
+ } = config14;
54430
+ const helpText = _helpText ?? "";
54431
+ const format3 = _format ?? ((val) => String(val));
54432
+ return {
54433
+ initial: () => [
54434
+ `${blCorner} ${bold(question)} ${dim(helpText)}`,
54435
+ `${space(2)}${gray(format3(defaultValue))}`,
54436
+ ``
54437
+ // extra line for readability
54438
+ ],
54439
+ active: ({ value }) => [
54440
+ `${blCorner} ${bold(question)} ${dim(helpText)}`,
54441
+ `${space(2)}${format3(value || dim(defaultValue))}`,
54442
+ ``
54443
+ // extra line for readability
54444
+ ],
54445
+ error: ({ value, error }) => [
54446
+ `${leftT} ${status.error} ${dim(error)}`,
54447
+ `${grayBar}`,
54448
+ `${blCorner} ${question} ${dim(helpText)}`,
54449
+ `${space(2)}${format3(value)}`,
54450
+ ``
54451
+ // extra line for readability
54452
+ ],
54453
+ submit: ({ value }) => renderSubmit(config14, format3(value)),
54454
+ cancel: handleCancel
54455
+ };
54456
+ };
54457
+ var getSelectRenderers = (config14) => {
54458
+ const { options, question, helpText: _helpText } = config14;
54459
+ const helpText = _helpText ?? "";
54460
+ const defaultRenderer = ({ cursor }) => {
54461
+ const renderOption = (opt, i) => {
54462
+ const { label: optionLabel } = opt;
54463
+ const active = i === cursor;
54464
+ const text = active ? blue.underline(optionLabel) : dim(optionLabel);
54465
+ const indicator = active ? blue(shapes.radioActive) : dim(shapes.radioInactive);
54466
+ return `${space(2)}${indicator} ${text}`;
54467
+ };
54468
+ return [
54469
+ `${blCorner} ${bold(question)} ${dim(helpText)}`,
54470
+ `${options.map(renderOption).join(`
54471
+ `)}`,
54472
+ ``
54473
+ // extra line for readability
54474
+ ];
54475
+ };
54476
+ return {
54477
+ initial: defaultRenderer,
54478
+ active: defaultRenderer,
54479
+ confirm: defaultRenderer,
54480
+ error: defaultRenderer,
54481
+ submit: ({ value }) => renderSubmit(
54482
+ config14,
54483
+ options.find((o2) => o2.value === value)?.label
54484
+ ),
54485
+ cancel: handleCancel
54486
+ };
54487
+ };
54488
+ var getConfirmRenderers = (config14) => {
54489
+ const { activeText, inactiveText, question, helpText: _helpText } = config14;
54490
+ const helpText = _helpText ?? "";
52065
54491
  const active = activeText || "Yes";
52066
54492
  const inactive = inactiveText || "No";
52067
- const prompt = new sD({
52068
- active,
52069
- inactive,
52070
- initialValue: defaultValue,
52071
- render() {
52072
- const yesColor = this.value ? blue : dim;
52073
- const noColor = this.value ? dim : blue;
52074
- let body = ``;
52075
- switch (this.state) {
52076
- case "submit":
52077
- body += `${leftT} ${question}
52078
- `;
52079
- body += `${grayBar} ${renderSubmitted(this.value)}`;
52080
- body += `
52081
- ${grayBar}`;
52082
- break;
52083
- default:
52084
- body += `${blCorner} ${bold(question)} ${dim(helpText)}
52085
- `;
52086
- body += `${space(2)}${yesColor(active)} / ${noColor(inactive)}
52087
- `;
52088
- break;
52089
- }
52090
- return body;
52091
- }
52092
- });
52093
- let value;
52094
- if (acceptDefault) {
52095
- logRaw(`${leftT} ${question}`);
52096
- logRaw(`${grayBar} ${renderSubmitted(defaultValue)}`);
52097
- logRaw(`${grayBar}`);
52098
- value = defaultValue;
52099
- } else {
52100
- value = Boolean(await prompt.prompt());
52101
- if (eD(value)) {
52102
- cancel("Operation cancelled.");
52103
- process.exit(0);
52104
- }
52105
- }
52106
- return value;
54493
+ const defaultRenderer = ({ value }) => {
54494
+ const yesColor = value ? blue : dim;
54495
+ const noColor = value ? dim : blue;
54496
+ return [
54497
+ `${blCorner} ${bold(question)} ${dim(helpText)}`,
54498
+ `${space(2)}${yesColor(active)} / ${noColor(inactive)}`
54499
+ ];
54500
+ };
54501
+ return {
54502
+ initial: defaultRenderer,
54503
+ active: defaultRenderer,
54504
+ confirm: defaultRenderer,
54505
+ error: defaultRenderer,
54506
+ submit: ({ value }) => renderSubmit(config14, value ? "yes" : "no"),
54507
+ cancel: handleCancel
54508
+ };
52107
54509
  };
54510
+ var spinnerFrames = ["\u2524", "\u2518", "\u2534", "\u2514", "\u251C", "\u250C", "\u252C", "\u2510"];
54511
+ var ellipsisFrames = ["", ".", "..", "...", " ..", " .", ""];
52108
54512
  var spinner = () => {
52109
- const spinnerFrames = ["\u2524", "\u2518", "\u2534", "\u2514", "\u251C", "\u250C", "\u252C", "\u2510"];
52110
- const ellipsisFrames = ["", ".", "..", "...", " ..", " .", ""];
52111
54513
  const color = brandColor;
52112
54514
  const frameRate = 120;
52113
54515
  let loop = null;
@@ -57008,7 +59410,7 @@ var Yargs = YargsFactory(esm_default);
57008
59410
  var yargs_default = Yargs;
57009
59411
 
57010
59412
  // package.json
57011
- var version = "0.0.0-91135e02";
59413
+ var version = "0.0.0-977b3a99";
57012
59414
 
57013
59415
  // src/common.ts
57014
59416
  var import_fs6 = require("fs");
@@ -57019,30 +59421,72 @@ var import_process2 = require("process");
57019
59421
  var import_fs5 = require("fs");
57020
59422
  var import_path5 = __toESM(require("path"));
57021
59423
  var import_cross_spawn = __toESM(require_cross_spawn());
59424
+
59425
+ // src/helpers/packages.ts
59426
+ var import_semver = __toESM(require_semver2());
57022
59427
  var import_which_pm_runs = __toESM(require_which_pm_runs());
57023
- var runCommand = async (command2, opts) => {
59428
+ var detectPackageManager = () => {
59429
+ const { name, version: version2 } = (0, import_which_pm_runs.default)() ?? { name: "npm", version: "0.0.0" };
59430
+ switch (name) {
59431
+ case "pnpm":
59432
+ if (import_semver.default.gt(version2, "6.0.0")) {
59433
+ return {
59434
+ npm: "pnpm",
59435
+ npx: "pnpm",
59436
+ dlx: "pnpm dlx"
59437
+ };
59438
+ }
59439
+ return {
59440
+ npm: "pnpm",
59441
+ npx: "pnpx",
59442
+ dlx: "pnpx"
59443
+ };
59444
+ case "yarn":
59445
+ if (import_semver.default.gt(version2, "2.0.0")) {
59446
+ return {
59447
+ npm: "yarn",
59448
+ npx: "yarn",
59449
+ dlx: "yarn dlx"
59450
+ };
59451
+ }
59452
+ return {
59453
+ npm: "yarn",
59454
+ npx: "yarn",
59455
+ dlx: "yarn"
59456
+ };
59457
+ case "npm":
59458
+ default:
59459
+ return {
59460
+ npm: "npm",
59461
+ npx: "npx",
59462
+ dlx: "npx"
59463
+ };
59464
+ }
59465
+ };
59466
+
59467
+ // src/helpers/command.ts
59468
+ var runCommand = async (command2, opts = {}) => {
57024
59469
  if (typeof command2 === "string") {
57025
59470
  command2 = command2.trim().replace(/\s+/g, ` `).split(" ");
57026
59471
  }
57027
59472
  return printAsyncStatus({
57028
- useSpinner: opts?.useSpinner ?? opts?.silent,
57029
- startText: opts?.startText || command2.join(" "),
57030
- doneText: opts?.doneText,
59473
+ useSpinner: opts.useSpinner ?? opts.silent,
59474
+ startText: opts.startText || command2.join(" ").trim(),
59475
+ doneText: opts.doneText,
57031
59476
  promise() {
57032
59477
  const [executable, ...args] = command2;
57033
- const squelch = opts?.silent || process.env.VITEST;
57034
59478
  const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
57035
59479
  // TODO: ideally inherit stderr, but npm install uses this for warnings
57036
59480
  // stdio: [ioMode, ioMode, "inherit"],
57037
- stdio: squelch ? "pipe" : "inherit",
59481
+ stdio: opts.silent ? "pipe" : "inherit",
57038
59482
  env: {
57039
59483
  ...process.env,
57040
- ...opts?.env
59484
+ ...opts.env
57041
59485
  },
57042
- cwd: opts?.cwd
59486
+ cwd: opts.cwd
57043
59487
  });
57044
59488
  let output = ``;
57045
- if (opts?.captureOutput ?? squelch) {
59489
+ if (opts.captureOutput ?? opts.silent) {
57046
59490
  cmd.stdout?.on("data", (data) => {
57047
59491
  output += data;
57048
59492
  });
@@ -57052,12 +59496,24 @@ var runCommand = async (command2, opts) => {
57052
59496
  }
57053
59497
  return new Promise((resolve9, reject) => {
57054
59498
  cmd.on("close", (code) => {
57055
- if (code === 0) {
57056
- resolve9(stripAnsi(output));
57057
- } else {
57058
- reject(new Error(output, { cause: code }));
59499
+ try {
59500
+ if (code !== 0) {
59501
+ throw new Error(output, { cause: code });
59502
+ }
59503
+ const transformOutput = opts.transformOutput ?? ((result) => result);
59504
+ const processedOutput = transformOutput(stripAnsi(output));
59505
+ resolve9(processedOutput);
59506
+ } catch (e) {
59507
+ if (opts.fallbackOutput) {
59508
+ resolve9(opts.fallbackOutput(e));
59509
+ } else {
59510
+ reject(new Error(output, { cause: e }));
59511
+ }
57059
59512
  }
57060
59513
  });
59514
+ cmd.on("error", (code) => {
59515
+ reject(code);
59516
+ });
57061
59517
  });
57062
59518
  }
57063
59519
  });
@@ -57068,9 +59524,11 @@ async function runCommands({ commands, ...opts }) {
57068
59524
  startText: opts.startText,
57069
59525
  doneText: opts.doneText,
57070
59526
  async promise() {
59527
+ const results = [];
57071
59528
  for (const command2 of commands) {
57072
- await runCommand(command2, { ...opts, useSpinner: false });
59529
+ results.push(await runCommand(command2, { ...opts, useSpinner: false }));
57073
59530
  }
59531
+ return results.join("\n");
57074
59532
  }
57075
59533
  });
57076
59534
  }
@@ -57087,8 +59545,9 @@ var printAsyncStatus = async ({
57087
59545
  promise = promise();
57088
59546
  }
57089
59547
  try {
57090
- await promise;
57091
- s?.stop(opts.doneText);
59548
+ const output = await promise;
59549
+ const doneText = typeof opts.doneText === "function" ? opts.doneText(output) : opts.doneText;
59550
+ s?.stop(doneText);
57092
59551
  } catch (err) {
57093
59552
  s?.stop(err.message);
57094
59553
  } finally {
@@ -57148,16 +59607,6 @@ var npmInstall = async () => {
57148
59607
  doneText: `${brandColor("installed")} ${dim(`via \`${npm12} install\``)}`
57149
59608
  });
57150
59609
  };
57151
- var detectPackageManager = () => {
57152
- const pm = (0, import_which_pm_runs.default)();
57153
- if (!pm) {
57154
- return { npm: "npm", npx: "npx" };
57155
- }
57156
- return {
57157
- npm: pm.name,
57158
- npx: pm.name === "pnpm" ? `pnpx` : `npx`
57159
- };
57160
- };
57161
59610
  var installWrangler = async () => {
57162
59611
  const { npm: npm12 } = detectPackageManager();
57163
59612
  if ((0, import_fs5.existsSync)(import_path5.default.resolve("node_modules", "wrangler"))) {
@@ -57174,14 +59623,18 @@ var installWrangler = async () => {
57174
59623
  });
57175
59624
  };
57176
59625
  var isLoggedIn = async () => {
57177
- const { npx: npx12 } = detectPackageManager();
57178
- const output = await runCommand(`${npx12} wrangler whoami`, {
57179
- silent: true
57180
- });
57181
- return !/not authenticated/.test(output);
59626
+ const { npx: npx6 } = detectPackageManager();
59627
+ try {
59628
+ const output = await runCommand(`${npx6} wrangler whoami`, {
59629
+ silent: true
59630
+ });
59631
+ return /You are logged in/.test(output);
59632
+ } catch (error) {
59633
+ return false;
59634
+ }
57182
59635
  };
57183
59636
  var wranglerLogin = async () => {
57184
- const { npx: npx12 } = detectPackageManager();
59637
+ const { npx: npx6 } = detectPackageManager();
57185
59638
  const s = spinner();
57186
59639
  s.start(`Logging into Cloudflare ${dim("checking authentication status")}`);
57187
59640
  const alreadyLoggedIn = await isLoggedIn();
@@ -57189,7 +59642,7 @@ var wranglerLogin = async () => {
57189
59642
  if (alreadyLoggedIn)
57190
59643
  return true;
57191
59644
  s.start(`Logging into Cloudflare ${dim("This will open a browser window")}`);
57192
- const output = await runCommand(`${npx12} wrangler login`, {
59645
+ const output = await runCommand(`${npx6} wrangler login`, {
57193
59646
  silent: true
57194
59647
  });
57195
59648
  const success = /Successfully logged in/.test(output);
@@ -57198,8 +59651,8 @@ var wranglerLogin = async () => {
57198
59651
  return success;
57199
59652
  };
57200
59653
  var listAccounts = async () => {
57201
- const { npx: npx12 } = detectPackageManager();
57202
- const output = await runCommand(`${npx12} wrangler whoami`, {
59654
+ const { npx: npx6 } = detectPackageManager();
59655
+ const output = await runCommand(`${npx6} wrangler whoami`, {
57203
59656
  silent: true
57204
59657
  });
57205
59658
  const accounts = {};
@@ -57211,6 +59664,24 @@ var listAccounts = async () => {
57211
59664
  });
57212
59665
  return accounts;
57213
59666
  };
59667
+ async function getWorkerdCompatibilityDate() {
59668
+ const { npm: npm12 } = detectPackageManager();
59669
+ return runCommand(`${npm12} info workerd dist-tags.latest`, {
59670
+ silent: true,
59671
+ captureOutput: true,
59672
+ startText: "Retrieving current workerd compatibility date",
59673
+ transformOutput: (result) => {
59674
+ const match = result.match(/\d+\.(\d{4})(\d{2})(\d{2})\.\d+/);
59675
+ if (!match) {
59676
+ throw new Error("Could not find workerd date");
59677
+ }
59678
+ const [, year, month, date] = match;
59679
+ return `${year}-${month}-${date}`;
59680
+ },
59681
+ fallbackOutput: () => "2023-05-18",
59682
+ doneText: (output) => `${brandColor("compatibility date")} ${dim(output)}`
59683
+ });
59684
+ }
57214
59685
 
57215
59686
  // src/helpers/poll.ts
57216
59687
  var import_promises = require("node:dns/promises");
@@ -57288,14 +59759,15 @@ var validateProjectDirectory = (relativePath) => {
57288
59759
  const existsAlready = (0, import_fs6.existsSync)(path3);
57289
59760
  const isEmpty = existsAlready && (0, import_fs6.readdirSync)(path3).length === 0;
57290
59761
  if (existsAlready && !isEmpty) {
57291
- crash(
57292
- `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`
57293
- );
59762
+ return `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`;
57294
59763
  }
57295
59764
  };
57296
59765
  var setupProjectDirectory = (args) => {
57297
59766
  const path3 = (0, import_path6.resolve)(args.projectName);
57298
- validateProjectDirectory(path3);
59767
+ const err = validateProjectDirectory(path3);
59768
+ if (err) {
59769
+ crash(err);
59770
+ }
57299
59771
  const directory = (0, import_path6.dirname)(path3);
57300
59772
  const name = (0, import_path6.basename)(path3);
57301
59773
  (0, import_fs6.mkdirSync)(directory, { recursive: true });
@@ -57304,14 +59776,12 @@ var setupProjectDirectory = (args) => {
57304
59776
  };
57305
59777
  var offerToDeploy = async (ctx) => {
57306
59778
  startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
57307
- ctx.args.deploy = await confirmInput({
59779
+ const label = `deploy via \`${npm} run ${ctx.framework?.config.deployCommand ?? "deploy"}\``;
59780
+ ctx.args.deploy = await processArgument(ctx.args, "deploy", {
59781
+ type: "confirm",
57308
59782
  question: "Do you want to deploy your application?",
57309
- renderSubmitted: (value) => `${brandColor(value ? `yes` : `no`)} ${dim(
57310
- `deploying via \`${npm} run ${ctx.framework?.config.deployCommand ?? "deploy"}\``
57311
- )}`,
57312
- defaultValue: ctx.args.deploy ?? (ctx.args.wranglerDefaults ? false : true),
57313
- // if --wrangler-defaults, default to false, otherwise default to true
57314
- acceptDefault: ctx.args.wranglerDefaults
59783
+ label,
59784
+ defaultValue: C3_DEFAULTS.deploy
57315
59785
  });
57316
59786
  if (!ctx.args.deploy)
57317
59787
  return;
@@ -57331,7 +59801,7 @@ var runDeploy = async (ctx) => {
57331
59801
  const result = await runCommand(deployCmd, {
57332
59802
  silent: true,
57333
59803
  cwd: ctx.project.path,
57334
- env: { CLOUDFLARE_ACCOUNT_ID: ctx.account.id },
59804
+ env: { CLOUDFLARE_ACCOUNT_ID: ctx.account.id, NODE_ENV: "production" },
57335
59805
  startText: `Deploying your application`,
57336
59806
  doneText: `${brandColor("deployed")} ${dim(`via \`${deployCmd}\``)}`
57337
59807
  });
@@ -57365,14 +59835,12 @@ var chooseAccount = async (ctx) => {
57365
59835
  label: name,
57366
59836
  value: id
57367
59837
  }));
57368
- accountId = await selectInput({
59838
+ accountId = await inputPrompt({
59839
+ type: "select",
57369
59840
  question: "Which account do you want to use?",
57370
59841
  options: accountOptions,
57371
- renderSubmitted: (option) => {
57372
- return `${brandColor("account")} ${dim(option.label)}`;
57373
- },
57374
- defaultValue: accountOptions[0].value,
57375
- acceptDefault: ctx.args.wranglerDefaults
59842
+ label: "account",
59843
+ defaultValue: accountOptions[0].value
57376
59844
  });
57377
59845
  }
57378
59846
  const accountName = Object.keys(accounts).find(
@@ -57382,6 +59850,7 @@ var chooseAccount = async (ctx) => {
57382
59850
  };
57383
59851
  var printSummary = async (ctx) => {
57384
59852
  const nextSteps = [
59853
+ [`Navigate to the new directory`, `cd ${ctx.project.name}`],
57385
59854
  [
57386
59855
  `Run the development server`,
57387
59856
  `${npm} run ${ctx.framework?.config.devCommand ?? "start"}`
@@ -57444,11 +59913,11 @@ var offerGit = async (ctx) => {
57444
59913
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
57445
59914
  if (insideGitRepo)
57446
59915
  return;
57447
- ctx.args.git ??= await confirmInput({
59916
+ ctx.args.git = await processArgument(ctx.args, "git", {
59917
+ type: "confirm",
57448
59918
  question: "Do you want to use git for version control?",
57449
- renderSubmitted: (value) => `${brandColor("git")} ${dim(value ? `yes` : `no`)}`,
57450
- defaultValue: true,
57451
- acceptDefault: ctx.args.wranglerDefaults
59919
+ label: "git",
59920
+ defaultValue: C3_DEFAULTS.git
57452
59921
  });
57453
59922
  if (ctx.args.git) {
57454
59923
  await printAsyncStatus({
@@ -57508,6 +59977,24 @@ async function initializeGit(cwd) {
57508
59977
  await runCommand(`git init`, { useSpinner: false, silent: true, cwd });
57509
59978
  }
57510
59979
  }
59980
+ async function getProductionBranch(cwd) {
59981
+ try {
59982
+ const productionBranch = await runCommand(
59983
+ // "git branch --show-current", // git@^2.22
59984
+ "git rev-parse --abbrev-ref HEAD",
59985
+ // git@^1.6.3
59986
+ {
59987
+ silent: true,
59988
+ cwd,
59989
+ useSpinner: false,
59990
+ captureOutput: true
59991
+ }
59992
+ );
59993
+ return productionBranch.trim();
59994
+ } catch (err) {
59995
+ }
59996
+ return "main";
59997
+ }
57511
59998
 
57512
59999
  // src/pages.ts
57513
60000
  var import_path8 = require("path");
@@ -57537,6 +60024,9 @@ var readJSON = (path3) => {
57537
60024
  const contents = readFile(path3);
57538
60025
  return contents ? JSON.parse(contents) : contents;
57539
60026
  };
60027
+ var writeJSON = (path3, object, stringifySpace) => {
60028
+ writeFile2(path3, JSON.stringify(object, null, stringifySpace));
60029
+ };
57540
60030
  var probePaths = (paths, errorMsg = "Failed to find required file.") => {
57541
60031
  for (const path3 of paths) {
57542
60032
  if ((0, import_fs7.existsSync)(path3)) {
@@ -57549,18 +60039,47 @@ var probePaths = (paths, errorMsg = "Failed to find required file.") => {
57549
60039
  var usesTypescript = (projectRoot = ".") => {
57550
60040
  return (0, import_fs7.existsSync)(`${projectRoot}/tsconfig.json`);
57551
60041
  };
60042
+ var eslintRcExts = ["js", "cjs", "yaml", "yml", "json"];
60043
+ var usesEslint = (ctx) => {
60044
+ for (const ext of eslintRcExts) {
60045
+ const eslintRcFilename = `.eslintrc.${ext}`;
60046
+ if ((0, import_fs7.existsSync)(`${ctx.project.path}/${eslintRcFilename}`)) {
60047
+ return {
60048
+ used: true,
60049
+ configType: eslintRcFilename
60050
+ };
60051
+ }
60052
+ }
60053
+ if ((0, import_fs7.existsSync)(`${ctx.project.path}/eslint.config.js`)) {
60054
+ return {
60055
+ used: true,
60056
+ configType: "eslint.config.js"
60057
+ };
60058
+ }
60059
+ try {
60060
+ const pkgJson = readJSON(`${ctx.project.path}/package.json`);
60061
+ if (pkgJson.eslintConfig) {
60062
+ return {
60063
+ used: true,
60064
+ configType: "package.json"
60065
+ };
60066
+ }
60067
+ } catch {
60068
+ }
60069
+ return { used: false };
60070
+ };
57552
60071
  var compatDateFlag = () => {
57553
60072
  const date = /* @__PURE__ */ new Date();
57554
60073
  return `--compatibility-date=${date.toISOString().slice(0, 10)}`;
57555
60074
  };
57556
60075
 
57557
60076
  // src/frameworks/angular/index.ts
57558
- var { npx, npm: npm2 } = detectPackageManager();
60077
+ var { dlx, npx, npm: npm2 } = detectPackageManager();
57559
60078
  var generate = async (ctx) => {
57560
60079
  const version2 = getFrameworkVersion(ctx);
57561
60080
  await runFrameworkGenerator(
57562
60081
  ctx,
57563
- `${npx} @angular/cli@${version2} new ${ctx.project.name} --standalone`
60082
+ `${dlx} @angular/cli@${version2} new ${ctx.project.name} --standalone`
57564
60083
  );
57565
60084
  logRaw("");
57566
60085
  };
@@ -57580,10 +60099,10 @@ var config = {
57580
60099
  displayName: "Angular",
57581
60100
  packageScripts: {
57582
60101
  process: "node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs",
57583
- prestart: "npm run build:ssr && npm run process",
60102
+ prestart: `${npm2} run build:ssr && ${npm2} run process`,
57584
60103
  start: "wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local",
57585
- predeploy: "npm run build:ssr && npm run process",
57586
- deploy: "wrangler pages publish dist/cloudflare"
60104
+ predeploy: `${npm2} run build:ssr && ${npm2} run process`,
60105
+ deploy: "wrangler pages deploy dist/cloudflare"
57587
60106
  },
57588
60107
  deployCommand: "deploy",
57589
60108
  devCommand: "start"
@@ -57629,7 +60148,10 @@ async function updateAppCode() {
57629
60148
  s.start(`Updating application code`);
57630
60149
  const appConfigPath = "src/app/app.config.ts";
57631
60150
  const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
57632
- const newAppConfig = "import { provideClientHydration } from '@angular/platform-browser';\n" + appConfig.replace("providers: [", "providers: [provideClientHydration(), ");
60151
+ const newAppConfig = "import { provideClientHydration } from '@angular/platform-browser';\nimport { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
60152
+ "providers: [",
60153
+ "providers: [provideHttpClient(withFetch()), provideClientHydration(), "
60154
+ );
57633
60155
  writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
57634
60156
  await (0, import_promises2.rm)((0, import_node_path.resolve)("server.ts"));
57635
60157
  s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
@@ -57649,12 +60171,12 @@ function updateAngularJson(ctx) {
57649
60171
  }
57650
60172
 
57651
60173
  // src/frameworks/astro/index.ts
57652
- var { npx: npx2 } = detectPackageManager();
60174
+ var { npx: npx2, dlx: dlx2 } = detectPackageManager();
57653
60175
  var generate2 = async (ctx) => {
57654
60176
  const version2 = getFrameworkVersion(ctx);
57655
60177
  await runFrameworkGenerator(
57656
60178
  ctx,
57657
- `${npx2} create-astro@${version2} ${ctx.project.name} --no-install`
60179
+ `${dlx2} create-astro@${version2} ${ctx.project.name} --no-install`
57658
60180
  );
57659
60181
  logRaw("");
57660
60182
  };
@@ -57675,7 +60197,7 @@ var config2 = {
57675
60197
  displayName: "Astro",
57676
60198
  packageScripts: {
57677
60199
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- astro dev`,
57678
- "pages:deploy": `astro build && wrangler pages publish ./dist`
60200
+ "pages:deploy": `astro build && wrangler pages deploy ./dist`
57679
60201
  },
57680
60202
  testFlags: [
57681
60203
  "--skip-houston",
@@ -57691,12 +60213,12 @@ var config2 = {
57691
60213
  var astro_default = config2;
57692
60214
 
57693
60215
  // src/frameworks/docusaurus/index.ts
57694
- var { npm: npm3 } = detectPackageManager();
60216
+ var { npm: npm3, dlx: dlx3 } = detectPackageManager();
57695
60217
  var generate3 = async (ctx) => {
57696
60218
  const version2 = getFrameworkVersion(ctx);
57697
60219
  await runFrameworkGenerator(
57698
60220
  ctx,
57699
- `${npm3} create docusaurus@${version2} ${ctx.project.name} classic`
60221
+ `${dlx3} create-docusaurus@${version2} ${ctx.project.name} classic`
57700
60222
  );
57701
60223
  };
57702
60224
  var config3 = {
@@ -57704,40 +60226,34 @@ var config3 = {
57704
60226
  displayName: "Docusaurus",
57705
60227
  packageScripts: {
57706
60228
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm3} run start`,
57707
- "pages:deploy": `NODE_VERSION=16 ${npm3} run build && wrangler pages publish ./build`
60229
+ "pages:deploy": `NODE_VERSION=16 ${npm3} run build && wrangler pages deploy ./build`
57708
60230
  }
57709
60231
  };
57710
60232
  var docusaurus_default = config3;
57711
60233
 
57712
60234
  // src/frameworks/gatsby/index.ts
57713
- var { npm: npm4, npx: npx3 } = detectPackageManager();
60235
+ var { npm: npm4, dlx: dlx4 } = detectPackageManager();
57714
60236
  var generate4 = async (ctx) => {
57715
60237
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
57716
- const useTemplate = await confirmInput({
60238
+ const useTemplate = await inputPrompt({
60239
+ type: "confirm",
57717
60240
  question: "Would you like to use a template?",
57718
- renderSubmitted: (value) => {
57719
- const status2 = value ? "yes" : "no";
57720
- return `${brandColor(`template`)} ${status2}`;
57721
- },
57722
- defaultValue: true,
57723
- acceptDefault: false
60241
+ label: "template",
60242
+ defaultValue: true
57724
60243
  });
57725
60244
  let templateUrl = "";
57726
60245
  if (useTemplate) {
57727
- templateUrl = await textInput({
60246
+ templateUrl = await inputPrompt({
60247
+ type: "text",
57728
60248
  question: `Please specify the url of the template you'd like to use`,
57729
- renderSubmitted: (value) => {
57730
- const result = `Using template \`${value}\``;
57731
- return `${brandColor("template")} ${dim(result)}`;
57732
- },
57733
- defaultValue: defaultTemplate,
57734
- acceptDefault: false
60249
+ label: "template",
60250
+ defaultValue: defaultTemplate
57735
60251
  });
57736
60252
  }
57737
60253
  const version2 = getFrameworkVersion(ctx);
57738
60254
  await runFrameworkGenerator(
57739
60255
  ctx,
57740
- `${npx3} gatsby@${version2} new ${ctx.project.name} ${templateUrl}`
60256
+ `${dlx4} gatsby@${version2} new ${ctx.project.name} ${templateUrl}`
57741
60257
  );
57742
60258
  };
57743
60259
  var config4 = {
@@ -57745,18 +60261,18 @@ var config4 = {
57745
60261
  displayName: "Gatsby",
57746
60262
  packageScripts: {
57747
60263
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 8000 -- ${npm4} run develop`,
57748
- "pages:deploy": `${npm4} run build && wrangler pages publish ./public`
60264
+ "pages:deploy": `${npm4} run build && wrangler pages deploy ./public`
57749
60265
  }
57750
60266
  };
57751
60267
  var gatsby_default = config4;
57752
60268
 
57753
60269
  // src/frameworks/hono/index.ts
57754
- var { npx: npx4 } = detectPackageManager();
60270
+ var { dlx: dlx5 } = detectPackageManager();
57755
60271
  var generate5 = async (ctx) => {
57756
60272
  const version2 = getFrameworkVersion(ctx);
57757
60273
  await runFrameworkGenerator(
57758
60274
  ctx,
57759
- `${npx4} create-hono@${version2} ${ctx.project.name} --template cloudflare-pages`
60275
+ `${dlx5} create-hono@${version2} ${ctx.project.name} --template cloudflare-pages`
57760
60276
  );
57761
60277
  logRaw("");
57762
60278
  };
@@ -57819,13 +60335,13 @@ export async function GET(request) {
57819
60335
  `;
57820
60336
 
57821
60337
  // src/frameworks/next/index.ts
57822
- var { npm: npm5, npx: npx5 } = detectPackageManager();
60338
+ var { npm: npm5, npx: npx3, dlx: dlx6 } = detectPackageManager();
57823
60339
  var generate6 = async (ctx) => {
57824
60340
  const projectName = ctx.project.name;
57825
60341
  const version2 = getFrameworkVersion(ctx);
57826
60342
  await runFrameworkGenerator(
57827
60343
  ctx,
57828
- `${npx5} create-next-app@${version2} ${projectName}`
60344
+ `${dlx6} create-next-app@${version2} ${projectName}`
57829
60345
  );
57830
60346
  };
57831
60347
  var getApiTemplate = (apiPath, isTypescript) => {
@@ -57857,23 +60373,59 @@ var configure3 = async (ctx) => {
57857
60373
  );
57858
60374
  writeFile2(handlerPath, handlerFile);
57859
60375
  updateStatus("Created an example API route handler");
60376
+ const installEslintPlugin = await shouldInstallNextOnPagesEslintPlugin(ctx);
60377
+ if (installEslintPlugin) {
60378
+ await writeEslintrc(ctx);
60379
+ }
57860
60380
  process.chdir(projectName);
57861
- const packages = ["@cloudflare/next-on-pages@1", "vercel"];
60381
+ const packages = [
60382
+ "@cloudflare/next-on-pages@1",
60383
+ "vercel",
60384
+ ...installEslintPlugin ? ["eslint-plugin-next-on-pages"] : []
60385
+ ];
57862
60386
  await installPackages(packages, {
57863
60387
  dev: true,
57864
60388
  startText: "Adding the Cloudflare Pages adapter",
57865
60389
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
57866
60390
  });
57867
60391
  };
60392
+ var shouldInstallNextOnPagesEslintPlugin = async (ctx) => {
60393
+ const eslintUsage = usesEslint(ctx);
60394
+ if (!eslintUsage.used)
60395
+ return false;
60396
+ if (eslintUsage.configType !== ".eslintrc.json") {
60397
+ warn(
60398
+ `Expected .eslintrc.json from Next.js scaffolding but found ${eslintUsage.configType} instead`
60399
+ );
60400
+ return false;
60401
+ }
60402
+ return await processArgument(ctx.args, "eslint-plugin", {
60403
+ type: "confirm",
60404
+ question: "Do you want to use the next-on-pages eslint-plugin?",
60405
+ label: "eslint-plugin",
60406
+ defaultValue: true
60407
+ });
60408
+ };
60409
+ var writeEslintrc = async (ctx) => {
60410
+ const eslintConfig = readJSON(`${ctx.project.name}/.eslintrc.json`);
60411
+ eslintConfig.plugins ??= [];
60412
+ eslintConfig.plugins.push("eslint-plugin-next-on-pages");
60413
+ if (typeof eslintConfig.extends === "string") {
60414
+ eslintConfig.extends = [eslintConfig.extends];
60415
+ }
60416
+ eslintConfig.extends ??= [];
60417
+ eslintConfig.extends.push("plugin:eslint-plugin-next-on-pages/recommended");
60418
+ writeJSON(`${ctx.project.name}/.eslintrc.json`, eslintConfig, 2);
60419
+ };
57868
60420
  var config6 = {
57869
60421
  generate: generate6,
57870
60422
  configure: configure3,
57871
60423
  displayName: "Next",
57872
60424
  packageScripts: {
57873
- "pages:build": `${npx5} @cloudflare/next-on-pages@1`,
57874
- "pages:deploy": `${npm5} run pages:build && wrangler pages publish .vercel/output/static`,
57875
- "pages:watch": `${npx5} @cloudflare/next-on-pages@1 --watch`,
57876
- "pages:dev": `${npx5} wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat`
60425
+ "pages:build": `${npx3} @cloudflare/next-on-pages@1`,
60426
+ "pages:deploy": `${npm5} run pages:build && wrangler pages deploy .vercel/output/static`,
60427
+ "pages:watch": `${npx3} @cloudflare/next-on-pages@1 --watch`,
60428
+ "pages:dev": `${npx3} wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat`
57877
60429
  },
57878
60430
  testFlags: [
57879
60431
  "--typescript",
@@ -57883,24 +60435,25 @@ var config6 = {
57883
60435
  "--src-dir",
57884
60436
  "--app",
57885
60437
  "--import-alias",
57886
- '"@/*"'
60438
+ "@/*"
57887
60439
  ],
57888
60440
  compatibilityFlags: ["nodejs_compat"]
57889
60441
  };
57890
60442
  var next_default = config6;
57891
60443
 
57892
60444
  // src/frameworks/nuxt/index.ts
57893
- var { npx: npx6 } = detectPackageManager();
60445
+ var { dlx: dlx7 } = detectPackageManager();
57894
60446
  var generate7 = async (ctx) => {
57895
60447
  const version2 = getFrameworkVersion(ctx);
57896
60448
  await runFrameworkGenerator(
57897
60449
  ctx,
57898
- `${npx6} nuxi@${version2} init ${ctx.project.name}`
60450
+ `${dlx7} nuxi@${version2} init ${ctx.project.name}`
57899
60451
  );
57900
60452
  logRaw("");
57901
60453
  };
57902
60454
  var configure4 = async (ctx) => {
57903
60455
  process.chdir(ctx.project.path);
60456
+ writeFile2("./.node-version", "17");
57904
60457
  await npmInstall();
57905
60458
  };
57906
60459
  var config7 = {
@@ -57908,25 +60461,26 @@ var config7 = {
57908
60461
  configure: configure4,
57909
60462
  displayName: "Nuxt",
57910
60463
  packageScripts: {
60464
+ build: (cmd) => `NITRO_PRESET=cloudflare-pages ${cmd}`,
57911
60465
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- npm run dev`,
57912
- "pages:deploy": `NODE_VERSION=17 npm run generate && wrangler pages publish ./dist`
60466
+ "pages:deploy": "npm run build && wrangler pages deploy ./dist"
57913
60467
  }
57914
60468
  };
57915
60469
  var nuxt_default = config7;
57916
60470
 
57917
60471
  // src/frameworks/qwik/index.ts
57918
- var { npm: npm6, npx: npx7 } = detectPackageManager();
60472
+ var { npm: npm6, npx: npx4, dlx: dlx8 } = detectPackageManager();
57919
60473
  var generate8 = async (ctx) => {
57920
60474
  const version2 = getFrameworkVersion(ctx);
57921
60475
  await runFrameworkGenerator(
57922
60476
  ctx,
57923
- `${npm6} create qwik@${version2} basic ${ctx.project.name}`
60477
+ `${dlx8} create-qwik@${version2} basic ${ctx.project.name}`
57924
60478
  );
57925
60479
  };
57926
60480
  var configure5 = async (ctx) => {
57927
60481
  process.chdir(ctx.project.path);
57928
60482
  await npmInstall();
57929
- const cmd = `${npx7} qwik add cloudflare-pages`;
60483
+ const cmd = `${npx4} qwik add cloudflare-pages`;
57930
60484
  endSection(`Running ${cmd}`);
57931
60485
  await runCommand(cmd);
57932
60486
  };
@@ -57942,12 +60496,12 @@ var config8 = {
57942
60496
  var qwik_default = config8;
57943
60497
 
57944
60498
  // src/frameworks/react/index.ts
57945
- var { npm: npm7, npx: npx8 } = detectPackageManager();
60499
+ var { npm: npm7, dlx: dlx9 } = detectPackageManager();
57946
60500
  var generate9 = async (ctx) => {
57947
60501
  const version2 = getFrameworkVersion(ctx);
57948
60502
  await runFrameworkGenerator(
57949
60503
  ctx,
57950
- `${npx8} create-react-app@${version2} ${ctx.project.name}`
60504
+ `${dlx9} create-react-app@${version2} ${ctx.project.name}`
57951
60505
  );
57952
60506
  logRaw("");
57953
60507
  };
@@ -57956,18 +60510,18 @@ var config9 = {
57956
60510
  displayName: "React",
57957
60511
  packageScripts: {
57958
60512
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --port 3000 -- ${npm7} start`,
57959
- "pages:deploy": `${npm7} run build && wrangler pages publish ./build`
60513
+ "pages:deploy": `${npm7} run build && wrangler pages deploy ./build`
57960
60514
  }
57961
60515
  };
57962
60516
  var react_default = config9;
57963
60517
 
57964
60518
  // src/frameworks/remix/index.ts
57965
- var { npm: npm8, npx: npx9 } = detectPackageManager();
60519
+ var { npm: npm8, dlx: dlx10 } = detectPackageManager();
57966
60520
  var generate10 = async (ctx) => {
57967
60521
  const version2 = getFrameworkVersion(ctx);
57968
60522
  await runFrameworkGenerator(
57969
60523
  ctx,
57970
- `${npx9} create-remix@${version2} ${ctx.project.name} --template https://github.com/remix-run/remix/tree/main/templates/cloudflare-pages`
60524
+ `${dlx10} create-remix@${version2} ${ctx.project.name} --template https://github.com/remix-run/remix/tree/main/templates/cloudflare-pages`
57971
60525
  );
57972
60526
  logRaw("");
57973
60527
  };
@@ -57975,7 +60529,7 @@ var config10 = {
57975
60529
  generate: generate10,
57976
60530
  displayName: "Remix",
57977
60531
  packageScripts: {
57978
- "pages:deploy": `${npm8} run build && wrangler pages publish ./public`
60532
+ "pages:deploy": `${npm8} run build && wrangler pages deploy ./public`
57979
60533
  },
57980
60534
  devCommand: "dev",
57981
60535
  testFlags: ["--typescript", "--no-install"]
@@ -57997,12 +60551,12 @@ export default defineConfig({
57997
60551
  `;
57998
60552
 
57999
60553
  // src/frameworks/solid/index.ts
58000
- var { npm: npm9 } = detectPackageManager();
60554
+ var { npm: npm9, dlx: dlx11 } = detectPackageManager();
58001
60555
  var generate11 = async (ctx) => {
58002
60556
  (0, import_fs9.mkdirSync)(ctx.project.path);
58003
60557
  process.chdir(ctx.project.path);
58004
60558
  const version2 = getFrameworkVersion(ctx);
58005
- await runFrameworkGenerator(ctx, `${npm9} create solid@${version2}`);
60559
+ await runFrameworkGenerator(ctx, `${dlx11} create-solid@${version2}`);
58006
60560
  logRaw("");
58007
60561
  };
58008
60562
  var configure6 = async () => {
@@ -58024,7 +60578,7 @@ var config11 = {
58024
60578
  displayName: "Solid",
58025
60579
  packageScripts: {
58026
60580
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm9} run dev`,
58027
- "pages:deploy": `${npm9} run build build && wrangler pages publish ./dist/public`
60581
+ "pages:deploy": `${npm9} run build && wrangler pages deploy ./dist/public`
58028
60582
  }
58029
60583
  };
58030
60584
  var solid_default = config11;
@@ -58076,12 +60630,12 @@ interface Platform {
58076
60630
  `;
58077
60631
 
58078
60632
  // src/frameworks/svelte/index.ts
58079
- var { npm: npm10 } = detectPackageManager();
60633
+ var { npm: npm10, dlx: dlx12 } = detectPackageManager();
58080
60634
  var generate12 = async (ctx) => {
58081
60635
  const version2 = getFrameworkVersion(ctx);
58082
60636
  await runFrameworkGenerator(
58083
60637
  ctx,
58084
- `${npm10} create svelte@${version2} ${ctx.project.name}`
60638
+ `${dlx12} create-svelte@${version2} ${ctx.project.name}`
58085
60639
  );
58086
60640
  logRaw("");
58087
60641
  };
@@ -58124,18 +60678,18 @@ var config12 = {
58124
60678
  displayName: "Svelte",
58125
60679
  packageScripts: {
58126
60680
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm10} run dev`,
58127
- "pages:deploy": `NODE_VERSION=16 ${npm10} run build && wrangler pages publish .svelte-kit/cloudflare`
60681
+ "pages:deploy": `NODE_VERSION=16 ${npm10} run build && wrangler pages deploy .svelte-kit/cloudflare`
58128
60682
  }
58129
60683
  };
58130
60684
  var svelte_default = config12;
58131
60685
 
58132
60686
  // src/frameworks/versionMap.json
58133
60687
  var versionMap_default = {
58134
- angular: "16.0.x",
60688
+ angular: "16.1.x",
58135
60689
  astro: "3.1.5",
58136
60690
  docusaurus: "2.4.1",
58137
60691
  gatsby: "5.10.0",
58138
- hono: "0.2.0",
60692
+ hono: "0.2.6",
58139
60693
  next: "13.4.2",
58140
60694
  nuxt: "3.4.2",
58141
60695
  qwik: "1.1.x",
@@ -58147,12 +60701,12 @@ var versionMap_default = {
58147
60701
  };
58148
60702
 
58149
60703
  // src/frameworks/vue/index.ts
58150
- var { npm: npm11, npx: npx10 } = detectPackageManager();
60704
+ var { npm: npm11, dlx: dlx13 } = detectPackageManager();
58151
60705
  var generate13 = async (ctx) => {
58152
60706
  const version2 = getFrameworkVersion(ctx);
58153
60707
  await runFrameworkGenerator(
58154
60708
  ctx,
58155
- `${npx10} create-vue@${version2} ${ctx.project.name}`
60709
+ `${dlx13} create-vue@${version2} ${ctx.project.name}`
58156
60710
  );
58157
60711
  };
58158
60712
  var config13 = {
@@ -58160,7 +60714,7 @@ var config13 = {
58160
60714
  displayName: "Vue",
58161
60715
  packageScripts: {
58162
60716
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm11} run dev`,
58163
- "pages:deploy": `${npm11} run build && wrangler pages publish ./dist`
60717
+ "pages:deploy": `${npm11} run build && wrangler pages deploy ./dist`
58164
60718
  },
58165
60719
  testFlags: ["--ts"]
58166
60720
  };
@@ -58195,7 +60749,7 @@ var supportedFramework = (framework) => {
58195
60749
 
58196
60750
  // src/pages.ts
58197
60751
  var CREATE_PROJECT_RETRIES = 3;
58198
- var { npx: npx11 } = detectPackageManager();
60752
+ var { npx: npx5 } = detectPackageManager();
58199
60753
  var defaultFrameworkConfig = {
58200
60754
  deployCommand: "pages:deploy",
58201
60755
  devCommand: "pages:dev"
@@ -58240,14 +60794,12 @@ var getFrameworkSelection = async (args) => {
58240
60794
  value: key
58241
60795
  })
58242
60796
  );
58243
- const framework = await selectInput({
60797
+ const framework = await processArgument(args, "framework", {
60798
+ type: "select",
60799
+ label: "framework",
58244
60800
  question: "Which development framework do you want to use?",
58245
60801
  options: frameworkOptions,
58246
- renderSubmitted: (option) => {
58247
- return `${brandColor("framework")} ${dim(option.label)}`;
58248
- },
58249
- defaultValue: args.framework ?? "svelte",
58250
- acceptDefault: Boolean(args.framework)
60802
+ defaultValue: C3_DEFAULTS.framework
58251
60803
  });
58252
60804
  framework || crash("A framework must be selected to continue.");
58253
60805
  if (!supportedFramework(framework)) {
@@ -58261,11 +60813,29 @@ var updatePackageScripts = async (ctx) => {
58261
60813
  const { packageScripts } = ctx.framework?.config ?? {};
58262
60814
  if (packageScripts) {
58263
60815
  const s = spinner();
58264
- s.start(`Adding command scripts`, `for development and deployment`);
60816
+ const updatingScripts = Object.entries(packageScripts).filter(
60817
+ ([_3, cmdOrUpdater]) => typeof cmdOrUpdater === "function"
60818
+ ).length > 0;
60819
+ s.start(
60820
+ `${updatingScripts ? "Updating" : "Adding"} command scripts`,
60821
+ "for development and deployment"
60822
+ );
58265
60823
  const pkgJsonPath = (0, import_path8.resolve)("package.json");
58266
60824
  const pkgConfig = readJSON(pkgJsonPath);
58267
- Object.entries(packageScripts).forEach(([target, command2]) => {
58268
- pkgConfig.scripts[target] = command2;
60825
+ Object.entries(packageScripts).forEach(([target, cmdOrUpdater]) => {
60826
+ if (typeof cmdOrUpdater === "string") {
60827
+ const command2 = cmdOrUpdater;
60828
+ pkgConfig.scripts[target] = command2;
60829
+ } else {
60830
+ const existingCommand = pkgConfig.scripts[target];
60831
+ if (!existingCommand) {
60832
+ throw new Error(
60833
+ `Could not find ${target} script to update during ${ctx.framework} setup`
60834
+ );
60835
+ }
60836
+ const updater = cmdOrUpdater;
60837
+ pkgConfig.scripts[target] = updater(existingCommand);
60838
+ }
58269
60839
  });
58270
60840
  writeFile2(pkgJsonPath, JSON.stringify(pkgConfig, null, 2));
58271
60841
  s.stop(`${brandColor("added")} ${dim("commands to `package.json`")}`);
@@ -58281,7 +60851,8 @@ var createProject = async (ctx) => {
58281
60851
  const CLOUDFLARE_ACCOUNT_ID = ctx.account.id;
58282
60852
  const compatFlags = ctx.framework?.config.compatibilityFlags?.join(" ");
58283
60853
  const compatFlagsArg = compatFlags ? `--compatibility-flags ${compatFlags}` : "";
58284
- const cmd = `${npx11} wrangler pages project create ${ctx.project.name} --production-branch main ${compatFlagsArg}`;
60854
+ const productionBranch = await getProductionBranch(ctx.project.path);
60855
+ const cmd = `${npx5} wrangler pages project create ${ctx.project.name} --production-branch ${productionBranch} ${compatFlagsArg}`;
58285
60856
  try {
58286
60857
  await retry(
58287
60858
  CREATE_PROJECT_RETRIES,
@@ -58290,7 +60861,7 @@ var createProject = async (ctx) => {
58290
60861
  cwd: ctx.project.path,
58291
60862
  env: { CLOUDFLARE_ACCOUNT_ID },
58292
60863
  startText: "Creating Pages project",
58293
- doneText: `${brandColor("created")} ${dim(`via \`${cmd}\``)}`
60864
+ doneText: `${brandColor("created")} ${dim(`via \`${cmd.trim()}\``)}`
58294
60865
  })
58295
60866
  );
58296
60867
  } catch (error) {
@@ -58324,14 +60895,12 @@ var runWorkersGenerator = async (args) => {
58324
60895
  await printSummary(ctx);
58325
60896
  };
58326
60897
  async function getTemplate(ctx) {
58327
- if (ctx.args.ts === void 0) {
58328
- ctx.args.ts = await confirmInput({
58329
- question: "Do you want to use TypeScript?",
58330
- renderSubmitted: (value) => `${brandColor("typescript")} ${dim(`${value ? "yes" : "no"}`)}`,
58331
- defaultValue: true,
58332
- acceptDefault: ctx.args.wranglerDefaults
58333
- });
58334
- }
60898
+ ctx.args.ts = await processArgument(ctx.args, "ts", {
60899
+ type: "confirm",
60900
+ question: "Do you want to use TypeScript?",
60901
+ label: "typescript",
60902
+ defaultValue: C3_DEFAULTS.ts
60903
+ });
58335
60904
  const preexisting = ctx.args.type === "pre-existing";
58336
60905
  const template = preexisting ? "hello-world" : ctx.args.type;
58337
60906
  const path3 = (0, import_path9.resolve)(
@@ -58355,12 +60924,16 @@ async function copyExistingWorkerFiles(ctx) {
58355
60924
  if (preexisting) {
58356
60925
  await chooseAccount(ctx);
58357
60926
  if (ctx.args.existingScript === void 0) {
58358
- ctx.args.existingScript = await textInput({
58359
- question: "Please specify the name of the existing worker in this account?",
58360
- renderSubmitted: (value) => `${brandColor("worker")} ${dim(`"${value}"`)}`,
58361
- defaultValue: ctx.project.name,
58362
- acceptDefault: ctx.args.wranglerDefaults
58363
- });
60927
+ ctx.args.existingScript = await processArgument(
60928
+ ctx.args,
60929
+ "existingScript",
60930
+ {
60931
+ type: "text",
60932
+ question: "Please specify the name of the existing worker in this account?",
60933
+ label: "worker",
60934
+ defaultValue: ctx.project.name
60935
+ }
60936
+ );
58364
60937
  }
58365
60938
  const tempdir = await (0, import_promises3.mkdtemp)(
58366
60939
  (0, import_path9.join)((0, import_os.tmpdir)(), "c3-wrangler-init--from-dash-")
@@ -58401,10 +60974,12 @@ async function updateFiles(ctx) {
58401
60974
  packagejson: JSON.parse(await (0, import_promises3.readFile)(paths.packagejson, "utf-8")),
58402
60975
  wranglertoml: await (0, import_promises3.readFile)(paths.wranglertoml, "utf-8")
58403
60976
  };
58404
- contents.packagejson.name = ctx.project.name;
58405
- contents.wranglertoml = contents.wranglertoml.replace(/^name = .+$/m, `name = "${ctx.project.name}"`).replace(
58406
- /^compatibility_date = .+$/m,
58407
- `compatibility_date = "${(/* @__PURE__ */ new Date()).toISOString().substring(0, 10)}"`
60977
+ if (contents.packagejson.name === "<TBD>") {
60978
+ contents.packagejson.name = ctx.project.name;
60979
+ }
60980
+ contents.wranglertoml = contents.wranglertoml.replace(/^name\s*=\s*"<TBD>"/m, `name = "${ctx.project.name}"`).replace(
60981
+ /^compatibility_date\s*=\s*"<TBD>"/m,
60982
+ `compatibility_date = "${await getWorkerdCompatibilityDate()}"`
58408
60983
  );
58409
60984
  await (0, import_promises3.writeFile)(
58410
60985
  paths.packagejson,
@@ -58414,19 +60989,55 @@ async function updateFiles(ctx) {
58414
60989
  }
58415
60990
 
58416
60991
  // src/cli.ts
60992
+ var C3_DEFAULTS = {
60993
+ projectName: new import_haikunator.default().haikunate({ tokenHex: true }),
60994
+ type: "hello-world",
60995
+ framework: "angular",
60996
+ deploy: true,
60997
+ git: true,
60998
+ open: true,
60999
+ ts: true
61000
+ };
61001
+ var WRANGLER_DEFAULTS = {
61002
+ ...C3_DEFAULTS,
61003
+ deploy: false
61004
+ };
58417
61005
  var main = async (argv) => {
58418
- printBanner();
58419
61006
  const args = await parseArgs(argv);
61007
+ printBanner();
61008
+ const projectName = await processArgument(args, "projectName", {
61009
+ type: "text",
61010
+ question: `In which directory do you want to create your application?`,
61011
+ helpText: "also used as application name",
61012
+ defaultValue: C3_DEFAULTS.projectName,
61013
+ label: "dir",
61014
+ validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName),
61015
+ format: (val) => `./${val}`
61016
+ });
61017
+ if (!args.type) {
61018
+ if (args.framework) {
61019
+ args.type = "webFramework";
61020
+ } else if (args.existingScript) {
61021
+ args.type = "pre-existing";
61022
+ }
61023
+ }
61024
+ const templateOptions = Object.entries(templateMap).filter(([_3, { hidden: hidden2 }]) => !hidden2).map(([value, { label }]) => ({ value, label }));
61025
+ const type = await processArgument(args, "type", {
61026
+ type: "select",
61027
+ question: "What type of application do you want to create?",
61028
+ label: "type",
61029
+ options: templateOptions,
61030
+ defaultValue: C3_DEFAULTS.type
61031
+ });
61032
+ if (!type || !Object.keys(templateMap).includes(type)) {
61033
+ return crash("An application type must be specified to continue.");
61034
+ }
58420
61035
  const validatedArgs = {
58421
61036
  ...args,
58422
- projectName: await validateName(args.projectName, {
58423
- acceptDefault: args.wranglerDefaults
58424
- }),
58425
- type: await validateType(args.type, {
58426
- acceptDefault: args.wranglerDefaults
58427
- })
61037
+ type,
61038
+ projectName
58428
61039
  };
58429
- const { handler } = templateMap[validatedArgs.type];
61040
+ const { handler } = templateMap[type];
58430
61041
  await handler(validatedArgs);
58431
61042
  };
58432
61043
  var printBanner = () => {
@@ -58443,41 +61054,17 @@ var parseArgs = async (argv) => {
58443
61054
  }).option("existing-script", {
58444
61055
  type: "string",
58445
61056
  hidden: templateMap["pre-existing"].hidden
58446
- }).option("wrangler-defaults", { type: "boolean", hidden: true }).help().argv;
61057
+ }).option("accept-defaults", {
61058
+ alias: "y",
61059
+ type: "boolean"
61060
+ }).option("wrangler-defaults", { type: "boolean", hidden: true }).version(version).help().argv;
58447
61061
  return {
61062
+ ...args.wranglerDefaults && WRANGLER_DEFAULTS,
61063
+ ...args.acceptDefaults && C3_DEFAULTS,
58448
61064
  projectName: args._[0],
58449
61065
  ...args
58450
61066
  };
58451
61067
  };
58452
- var validateName = async (name, { acceptDefault = false } = {}) => {
58453
- const defaultValue = name ?? new import_haikunator.default().haikunate({ tokenHex: true });
58454
- return textInput({
58455
- question: `Where do you want to create your application?`,
58456
- helpText: "also used as application name",
58457
- renderSubmitted: (value) => {
58458
- return `${brandColor("dir")} ${dim(value)}`;
58459
- },
58460
- defaultValue,
58461
- acceptDefault,
58462
- validate: (value = defaultValue) => validateProjectDirectory(value)
58463
- });
58464
- };
58465
- var validateType = async (type, { acceptDefault = false } = {}) => {
58466
- const templateOptions = Object.entries(templateMap).filter(([_3, { hidden: hidden2 }]) => !hidden2).map(([value, { label }]) => ({ value, label }));
58467
- type = await selectInput({
58468
- question: "What type of application do you want to create?",
58469
- options: templateOptions,
58470
- renderSubmitted: (option) => {
58471
- return `${brandColor("type")} ${dim(option.label)}`;
58472
- },
58473
- defaultValue: type ?? "hello-world",
58474
- acceptDefault
58475
- });
58476
- if (!type || !Object.keys(templateMap).includes(type)) {
58477
- crash("An application type must be specified to continue.");
58478
- }
58479
- return type;
58480
- };
58481
61068
  var templateMap = {
58482
61069
  webFramework: {
58483
61070
  label: "Website or web app",
@@ -58515,7 +61102,9 @@ var templateMap = {
58515
61102
  main(process.argv).catch((e) => crash(e));
58516
61103
  // Annotate the CommonJS export names for ESM import in node:
58517
61104
  0 && (module.exports = {
58518
- main
61105
+ C3_DEFAULTS,
61106
+ main,
61107
+ parseArgs
58519
61108
  });
58520
61109
  /*! Bundled license information:
58521
61110