@sentry/craft 2.13.1 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/craft CHANGED
@@ -61802,7 +61802,7 @@ var require_package = __commonJS({
61802
61802
  "package.json"(exports2, module2) {
61803
61803
  module2.exports = {
61804
61804
  name: "@sentry/craft",
61805
- version: "2.13.1",
61805
+ version: "2.14.0",
61806
61806
  description: "The universal sentry workflow CLI",
61807
61807
  main: "dist/craft",
61808
61808
  repository: "https://github.com/getsentry/craft",
@@ -61968,7 +61968,7 @@ function getPackage() {
61968
61968
  }
61969
61969
  function getPackageVersion() {
61970
61970
  const { version: version2 } = getPackage();
61971
- const buildInfo = "164a26dea1dae5ab562671b7a1822461f358fa96";
61971
+ const buildInfo = "8c1d5d40c99e031f7e2340f71c2c7197d9cfdb31";
61972
61972
  return buildInfo ? `${version2} (${buildInfo})` : version2;
61973
61973
  }
61974
61974
  function semVerToString(s3) {
@@ -70890,7 +70890,7 @@ var require_path_reservations = __commonJS({
70890
70890
  var assert = require("assert");
70891
70891
  var normalize5 = require_normalize_unicode();
70892
70892
  var stripSlashes = require_strip_trailing_slashes();
70893
- var { join: join25 } = require("path");
70893
+ var { join: join26 } = require("path");
70894
70894
  var platform4 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
70895
70895
  var isWindows = platform4 === "win32";
70896
70896
  module2.exports = () => {
@@ -70899,7 +70899,7 @@ var require_path_reservations = __commonJS({
70899
70899
  const getDirs = (path17) => {
70900
70900
  const dirs = path17.split("/").slice(0, -1).reduce((set2, path18) => {
70901
70901
  if (set2.length) {
70902
- path18 = join25(set2[set2.length - 1], path18);
70902
+ path18 = join26(set2[set2.length - 1], path18);
70903
70903
  }
70904
70904
  set2.push(path18 || "/");
70905
70905
  return set2;
@@ -70967,7 +70967,7 @@ var require_path_reservations = __commonJS({
70967
70967
  };
70968
70968
  const reserve = (paths, fn) => {
70969
70969
  paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p3) => {
70970
- return stripSlashes(join25(normalize5(p3))).toLowerCase();
70970
+ return stripSlashes(join26(normalize5(p3))).toLowerCase();
70971
70971
  });
70972
70972
  const dirs = new Set(
70973
70973
  paths.map((path17) => getDirs(path17)).reduce((a3, b3) => a3.concat(b3))
@@ -73591,11 +73591,19 @@ async function spawnProcess(command9, args = [], options = {}, spawnProcessOptio
73591
73591
  const processedArgs = args.map(
73592
73592
  (arg) => replaceEnvVariable(arg, { ...process.env, ...options.env })
73593
73593
  );
73594
- options.stdio = ["inherit", "pipe", "pipe"];
73594
+ options.stdio = [
73595
+ spawnProcessOptions.stdin !== void 0 ? "pipe" : "inherit",
73596
+ "pipe",
73597
+ "pipe"
73598
+ ];
73595
73599
  child = (0, import_child_process2.spawn)(command9, processedArgs, options);
73596
73600
  if (!child.stdout || !child.stderr) {
73597
73601
  throw new Error("Invalid standard output or error for child process");
73598
73602
  }
73603
+ if (spawnProcessOptions.stdin !== void 0 && child.stdin) {
73604
+ child.stdin.write(spawnProcessOptions.stdin);
73605
+ child.stdin.end();
73606
+ }
73599
73607
  child.on("exit", (code) => code === 0 ? succeed() : fail({ code }));
73600
73608
  child.on("error", fail);
73601
73609
  child.stdout.on("data", (chunk) => stdoutChunks.push(chunk));
@@ -113713,7 +113721,7 @@ var require_buffer_list = __commonJS({
113713
113721
  }
113714
113722
  }, {
113715
113723
  key: "join",
113716
- value: function join25(s3) {
113724
+ value: function join26(s3) {
113717
113725
  if (this.length === 0) return "";
113718
113726
  var p3 = this.head;
113719
113727
  var ret = "" + p3.data;
@@ -138982,8 +138990,8 @@ var require_semver2 = __commonJS({
138982
138990
  this.raw = this.version;
138983
138991
  return this;
138984
138992
  };
138985
- exports2.inc = inc;
138986
- function inc(version2, release3, loose, identifier) {
138993
+ exports2.inc = inc2;
138994
+ function inc2(version2, release3, loose, identifier) {
138987
138995
  if (typeof loose === "string") {
138988
138996
  identifier = loose;
138989
138997
  loose = void 0;
@@ -139756,8 +139764,8 @@ var require_make_dir = __commonJS({
139756
139764
  var fs11 = require("fs");
139757
139765
  var path17 = require("path");
139758
139766
  var { promisify: promisify4 } = require("util");
139759
- var semver = require_semver2();
139760
- var useNativeRecursiveOption = semver.satisfies(process.version, ">=10.12.0");
139767
+ var semver2 = require_semver2();
139768
+ var useNativeRecursiveOption = semver2.satisfies(process.version, ">=10.12.0");
139761
139769
  var checkPath = (pth) => {
139762
139770
  if (process.platform === "win32") {
139763
139771
  const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path17.parse(pth).root, ""));
@@ -157354,16 +157362,125 @@ var init_crates = __esm({
157354
157362
  });
157355
157363
 
157356
157364
  // src/targets/docker.ts
157357
- var DEFAULT_DOCKER_BIN, DOCKER_BIN, DockerTarget;
157365
+ function isGoogleCloudRegistry(registry) {
157366
+ if (!registry) return false;
157367
+ return GCR_REGISTRY_PATTERNS.some((pattern) => pattern.test(registry));
157368
+ }
157369
+ function hasGcloudCredentials() {
157370
+ const credPaths = [
157371
+ process.env.GOOGLE_APPLICATION_CREDENTIALS,
157372
+ process.env.GOOGLE_GHA_CREDS_PATH,
157373
+ process.env.CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE
157374
+ ];
157375
+ for (const credPath of credPaths) {
157376
+ if (credPath && (0, import_node_fs5.existsSync)(credPath)) {
157377
+ return true;
157378
+ }
157379
+ }
157380
+ const defaultAdcPath = (0, import_node_path5.join)(
157381
+ (0, import_node_os.homedir)(),
157382
+ ".config",
157383
+ "gcloud",
157384
+ "application_default_credentials.json"
157385
+ );
157386
+ if ((0, import_node_fs5.existsSync)(defaultAdcPath)) {
157387
+ return true;
157388
+ }
157389
+ return false;
157390
+ }
157391
+ async function isGcloudAvailable() {
157392
+ try {
157393
+ await spawnProcess("gcloud", ["--version"], {}, {});
157394
+ return true;
157395
+ } catch {
157396
+ return false;
157397
+ }
157398
+ }
157399
+ function extractRegistry(imagePath) {
157400
+ const parts = imagePath.split("/");
157401
+ if (parts.length >= 2 && (parts[0].includes(".") || parts[0].includes(":"))) {
157402
+ const registry = parts[0];
157403
+ if (DOCKER_HUB_REGISTRIES.includes(registry)) {
157404
+ return void 0;
157405
+ }
157406
+ return registry;
157407
+ }
157408
+ return void 0;
157409
+ }
157410
+ function registryToEnvPrefix(registry) {
157411
+ return registry.toUpperCase().replace(/[.\-:]/g, "_");
157412
+ }
157413
+ function normalizeImageRef(config3, type2) {
157414
+ const ref = config3[type2];
157415
+ if (ref === void 0 || ref === null) {
157416
+ throw new ConfigurationError(
157417
+ `Docker target requires a '${type2}' property. Please specify the ${type2} image.`
157418
+ );
157419
+ }
157420
+ const keys = LEGACY_KEYS[type2];
157421
+ const legacyFormat = config3[keys.format];
157422
+ const legacyRegistry = config3[keys.registry];
157423
+ const legacyUsernameVar = config3[keys.usernameVar];
157424
+ const legacyPasswordVar = config3[keys.passwordVar];
157425
+ const legacySkipLogin = config3[keys.skipLogin];
157426
+ if (typeof ref === "string") {
157427
+ return {
157428
+ image: ref,
157429
+ format: legacyFormat,
157430
+ registry: legacyRegistry,
157431
+ usernameVar: legacyUsernameVar,
157432
+ passwordVar: legacyPasswordVar,
157433
+ skipLogin: legacySkipLogin
157434
+ };
157435
+ }
157436
+ return {
157437
+ image: ref.image,
157438
+ format: ref.format ?? legacyFormat,
157439
+ registry: ref.registry ?? legacyRegistry,
157440
+ usernameVar: ref.usernameVar ?? legacyUsernameVar,
157441
+ passwordVar: ref.passwordVar ?? legacyPasswordVar,
157442
+ skipLogin: ref.skipLogin ?? legacySkipLogin
157443
+ };
157444
+ }
157445
+ var import_node_fs5, import_node_os, import_node_path5, DEFAULT_DOCKER_BIN, DOCKER_BIN, DOCKER_HUB_REGISTRIES, GCR_REGISTRY_PATTERNS, LEGACY_KEYS, DockerTarget;
157358
157446
  var init_docker = __esm({
157359
157447
  "src/targets/docker.ts"() {
157360
157448
  init_import_meta_url();
157449
+ import_node_fs5 = require("node:fs");
157450
+ import_node_os = require("node:os");
157451
+ import_node_path5 = require("node:path");
157361
157452
  init_errors2();
157362
157453
  init_strings();
157363
157454
  init_system();
157364
157455
  init_base5();
157365
157456
  DEFAULT_DOCKER_BIN = "docker";
157366
157457
  DOCKER_BIN = process.env.DOCKER_BIN || DEFAULT_DOCKER_BIN;
157458
+ DOCKER_HUB_REGISTRIES = ["docker.io", "index.docker.io", "registry-1.docker.io"];
157459
+ GCR_REGISTRY_PATTERNS = [
157460
+ /^gcr\.io$/,
157461
+ /^[a-z]+-gcr\.io$/,
157462
+ // us-gcr.io, eu-gcr.io, asia-gcr.io, etc.
157463
+ /^[a-z]+\.gcr\.io$/,
157464
+ // us.gcr.io, eu.gcr.io, asia.gcr.io, etc.
157465
+ /^[a-z][a-z0-9-]*-docker\.pkg\.dev$/
157466
+ // us-docker.pkg.dev, us-west1-docker.pkg.dev, europe-west1-docker.pkg.dev, etc.
157467
+ ];
157468
+ LEGACY_KEYS = {
157469
+ source: {
157470
+ format: "sourceFormat",
157471
+ registry: "sourceRegistry",
157472
+ usernameVar: "sourceUsernameVar",
157473
+ passwordVar: "sourcePasswordVar",
157474
+ skipLogin: "sourceSkipLogin"
157475
+ },
157476
+ target: {
157477
+ format: "targetFormat",
157478
+ registry: "registry",
157479
+ usernameVar: "usernameVar",
157480
+ passwordVar: "passwordVar",
157481
+ skipLogin: "skipLogin"
157482
+ }
157483
+ };
157367
157484
  DockerTarget = class extends BaseTarget {
157368
157485
  /** Target name */
157369
157486
  name = "docker";
@@ -157375,39 +157492,221 @@ var init_docker = __esm({
157375
157492
  checkExecutableIsPresent(DOCKER_BIN);
157376
157493
  }
157377
157494
  /**
157378
- * Extracts Docker target options from the environment
157495
+ * Resolves credentials for a registry.
157496
+ *
157497
+ * Credential resolution follows two modes:
157498
+ *
157499
+ * Mode A (explicit env vars): If usernameVar and passwordVar are provided,
157500
+ * only those env vars are used. Throws if either is missing.
157501
+ *
157502
+ * Mode B (automatic resolution): Tries in order:
157503
+ * 1. Registry-derived env vars: DOCKER_<REGISTRY>_USERNAME / DOCKER_<REGISTRY>_PASSWORD
157504
+ * 2. Built-in defaults for known registries (GHCR: GITHUB_ACTOR / GITHUB_TOKEN)
157505
+ * 3. Default: DOCKER_USERNAME / DOCKER_PASSWORD (only if useDefaultFallback is true)
157506
+ *
157507
+ * @param registry The registry host (e.g., "ghcr.io"), undefined for Docker Hub
157508
+ * @param usernameVar Optional explicit env var name for username
157509
+ * @param passwordVar Optional explicit env var name for password
157510
+ * @param required Whether credentials are required (throws if missing)
157511
+ * @param useDefaultFallback Whether to fall back to DOCKER_USERNAME/PASSWORD defaults
157512
+ * @returns Credentials if found, undefined if not required and not found
157513
+ */
157514
+ resolveCredentials(registry, usernameVar, passwordVar, required = true, useDefaultFallback = true) {
157515
+ let username;
157516
+ let password;
157517
+ if (usernameVar || passwordVar) {
157518
+ if (!usernameVar || !passwordVar) {
157519
+ throw new ConfigurationError(
157520
+ "Both usernameVar and passwordVar must be specified together"
157521
+ );
157522
+ }
157523
+ username = process.env[usernameVar];
157524
+ password = process.env[passwordVar];
157525
+ if (!username || !password) {
157526
+ if (required) {
157527
+ throw new ConfigurationError(
157528
+ `Missing credentials: ${usernameVar} and/or ${passwordVar} environment variable(s) not set`
157529
+ );
157530
+ }
157531
+ return void 0;
157532
+ }
157533
+ } else {
157534
+ if (registry) {
157535
+ const prefix = `DOCKER_${registryToEnvPrefix(registry)}_`;
157536
+ username = process.env[`${prefix}USERNAME`];
157537
+ password = process.env[`${prefix}PASSWORD`];
157538
+ }
157539
+ if (!username || !password) {
157540
+ if (registry === "ghcr.io") {
157541
+ username = username ?? process.env.GITHUB_ACTOR;
157542
+ password = password ?? process.env.GITHUB_TOKEN;
157543
+ }
157544
+ }
157545
+ if (useDefaultFallback) {
157546
+ username = username ?? process.env.DOCKER_USERNAME;
157547
+ password = password ?? process.env.DOCKER_PASSWORD;
157548
+ }
157549
+ }
157550
+ if (!username || !password) {
157551
+ if (required) {
157552
+ const registryHint = registry ? `DOCKER_${registryToEnvPrefix(registry)}_USERNAME/PASSWORD or ` : "";
157553
+ throw new ConfigurationError(
157554
+ `Cannot perform Docker release: missing credentials.
157555
+ Please use ${registryHint}DOCKER_USERNAME and DOCKER_PASSWORD environment variables.`.replace(
157556
+ /^\s+/gm,
157557
+ ""
157558
+ )
157559
+ );
157560
+ }
157561
+ return void 0;
157562
+ }
157563
+ return { username, password, registry };
157564
+ }
157565
+ /**
157566
+ * Extracts Docker target options from the environment.
157567
+ *
157568
+ * Supports both new nested config format and legacy flat format:
157569
+ *
157570
+ * New format:
157571
+ * source: { image: "ghcr.io/org/image", registry: "ghcr.io", usernameVar: "X" }
157572
+ * target: "getsentry/craft" # string shorthand
157573
+ *
157574
+ * Legacy format:
157575
+ * source: "ghcr.io/org/image"
157576
+ * sourceRegistry: "ghcr.io"
157577
+ * sourceUsernameVar: "X"
157379
157578
  */
157380
157579
  getDockerConfig() {
157381
- if (!process.env.DOCKER_USERNAME || !process.env.DOCKER_PASSWORD) {
157382
- throw new ConfigurationError(
157383
- `Cannot perform Docker release: missing credentials.
157384
- Please use DOCKER_USERNAME and DOCKER_PASSWORD environment variables.`.replace(
157385
- /^\s+/gm,
157386
- ""
157387
- )
157580
+ const source = normalizeImageRef(this.config, "source");
157581
+ const target = normalizeImageRef(this.config, "target");
157582
+ const targetRegistry = target.registry ?? extractRegistry(target.image);
157583
+ const sourceRegistry = source.registry ?? extractRegistry(source.image);
157584
+ let targetCredentials;
157585
+ if (!target.skipLogin) {
157586
+ const isGcrTarget = isGoogleCloudRegistry(targetRegistry);
157587
+ targetCredentials = this.resolveCredentials(
157588
+ targetRegistry,
157589
+ target.usernameVar,
157590
+ target.passwordVar,
157591
+ // Required unless it's a GCR registry (which can use gcloud auth)
157592
+ !isGcrTarget
157593
+ );
157594
+ }
157595
+ let sourceCredentials;
157596
+ if (!source.skipLogin && sourceRegistry !== targetRegistry) {
157597
+ sourceCredentials = this.resolveCredentials(
157598
+ sourceRegistry,
157599
+ source.usernameVar,
157600
+ source.passwordVar,
157601
+ // Only required if explicit source env vars are specified
157602
+ !!(source.usernameVar || source.passwordVar),
157603
+ // Don't fall back to DOCKER_USERNAME/PASSWORD for source
157604
+ false
157388
157605
  );
157389
157606
  }
157390
157607
  return {
157391
- password: process.env.DOCKER_PASSWORD,
157392
- source: this.config.source,
157393
- target: this.config.target,
157394
- sourceTemplate: this.config.sourceFormat || "{{{source}}}:{{{revision}}}",
157395
- targetTemplate: this.config.targetFormat || "{{{target}}}:{{{version}}}",
157396
- username: process.env.DOCKER_USERNAME
157608
+ source: {
157609
+ ...source,
157610
+ format: source.format || "{{{source}}}:{{{revision}}}",
157611
+ credentials: sourceCredentials
157612
+ },
157613
+ target: {
157614
+ ...target,
157615
+ format: target.format || "{{{target}}}:{{{version}}}",
157616
+ credentials: targetCredentials
157617
+ }
157397
157618
  };
157398
157619
  }
157399
157620
  /**
157400
- * Logs into docker client with the provided username and password in config
157621
+ * Logs into a Docker registry with the provided credentials.
157401
157622
  *
157402
157623
  * NOTE: This may change the globally logged in Docker user on the system
157624
+ *
157625
+ * @param credentials The registry credentials to use
157626
+ */
157627
+ async loginToRegistry(credentials) {
157628
+ const { username, password, registry } = credentials;
157629
+ const args = ["login", `--username=${username}`, "--password-stdin"];
157630
+ if (registry) {
157631
+ args.push(registry);
157632
+ }
157633
+ const registryName = registry || "Docker Hub";
157634
+ this.logger.debug(`Logging into ${registryName}...`);
157635
+ await spawnProcess(DOCKER_BIN, args, {}, { stdin: password });
157636
+ }
157637
+ /**
157638
+ * Configures Docker to use gcloud for authentication to Google Cloud registries.
157639
+ * This runs `gcloud auth configure-docker` which sets up the credential helper.
157640
+ *
157641
+ * @param registries List of Google Cloud registries to configure
157642
+ * @returns true if configuration was successful, false otherwise
157643
+ */
157644
+ async configureGcloudDocker(registries) {
157645
+ if (registries.length === 0) {
157646
+ return false;
157647
+ }
157648
+ if (!hasGcloudCredentials()) {
157649
+ this.logger.debug("No gcloud credentials detected, skipping gcloud auth configure-docker");
157650
+ return false;
157651
+ }
157652
+ if (!await isGcloudAvailable()) {
157653
+ this.logger.debug("gcloud CLI not available, skipping gcloud auth configure-docker");
157654
+ return false;
157655
+ }
157656
+ const registryList = registries.join(",");
157657
+ this.logger.debug(`Configuring Docker for Google Cloud registries: ${registryList}`);
157658
+ try {
157659
+ await spawnProcess("gcloud", ["auth", "configure-docker", registryList, "--quiet"], {}, {});
157660
+ this.logger.info(`Configured Docker authentication for: ${registryList}`);
157661
+ return true;
157662
+ } catch (error3) {
157663
+ this.logger.warn(`Failed to configure gcloud Docker auth: ${error3}`);
157664
+ return false;
157665
+ }
157666
+ }
157667
+ /**
157668
+ * Logs into all required Docker registries (source and target).
157669
+ *
157670
+ * For Google Cloud registries (gcr.io, *.pkg.dev), automatically uses
157671
+ * `gcloud auth configure-docker` if gcloud credentials are available.
157672
+ *
157673
+ * If the source registry differs from target and has credentials configured,
157674
+ * logs into both. Otherwise, only logs into the target registry.
157403
157675
  */
157404
157676
  async login() {
157405
- const { username, password } = this.dockerConfig;
157406
- return spawnProcess(DOCKER_BIN, [
157407
- "login",
157408
- `--username=${username}`,
157409
- `--password=${password}`
157410
- ]);
157677
+ const { source, target } = this.dockerConfig;
157678
+ const sourceRegistry = source.registry ?? extractRegistry(source.image);
157679
+ const targetRegistry = target.registry ?? extractRegistry(target.image);
157680
+ const gcrRegistries = [];
157681
+ const gcrConfiguredRegistries = /* @__PURE__ */ new Set();
157682
+ if (!source.skipLogin && !source.credentials && sourceRegistry && isGoogleCloudRegistry(sourceRegistry)) {
157683
+ gcrRegistries.push(sourceRegistry);
157684
+ }
157685
+ if (!target.skipLogin && !target.credentials && targetRegistry && isGoogleCloudRegistry(targetRegistry)) {
157686
+ if (!gcrRegistries.includes(targetRegistry)) {
157687
+ gcrRegistries.push(targetRegistry);
157688
+ }
157689
+ }
157690
+ if (gcrRegistries.length > 0) {
157691
+ const configured = await this.configureGcloudDocker(gcrRegistries);
157692
+ if (configured) {
157693
+ gcrRegistries.forEach((r3) => gcrConfiguredRegistries.add(r3));
157694
+ }
157695
+ }
157696
+ if (source.credentials) {
157697
+ await this.loginToRegistry(source.credentials);
157698
+ } else if (sourceRegistry && !source.skipLogin && !gcrConfiguredRegistries.has(sourceRegistry)) {
157699
+ this.logger.debug(`No credentials for source registry ${sourceRegistry}, assuming public`);
157700
+ }
157701
+ if (target.credentials) {
157702
+ await this.loginToRegistry(target.credentials);
157703
+ } else if (!target.skipLogin && !gcrConfiguredRegistries.has(targetRegistry || "")) {
157704
+ if (targetRegistry) {
157705
+ this.logger.warn(
157706
+ `No credentials for target registry ${targetRegistry}. Push may fail.`
157707
+ );
157708
+ }
157709
+ }
157411
157710
  }
157412
157711
  /**
157413
157712
  * Copies an existing local or remote docker image to a new destination.
@@ -157418,12 +157717,15 @@ var init_docker = __esm({
157418
157717
  * @param version The release version for the target image
157419
157718
  */
157420
157719
  async copy(sourceRevision, version2) {
157421
- const sourceImage = renderTemplateSafe(this.dockerConfig.sourceTemplate, {
157422
- ...this.dockerConfig,
157720
+ const { source, target } = this.dockerConfig;
157721
+ const sourceImage = renderTemplateSafe(source.format, {
157722
+ source: source.image,
157723
+ target: target.image,
157423
157724
  revision: sourceRevision
157424
157725
  });
157425
- const targetImage = renderTemplateSafe(this.dockerConfig.targetTemplate, {
157426
- ...this.dockerConfig,
157726
+ const targetImage = renderTemplateSafe(target.format, {
157727
+ source: source.image,
157728
+ target: target.image,
157427
157729
  version: version2
157428
157730
  });
157429
157731
  this.logger.debug(`Copying image from ${sourceImage} to ${targetImage}...`);
@@ -157435,7 +157737,7 @@ var init_docker = __esm({
157435
157737
  );
157436
157738
  }
157437
157739
  /**
157438
- * Pushes a source image to Docker Hub
157740
+ * Publishes a source image to the target registry
157439
157741
  *
157440
157742
  * @param version The new version
157441
157743
  * @param revision The SHA revision of the new version
@@ -157935,6 +158237,9 @@ var init_git = __esm({
157935
158237
  });
157936
158238
 
157937
158239
  // src/utils/changelog.ts
158240
+ function isBumpType(value) {
158241
+ return BUMP_TYPES.has(value);
158242
+ }
157938
158243
  function escapeMarkdownPound(text) {
157939
158244
  return text.replace(/#/g, "&#35;");
157940
158245
  }
@@ -158092,6 +158397,7 @@ function normalizeReleaseConfig(config3) {
158092
158397
  return null;
158093
158398
  }
158094
158399
  }).filter((r3) => r3 !== null),
158400
+ semver: category.semver,
158095
158401
  exclude: {
158096
158402
  labels: /* @__PURE__ */ new Set(),
158097
158403
  authors: /* @__PURE__ */ new Set()
@@ -158143,7 +158449,7 @@ function isCategoryExcluded(category, labels, author) {
158143
158449
  }
158144
158450
  return false;
158145
158451
  }
158146
- function matchPRToCategory(labels, author, title, config3) {
158452
+ function matchCommitToCategory(labels, author, title, config3) {
158147
158453
  if (!config3?.changelog || config3.changelog.categories.length === 0) {
158148
158454
  return null;
158149
158455
  }
@@ -158163,7 +158469,7 @@ function matchPRToCategory(labels, author, title, config3) {
158163
158469
  for (const category of regularCategories) {
158164
158470
  const matchesCategory = category.labels.some((label) => labels.has(label));
158165
158471
  if (matchesCategory && !isCategoryExcluded(category, labels, author)) {
158166
- return category.title;
158472
+ return category;
158167
158473
  }
158168
158474
  }
158169
158475
  }
@@ -158172,14 +158478,14 @@ function matchPRToCategory(labels, author, title, config3) {
158172
158478
  (re2) => re2.test(title)
158173
158479
  );
158174
158480
  if (matchesPattern && !isCategoryExcluded(category, labels, author)) {
158175
- return category.title;
158481
+ return category;
158176
158482
  }
158177
158483
  }
158178
158484
  if (wildcardCategory) {
158179
158485
  if (isCategoryExcluded(wildcardCategory, labels, author)) {
158180
158486
  return null;
158181
158487
  }
158182
- return wildcardCategory.title;
158488
+ return wildcardCategory;
158183
158489
  }
158184
158490
  return null;
158185
158491
  }
@@ -158218,7 +158524,20 @@ function formatChangelogEntry(entry) {
158218
158524
  }
158219
158525
  return text;
158220
158526
  }
158527
+ function getChangesetCacheKey(rev, maxLeftovers) {
158528
+ return `${rev}:${maxLeftovers}`;
158529
+ }
158221
158530
  async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS) {
158531
+ const cacheKey = getChangesetCacheKey(rev, maxLeftovers);
158532
+ const cached = changesetCache.get(cacheKey);
158533
+ if (cached) {
158534
+ return cached;
158535
+ }
158536
+ const promise = generateChangesetFromGitImpl(git, rev, maxLeftovers);
158537
+ changesetCache.set(cacheKey, promise);
158538
+ return promise;
158539
+ }
158540
+ async function generateChangesetFromGitImpl(git, rev, maxLeftovers) {
158222
158541
  const rawConfig = readReleaseConfig();
158223
158542
  const releaseConfig = normalizeReleaseConfig(rawConfig);
158224
158543
  const gitCommits = (await getChangesSince(git, rev)).filter(
@@ -158231,6 +158550,8 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS)
158231
158550
  const commits = {};
158232
158551
  const leftovers = [];
158233
158552
  const missing = [];
158553
+ let bumpPriority = null;
158554
+ let matchedCommitsWithSemver = 0;
158234
158555
  for (const gitCommit of gitCommits) {
158235
158556
  const hash = gitCommit.hash;
158236
158557
  const githubCommit = githubCommits[hash];
@@ -158244,12 +158565,20 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS)
158244
158565
  continue;
158245
158566
  }
158246
158567
  const titleForMatching = githubCommit?.prTitle ?? gitCommit.title;
158247
- const categoryTitle = matchPRToCategory(
158568
+ const matchedCategory = matchCommitToCategory(
158248
158569
  labels,
158249
158570
  author,
158250
158571
  titleForMatching,
158251
158572
  releaseConfig
158252
158573
  );
158574
+ const categoryTitle = matchedCategory?.title ?? null;
158575
+ if (matchedCategory?.semver) {
158576
+ const priority = BUMP_TYPES.get(matchedCategory.semver);
158577
+ if (priority !== void 0) {
158578
+ matchedCommitsWithSemver++;
158579
+ bumpPriority = Math.min(bumpPriority ?? priority, priority);
158580
+ }
158581
+ }
158253
158582
  const commit = {
158254
158583
  author,
158255
158584
  hash,
@@ -158298,6 +158627,15 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS)
158298
158627
  }
158299
158628
  }
158300
158629
  }
158630
+ let bumpType = null;
158631
+ if (bumpPriority !== null) {
158632
+ for (const [type2, priority] of BUMP_TYPES) {
158633
+ if (priority === bumpPriority) {
158634
+ bumpType = type2;
158635
+ break;
158636
+ }
158637
+ }
158638
+ }
158301
158639
  if (missing.length > 0) {
158302
158640
  logger.warn(
158303
158641
  "The following commits were not found on GitHub:",
@@ -158336,11 +158674,16 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS)
158336
158674
  if (scopeB === null) return -1;
158337
158675
  return scopeA.localeCompare(scopeB);
158338
158676
  });
158677
+ const hasScopeHeaders = [...category.scopeGroups.entries()].some(
158678
+ ([s3, entries]) => s3 !== null && entries.length > 1
158679
+ );
158339
158680
  for (const [scope, prs] of sortedScopes) {
158340
158681
  if (scopeGroupingEnabled && scope !== null && prs.length > 1) {
158341
158682
  changelogSections.push(
158342
158683
  markdownHeader(SCOPE_HEADER_LEVEL, formatScopeTitle(scope))
158343
158684
  );
158685
+ } else if (scopeGroupingEnabled && scope === null && hasScopeHeaders) {
158686
+ changelogSections.push(markdownHeader(SCOPE_HEADER_LEVEL, "Other"));
158344
158687
  }
158345
158688
  const prEntries = prs.map(
158346
158689
  (pr) => formatChangelogEntry({
@@ -158377,7 +158720,12 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS)
158377
158720
  changelogSections.push(`_Plus ${nLeftovers - maxLeftovers} more_`);
158378
158721
  }
158379
158722
  }
158380
- return changelogSections.join("\n\n");
158723
+ return {
158724
+ changelog: changelogSections.join("\n\n"),
158725
+ bumpType,
158726
+ totalCommits: gitCommits.length,
158727
+ matchedCommitsWithSemver
158728
+ };
158381
158729
  }
158382
158730
  async function getPRAndLabelsFromCommit(hashes) {
158383
158731
  if (hashes.length === 0) {
@@ -158448,7 +158796,7 @@ async function getPRAndLabelsFromCommit(hashes) {
158448
158796
  })
158449
158797
  );
158450
158798
  }
158451
- var import_fs4, import_path7, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, BODY_IN_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, SHORT_SHA_LENGTH;
158799
+ var import_fs4, import_path7, BUMP_TYPES, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, BODY_IN_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, SHORT_SHA_LENGTH, changesetCache;
158452
158800
  var init_changelog = __esm({
158453
158801
  "src/utils/changelog.ts"() {
158454
158802
  init_import_meta_url();
@@ -158460,6 +158808,11 @@ var init_changelog = __esm({
158460
158808
  init_git();
158461
158809
  init_githubApi();
158462
158810
  init_version4();
158811
+ BUMP_TYPES = /* @__PURE__ */ new Map([
158812
+ ["major", 0],
158813
+ ["minor", 1],
158814
+ ["patch", 2]
158815
+ ]);
158463
158816
  DEFAULT_CHANGELOG_PATH = "CHANGELOG.md";
158464
158817
  DEFAULT_UNRELEASED_TITLE = "Unreleased";
158465
158818
  SKIP_CHANGELOG_MAGIC_WORD = "#skip-changelog";
@@ -158475,31 +158828,40 @@ var init_changelog = __esm({
158475
158828
  }
158476
158829
  DEFAULT_RELEASE_CONFIG = {
158477
158830
  changelog: {
158831
+ exclude: {
158832
+ labels: ["skip-changelog"]
158833
+ },
158478
158834
  categories: [
158479
158835
  {
158480
158836
  title: "Breaking Changes \u{1F6E0}",
158481
- commit_patterns: ["^\\w+(?:\\([^)]+\\))?!:"]
158837
+ commit_patterns: ["^\\w+(?:\\([^)]+\\))?!:"],
158838
+ semver: "major"
158482
158839
  },
158483
158840
  {
158484
158841
  title: "New Features \u2728",
158485
- commit_patterns: ["^feat\\b"]
158842
+ commit_patterns: ["^feat\\b"],
158843
+ semver: "minor"
158486
158844
  },
158487
158845
  {
158488
158846
  title: "Bug Fixes \u{1F41B}",
158489
- commit_patterns: ["^fix\\b"]
158847
+ commit_patterns: ["^fix\\b"],
158848
+ semver: "patch"
158490
158849
  },
158491
158850
  {
158492
158851
  title: "Documentation \u{1F4DA}",
158493
- commit_patterns: ["^docs?\\b"]
158852
+ commit_patterns: ["^docs?\\b"],
158853
+ semver: "patch"
158494
158854
  },
158495
158855
  {
158496
158856
  title: "Build / dependencies / internal \u{1F527}",
158497
- commit_patterns: ["^(?:build|refactor|meta|chore|ci)\\b"]
158857
+ commit_patterns: ["^(?:build|refactor|meta|chore|ci)\\b"],
158858
+ semver: "patch"
158498
158859
  }
158499
158860
  ]
158500
158861
  }
158501
158862
  };
158502
158863
  SHORT_SHA_LENGTH = 8;
158864
+ changesetCache = /* @__PURE__ */ new Map();
158503
158865
  }
158504
158866
  });
158505
158867
 
@@ -162735,12 +163097,12 @@ var init_esm13 = __esm({
162735
163097
  });
162736
163098
 
162737
163099
  // node_modules/path-scurry/dist/esm/index.js
162738
- var import_node_path5, import_node_url, import_fs6, actualFS, import_promises, realpathSync, defaultFS, fsFromOption, uncDriveRegexp, uncToDrive, eitherSep, UNKNOWN, IFIFO, IFCHR, IFDIR, IFBLK, IFREG, IFLNK, IFSOCK, IFMT, IFMT_UNKNOWN, READDIR_CALLED, LSTAT_CALLED, ENOTDIR, ENOENT, ENOREADLINK, ENOREALPATH, ENOCHILD, TYPEMASK, entToType, normalizeCache, normalize4, normalizeNocaseCache, normalizeNocase, ResolveCache, ChildrenCache, setAsCwd, PathBase, PathWin32, PathPosix, PathScurryBase, PathScurryWin32, PathScurryPosix, PathScurryDarwin, Path, PathScurry;
163100
+ var import_node_path6, import_node_url, import_fs6, actualFS, import_promises, realpathSync, defaultFS, fsFromOption, uncDriveRegexp, uncToDrive, eitherSep, UNKNOWN, IFIFO, IFCHR, IFDIR, IFBLK, IFREG, IFLNK, IFSOCK, IFMT, IFMT_UNKNOWN, READDIR_CALLED, LSTAT_CALLED, ENOTDIR, ENOENT, ENOREADLINK, ENOREALPATH, ENOCHILD, TYPEMASK, entToType, normalizeCache, normalize4, normalizeNocaseCache, normalizeNocase, ResolveCache, ChildrenCache, setAsCwd, PathBase, PathWin32, PathPosix, PathScurryBase, PathScurryWin32, PathScurryPosix, PathScurryDarwin, Path, PathScurry;
162739
163101
  var init_esm14 = __esm({
162740
163102
  "node_modules/path-scurry/dist/esm/index.js"() {
162741
163103
  init_import_meta_url();
162742
163104
  init_esm12();
162743
- import_node_path5 = require("node:path");
163105
+ import_node_path6 = require("node:path");
162744
163106
  import_node_url = require("node:url");
162745
163107
  import_fs6 = require("fs");
162746
163108
  actualFS = __toESM(require("node:fs"), 1);
@@ -163770,7 +164132,7 @@ var init_esm14 = __esm({
163770
164132
  * @internal
163771
164133
  */
163772
164134
  getRootString(path17) {
163773
- return import_node_path5.win32.parse(path17).root;
164135
+ return import_node_path6.win32.parse(path17).root;
163774
164136
  }
163775
164137
  /**
163776
164138
  * @internal
@@ -164410,7 +164772,7 @@ var init_esm14 = __esm({
164410
164772
  sep = "\\";
164411
164773
  constructor(cwd = process.cwd(), opts = {}) {
164412
164774
  const { nocase = true } = opts;
164413
- super(cwd, import_node_path5.win32, "\\", { ...opts, nocase });
164775
+ super(cwd, import_node_path6.win32, "\\", { ...opts, nocase });
164414
164776
  this.nocase = nocase;
164415
164777
  for (let p3 = this.cwd; p3; p3 = p3.parent) {
164416
164778
  p3.nocase = this.nocase;
@@ -164420,7 +164782,7 @@ var init_esm14 = __esm({
164420
164782
  * @internal
164421
164783
  */
164422
164784
  parseRootPath(dir) {
164423
- return import_node_path5.win32.parse(dir).root.toUpperCase();
164785
+ return import_node_path6.win32.parse(dir).root.toUpperCase();
164424
164786
  }
164425
164787
  /**
164426
164788
  * @internal
@@ -164442,7 +164804,7 @@ var init_esm14 = __esm({
164442
164804
  sep = "/";
164443
164805
  constructor(cwd = process.cwd(), opts = {}) {
164444
164806
  const { nocase = false } = opts;
164445
- super(cwd, import_node_path5.posix, "/", { ...opts, nocase });
164807
+ super(cwd, import_node_path6.posix, "/", { ...opts, nocase });
164446
164808
  this.nocase = nocase;
164447
164809
  }
164448
164810
  /**
@@ -197345,6 +197707,19 @@ function checkMinimalConfigVersion(config3) {
197345
197707
  );
197346
197708
  }
197347
197709
  }
197710
+ function requiresMinVersion(requiredVersion) {
197711
+ const config3 = getConfiguration();
197712
+ const minVersionRaw = config3.minVersion;
197713
+ if (!minVersionRaw) {
197714
+ return false;
197715
+ }
197716
+ const configuredMinVersion = parseVersion(minVersionRaw);
197717
+ const required = parseVersion(requiredVersion);
197718
+ if (!configuredMinVersion || !required) {
197719
+ return false;
197720
+ }
197721
+ return versionGreaterOrEqualThan(configuredMinVersion, required);
197722
+ }
197348
197723
  async function getGlobalGitHubConfig(clearCache = false) {
197349
197724
  if (!clearCache && _globalGitHubConfigCache !== void 0) {
197350
197725
  if (_globalGitHubConfigCache === null) {
@@ -197779,6 +198154,1981 @@ var require_shell_quote = __commonJS({
197779
198154
  }
197780
198155
  });
197781
198156
 
198157
+ // node_modules/semver/internal/constants.js
198158
+ var require_constants3 = __commonJS({
198159
+ "node_modules/semver/internal/constants.js"(exports2, module2) {
198160
+ "use strict";
198161
+ init_import_meta_url();
198162
+ var SEMVER_SPEC_VERSION = "2.0.0";
198163
+ var MAX_LENGTH = 256;
198164
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
198165
+ 9007199254740991;
198166
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
198167
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
198168
+ var RELEASE_TYPES = [
198169
+ "major",
198170
+ "premajor",
198171
+ "minor",
198172
+ "preminor",
198173
+ "patch",
198174
+ "prepatch",
198175
+ "prerelease"
198176
+ ];
198177
+ module2.exports = {
198178
+ MAX_LENGTH,
198179
+ MAX_SAFE_COMPONENT_LENGTH,
198180
+ MAX_SAFE_BUILD_LENGTH,
198181
+ MAX_SAFE_INTEGER,
198182
+ RELEASE_TYPES,
198183
+ SEMVER_SPEC_VERSION,
198184
+ FLAG_INCLUDE_PRERELEASE: 1,
198185
+ FLAG_LOOSE: 2
198186
+ };
198187
+ }
198188
+ });
198189
+
198190
+ // node_modules/semver/internal/debug.js
198191
+ var require_debug = __commonJS({
198192
+ "node_modules/semver/internal/debug.js"(exports2, module2) {
198193
+ "use strict";
198194
+ init_import_meta_url();
198195
+ var debug3 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
198196
+ };
198197
+ module2.exports = debug3;
198198
+ }
198199
+ });
198200
+
198201
+ // node_modules/semver/internal/re.js
198202
+ var require_re = __commonJS({
198203
+ "node_modules/semver/internal/re.js"(exports2, module2) {
198204
+ "use strict";
198205
+ init_import_meta_url();
198206
+ var {
198207
+ MAX_SAFE_COMPONENT_LENGTH,
198208
+ MAX_SAFE_BUILD_LENGTH,
198209
+ MAX_LENGTH
198210
+ } = require_constants3();
198211
+ var debug3 = require_debug();
198212
+ exports2 = module2.exports = {};
198213
+ var re2 = exports2.re = [];
198214
+ var safeRe = exports2.safeRe = [];
198215
+ var src = exports2.src = [];
198216
+ var safeSrc = exports2.safeSrc = [];
198217
+ var t3 = exports2.t = {};
198218
+ var R = 0;
198219
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
198220
+ var safeRegexReplacements = [
198221
+ ["\\s", 1],
198222
+ ["\\d", MAX_LENGTH],
198223
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
198224
+ ];
198225
+ var makeSafeRegex = (value) => {
198226
+ for (const [token, max] of safeRegexReplacements) {
198227
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
198228
+ }
198229
+ return value;
198230
+ };
198231
+ var createToken = (name, value, isGlobal) => {
198232
+ const safe = makeSafeRegex(value);
198233
+ const index = R++;
198234
+ debug3(name, index, value);
198235
+ t3[name] = index;
198236
+ src[index] = value;
198237
+ safeSrc[index] = safe;
198238
+ re2[index] = new RegExp(value, isGlobal ? "g" : void 0);
198239
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
198240
+ };
198241
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
198242
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
198243
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
198244
+ createToken("MAINVERSION", `(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})\\.(${src[t3.NUMERICIDENTIFIER]})`);
198245
+ createToken("MAINVERSIONLOOSE", `(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})\\.(${src[t3.NUMERICIDENTIFIERLOOSE]})`);
198246
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t3.NONNUMERICIDENTIFIER]}|${src[t3.NUMERICIDENTIFIER]})`);
198247
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t3.NONNUMERICIDENTIFIER]}|${src[t3.NUMERICIDENTIFIERLOOSE]})`);
198248
+ createToken("PRERELEASE", `(?:-(${src[t3.PRERELEASEIDENTIFIER]}(?:\\.${src[t3.PRERELEASEIDENTIFIER]})*))`);
198249
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t3.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t3.PRERELEASEIDENTIFIERLOOSE]})*))`);
198250
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
198251
+ createToken("BUILD", `(?:\\+(${src[t3.BUILDIDENTIFIER]}(?:\\.${src[t3.BUILDIDENTIFIER]})*))`);
198252
+ createToken("FULLPLAIN", `v?${src[t3.MAINVERSION]}${src[t3.PRERELEASE]}?${src[t3.BUILD]}?`);
198253
+ createToken("FULL", `^${src[t3.FULLPLAIN]}$`);
198254
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t3.MAINVERSIONLOOSE]}${src[t3.PRERELEASELOOSE]}?${src[t3.BUILD]}?`);
198255
+ createToken("LOOSE", `^${src[t3.LOOSEPLAIN]}$`);
198256
+ createToken("GTLT", "((?:<|>)?=?)");
198257
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t3.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
198258
+ createToken("XRANGEIDENTIFIER", `${src[t3.NUMERICIDENTIFIER]}|x|X|\\*`);
198259
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:\\.(${src[t3.XRANGEIDENTIFIER]})(?:${src[t3.PRERELEASE]})?${src[t3.BUILD]}?)?)?`);
198260
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t3.XRANGEIDENTIFIERLOOSE]})(?:${src[t3.PRERELEASELOOSE]})?${src[t3.BUILD]}?)?)?`);
198261
+ createToken("XRANGE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAIN]}$`);
198262
+ createToken("XRANGELOOSE", `^${src[t3.GTLT]}\\s*${src[t3.XRANGEPLAINLOOSE]}$`);
198263
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
198264
+ createToken("COERCE", `${src[t3.COERCEPLAIN]}(?:$|[^\\d])`);
198265
+ createToken("COERCEFULL", src[t3.COERCEPLAIN] + `(?:${src[t3.PRERELEASE]})?(?:${src[t3.BUILD]})?(?:$|[^\\d])`);
198266
+ createToken("COERCERTL", src[t3.COERCE], true);
198267
+ createToken("COERCERTLFULL", src[t3.COERCEFULL], true);
198268
+ createToken("LONETILDE", "(?:~>?)");
198269
+ createToken("TILDETRIM", `(\\s*)${src[t3.LONETILDE]}\\s+`, true);
198270
+ exports2.tildeTrimReplace = "$1~";
198271
+ createToken("TILDE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAIN]}$`);
198272
+ createToken("TILDELOOSE", `^${src[t3.LONETILDE]}${src[t3.XRANGEPLAINLOOSE]}$`);
198273
+ createToken("LONECARET", "(?:\\^)");
198274
+ createToken("CARETTRIM", `(\\s*)${src[t3.LONECARET]}\\s+`, true);
198275
+ exports2.caretTrimReplace = "$1^";
198276
+ createToken("CARET", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAIN]}$`);
198277
+ createToken("CARETLOOSE", `^${src[t3.LONECARET]}${src[t3.XRANGEPLAINLOOSE]}$`);
198278
+ createToken("COMPARATORLOOSE", `^${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]})$|^$`);
198279
+ createToken("COMPARATOR", `^${src[t3.GTLT]}\\s*(${src[t3.FULLPLAIN]})$|^$`);
198280
+ createToken("COMPARATORTRIM", `(\\s*)${src[t3.GTLT]}\\s*(${src[t3.LOOSEPLAIN]}|${src[t3.XRANGEPLAIN]})`, true);
198281
+ exports2.comparatorTrimReplace = "$1$2$3";
198282
+ createToken("HYPHENRANGE", `^\\s*(${src[t3.XRANGEPLAIN]})\\s+-\\s+(${src[t3.XRANGEPLAIN]})\\s*$`);
198283
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t3.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t3.XRANGEPLAINLOOSE]})\\s*$`);
198284
+ createToken("STAR", "(<|>)?=?\\s*\\*");
198285
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
198286
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
198287
+ }
198288
+ });
198289
+
198290
+ // node_modules/semver/internal/parse-options.js
198291
+ var require_parse_options = __commonJS({
198292
+ "node_modules/semver/internal/parse-options.js"(exports2, module2) {
198293
+ "use strict";
198294
+ init_import_meta_url();
198295
+ var looseOption = Object.freeze({ loose: true });
198296
+ var emptyOpts = Object.freeze({});
198297
+ var parseOptions = (options) => {
198298
+ if (!options) {
198299
+ return emptyOpts;
198300
+ }
198301
+ if (typeof options !== "object") {
198302
+ return looseOption;
198303
+ }
198304
+ return options;
198305
+ };
198306
+ module2.exports = parseOptions;
198307
+ }
198308
+ });
198309
+
198310
+ // node_modules/semver/internal/identifiers.js
198311
+ var require_identifiers = __commonJS({
198312
+ "node_modules/semver/internal/identifiers.js"(exports2, module2) {
198313
+ "use strict";
198314
+ init_import_meta_url();
198315
+ var numeric2 = /^[0-9]+$/;
198316
+ var compareIdentifiers = (a3, b3) => {
198317
+ if (typeof a3 === "number" && typeof b3 === "number") {
198318
+ return a3 === b3 ? 0 : a3 < b3 ? -1 : 1;
198319
+ }
198320
+ const anum = numeric2.test(a3);
198321
+ const bnum = numeric2.test(b3);
198322
+ if (anum && bnum) {
198323
+ a3 = +a3;
198324
+ b3 = +b3;
198325
+ }
198326
+ return a3 === b3 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a3 < b3 ? -1 : 1;
198327
+ };
198328
+ var rcompareIdentifiers = (a3, b3) => compareIdentifiers(b3, a3);
198329
+ module2.exports = {
198330
+ compareIdentifiers,
198331
+ rcompareIdentifiers
198332
+ };
198333
+ }
198334
+ });
198335
+
198336
+ // node_modules/semver/classes/semver.js
198337
+ var require_semver3 = __commonJS({
198338
+ "node_modules/semver/classes/semver.js"(exports2, module2) {
198339
+ "use strict";
198340
+ init_import_meta_url();
198341
+ var debug3 = require_debug();
198342
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants3();
198343
+ var { safeRe: re2, t: t3 } = require_re();
198344
+ var parseOptions = require_parse_options();
198345
+ var { compareIdentifiers } = require_identifiers();
198346
+ var SemVer2 = class _SemVer {
198347
+ constructor(version2, options) {
198348
+ options = parseOptions(options);
198349
+ if (version2 instanceof _SemVer) {
198350
+ if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
198351
+ return version2;
198352
+ } else {
198353
+ version2 = version2.version;
198354
+ }
198355
+ } else if (typeof version2 !== "string") {
198356
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
198357
+ }
198358
+ if (version2.length > MAX_LENGTH) {
198359
+ throw new TypeError(
198360
+ `version is longer than ${MAX_LENGTH} characters`
198361
+ );
198362
+ }
198363
+ debug3("SemVer", version2, options);
198364
+ this.options = options;
198365
+ this.loose = !!options.loose;
198366
+ this.includePrerelease = !!options.includePrerelease;
198367
+ const m3 = version2.trim().match(options.loose ? re2[t3.LOOSE] : re2[t3.FULL]);
198368
+ if (!m3) {
198369
+ throw new TypeError(`Invalid Version: ${version2}`);
198370
+ }
198371
+ this.raw = version2;
198372
+ this.major = +m3[1];
198373
+ this.minor = +m3[2];
198374
+ this.patch = +m3[3];
198375
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
198376
+ throw new TypeError("Invalid major version");
198377
+ }
198378
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
198379
+ throw new TypeError("Invalid minor version");
198380
+ }
198381
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
198382
+ throw new TypeError("Invalid patch version");
198383
+ }
198384
+ if (!m3[4]) {
198385
+ this.prerelease = [];
198386
+ } else {
198387
+ this.prerelease = m3[4].split(".").map((id) => {
198388
+ if (/^[0-9]+$/.test(id)) {
198389
+ const num = +id;
198390
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
198391
+ return num;
198392
+ }
198393
+ }
198394
+ return id;
198395
+ });
198396
+ }
198397
+ this.build = m3[5] ? m3[5].split(".") : [];
198398
+ this.format();
198399
+ }
198400
+ format() {
198401
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
198402
+ if (this.prerelease.length) {
198403
+ this.version += `-${this.prerelease.join(".")}`;
198404
+ }
198405
+ return this.version;
198406
+ }
198407
+ toString() {
198408
+ return this.version;
198409
+ }
198410
+ compare(other) {
198411
+ debug3("SemVer.compare", this.version, this.options, other);
198412
+ if (!(other instanceof _SemVer)) {
198413
+ if (typeof other === "string" && other === this.version) {
198414
+ return 0;
198415
+ }
198416
+ other = new _SemVer(other, this.options);
198417
+ }
198418
+ if (other.version === this.version) {
198419
+ return 0;
198420
+ }
198421
+ return this.compareMain(other) || this.comparePre(other);
198422
+ }
198423
+ compareMain(other) {
198424
+ if (!(other instanceof _SemVer)) {
198425
+ other = new _SemVer(other, this.options);
198426
+ }
198427
+ if (this.major < other.major) {
198428
+ return -1;
198429
+ }
198430
+ if (this.major > other.major) {
198431
+ return 1;
198432
+ }
198433
+ if (this.minor < other.minor) {
198434
+ return -1;
198435
+ }
198436
+ if (this.minor > other.minor) {
198437
+ return 1;
198438
+ }
198439
+ if (this.patch < other.patch) {
198440
+ return -1;
198441
+ }
198442
+ if (this.patch > other.patch) {
198443
+ return 1;
198444
+ }
198445
+ return 0;
198446
+ }
198447
+ comparePre(other) {
198448
+ if (!(other instanceof _SemVer)) {
198449
+ other = new _SemVer(other, this.options);
198450
+ }
198451
+ if (this.prerelease.length && !other.prerelease.length) {
198452
+ return -1;
198453
+ } else if (!this.prerelease.length && other.prerelease.length) {
198454
+ return 1;
198455
+ } else if (!this.prerelease.length && !other.prerelease.length) {
198456
+ return 0;
198457
+ }
198458
+ let i3 = 0;
198459
+ do {
198460
+ const a3 = this.prerelease[i3];
198461
+ const b3 = other.prerelease[i3];
198462
+ debug3("prerelease compare", i3, a3, b3);
198463
+ if (a3 === void 0 && b3 === void 0) {
198464
+ return 0;
198465
+ } else if (b3 === void 0) {
198466
+ return 1;
198467
+ } else if (a3 === void 0) {
198468
+ return -1;
198469
+ } else if (a3 === b3) {
198470
+ continue;
198471
+ } else {
198472
+ return compareIdentifiers(a3, b3);
198473
+ }
198474
+ } while (++i3);
198475
+ }
198476
+ compareBuild(other) {
198477
+ if (!(other instanceof _SemVer)) {
198478
+ other = new _SemVer(other, this.options);
198479
+ }
198480
+ let i3 = 0;
198481
+ do {
198482
+ const a3 = this.build[i3];
198483
+ const b3 = other.build[i3];
198484
+ debug3("build compare", i3, a3, b3);
198485
+ if (a3 === void 0 && b3 === void 0) {
198486
+ return 0;
198487
+ } else if (b3 === void 0) {
198488
+ return 1;
198489
+ } else if (a3 === void 0) {
198490
+ return -1;
198491
+ } else if (a3 === b3) {
198492
+ continue;
198493
+ } else {
198494
+ return compareIdentifiers(a3, b3);
198495
+ }
198496
+ } while (++i3);
198497
+ }
198498
+ // preminor will bump the version up to the next minor release, and immediately
198499
+ // down to pre-release. premajor and prepatch work the same way.
198500
+ inc(release3, identifier, identifierBase) {
198501
+ if (release3.startsWith("pre")) {
198502
+ if (!identifier && identifierBase === false) {
198503
+ throw new Error("invalid increment argument: identifier is empty");
198504
+ }
198505
+ if (identifier) {
198506
+ const match3 = `-${identifier}`.match(this.options.loose ? re2[t3.PRERELEASELOOSE] : re2[t3.PRERELEASE]);
198507
+ if (!match3 || match3[1] !== identifier) {
198508
+ throw new Error(`invalid identifier: ${identifier}`);
198509
+ }
198510
+ }
198511
+ }
198512
+ switch (release3) {
198513
+ case "premajor":
198514
+ this.prerelease.length = 0;
198515
+ this.patch = 0;
198516
+ this.minor = 0;
198517
+ this.major++;
198518
+ this.inc("pre", identifier, identifierBase);
198519
+ break;
198520
+ case "preminor":
198521
+ this.prerelease.length = 0;
198522
+ this.patch = 0;
198523
+ this.minor++;
198524
+ this.inc("pre", identifier, identifierBase);
198525
+ break;
198526
+ case "prepatch":
198527
+ this.prerelease.length = 0;
198528
+ this.inc("patch", identifier, identifierBase);
198529
+ this.inc("pre", identifier, identifierBase);
198530
+ break;
198531
+ // If the input is a non-prerelease version, this acts the same as
198532
+ // prepatch.
198533
+ case "prerelease":
198534
+ if (this.prerelease.length === 0) {
198535
+ this.inc("patch", identifier, identifierBase);
198536
+ }
198537
+ this.inc("pre", identifier, identifierBase);
198538
+ break;
198539
+ case "release":
198540
+ if (this.prerelease.length === 0) {
198541
+ throw new Error(`version ${this.raw} is not a prerelease`);
198542
+ }
198543
+ this.prerelease.length = 0;
198544
+ break;
198545
+ case "major":
198546
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
198547
+ this.major++;
198548
+ }
198549
+ this.minor = 0;
198550
+ this.patch = 0;
198551
+ this.prerelease = [];
198552
+ break;
198553
+ case "minor":
198554
+ if (this.patch !== 0 || this.prerelease.length === 0) {
198555
+ this.minor++;
198556
+ }
198557
+ this.patch = 0;
198558
+ this.prerelease = [];
198559
+ break;
198560
+ case "patch":
198561
+ if (this.prerelease.length === 0) {
198562
+ this.patch++;
198563
+ }
198564
+ this.prerelease = [];
198565
+ break;
198566
+ // This probably shouldn't be used publicly.
198567
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
198568
+ case "pre": {
198569
+ const base = Number(identifierBase) ? 1 : 0;
198570
+ if (this.prerelease.length === 0) {
198571
+ this.prerelease = [base];
198572
+ } else {
198573
+ let i3 = this.prerelease.length;
198574
+ while (--i3 >= 0) {
198575
+ if (typeof this.prerelease[i3] === "number") {
198576
+ this.prerelease[i3]++;
198577
+ i3 = -2;
198578
+ }
198579
+ }
198580
+ if (i3 === -1) {
198581
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
198582
+ throw new Error("invalid increment argument: identifier already exists");
198583
+ }
198584
+ this.prerelease.push(base);
198585
+ }
198586
+ }
198587
+ if (identifier) {
198588
+ let prerelease = [identifier, base];
198589
+ if (identifierBase === false) {
198590
+ prerelease = [identifier];
198591
+ }
198592
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
198593
+ if (isNaN(this.prerelease[1])) {
198594
+ this.prerelease = prerelease;
198595
+ }
198596
+ } else {
198597
+ this.prerelease = prerelease;
198598
+ }
198599
+ }
198600
+ break;
198601
+ }
198602
+ default:
198603
+ throw new Error(`invalid increment argument: ${release3}`);
198604
+ }
198605
+ this.raw = this.format();
198606
+ if (this.build.length) {
198607
+ this.raw += `+${this.build.join(".")}`;
198608
+ }
198609
+ return this;
198610
+ }
198611
+ };
198612
+ module2.exports = SemVer2;
198613
+ }
198614
+ });
198615
+
198616
+ // node_modules/semver/functions/parse.js
198617
+ var require_parse3 = __commonJS({
198618
+ "node_modules/semver/functions/parse.js"(exports2, module2) {
198619
+ "use strict";
198620
+ init_import_meta_url();
198621
+ var SemVer2 = require_semver3();
198622
+ var parse4 = (version2, options, throwErrors = false) => {
198623
+ if (version2 instanceof SemVer2) {
198624
+ return version2;
198625
+ }
198626
+ try {
198627
+ return new SemVer2(version2, options);
198628
+ } catch (er) {
198629
+ if (!throwErrors) {
198630
+ return null;
198631
+ }
198632
+ throw er;
198633
+ }
198634
+ };
198635
+ module2.exports = parse4;
198636
+ }
198637
+ });
198638
+
198639
+ // node_modules/semver/functions/valid.js
198640
+ var require_valid = __commonJS({
198641
+ "node_modules/semver/functions/valid.js"(exports2, module2) {
198642
+ "use strict";
198643
+ init_import_meta_url();
198644
+ var parse4 = require_parse3();
198645
+ var valid = (version2, options) => {
198646
+ const v6 = parse4(version2, options);
198647
+ return v6 ? v6.version : null;
198648
+ };
198649
+ module2.exports = valid;
198650
+ }
198651
+ });
198652
+
198653
+ // node_modules/semver/functions/clean.js
198654
+ var require_clean = __commonJS({
198655
+ "node_modules/semver/functions/clean.js"(exports2, module2) {
198656
+ "use strict";
198657
+ init_import_meta_url();
198658
+ var parse4 = require_parse3();
198659
+ var clean = (version2, options) => {
198660
+ const s3 = parse4(version2.trim().replace(/^[=v]+/, ""), options);
198661
+ return s3 ? s3.version : null;
198662
+ };
198663
+ module2.exports = clean;
198664
+ }
198665
+ });
198666
+
198667
+ // node_modules/semver/functions/inc.js
198668
+ var require_inc = __commonJS({
198669
+ "node_modules/semver/functions/inc.js"(exports2, module2) {
198670
+ "use strict";
198671
+ init_import_meta_url();
198672
+ var SemVer2 = require_semver3();
198673
+ var inc2 = (version2, release3, options, identifier, identifierBase) => {
198674
+ if (typeof options === "string") {
198675
+ identifierBase = identifier;
198676
+ identifier = options;
198677
+ options = void 0;
198678
+ }
198679
+ try {
198680
+ return new SemVer2(
198681
+ version2 instanceof SemVer2 ? version2.version : version2,
198682
+ options
198683
+ ).inc(release3, identifier, identifierBase).version;
198684
+ } catch (er) {
198685
+ return null;
198686
+ }
198687
+ };
198688
+ module2.exports = inc2;
198689
+ }
198690
+ });
198691
+
198692
+ // node_modules/semver/functions/diff.js
198693
+ var require_diff = __commonJS({
198694
+ "node_modules/semver/functions/diff.js"(exports2, module2) {
198695
+ "use strict";
198696
+ init_import_meta_url();
198697
+ var parse4 = require_parse3();
198698
+ var diff = (version1, version2) => {
198699
+ const v12 = parse4(version1, null, true);
198700
+ const v22 = parse4(version2, null, true);
198701
+ const comparison = v12.compare(v22);
198702
+ if (comparison === 0) {
198703
+ return null;
198704
+ }
198705
+ const v1Higher = comparison > 0;
198706
+ const highVersion = v1Higher ? v12 : v22;
198707
+ const lowVersion = v1Higher ? v22 : v12;
198708
+ const highHasPre = !!highVersion.prerelease.length;
198709
+ const lowHasPre = !!lowVersion.prerelease.length;
198710
+ if (lowHasPre && !highHasPre) {
198711
+ if (!lowVersion.patch && !lowVersion.minor) {
198712
+ return "major";
198713
+ }
198714
+ if (lowVersion.compareMain(highVersion) === 0) {
198715
+ if (lowVersion.minor && !lowVersion.patch) {
198716
+ return "minor";
198717
+ }
198718
+ return "patch";
198719
+ }
198720
+ }
198721
+ const prefix = highHasPre ? "pre" : "";
198722
+ if (v12.major !== v22.major) {
198723
+ return prefix + "major";
198724
+ }
198725
+ if (v12.minor !== v22.minor) {
198726
+ return prefix + "minor";
198727
+ }
198728
+ if (v12.patch !== v22.patch) {
198729
+ return prefix + "patch";
198730
+ }
198731
+ return "prerelease";
198732
+ };
198733
+ module2.exports = diff;
198734
+ }
198735
+ });
198736
+
198737
+ // node_modules/semver/functions/major.js
198738
+ var require_major = __commonJS({
198739
+ "node_modules/semver/functions/major.js"(exports2, module2) {
198740
+ "use strict";
198741
+ init_import_meta_url();
198742
+ var SemVer2 = require_semver3();
198743
+ var major2 = (a3, loose) => new SemVer2(a3, loose).major;
198744
+ module2.exports = major2;
198745
+ }
198746
+ });
198747
+
198748
+ // node_modules/semver/functions/minor.js
198749
+ var require_minor = __commonJS({
198750
+ "node_modules/semver/functions/minor.js"(exports2, module2) {
198751
+ "use strict";
198752
+ init_import_meta_url();
198753
+ var SemVer2 = require_semver3();
198754
+ var minor = (a3, loose) => new SemVer2(a3, loose).minor;
198755
+ module2.exports = minor;
198756
+ }
198757
+ });
198758
+
198759
+ // node_modules/semver/functions/patch.js
198760
+ var require_patch = __commonJS({
198761
+ "node_modules/semver/functions/patch.js"(exports2, module2) {
198762
+ "use strict";
198763
+ init_import_meta_url();
198764
+ var SemVer2 = require_semver3();
198765
+ var patch = (a3, loose) => new SemVer2(a3, loose).patch;
198766
+ module2.exports = patch;
198767
+ }
198768
+ });
198769
+
198770
+ // node_modules/semver/functions/prerelease.js
198771
+ var require_prerelease = __commonJS({
198772
+ "node_modules/semver/functions/prerelease.js"(exports2, module2) {
198773
+ "use strict";
198774
+ init_import_meta_url();
198775
+ var parse4 = require_parse3();
198776
+ var prerelease = (version2, options) => {
198777
+ const parsed = parse4(version2, options);
198778
+ return parsed && parsed.prerelease.length ? parsed.prerelease : null;
198779
+ };
198780
+ module2.exports = prerelease;
198781
+ }
198782
+ });
198783
+
198784
+ // node_modules/semver/functions/compare.js
198785
+ var require_compare = __commonJS({
198786
+ "node_modules/semver/functions/compare.js"(exports2, module2) {
198787
+ "use strict";
198788
+ init_import_meta_url();
198789
+ var SemVer2 = require_semver3();
198790
+ var compare = (a3, b3, loose) => new SemVer2(a3, loose).compare(new SemVer2(b3, loose));
198791
+ module2.exports = compare;
198792
+ }
198793
+ });
198794
+
198795
+ // node_modules/semver/functions/rcompare.js
198796
+ var require_rcompare = __commonJS({
198797
+ "node_modules/semver/functions/rcompare.js"(exports2, module2) {
198798
+ "use strict";
198799
+ init_import_meta_url();
198800
+ var compare = require_compare();
198801
+ var rcompare = (a3, b3, loose) => compare(b3, a3, loose);
198802
+ module2.exports = rcompare;
198803
+ }
198804
+ });
198805
+
198806
+ // node_modules/semver/functions/compare-loose.js
198807
+ var require_compare_loose = __commonJS({
198808
+ "node_modules/semver/functions/compare-loose.js"(exports2, module2) {
198809
+ "use strict";
198810
+ init_import_meta_url();
198811
+ var compare = require_compare();
198812
+ var compareLoose = (a3, b3) => compare(a3, b3, true);
198813
+ module2.exports = compareLoose;
198814
+ }
198815
+ });
198816
+
198817
+ // node_modules/semver/functions/compare-build.js
198818
+ var require_compare_build = __commonJS({
198819
+ "node_modules/semver/functions/compare-build.js"(exports2, module2) {
198820
+ "use strict";
198821
+ init_import_meta_url();
198822
+ var SemVer2 = require_semver3();
198823
+ var compareBuild = (a3, b3, loose) => {
198824
+ const versionA = new SemVer2(a3, loose);
198825
+ const versionB = new SemVer2(b3, loose);
198826
+ return versionA.compare(versionB) || versionA.compareBuild(versionB);
198827
+ };
198828
+ module2.exports = compareBuild;
198829
+ }
198830
+ });
198831
+
198832
+ // node_modules/semver/functions/sort.js
198833
+ var require_sort = __commonJS({
198834
+ "node_modules/semver/functions/sort.js"(exports2, module2) {
198835
+ "use strict";
198836
+ init_import_meta_url();
198837
+ var compareBuild = require_compare_build();
198838
+ var sort = (list2, loose) => list2.sort((a3, b3) => compareBuild(a3, b3, loose));
198839
+ module2.exports = sort;
198840
+ }
198841
+ });
198842
+
198843
+ // node_modules/semver/functions/rsort.js
198844
+ var require_rsort = __commonJS({
198845
+ "node_modules/semver/functions/rsort.js"(exports2, module2) {
198846
+ "use strict";
198847
+ init_import_meta_url();
198848
+ var compareBuild = require_compare_build();
198849
+ var rsort = (list2, loose) => list2.sort((a3, b3) => compareBuild(b3, a3, loose));
198850
+ module2.exports = rsort;
198851
+ }
198852
+ });
198853
+
198854
+ // node_modules/semver/functions/gt.js
198855
+ var require_gt = __commonJS({
198856
+ "node_modules/semver/functions/gt.js"(exports2, module2) {
198857
+ "use strict";
198858
+ init_import_meta_url();
198859
+ var compare = require_compare();
198860
+ var gt = (a3, b3, loose) => compare(a3, b3, loose) > 0;
198861
+ module2.exports = gt;
198862
+ }
198863
+ });
198864
+
198865
+ // node_modules/semver/functions/lt.js
198866
+ var require_lt = __commonJS({
198867
+ "node_modules/semver/functions/lt.js"(exports2, module2) {
198868
+ "use strict";
198869
+ init_import_meta_url();
198870
+ var compare = require_compare();
198871
+ var lt = (a3, b3, loose) => compare(a3, b3, loose) < 0;
198872
+ module2.exports = lt;
198873
+ }
198874
+ });
198875
+
198876
+ // node_modules/semver/functions/eq.js
198877
+ var require_eq = __commonJS({
198878
+ "node_modules/semver/functions/eq.js"(exports2, module2) {
198879
+ "use strict";
198880
+ init_import_meta_url();
198881
+ var compare = require_compare();
198882
+ var eq = (a3, b3, loose) => compare(a3, b3, loose) === 0;
198883
+ module2.exports = eq;
198884
+ }
198885
+ });
198886
+
198887
+ // node_modules/semver/functions/neq.js
198888
+ var require_neq = __commonJS({
198889
+ "node_modules/semver/functions/neq.js"(exports2, module2) {
198890
+ "use strict";
198891
+ init_import_meta_url();
198892
+ var compare = require_compare();
198893
+ var neq = (a3, b3, loose) => compare(a3, b3, loose) !== 0;
198894
+ module2.exports = neq;
198895
+ }
198896
+ });
198897
+
198898
+ // node_modules/semver/functions/gte.js
198899
+ var require_gte = __commonJS({
198900
+ "node_modules/semver/functions/gte.js"(exports2, module2) {
198901
+ "use strict";
198902
+ init_import_meta_url();
198903
+ var compare = require_compare();
198904
+ var gte2 = (a3, b3, loose) => compare(a3, b3, loose) >= 0;
198905
+ module2.exports = gte2;
198906
+ }
198907
+ });
198908
+
198909
+ // node_modules/semver/functions/lte.js
198910
+ var require_lte = __commonJS({
198911
+ "node_modules/semver/functions/lte.js"(exports2, module2) {
198912
+ "use strict";
198913
+ init_import_meta_url();
198914
+ var compare = require_compare();
198915
+ var lte2 = (a3, b3, loose) => compare(a3, b3, loose) <= 0;
198916
+ module2.exports = lte2;
198917
+ }
198918
+ });
198919
+
198920
+ // node_modules/semver/functions/cmp.js
198921
+ var require_cmp = __commonJS({
198922
+ "node_modules/semver/functions/cmp.js"(exports2, module2) {
198923
+ "use strict";
198924
+ init_import_meta_url();
198925
+ var eq = require_eq();
198926
+ var neq = require_neq();
198927
+ var gt = require_gt();
198928
+ var gte2 = require_gte();
198929
+ var lt = require_lt();
198930
+ var lte2 = require_lte();
198931
+ var cmp = (a3, op2, b3, loose) => {
198932
+ switch (op2) {
198933
+ case "===":
198934
+ if (typeof a3 === "object") {
198935
+ a3 = a3.version;
198936
+ }
198937
+ if (typeof b3 === "object") {
198938
+ b3 = b3.version;
198939
+ }
198940
+ return a3 === b3;
198941
+ case "!==":
198942
+ if (typeof a3 === "object") {
198943
+ a3 = a3.version;
198944
+ }
198945
+ if (typeof b3 === "object") {
198946
+ b3 = b3.version;
198947
+ }
198948
+ return a3 !== b3;
198949
+ case "":
198950
+ case "=":
198951
+ case "==":
198952
+ return eq(a3, b3, loose);
198953
+ case "!=":
198954
+ return neq(a3, b3, loose);
198955
+ case ">":
198956
+ return gt(a3, b3, loose);
198957
+ case ">=":
198958
+ return gte2(a3, b3, loose);
198959
+ case "<":
198960
+ return lt(a3, b3, loose);
198961
+ case "<=":
198962
+ return lte2(a3, b3, loose);
198963
+ default:
198964
+ throw new TypeError(`Invalid operator: ${op2}`);
198965
+ }
198966
+ };
198967
+ module2.exports = cmp;
198968
+ }
198969
+ });
198970
+
198971
+ // node_modules/semver/functions/coerce.js
198972
+ var require_coerce = __commonJS({
198973
+ "node_modules/semver/functions/coerce.js"(exports2, module2) {
198974
+ "use strict";
198975
+ init_import_meta_url();
198976
+ var SemVer2 = require_semver3();
198977
+ var parse4 = require_parse3();
198978
+ var { safeRe: re2, t: t3 } = require_re();
198979
+ var coerce = (version2, options) => {
198980
+ if (version2 instanceof SemVer2) {
198981
+ return version2;
198982
+ }
198983
+ if (typeof version2 === "number") {
198984
+ version2 = String(version2);
198985
+ }
198986
+ if (typeof version2 !== "string") {
198987
+ return null;
198988
+ }
198989
+ options = options || {};
198990
+ let match3 = null;
198991
+ if (!options.rtl) {
198992
+ match3 = version2.match(options.includePrerelease ? re2[t3.COERCEFULL] : re2[t3.COERCE]);
198993
+ } else {
198994
+ const coerceRtlRegex = options.includePrerelease ? re2[t3.COERCERTLFULL] : re2[t3.COERCERTL];
198995
+ let next;
198996
+ while ((next = coerceRtlRegex.exec(version2)) && (!match3 || match3.index + match3[0].length !== version2.length)) {
198997
+ if (!match3 || next.index + next[0].length !== match3.index + match3[0].length) {
198998
+ match3 = next;
198999
+ }
199000
+ coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
199001
+ }
199002
+ coerceRtlRegex.lastIndex = -1;
199003
+ }
199004
+ if (match3 === null) {
199005
+ return null;
199006
+ }
199007
+ const major2 = match3[2];
199008
+ const minor = match3[3] || "0";
199009
+ const patch = match3[4] || "0";
199010
+ const prerelease = options.includePrerelease && match3[5] ? `-${match3[5]}` : "";
199011
+ const build = options.includePrerelease && match3[6] ? `+${match3[6]}` : "";
199012
+ return parse4(`${major2}.${minor}.${patch}${prerelease}${build}`, options);
199013
+ };
199014
+ module2.exports = coerce;
199015
+ }
199016
+ });
199017
+
199018
+ // node_modules/semver/internal/lrucache.js
199019
+ var require_lrucache = __commonJS({
199020
+ "node_modules/semver/internal/lrucache.js"(exports2, module2) {
199021
+ "use strict";
199022
+ init_import_meta_url();
199023
+ var LRUCache2 = class {
199024
+ constructor() {
199025
+ this.max = 1e3;
199026
+ this.map = /* @__PURE__ */ new Map();
199027
+ }
199028
+ get(key) {
199029
+ const value = this.map.get(key);
199030
+ if (value === void 0) {
199031
+ return void 0;
199032
+ } else {
199033
+ this.map.delete(key);
199034
+ this.map.set(key, value);
199035
+ return value;
199036
+ }
199037
+ }
199038
+ delete(key) {
199039
+ return this.map.delete(key);
199040
+ }
199041
+ set(key, value) {
199042
+ const deleted = this.delete(key);
199043
+ if (!deleted && value !== void 0) {
199044
+ if (this.map.size >= this.max) {
199045
+ const firstKey = this.map.keys().next().value;
199046
+ this.delete(firstKey);
199047
+ }
199048
+ this.map.set(key, value);
199049
+ }
199050
+ return this;
199051
+ }
199052
+ };
199053
+ module2.exports = LRUCache2;
199054
+ }
199055
+ });
199056
+
199057
+ // node_modules/semver/classes/range.js
199058
+ var require_range2 = __commonJS({
199059
+ "node_modules/semver/classes/range.js"(exports2, module2) {
199060
+ "use strict";
199061
+ init_import_meta_url();
199062
+ var SPACE_CHARACTERS = /\s+/g;
199063
+ var Range = class _Range {
199064
+ constructor(range3, options) {
199065
+ options = parseOptions(options);
199066
+ if (range3 instanceof _Range) {
199067
+ if (range3.loose === !!options.loose && range3.includePrerelease === !!options.includePrerelease) {
199068
+ return range3;
199069
+ } else {
199070
+ return new _Range(range3.raw, options);
199071
+ }
199072
+ }
199073
+ if (range3 instanceof Comparator) {
199074
+ this.raw = range3.value;
199075
+ this.set = [[range3]];
199076
+ this.formatted = void 0;
199077
+ return this;
199078
+ }
199079
+ this.options = options;
199080
+ this.loose = !!options.loose;
199081
+ this.includePrerelease = !!options.includePrerelease;
199082
+ this.raw = range3.trim().replace(SPACE_CHARACTERS, " ");
199083
+ this.set = this.raw.split("||").map((r3) => this.parseRange(r3.trim())).filter((c3) => c3.length);
199084
+ if (!this.set.length) {
199085
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
199086
+ }
199087
+ if (this.set.length > 1) {
199088
+ const first2 = this.set[0];
199089
+ this.set = this.set.filter((c3) => !isNullSet(c3[0]));
199090
+ if (this.set.length === 0) {
199091
+ this.set = [first2];
199092
+ } else if (this.set.length > 1) {
199093
+ for (const c3 of this.set) {
199094
+ if (c3.length === 1 && isAny(c3[0])) {
199095
+ this.set = [c3];
199096
+ break;
199097
+ }
199098
+ }
199099
+ }
199100
+ }
199101
+ this.formatted = void 0;
199102
+ }
199103
+ get range() {
199104
+ if (this.formatted === void 0) {
199105
+ this.formatted = "";
199106
+ for (let i3 = 0; i3 < this.set.length; i3++) {
199107
+ if (i3 > 0) {
199108
+ this.formatted += "||";
199109
+ }
199110
+ const comps = this.set[i3];
199111
+ for (let k3 = 0; k3 < comps.length; k3++) {
199112
+ if (k3 > 0) {
199113
+ this.formatted += " ";
199114
+ }
199115
+ this.formatted += comps[k3].toString().trim();
199116
+ }
199117
+ }
199118
+ }
199119
+ return this.formatted;
199120
+ }
199121
+ format() {
199122
+ return this.range;
199123
+ }
199124
+ toString() {
199125
+ return this.range;
199126
+ }
199127
+ parseRange(range3) {
199128
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
199129
+ const memoKey = memoOpts + ":" + range3;
199130
+ const cached = cache4.get(memoKey);
199131
+ if (cached) {
199132
+ return cached;
199133
+ }
199134
+ const loose = this.options.loose;
199135
+ const hr = loose ? re2[t3.HYPHENRANGELOOSE] : re2[t3.HYPHENRANGE];
199136
+ range3 = range3.replace(hr, hyphenReplace(this.options.includePrerelease));
199137
+ debug3("hyphen replace", range3);
199138
+ range3 = range3.replace(re2[t3.COMPARATORTRIM], comparatorTrimReplace);
199139
+ debug3("comparator trim", range3);
199140
+ range3 = range3.replace(re2[t3.TILDETRIM], tildeTrimReplace);
199141
+ debug3("tilde trim", range3);
199142
+ range3 = range3.replace(re2[t3.CARETTRIM], caretTrimReplace);
199143
+ debug3("caret trim", range3);
199144
+ let rangeList = range3.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
199145
+ if (loose) {
199146
+ rangeList = rangeList.filter((comp) => {
199147
+ debug3("loose invalid filter", comp, this.options);
199148
+ return !!comp.match(re2[t3.COMPARATORLOOSE]);
199149
+ });
199150
+ }
199151
+ debug3("range list", rangeList);
199152
+ const rangeMap = /* @__PURE__ */ new Map();
199153
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
199154
+ for (const comp of comparators) {
199155
+ if (isNullSet(comp)) {
199156
+ return [comp];
199157
+ }
199158
+ rangeMap.set(comp.value, comp);
199159
+ }
199160
+ if (rangeMap.size > 1 && rangeMap.has("")) {
199161
+ rangeMap.delete("");
199162
+ }
199163
+ const result = [...rangeMap.values()];
199164
+ cache4.set(memoKey, result);
199165
+ return result;
199166
+ }
199167
+ intersects(range3, options) {
199168
+ if (!(range3 instanceof _Range)) {
199169
+ throw new TypeError("a Range is required");
199170
+ }
199171
+ return this.set.some((thisComparators) => {
199172
+ return isSatisfiable(thisComparators, options) && range3.set.some((rangeComparators) => {
199173
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
199174
+ return rangeComparators.every((rangeComparator) => {
199175
+ return thisComparator.intersects(rangeComparator, options);
199176
+ });
199177
+ });
199178
+ });
199179
+ });
199180
+ }
199181
+ // if ANY of the sets match ALL of its comparators, then pass
199182
+ test(version2) {
199183
+ if (!version2) {
199184
+ return false;
199185
+ }
199186
+ if (typeof version2 === "string") {
199187
+ try {
199188
+ version2 = new SemVer2(version2, this.options);
199189
+ } catch (er) {
199190
+ return false;
199191
+ }
199192
+ }
199193
+ for (let i3 = 0; i3 < this.set.length; i3++) {
199194
+ if (testSet(this.set[i3], version2, this.options)) {
199195
+ return true;
199196
+ }
199197
+ }
199198
+ return false;
199199
+ }
199200
+ };
199201
+ module2.exports = Range;
199202
+ var LRU = require_lrucache();
199203
+ var cache4 = new LRU();
199204
+ var parseOptions = require_parse_options();
199205
+ var Comparator = require_comparator();
199206
+ var debug3 = require_debug();
199207
+ var SemVer2 = require_semver3();
199208
+ var {
199209
+ safeRe: re2,
199210
+ t: t3,
199211
+ comparatorTrimReplace,
199212
+ tildeTrimReplace,
199213
+ caretTrimReplace
199214
+ } = require_re();
199215
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants3();
199216
+ var isNullSet = (c3) => c3.value === "<0.0.0-0";
199217
+ var isAny = (c3) => c3.value === "";
199218
+ var isSatisfiable = (comparators, options) => {
199219
+ let result = true;
199220
+ const remainingComparators = comparators.slice();
199221
+ let testComparator = remainingComparators.pop();
199222
+ while (result && remainingComparators.length) {
199223
+ result = remainingComparators.every((otherComparator) => {
199224
+ return testComparator.intersects(otherComparator, options);
199225
+ });
199226
+ testComparator = remainingComparators.pop();
199227
+ }
199228
+ return result;
199229
+ };
199230
+ var parseComparator = (comp, options) => {
199231
+ comp = comp.replace(re2[t3.BUILD], "");
199232
+ debug3("comp", comp, options);
199233
+ comp = replaceCarets(comp, options);
199234
+ debug3("caret", comp);
199235
+ comp = replaceTildes(comp, options);
199236
+ debug3("tildes", comp);
199237
+ comp = replaceXRanges(comp, options);
199238
+ debug3("xrange", comp);
199239
+ comp = replaceStars(comp, options);
199240
+ debug3("stars", comp);
199241
+ return comp;
199242
+ };
199243
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
199244
+ var replaceTildes = (comp, options) => {
199245
+ return comp.trim().split(/\s+/).map((c3) => replaceTilde(c3, options)).join(" ");
199246
+ };
199247
+ var replaceTilde = (comp, options) => {
199248
+ const r3 = options.loose ? re2[t3.TILDELOOSE] : re2[t3.TILDE];
199249
+ return comp.replace(r3, (_, M, m3, p3, pr) => {
199250
+ debug3("tilde", comp, _, M, m3, p3, pr);
199251
+ let ret;
199252
+ if (isX(M)) {
199253
+ ret = "";
199254
+ } else if (isX(m3)) {
199255
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
199256
+ } else if (isX(p3)) {
199257
+ ret = `>=${M}.${m3}.0 <${M}.${+m3 + 1}.0-0`;
199258
+ } else if (pr) {
199259
+ debug3("replaceTilde pr", pr);
199260
+ ret = `>=${M}.${m3}.${p3}-${pr} <${M}.${+m3 + 1}.0-0`;
199261
+ } else {
199262
+ ret = `>=${M}.${m3}.${p3} <${M}.${+m3 + 1}.0-0`;
199263
+ }
199264
+ debug3("tilde return", ret);
199265
+ return ret;
199266
+ });
199267
+ };
199268
+ var replaceCarets = (comp, options) => {
199269
+ return comp.trim().split(/\s+/).map((c3) => replaceCaret(c3, options)).join(" ");
199270
+ };
199271
+ var replaceCaret = (comp, options) => {
199272
+ debug3("caret", comp, options);
199273
+ const r3 = options.loose ? re2[t3.CARETLOOSE] : re2[t3.CARET];
199274
+ const z2 = options.includePrerelease ? "-0" : "";
199275
+ return comp.replace(r3, (_, M, m3, p3, pr) => {
199276
+ debug3("caret", comp, _, M, m3, p3, pr);
199277
+ let ret;
199278
+ if (isX(M)) {
199279
+ ret = "";
199280
+ } else if (isX(m3)) {
199281
+ ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
199282
+ } else if (isX(p3)) {
199283
+ if (M === "0") {
199284
+ ret = `>=${M}.${m3}.0${z2} <${M}.${+m3 + 1}.0-0`;
199285
+ } else {
199286
+ ret = `>=${M}.${m3}.0${z2} <${+M + 1}.0.0-0`;
199287
+ }
199288
+ } else if (pr) {
199289
+ debug3("replaceCaret pr", pr);
199290
+ if (M === "0") {
199291
+ if (m3 === "0") {
199292
+ ret = `>=${M}.${m3}.${p3}-${pr} <${M}.${m3}.${+p3 + 1}-0`;
199293
+ } else {
199294
+ ret = `>=${M}.${m3}.${p3}-${pr} <${M}.${+m3 + 1}.0-0`;
199295
+ }
199296
+ } else {
199297
+ ret = `>=${M}.${m3}.${p3}-${pr} <${+M + 1}.0.0-0`;
199298
+ }
199299
+ } else {
199300
+ debug3("no pr");
199301
+ if (M === "0") {
199302
+ if (m3 === "0") {
199303
+ ret = `>=${M}.${m3}.${p3}${z2} <${M}.${m3}.${+p3 + 1}-0`;
199304
+ } else {
199305
+ ret = `>=${M}.${m3}.${p3}${z2} <${M}.${+m3 + 1}.0-0`;
199306
+ }
199307
+ } else {
199308
+ ret = `>=${M}.${m3}.${p3} <${+M + 1}.0.0-0`;
199309
+ }
199310
+ }
199311
+ debug3("caret return", ret);
199312
+ return ret;
199313
+ });
199314
+ };
199315
+ var replaceXRanges = (comp, options) => {
199316
+ debug3("replaceXRanges", comp, options);
199317
+ return comp.split(/\s+/).map((c3) => replaceXRange(c3, options)).join(" ");
199318
+ };
199319
+ var replaceXRange = (comp, options) => {
199320
+ comp = comp.trim();
199321
+ const r3 = options.loose ? re2[t3.XRANGELOOSE] : re2[t3.XRANGE];
199322
+ return comp.replace(r3, (ret, gtlt, M, m3, p3, pr) => {
199323
+ debug3("xRange", comp, ret, gtlt, M, m3, p3, pr);
199324
+ const xM = isX(M);
199325
+ const xm = xM || isX(m3);
199326
+ const xp = xm || isX(p3);
199327
+ const anyX = xp;
199328
+ if (gtlt === "=" && anyX) {
199329
+ gtlt = "";
199330
+ }
199331
+ pr = options.includePrerelease ? "-0" : "";
199332
+ if (xM) {
199333
+ if (gtlt === ">" || gtlt === "<") {
199334
+ ret = "<0.0.0-0";
199335
+ } else {
199336
+ ret = "*";
199337
+ }
199338
+ } else if (gtlt && anyX) {
199339
+ if (xm) {
199340
+ m3 = 0;
199341
+ }
199342
+ p3 = 0;
199343
+ if (gtlt === ">") {
199344
+ gtlt = ">=";
199345
+ if (xm) {
199346
+ M = +M + 1;
199347
+ m3 = 0;
199348
+ p3 = 0;
199349
+ } else {
199350
+ m3 = +m3 + 1;
199351
+ p3 = 0;
199352
+ }
199353
+ } else if (gtlt === "<=") {
199354
+ gtlt = "<";
199355
+ if (xm) {
199356
+ M = +M + 1;
199357
+ } else {
199358
+ m3 = +m3 + 1;
199359
+ }
199360
+ }
199361
+ if (gtlt === "<") {
199362
+ pr = "-0";
199363
+ }
199364
+ ret = `${gtlt + M}.${m3}.${p3}${pr}`;
199365
+ } else if (xm) {
199366
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
199367
+ } else if (xp) {
199368
+ ret = `>=${M}.${m3}.0${pr} <${M}.${+m3 + 1}.0-0`;
199369
+ }
199370
+ debug3("xRange return", ret);
199371
+ return ret;
199372
+ });
199373
+ };
199374
+ var replaceStars = (comp, options) => {
199375
+ debug3("replaceStars", comp, options);
199376
+ return comp.trim().replace(re2[t3.STAR], "");
199377
+ };
199378
+ var replaceGTE0 = (comp, options) => {
199379
+ debug3("replaceGTE0", comp, options);
199380
+ return comp.trim().replace(re2[options.includePrerelease ? t3.GTE0PRE : t3.GTE0], "");
199381
+ };
199382
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
199383
+ if (isX(fM)) {
199384
+ from = "";
199385
+ } else if (isX(fm)) {
199386
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
199387
+ } else if (isX(fp)) {
199388
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
199389
+ } else if (fpr) {
199390
+ from = `>=${from}`;
199391
+ } else {
199392
+ from = `>=${from}${incPr ? "-0" : ""}`;
199393
+ }
199394
+ if (isX(tM)) {
199395
+ to = "";
199396
+ } else if (isX(tm)) {
199397
+ to = `<${+tM + 1}.0.0-0`;
199398
+ } else if (isX(tp)) {
199399
+ to = `<${tM}.${+tm + 1}.0-0`;
199400
+ } else if (tpr) {
199401
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
199402
+ } else if (incPr) {
199403
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
199404
+ } else {
199405
+ to = `<=${to}`;
199406
+ }
199407
+ return `${from} ${to}`.trim();
199408
+ };
199409
+ var testSet = (set2, version2, options) => {
199410
+ for (let i3 = 0; i3 < set2.length; i3++) {
199411
+ if (!set2[i3].test(version2)) {
199412
+ return false;
199413
+ }
199414
+ }
199415
+ if (version2.prerelease.length && !options.includePrerelease) {
199416
+ for (let i3 = 0; i3 < set2.length; i3++) {
199417
+ debug3(set2[i3].semver);
199418
+ if (set2[i3].semver === Comparator.ANY) {
199419
+ continue;
199420
+ }
199421
+ if (set2[i3].semver.prerelease.length > 0) {
199422
+ const allowed = set2[i3].semver;
199423
+ if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
199424
+ return true;
199425
+ }
199426
+ }
199427
+ }
199428
+ return false;
199429
+ }
199430
+ return true;
199431
+ };
199432
+ }
199433
+ });
199434
+
199435
+ // node_modules/semver/classes/comparator.js
199436
+ var require_comparator = __commonJS({
199437
+ "node_modules/semver/classes/comparator.js"(exports2, module2) {
199438
+ "use strict";
199439
+ init_import_meta_url();
199440
+ var ANY = Symbol("SemVer ANY");
199441
+ var Comparator = class _Comparator {
199442
+ static get ANY() {
199443
+ return ANY;
199444
+ }
199445
+ constructor(comp, options) {
199446
+ options = parseOptions(options);
199447
+ if (comp instanceof _Comparator) {
199448
+ if (comp.loose === !!options.loose) {
199449
+ return comp;
199450
+ } else {
199451
+ comp = comp.value;
199452
+ }
199453
+ }
199454
+ comp = comp.trim().split(/\s+/).join(" ");
199455
+ debug3("comparator", comp, options);
199456
+ this.options = options;
199457
+ this.loose = !!options.loose;
199458
+ this.parse(comp);
199459
+ if (this.semver === ANY) {
199460
+ this.value = "";
199461
+ } else {
199462
+ this.value = this.operator + this.semver.version;
199463
+ }
199464
+ debug3("comp", this);
199465
+ }
199466
+ parse(comp) {
199467
+ const r3 = this.options.loose ? re2[t3.COMPARATORLOOSE] : re2[t3.COMPARATOR];
199468
+ const m3 = comp.match(r3);
199469
+ if (!m3) {
199470
+ throw new TypeError(`Invalid comparator: ${comp}`);
199471
+ }
199472
+ this.operator = m3[1] !== void 0 ? m3[1] : "";
199473
+ if (this.operator === "=") {
199474
+ this.operator = "";
199475
+ }
199476
+ if (!m3[2]) {
199477
+ this.semver = ANY;
199478
+ } else {
199479
+ this.semver = new SemVer2(m3[2], this.options.loose);
199480
+ }
199481
+ }
199482
+ toString() {
199483
+ return this.value;
199484
+ }
199485
+ test(version2) {
199486
+ debug3("Comparator.test", version2, this.options.loose);
199487
+ if (this.semver === ANY || version2 === ANY) {
199488
+ return true;
199489
+ }
199490
+ if (typeof version2 === "string") {
199491
+ try {
199492
+ version2 = new SemVer2(version2, this.options);
199493
+ } catch (er) {
199494
+ return false;
199495
+ }
199496
+ }
199497
+ return cmp(version2, this.operator, this.semver, this.options);
199498
+ }
199499
+ intersects(comp, options) {
199500
+ if (!(comp instanceof _Comparator)) {
199501
+ throw new TypeError("a Comparator is required");
199502
+ }
199503
+ if (this.operator === "") {
199504
+ if (this.value === "") {
199505
+ return true;
199506
+ }
199507
+ return new Range(comp.value, options).test(this.value);
199508
+ } else if (comp.operator === "") {
199509
+ if (comp.value === "") {
199510
+ return true;
199511
+ }
199512
+ return new Range(this.value, options).test(comp.semver);
199513
+ }
199514
+ options = parseOptions(options);
199515
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
199516
+ return false;
199517
+ }
199518
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
199519
+ return false;
199520
+ }
199521
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
199522
+ return true;
199523
+ }
199524
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
199525
+ return true;
199526
+ }
199527
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
199528
+ return true;
199529
+ }
199530
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
199531
+ return true;
199532
+ }
199533
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
199534
+ return true;
199535
+ }
199536
+ return false;
199537
+ }
199538
+ };
199539
+ module2.exports = Comparator;
199540
+ var parseOptions = require_parse_options();
199541
+ var { safeRe: re2, t: t3 } = require_re();
199542
+ var cmp = require_cmp();
199543
+ var debug3 = require_debug();
199544
+ var SemVer2 = require_semver3();
199545
+ var Range = require_range2();
199546
+ }
199547
+ });
199548
+
199549
+ // node_modules/semver/functions/satisfies.js
199550
+ var require_satisfies = __commonJS({
199551
+ "node_modules/semver/functions/satisfies.js"(exports2, module2) {
199552
+ "use strict";
199553
+ init_import_meta_url();
199554
+ var Range = require_range2();
199555
+ var satisfies = (version2, range3, options) => {
199556
+ try {
199557
+ range3 = new Range(range3, options);
199558
+ } catch (er) {
199559
+ return false;
199560
+ }
199561
+ return range3.test(version2);
199562
+ };
199563
+ module2.exports = satisfies;
199564
+ }
199565
+ });
199566
+
199567
+ // node_modules/semver/ranges/to-comparators.js
199568
+ var require_to_comparators = __commonJS({
199569
+ "node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
199570
+ "use strict";
199571
+ init_import_meta_url();
199572
+ var Range = require_range2();
199573
+ var toComparators = (range3, options) => new Range(range3, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
199574
+ module2.exports = toComparators;
199575
+ }
199576
+ });
199577
+
199578
+ // node_modules/semver/ranges/max-satisfying.js
199579
+ var require_max_satisfying = __commonJS({
199580
+ "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
199581
+ "use strict";
199582
+ init_import_meta_url();
199583
+ var SemVer2 = require_semver3();
199584
+ var Range = require_range2();
199585
+ var maxSatisfying = (versions, range3, options) => {
199586
+ let max = null;
199587
+ let maxSV = null;
199588
+ let rangeObj = null;
199589
+ try {
199590
+ rangeObj = new Range(range3, options);
199591
+ } catch (er) {
199592
+ return null;
199593
+ }
199594
+ versions.forEach((v6) => {
199595
+ if (rangeObj.test(v6)) {
199596
+ if (!max || maxSV.compare(v6) === -1) {
199597
+ max = v6;
199598
+ maxSV = new SemVer2(max, options);
199599
+ }
199600
+ }
199601
+ });
199602
+ return max;
199603
+ };
199604
+ module2.exports = maxSatisfying;
199605
+ }
199606
+ });
199607
+
199608
+ // node_modules/semver/ranges/min-satisfying.js
199609
+ var require_min_satisfying = __commonJS({
199610
+ "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
199611
+ "use strict";
199612
+ init_import_meta_url();
199613
+ var SemVer2 = require_semver3();
199614
+ var Range = require_range2();
199615
+ var minSatisfying = (versions, range3, options) => {
199616
+ let min = null;
199617
+ let minSV = null;
199618
+ let rangeObj = null;
199619
+ try {
199620
+ rangeObj = new Range(range3, options);
199621
+ } catch (er) {
199622
+ return null;
199623
+ }
199624
+ versions.forEach((v6) => {
199625
+ if (rangeObj.test(v6)) {
199626
+ if (!min || minSV.compare(v6) === 1) {
199627
+ min = v6;
199628
+ minSV = new SemVer2(min, options);
199629
+ }
199630
+ }
199631
+ });
199632
+ return min;
199633
+ };
199634
+ module2.exports = minSatisfying;
199635
+ }
199636
+ });
199637
+
199638
+ // node_modules/semver/ranges/min-version.js
199639
+ var require_min_version = __commonJS({
199640
+ "node_modules/semver/ranges/min-version.js"(exports2, module2) {
199641
+ "use strict";
199642
+ init_import_meta_url();
199643
+ var SemVer2 = require_semver3();
199644
+ var Range = require_range2();
199645
+ var gt = require_gt();
199646
+ var minVersion = (range3, loose) => {
199647
+ range3 = new Range(range3, loose);
199648
+ let minver = new SemVer2("0.0.0");
199649
+ if (range3.test(minver)) {
199650
+ return minver;
199651
+ }
199652
+ minver = new SemVer2("0.0.0-0");
199653
+ if (range3.test(minver)) {
199654
+ return minver;
199655
+ }
199656
+ minver = null;
199657
+ for (let i3 = 0; i3 < range3.set.length; ++i3) {
199658
+ const comparators = range3.set[i3];
199659
+ let setMin = null;
199660
+ comparators.forEach((comparator) => {
199661
+ const compver = new SemVer2(comparator.semver.version);
199662
+ switch (comparator.operator) {
199663
+ case ">":
199664
+ if (compver.prerelease.length === 0) {
199665
+ compver.patch++;
199666
+ } else {
199667
+ compver.prerelease.push(0);
199668
+ }
199669
+ compver.raw = compver.format();
199670
+ /* fallthrough */
199671
+ case "":
199672
+ case ">=":
199673
+ if (!setMin || gt(compver, setMin)) {
199674
+ setMin = compver;
199675
+ }
199676
+ break;
199677
+ case "<":
199678
+ case "<=":
199679
+ break;
199680
+ /* istanbul ignore next */
199681
+ default:
199682
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
199683
+ }
199684
+ });
199685
+ if (setMin && (!minver || gt(minver, setMin))) {
199686
+ minver = setMin;
199687
+ }
199688
+ }
199689
+ if (minver && range3.test(minver)) {
199690
+ return minver;
199691
+ }
199692
+ return null;
199693
+ };
199694
+ module2.exports = minVersion;
199695
+ }
199696
+ });
199697
+
199698
+ // node_modules/semver/ranges/valid.js
199699
+ var require_valid2 = __commonJS({
199700
+ "node_modules/semver/ranges/valid.js"(exports2, module2) {
199701
+ "use strict";
199702
+ init_import_meta_url();
199703
+ var Range = require_range2();
199704
+ var validRange = (range3, options) => {
199705
+ try {
199706
+ return new Range(range3, options).range || "*";
199707
+ } catch (er) {
199708
+ return null;
199709
+ }
199710
+ };
199711
+ module2.exports = validRange;
199712
+ }
199713
+ });
199714
+
199715
+ // node_modules/semver/ranges/outside.js
199716
+ var require_outside = __commonJS({
199717
+ "node_modules/semver/ranges/outside.js"(exports2, module2) {
199718
+ "use strict";
199719
+ init_import_meta_url();
199720
+ var SemVer2 = require_semver3();
199721
+ var Comparator = require_comparator();
199722
+ var { ANY } = Comparator;
199723
+ var Range = require_range2();
199724
+ var satisfies = require_satisfies();
199725
+ var gt = require_gt();
199726
+ var lt = require_lt();
199727
+ var lte2 = require_lte();
199728
+ var gte2 = require_gte();
199729
+ var outside = (version2, range3, hilo, options) => {
199730
+ version2 = new SemVer2(version2, options);
199731
+ range3 = new Range(range3, options);
199732
+ let gtfn, ltefn, ltfn, comp, ecomp;
199733
+ switch (hilo) {
199734
+ case ">":
199735
+ gtfn = gt;
199736
+ ltefn = lte2;
199737
+ ltfn = lt;
199738
+ comp = ">";
199739
+ ecomp = ">=";
199740
+ break;
199741
+ case "<":
199742
+ gtfn = lt;
199743
+ ltefn = gte2;
199744
+ ltfn = gt;
199745
+ comp = "<";
199746
+ ecomp = "<=";
199747
+ break;
199748
+ default:
199749
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
199750
+ }
199751
+ if (satisfies(version2, range3, options)) {
199752
+ return false;
199753
+ }
199754
+ for (let i3 = 0; i3 < range3.set.length; ++i3) {
199755
+ const comparators = range3.set[i3];
199756
+ let high = null;
199757
+ let low = null;
199758
+ comparators.forEach((comparator) => {
199759
+ if (comparator.semver === ANY) {
199760
+ comparator = new Comparator(">=0.0.0");
199761
+ }
199762
+ high = high || comparator;
199763
+ low = low || comparator;
199764
+ if (gtfn(comparator.semver, high.semver, options)) {
199765
+ high = comparator;
199766
+ } else if (ltfn(comparator.semver, low.semver, options)) {
199767
+ low = comparator;
199768
+ }
199769
+ });
199770
+ if (high.operator === comp || high.operator === ecomp) {
199771
+ return false;
199772
+ }
199773
+ if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
199774
+ return false;
199775
+ } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
199776
+ return false;
199777
+ }
199778
+ }
199779
+ return true;
199780
+ };
199781
+ module2.exports = outside;
199782
+ }
199783
+ });
199784
+
199785
+ // node_modules/semver/ranges/gtr.js
199786
+ var require_gtr = __commonJS({
199787
+ "node_modules/semver/ranges/gtr.js"(exports2, module2) {
199788
+ "use strict";
199789
+ init_import_meta_url();
199790
+ var outside = require_outside();
199791
+ var gtr = (version2, range3, options) => outside(version2, range3, ">", options);
199792
+ module2.exports = gtr;
199793
+ }
199794
+ });
199795
+
199796
+ // node_modules/semver/ranges/ltr.js
199797
+ var require_ltr = __commonJS({
199798
+ "node_modules/semver/ranges/ltr.js"(exports2, module2) {
199799
+ "use strict";
199800
+ init_import_meta_url();
199801
+ var outside = require_outside();
199802
+ var ltr = (version2, range3, options) => outside(version2, range3, "<", options);
199803
+ module2.exports = ltr;
199804
+ }
199805
+ });
199806
+
199807
+ // node_modules/semver/ranges/intersects.js
199808
+ var require_intersects = __commonJS({
199809
+ "node_modules/semver/ranges/intersects.js"(exports2, module2) {
199810
+ "use strict";
199811
+ init_import_meta_url();
199812
+ var Range = require_range2();
199813
+ var intersects = (r1, r22, options) => {
199814
+ r1 = new Range(r1, options);
199815
+ r22 = new Range(r22, options);
199816
+ return r1.intersects(r22, options);
199817
+ };
199818
+ module2.exports = intersects;
199819
+ }
199820
+ });
199821
+
199822
+ // node_modules/semver/ranges/simplify.js
199823
+ var require_simplify = __commonJS({
199824
+ "node_modules/semver/ranges/simplify.js"(exports2, module2) {
199825
+ "use strict";
199826
+ init_import_meta_url();
199827
+ var satisfies = require_satisfies();
199828
+ var compare = require_compare();
199829
+ module2.exports = (versions, range3, options) => {
199830
+ const set2 = [];
199831
+ let first2 = null;
199832
+ let prev = null;
199833
+ const v6 = versions.sort((a3, b3) => compare(a3, b3, options));
199834
+ for (const version2 of v6) {
199835
+ const included = satisfies(version2, range3, options);
199836
+ if (included) {
199837
+ prev = version2;
199838
+ if (!first2) {
199839
+ first2 = version2;
199840
+ }
199841
+ } else {
199842
+ if (prev) {
199843
+ set2.push([first2, prev]);
199844
+ }
199845
+ prev = null;
199846
+ first2 = null;
199847
+ }
199848
+ }
199849
+ if (first2) {
199850
+ set2.push([first2, null]);
199851
+ }
199852
+ const ranges = [];
199853
+ for (const [min, max] of set2) {
199854
+ if (min === max) {
199855
+ ranges.push(min);
199856
+ } else if (!max && min === v6[0]) {
199857
+ ranges.push("*");
199858
+ } else if (!max) {
199859
+ ranges.push(`>=${min}`);
199860
+ } else if (min === v6[0]) {
199861
+ ranges.push(`<=${max}`);
199862
+ } else {
199863
+ ranges.push(`${min} - ${max}`);
199864
+ }
199865
+ }
199866
+ const simplified = ranges.join(" || ");
199867
+ const original = typeof range3.raw === "string" ? range3.raw : String(range3);
199868
+ return simplified.length < original.length ? simplified : range3;
199869
+ };
199870
+ }
199871
+ });
199872
+
199873
+ // node_modules/semver/ranges/subset.js
199874
+ var require_subset = __commonJS({
199875
+ "node_modules/semver/ranges/subset.js"(exports2, module2) {
199876
+ "use strict";
199877
+ init_import_meta_url();
199878
+ var Range = require_range2();
199879
+ var Comparator = require_comparator();
199880
+ var { ANY } = Comparator;
199881
+ var satisfies = require_satisfies();
199882
+ var compare = require_compare();
199883
+ var subset = (sub, dom, options = {}) => {
199884
+ if (sub === dom) {
199885
+ return true;
199886
+ }
199887
+ sub = new Range(sub, options);
199888
+ dom = new Range(dom, options);
199889
+ let sawNonNull = false;
199890
+ OUTER: for (const simpleSub of sub.set) {
199891
+ for (const simpleDom of dom.set) {
199892
+ const isSub = simpleSubset(simpleSub, simpleDom, options);
199893
+ sawNonNull = sawNonNull || isSub !== null;
199894
+ if (isSub) {
199895
+ continue OUTER;
199896
+ }
199897
+ }
199898
+ if (sawNonNull) {
199899
+ return false;
199900
+ }
199901
+ }
199902
+ return true;
199903
+ };
199904
+ var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
199905
+ var minimumVersion = [new Comparator(">=0.0.0")];
199906
+ var simpleSubset = (sub, dom, options) => {
199907
+ if (sub === dom) {
199908
+ return true;
199909
+ }
199910
+ if (sub.length === 1 && sub[0].semver === ANY) {
199911
+ if (dom.length === 1 && dom[0].semver === ANY) {
199912
+ return true;
199913
+ } else if (options.includePrerelease) {
199914
+ sub = minimumVersionWithPreRelease;
199915
+ } else {
199916
+ sub = minimumVersion;
199917
+ }
199918
+ }
199919
+ if (dom.length === 1 && dom[0].semver === ANY) {
199920
+ if (options.includePrerelease) {
199921
+ return true;
199922
+ } else {
199923
+ dom = minimumVersion;
199924
+ }
199925
+ }
199926
+ const eqSet = /* @__PURE__ */ new Set();
199927
+ let gt, lt;
199928
+ for (const c3 of sub) {
199929
+ if (c3.operator === ">" || c3.operator === ">=") {
199930
+ gt = higherGT(gt, c3, options);
199931
+ } else if (c3.operator === "<" || c3.operator === "<=") {
199932
+ lt = lowerLT(lt, c3, options);
199933
+ } else {
199934
+ eqSet.add(c3.semver);
199935
+ }
199936
+ }
199937
+ if (eqSet.size > 1) {
199938
+ return null;
199939
+ }
199940
+ let gtltComp;
199941
+ if (gt && lt) {
199942
+ gtltComp = compare(gt.semver, lt.semver, options);
199943
+ if (gtltComp > 0) {
199944
+ return null;
199945
+ } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
199946
+ return null;
199947
+ }
199948
+ }
199949
+ for (const eq of eqSet) {
199950
+ if (gt && !satisfies(eq, String(gt), options)) {
199951
+ return null;
199952
+ }
199953
+ if (lt && !satisfies(eq, String(lt), options)) {
199954
+ return null;
199955
+ }
199956
+ for (const c3 of dom) {
199957
+ if (!satisfies(eq, String(c3), options)) {
199958
+ return false;
199959
+ }
199960
+ }
199961
+ return true;
199962
+ }
199963
+ let higher, lower;
199964
+ let hasDomLT, hasDomGT;
199965
+ let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
199966
+ let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
199967
+ if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
199968
+ needDomLTPre = false;
199969
+ }
199970
+ for (const c3 of dom) {
199971
+ hasDomGT = hasDomGT || c3.operator === ">" || c3.operator === ">=";
199972
+ hasDomLT = hasDomLT || c3.operator === "<" || c3.operator === "<=";
199973
+ if (gt) {
199974
+ if (needDomGTPre) {
199975
+ if (c3.semver.prerelease && c3.semver.prerelease.length && c3.semver.major === needDomGTPre.major && c3.semver.minor === needDomGTPre.minor && c3.semver.patch === needDomGTPre.patch) {
199976
+ needDomGTPre = false;
199977
+ }
199978
+ }
199979
+ if (c3.operator === ">" || c3.operator === ">=") {
199980
+ higher = higherGT(gt, c3, options);
199981
+ if (higher === c3 && higher !== gt) {
199982
+ return false;
199983
+ }
199984
+ } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c3), options)) {
199985
+ return false;
199986
+ }
199987
+ }
199988
+ if (lt) {
199989
+ if (needDomLTPre) {
199990
+ if (c3.semver.prerelease && c3.semver.prerelease.length && c3.semver.major === needDomLTPre.major && c3.semver.minor === needDomLTPre.minor && c3.semver.patch === needDomLTPre.patch) {
199991
+ needDomLTPre = false;
199992
+ }
199993
+ }
199994
+ if (c3.operator === "<" || c3.operator === "<=") {
199995
+ lower = lowerLT(lt, c3, options);
199996
+ if (lower === c3 && lower !== lt) {
199997
+ return false;
199998
+ }
199999
+ } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c3), options)) {
200000
+ return false;
200001
+ }
200002
+ }
200003
+ if (!c3.operator && (lt || gt) && gtltComp !== 0) {
200004
+ return false;
200005
+ }
200006
+ }
200007
+ if (gt && hasDomLT && !lt && gtltComp !== 0) {
200008
+ return false;
200009
+ }
200010
+ if (lt && hasDomGT && !gt && gtltComp !== 0) {
200011
+ return false;
200012
+ }
200013
+ if (needDomGTPre || needDomLTPre) {
200014
+ return false;
200015
+ }
200016
+ return true;
200017
+ };
200018
+ var higherGT = (a3, b3, options) => {
200019
+ if (!a3) {
200020
+ return b3;
200021
+ }
200022
+ const comp = compare(a3.semver, b3.semver, options);
200023
+ return comp > 0 ? a3 : comp < 0 ? b3 : b3.operator === ">" && a3.operator === ">=" ? b3 : a3;
200024
+ };
200025
+ var lowerLT = (a3, b3, options) => {
200026
+ if (!a3) {
200027
+ return b3;
200028
+ }
200029
+ const comp = compare(a3.semver, b3.semver, options);
200030
+ return comp < 0 ? a3 : comp > 0 ? b3 : b3.operator === "<" && a3.operator === "<=" ? b3 : a3;
200031
+ };
200032
+ module2.exports = subset;
200033
+ }
200034
+ });
200035
+
200036
+ // node_modules/semver/index.js
200037
+ var require_semver4 = __commonJS({
200038
+ "node_modules/semver/index.js"(exports2, module2) {
200039
+ "use strict";
200040
+ init_import_meta_url();
200041
+ var internalRe = require_re();
200042
+ var constants3 = require_constants3();
200043
+ var SemVer2 = require_semver3();
200044
+ var identifiers = require_identifiers();
200045
+ var parse4 = require_parse3();
200046
+ var valid = require_valid();
200047
+ var clean = require_clean();
200048
+ var inc2 = require_inc();
200049
+ var diff = require_diff();
200050
+ var major2 = require_major();
200051
+ var minor = require_minor();
200052
+ var patch = require_patch();
200053
+ var prerelease = require_prerelease();
200054
+ var compare = require_compare();
200055
+ var rcompare = require_rcompare();
200056
+ var compareLoose = require_compare_loose();
200057
+ var compareBuild = require_compare_build();
200058
+ var sort = require_sort();
200059
+ var rsort = require_rsort();
200060
+ var gt = require_gt();
200061
+ var lt = require_lt();
200062
+ var eq = require_eq();
200063
+ var neq = require_neq();
200064
+ var gte2 = require_gte();
200065
+ var lte2 = require_lte();
200066
+ var cmp = require_cmp();
200067
+ var coerce = require_coerce();
200068
+ var Comparator = require_comparator();
200069
+ var Range = require_range2();
200070
+ var satisfies = require_satisfies();
200071
+ var toComparators = require_to_comparators();
200072
+ var maxSatisfying = require_max_satisfying();
200073
+ var minSatisfying = require_min_satisfying();
200074
+ var minVersion = require_min_version();
200075
+ var validRange = require_valid2();
200076
+ var outside = require_outside();
200077
+ var gtr = require_gtr();
200078
+ var ltr = require_ltr();
200079
+ var intersects = require_intersects();
200080
+ var simplifyRange = require_simplify();
200081
+ var subset = require_subset();
200082
+ module2.exports = {
200083
+ parse: parse4,
200084
+ valid,
200085
+ clean,
200086
+ inc: inc2,
200087
+ diff,
200088
+ major: major2,
200089
+ minor,
200090
+ patch,
200091
+ prerelease,
200092
+ compare,
200093
+ rcompare,
200094
+ compareLoose,
200095
+ compareBuild,
200096
+ sort,
200097
+ rsort,
200098
+ gt,
200099
+ lt,
200100
+ eq,
200101
+ neq,
200102
+ gte: gte2,
200103
+ lte: lte2,
200104
+ cmp,
200105
+ coerce,
200106
+ Comparator,
200107
+ Range,
200108
+ satisfies,
200109
+ toComparators,
200110
+ maxSatisfying,
200111
+ minSatisfying,
200112
+ minVersion,
200113
+ validRange,
200114
+ outside,
200115
+ gtr,
200116
+ ltr,
200117
+ intersects,
200118
+ simplifyRange,
200119
+ subset,
200120
+ SemVer: SemVer2,
200121
+ re: internalRe.re,
200122
+ src: internalRe.src,
200123
+ tokens: internalRe.t,
200124
+ SEMVER_SPEC_VERSION: constants3.SEMVER_SPEC_VERSION,
200125
+ RELEASE_TYPES: constants3.RELEASE_TYPES,
200126
+ compareIdentifiers: identifiers.compareIdentifiers,
200127
+ rcompareIdentifiers: identifiers.rcompareIdentifiers
200128
+ };
200129
+ }
200130
+ });
200131
+
197782
200132
  // node_modules/string-length/node_modules/strip-ansi/index.js
197783
200133
  var require_strip_ansi2 = __commonJS({
197784
200134
  "node_modules/string-length/node_modules/strip-ansi/index.js"(exports2, module2) {
@@ -203343,6 +205693,48 @@ init_async();
203343
205693
  init_changelog();
203344
205694
  init_errors2();
203345
205695
  init_git();
205696
+
205697
+ // src/utils/autoVersion.ts
205698
+ init_import_meta_url();
205699
+ var semver = __toESM(require_semver4());
205700
+ init_logger2();
205701
+ init_changelog();
205702
+ function calculateNextVersion(currentVersion, bumpType) {
205703
+ const versionToBump = currentVersion || "0.0.0";
205704
+ const newVersion = semver.inc(versionToBump, bumpType);
205705
+ if (!newVersion) {
205706
+ throw new Error(
205707
+ `Failed to increment version "${versionToBump}" with bump type "${bumpType}"`
205708
+ );
205709
+ }
205710
+ return newVersion;
205711
+ }
205712
+ async function getChangelogWithBumpType(git, rev) {
205713
+ logger.info(
205714
+ `Analyzing commits since ${rev || "(beginning of history)"} for auto-versioning...`
205715
+ );
205716
+ const result = await generateChangesetFromGit(git, rev);
205717
+ if (result.bumpType) {
205718
+ logger.info(
205719
+ `Auto-version: determined ${result.bumpType} bump (${result.matchedCommitsWithSemver}/${result.totalCommits} commits matched)`
205720
+ );
205721
+ }
205722
+ return result;
205723
+ }
205724
+ function validateBumpType(result) {
205725
+ if (result.totalCommits === 0) {
205726
+ throw new Error(
205727
+ "Cannot determine version automatically: no commits found since the last release."
205728
+ );
205729
+ }
205730
+ if (result.bumpType === null) {
205731
+ throw new Error(
205732
+ `Cannot determine version automatically: ${result.totalCommits} commit(s) found, but none matched a category with a "semver" field in the release configuration. Please ensure your .github/release.yml categories have "semver" fields defined, or specify the version explicitly.`
205733
+ );
205734
+ }
205735
+ }
205736
+
205737
+ // src/commands/prepare.ts
203346
205738
  init_helpers();
203347
205739
  init_strings();
203348
205740
  init_system();
@@ -203746,8 +206138,9 @@ var command3 = ["prepare NEW-VERSION"];
203746
206138
  var aliases2 = ["p", "prerelease", "prepublish", "prepare", "release"];
203747
206139
  var description2 = "\u{1F6A2} Prepare a new release branch";
203748
206140
  var DEFAULT_BUMP_VERSION_PATH = (0, import_path17.join)("scripts", "bump-version.sh");
206141
+ var AUTO_VERSION_MIN_VERSION = "2.14.0";
203749
206142
  var builder2 = (yargs) => yargs.positional("NEW-VERSION", {
203750
- description: "The new version you want to release",
206143
+ description: 'The new version to release. Can be: a semver string (e.g., "1.2.3"), a bump type ("major", "minor", or "patch"), or "auto" to determine automatically from conventional commits. Bump types and "auto" require minVersion >= 2.14.0 in .craft.yml',
203751
206144
  type: "string"
203752
206145
  }).option("rev", {
203753
206146
  alias: "r",
@@ -203777,9 +206170,13 @@ var builder2 = (yargs) => yargs.positional("NEW-VERSION", {
203777
206170
  var SLEEP_BEFORE_PUBLISH_SECONDS = 30;
203778
206171
  function checkVersionOrPart(argv, _opt) {
203779
206172
  const version2 = argv.newVersion;
203780
- if (["major", "minor", "patch"].indexOf(version2) > -1) {
203781
- throw Error("Version part is not supported yet");
203782
- } else if (isValidVersion(version2)) {
206173
+ if (version2 === "auto") {
206174
+ return true;
206175
+ }
206176
+ if (isBumpType(version2)) {
206177
+ return true;
206178
+ }
206179
+ if (isValidVersion(version2)) {
203783
206180
  return true;
203784
206181
  } else {
203785
206182
  let errMsg = `Invalid version or version part specified: "${version2}"`;
@@ -203947,7 +206344,8 @@ async function prepareChangelog(git, oldVersion, newVersion, changelogPolicy = "
203947
206344
  }
203948
206345
  if (!changeset.body) {
203949
206346
  replaceSection = changeset.name;
203950
- changeset.body = await generateChangesetFromGit(git, oldVersion);
206347
+ const result = await generateChangesetFromGit(git, oldVersion);
206348
+ changeset.body = result.changelog;
203951
206349
  }
203952
206350
  if (changeset.name === DEFAULT_UNRELEASED_TITLE) {
203953
206351
  replaceSection = changeset.name;
@@ -203993,7 +206391,7 @@ async function switchToDefaultBranch(git, defaultBranch) {
203993
206391
  async function prepareMain(argv) {
203994
206392
  const config3 = getConfiguration();
203995
206393
  const githubConfig = await getGlobalGitHubConfig();
203996
- const newVersion = argv.newVersion;
206394
+ let newVersion = argv.newVersion;
203997
206395
  const git = await getGitClient();
203998
206396
  const defaultBranch = await getDefaultBranch(git, argv.remote);
203999
206397
  logger.debug(`Default branch for the repo:`, defaultBranch);
@@ -204004,6 +206402,27 @@ async function prepareMain(argv) {
204004
206402
  } else {
204005
206403
  checkGitStatus(repoStatus, rev);
204006
206404
  }
206405
+ const isVersionBumpType = isBumpType(newVersion);
206406
+ if (newVersion === "auto" || isVersionBumpType) {
206407
+ if (!requiresMinVersion(AUTO_VERSION_MIN_VERSION)) {
206408
+ const featureName = isVersionBumpType ? "Version bump types" : "Auto-versioning";
206409
+ throw new ConfigurationError(
206410
+ `${featureName} requires minVersion >= ${AUTO_VERSION_MIN_VERSION} in .craft.yml. Please update your configuration or specify the version explicitly.`
206411
+ );
206412
+ }
206413
+ const latestTag = await getLatestTag(git);
206414
+ let bumpType;
206415
+ if (newVersion === "auto") {
206416
+ const changelogResult = await getChangelogWithBumpType(git, latestTag);
206417
+ validateBumpType(changelogResult);
206418
+ bumpType = changelogResult.bumpType;
206419
+ } else {
206420
+ bumpType = newVersion;
206421
+ }
206422
+ const currentVersion = latestTag && latestTag.replace(/^v/, "").match(/^\d/) ? latestTag.replace(/^v/, "") : "0.0.0";
206423
+ newVersion = calculateNextVersion(currentVersion, bumpType);
206424
+ logger.info(`Version bump: ${currentVersion} -> ${newVersion} (${bumpType} bump)`);
206425
+ }
204007
206426
  logger.info(`Releasing version ${newVersion} from ${rev}`);
204008
206427
  if (!argv.rev && rev !== defaultBranch) {
204009
206428
  logger.warn("You're not on your default branch, so I have to ask...");