@sentry/craft 2.21.1 → 2.21.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/craft +313 -192
  2. package/package.json +4 -1
package/dist/craft CHANGED
@@ -55046,8 +55046,14 @@ function envToBool2(envVar) {
55046
55046
  return !FALSY_ENV_VALUES2.has(normalized);
55047
55047
  }
55048
55048
  function setGlobals(argv) {
55049
- for (const globalFlag of Object.keys(GLOBAL_FLAGS)) {
55050
- GLOBAL_FLAGS[globalFlag] = argv[globalFlag];
55049
+ if (argv["dry-run"] !== void 0) {
55050
+ GLOBAL_FLAGS["dry-run"] = argv["dry-run"];
55051
+ }
55052
+ if (argv["no-input"] !== void 0) {
55053
+ GLOBAL_FLAGS["no-input"] = argv["no-input"];
55054
+ }
55055
+ if (argv["log-level"] !== void 0) {
55056
+ GLOBAL_FLAGS["log-level"] = argv["log-level"];
55051
55057
  }
55052
55058
  logger.trace("Global flags:", GLOBAL_FLAGS);
55053
55059
  setLevel(import_consola.LogLevel[GLOBAL_FLAGS["log-level"]]);
@@ -71039,7 +71045,7 @@ function replaceEnvVariable(arg, env2) {
71039
71045
  return arg;
71040
71046
  }
71041
71047
  }
71042
- async function spawnProcess2(command10, args = [], options = {}, spawnProcessOptions = {}) {
71048
+ async function spawnProcess(command10, args = [], options = {}, spawnProcessOptions = {}) {
71043
71049
  const argsString = args.map((arg) => `"${arg}"`).join(" ");
71044
71050
  if (isDryRun() && !spawnProcessOptions.enableInDryRunMode && !isInWorktreeMode()) {
71045
71051
  logger.info("[dry-run] Not spawning process:", `${command10} ${argsString}`);
@@ -71189,7 +71195,7 @@ async function runWithExecutable(config3, args, options = {}, spawnOpts = {}) {
71189
71195
  }
71190
71196
  }
71191
71197
  logger.debug(`Running: ${bin} ${args.join(" ")}`);
71192
- return spawnProcess2(bin, args, options, spawnOpts);
71198
+ return spawnProcess(bin, args, options, spawnOpts);
71193
71199
  }
71194
71200
  async function extractZipArchive(filePath, dir) {
71195
71201
  await (0, import_extract_zip.default)(filePath, { dir });
@@ -71278,10 +71284,29 @@ function stringToRegexp(str2) {
71278
71284
  function escapeRegex(str2) {
71279
71285
  return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
71280
71286
  }
71287
+ function hasGlobChars(str2) {
71288
+ return /[*?]/.test(str2);
71289
+ }
71290
+ function globToRegex(pattern) {
71291
+ let result = "";
71292
+ for (const char of pattern) {
71293
+ if (char === "*") {
71294
+ result += ".*";
71295
+ } else if (char === "?") {
71296
+ result += ".";
71297
+ } else {
71298
+ result += escapeRegex(char);
71299
+ }
71300
+ }
71301
+ return result;
71302
+ }
71281
71303
  function patternToRegexp(pattern) {
71282
71304
  if (pattern.startsWith("/") && pattern.lastIndexOf("/") > 0) {
71283
71305
  return stringToRegexp(pattern);
71284
71306
  }
71307
+ if (hasGlobChars(pattern)) {
71308
+ return new RegExp(`^${globToRegex(pattern)}$`);
71309
+ }
71285
71310
  return new RegExp(`^${escapeRegex(pattern)}$`);
71286
71311
  }
71287
71312
  var init_filters = __esm({
@@ -80165,7 +80190,7 @@ async function retrySpawnProcess(command10, args = [], spawnOptions = {}, spawnP
80165
80190
  const retryExpFactor = retryOptions.retryExpFactor ?? RETRY_EXP_FACTOR;
80166
80191
  let retryDelay = retryOptions.retryDelay ?? RETRY_DELAY_SECS;
80167
80192
  return withRetry(
80168
- () => spawnProcess2(command10, args, spawnOptions, spawnProcessOptions),
80193
+ () => spawnProcess(command10, args, spawnOptions, spawnProcessOptions),
80169
80194
  maxRetries,
80170
80195
  async (err) => {
80171
80196
  logger.warn(`${command10} failed. Trying again in ${retryDelay}s.`);
@@ -80391,10 +80416,14 @@ function normalizeArtifactsConfig(config3) {
80391
80416
  return [];
80392
80417
  }
80393
80418
  if (typeof config3 === "string") {
80394
- return [{ workflow: void 0, artifacts: normalizeArtifactPatterns(config3) }];
80419
+ return [
80420
+ { workflow: void 0, artifacts: normalizeArtifactPatterns(config3) }
80421
+ ];
80395
80422
  }
80396
80423
  if (Array.isArray(config3)) {
80397
- return [{ workflow: void 0, artifacts: normalizeArtifactPatterns(config3) }];
80424
+ return [
80425
+ { workflow: void 0, artifacts: normalizeArtifactPatterns(config3) }
80426
+ ];
80398
80427
  }
80399
80428
  const filters = [];
80400
80429
  for (const [workflowPattern, artifactPatterns] of Object.entries(config3)) {
@@ -80735,10 +80764,15 @@ var init_github = __esm({
80735
80764
  try {
80736
80765
  if (fs14.existsSync(tempFile)) {
80737
80766
  fs14.unlinkSync(tempFile);
80738
- this.logger.debug(`Cleaned up temp file after failed unpack: ${tempFile}`);
80767
+ this.logger.debug(
80768
+ `Cleaned up temp file after failed unpack: ${tempFile}`
80769
+ );
80739
80770
  }
80740
80771
  } catch (cleanupError) {
80741
- this.logger.warn(`Failed to clean up temp file ${tempFile}:`, cleanupError);
80772
+ this.logger.warn(
80773
+ `Failed to clean up temp file ${tempFile}:`,
80774
+ cleanupError
80775
+ );
80742
80776
  }
80743
80777
  }
80744
80778
  }
@@ -80750,6 +80784,49 @@ var init_github = __esm({
80750
80784
  }
80751
80785
  return allArtifacts;
80752
80786
  }
80787
+ /**
80788
+ * Validates that every configured workflow pattern matched at least one
80789
+ * workflow run, and every artifact pattern matched at least one artifact.
80790
+ *
80791
+ * This catches configuration issues early with clear error messages instead
80792
+ * of letting them surface as confusing per-target failures later.
80793
+ *
80794
+ * @param filters Normalized artifact filters from config
80795
+ * @param allRuns All workflow runs found for the commit
80796
+ * @param matchingArtifacts Artifacts that matched at least one pattern
80797
+ */
80798
+ validateAllPatternsMatched(filters, allRuns, matchingArtifacts) {
80799
+ const errors = [];
80800
+ for (const filter3 of filters) {
80801
+ if (filter3.workflow) {
80802
+ const hasMatchingRun = allRuns.some(
80803
+ (run) => filter3.workflow.test(run.name ?? "")
80804
+ );
80805
+ if (!hasMatchingRun) {
80806
+ const availableNames = allRuns.map((r4) => r4.name ?? "(unnamed)").join(", ");
80807
+ errors.push(
80808
+ `Workflow pattern ${filter3.workflow} did not match any workflow runs. Available workflows: ${availableNames || "(none)"}`
80809
+ );
80810
+ continue;
80811
+ }
80812
+ }
80813
+ const scopedArtifacts = filter3.workflow ? matchingArtifacts.filter((a4) => {
80814
+ const runName = allRuns.find((r4) => r4.id === a4.workflow_run?.id)?.name ?? "";
80815
+ return filter3.workflow.test(runName);
80816
+ }) : matchingArtifacts;
80817
+ for (const artifactPattern of filter3.artifacts) {
80818
+ const matched = scopedArtifacts.some((a4) => artifactPattern.test(a4.name));
80819
+ if (!matched) {
80820
+ const availableNames = scopedArtifacts.map((a4) => a4.name).join(", ");
80821
+ const workflowDesc = filter3.workflow ? ` (from workflow ${filter3.workflow})` : "";
80822
+ errors.push(
80823
+ `Artifact pattern ${artifactPattern}${workflowDesc} did not match any artifacts. Available artifact names: ${availableNames || "(none)"}`
80824
+ );
80825
+ }
80826
+ }
80827
+ }
80828
+ return errors;
80829
+ }
80753
80830
  /**
80754
80831
  * Fetches artifacts using the new workflow-based approach
80755
80832
  *
@@ -80797,6 +80874,25 @@ var init_github = __esm({
80797
80874
  `No artifacts matching filters found for revision "${revision}" (tries: ${MAX_TRIES})`
80798
80875
  );
80799
80876
  }
80877
+ const validationErrors = this.validateAllPatternsMatched(
80878
+ filters,
80879
+ allRuns,
80880
+ matchingArtifacts
80881
+ );
80882
+ if (validationErrors.length > 0) {
80883
+ if (tries + 1 < MAX_TRIES) {
80884
+ this.logger.info(
80885
+ `Not all patterns matched yet (${validationErrors.length} unmatched). Waiting ${ARTIFACTS_POLLING_INTERVAL / MILLISECONDS} seconds before retrying...`
80886
+ );
80887
+ await sleep(ARTIFACTS_POLLING_INTERVAL);
80888
+ continue;
80889
+ }
80890
+ throw new Error(
80891
+ `Not all configured artifact patterns were satisfied:
80892
+ - ${validationErrors.join("\n - ")}
80893
+ Check that your workflow names and artifact names in .craft.yml match what your CI actually produces.`
80894
+ );
80895
+ }
80800
80896
  this.logger.debug(
80801
80897
  `Downloading ${matchingArtifacts.length} artifacts in parallel...`
80802
80898
  );
@@ -110903,7 +110999,7 @@ var init_gcsApi = __esm({
110903
110999
  this.bucket = new Bucket(
110904
111000
  new Storage({
110905
111001
  credentials,
110906
- maxRetries,
111002
+ retryOptions: { maxRetries },
110907
111003
  projectId
110908
111004
  }),
110909
111005
  bucketName
@@ -110948,7 +111044,9 @@ var init_gcsApi = __esm({
110948
111044
  );
110949
111045
  const destination = path14.posix.join(this.bucketName, pathInBucket);
110950
111046
  await safeExec(async () => {
110951
- logger.debug(`Attempting to upload \`${filename}\` to \`${destination}\`.`);
111047
+ logger.debug(
111048
+ `Attempting to upload \`${filename}\` to \`${destination}\`.`
111049
+ );
110952
111050
  try {
110953
111051
  await this.bucket.upload(artifactLocalPath, uploadConfig);
110954
111052
  } catch (err) {
@@ -111020,7 +111118,7 @@ var init_gcsApi = __esm({
111020
111118
  filename,
111021
111119
  mimeType,
111022
111120
  storedFile: {
111023
- downloadFilepath,
111121
+ downloadFilepath: downloadFilepath ?? name2,
111024
111122
  filename,
111025
111123
  lastUpdated,
111026
111124
  size: Number(size)
@@ -111036,17 +111134,16 @@ var init_gcsApi = __esm({
111036
111134
  * @returns An array of RemoteArtifact objects
111037
111135
  */
111038
111136
  async listArtifactsForRevision(repoOwner, repoName, revision) {
111039
- let filesResponse = [[]];
111137
+ let files = [];
111040
111138
  const prefix = path14.posix.join(repoOwner, repoName, revision);
111041
111139
  logger.debug(`Looking for files starting with '${prefix}'`);
111042
111140
  try {
111043
- filesResponse = await this.bucket.getFiles({ prefix });
111141
+ [files] = await this.bucket.getFiles({ prefix });
111044
111142
  } catch (err) {
111045
111143
  reportError(
111046
111144
  `Error retrieving artifact list from GCS: ${formatJson(err)}`
111047
111145
  );
111048
111146
  }
111049
- const files = filesResponse[0];
111050
111147
  return files.map((gcsFile) => this.convertToRemoteArtifact(gcsFile));
111051
111148
  }
111052
111149
  };
@@ -117929,13 +118026,14 @@ var init_brew = __esm({
117929
118026
  * Extracts Brew target options from the raw configuration
117930
118027
  */
117931
118028
  getBrewConfig() {
117932
- const template = this.config.template;
118029
+ const config3 = this.config;
118030
+ const template = config3.template;
117933
118031
  if (!template) {
117934
118032
  throw new ConfigurationError(
117935
118033
  'Please specify Formula template in the "brew" target configuration.'
117936
118034
  );
117937
118035
  }
117938
- const { formula, path: path26 } = this.config;
118036
+ const { formula, path: path26 } = config3;
117939
118037
  return {
117940
118038
  formula,
117941
118039
  path: path26,
@@ -117953,7 +118051,8 @@ var init_brew = __esm({
117953
118051
  * @returns The owner and repository of the tap
117954
118052
  */
117955
118053
  getTapRepo() {
117956
- const { tap } = this.config;
118054
+ const config3 = this.config;
118055
+ const { tap } = config3;
117957
118056
  if (!tap) {
117958
118057
  return {
117959
118058
  owner: "homebrew",
@@ -118042,14 +118141,18 @@ var init_brew = __esm({
118042
118141
  this.logger.debug("Downloading artifacts for the revision");
118043
118142
  this.logger.trace(filesList.map((file) => file.filename));
118044
118143
  const checksums = {};
118045
- await (0, import_async4.mapLimit)(filesList, MAX_DOWNLOAD_CONCURRENCY, async (file) => {
118046
- const key = file.filename.replace(version2, "__VERSION__");
118047
- checksums[key] = await this.artifactProvider.getChecksum(
118048
- file,
118049
- "sha256" /* SHA256 */,
118050
- "hex" /* Hex */
118051
- );
118052
- });
118144
+ await (0, import_async4.mapLimit)(
118145
+ filesList,
118146
+ MAX_DOWNLOAD_CONCURRENCY,
118147
+ async (file) => {
118148
+ const key = file.filename.replace(version2, "__VERSION__");
118149
+ checksums[key] = await this.artifactProvider.getChecksum(
118150
+ file,
118151
+ "sha256" /* SHA256 */,
118152
+ "hex" /* Hex */
118153
+ );
118154
+ }
118155
+ );
118053
118156
  const data2 = renderTemplateSafe(template, {
118054
118157
  checksums,
118055
118158
  revision,
@@ -118119,7 +118222,8 @@ var init_cocoapods = __esm({
118119
118222
  * Extracts Cocoapods target options from the environment
118120
118223
  */
118121
118224
  getCocoapodsConfig() {
118122
- const specPath = this.config.specPath;
118225
+ const config3 = this.config;
118226
+ const specPath = config3.specPath;
118123
118227
  if (!specPath) {
118124
118228
  throw new ConfigurationError("No podspec path provided!");
118125
118229
  }
@@ -118154,8 +118258,8 @@ var init_cocoapods = __esm({
118154
118258
  const filePath = (0, import_path7.join)(directory, fileName);
118155
118259
  await writeFile2(filePath, specContents, "utf8");
118156
118260
  this.logger.info(`Pushing podspec "${fileName}" to cocoapods...`);
118157
- await spawnProcess2(COCOAPODS_BIN, ["setup"]);
118158
- await spawnProcess2(
118261
+ await spawnProcess(COCOAPODS_BIN, ["setup"]);
118262
+ await spawnProcess(
118159
118263
  COCOAPODS_BIN,
118160
118264
  ["trunk", "push", fileName, "--allow-warnings", "--synchronous"],
118161
118265
  {
@@ -118468,7 +118572,7 @@ function hasGcloudCredentials() {
118468
118572
  }
118469
118573
  async function isGcloudAvailable() {
118470
118574
  try {
118471
- await spawnProcess2("gcloud", ["--version"], {}, {});
118575
+ await spawnProcess("gcloud", ["--version"], {}, {});
118472
118576
  return true;
118473
118577
  } catch {
118474
118578
  return false;
@@ -118710,7 +118814,7 @@ Please use ${registryHint}DOCKER_USERNAME and DOCKER_PASSWORD environment variab
118710
118814
  }
118711
118815
  const registryName = registry || "Docker Hub";
118712
118816
  this.logger.debug(`Logging into ${registryName}...`);
118713
- await spawnProcess2(DOCKER_BIN, args, {}, { stdin: password });
118817
+ await spawnProcess(DOCKER_BIN, args, {}, { stdin: password });
118714
118818
  }
118715
118819
  /**
118716
118820
  * Configures Docker to use gcloud for authentication to Google Cloud registries.
@@ -118734,7 +118838,7 @@ Please use ${registryHint}DOCKER_USERNAME and DOCKER_PASSWORD environment variab
118734
118838
  const registryList = registries.join(",");
118735
118839
  this.logger.debug(`Configuring Docker for Google Cloud registries: ${registryList}`);
118736
118840
  try {
118737
- await spawnProcess2("gcloud", ["auth", "configure-docker", registryList, "--quiet"], {}, {});
118841
+ await spawnProcess("gcloud", ["auth", "configure-docker", registryList, "--quiet"], {}, {});
118738
118842
  this.logger.info(`Configured Docker authentication for: ${registryList}`);
118739
118843
  return true;
118740
118844
  } catch (error3) {
@@ -118810,7 +118914,7 @@ Please use ${registryHint}DOCKER_USERNAME and DOCKER_PASSWORD environment variab
118810
118914
  version: version2
118811
118915
  });
118812
118916
  this.logger.debug(`Copying image from ${sourceImage} to ${targetImage}...`);
118813
- return spawnProcess2(
118917
+ return spawnProcess(
118814
118918
  DOCKER_BIN,
118815
118919
  ["buildx", "imagetools", "create", "--tag", targetImage, sourceImage],
118816
118920
  {},
@@ -118868,9 +118972,11 @@ var init_gcs2 = __esm({
118868
118972
  legacyName: "CRAFT_GCS_CREDENTIALS_PATH"
118869
118973
  }
118870
118974
  );
118871
- const bucketName = this.config.bucket;
118975
+ const config3 = this.config;
118976
+ const bucketName = config3.bucket;
118872
118977
  if (!bucketName) {
118873
118978
  reportError("No GCS bucket provided!");
118979
+ throw new Error("No GCS bucket provided!");
118874
118980
  }
118875
118981
  const pathTemplates = this.parseRawPathConfig(
118876
118982
  this.config.paths
@@ -119110,7 +119216,7 @@ var init_gem = __esm({
119110
119216
  * @returns A promise that resolves when the gem pushed
119111
119217
  */
119112
119218
  async pushGem(path26) {
119113
- return spawnProcess2(GEM_BIN, ["push", path26]);
119219
+ return spawnProcess(GEM_BIN, ["push", path26]);
119114
119220
  }
119115
119221
  /**
119116
119222
  * Pushes a gem to rubygems.org
@@ -119174,12 +119280,13 @@ var init_ghPages = __esm({
119174
119280
  * Extracts "gh-pages" target options from the raw configuration
119175
119281
  */
119176
119282
  getGhPagesConfig() {
119283
+ const config3 = this.config;
119177
119284
  let githubOwner;
119178
119285
  let githubRepo;
119179
- if (this.config.githubOwner && this.config.githubRepo) {
119180
- githubOwner = this.config.githubOwner;
119181
- githubRepo = this.config.githubRepo;
119182
- } else if (!this.config.githubOwner && !this.config.githubRepo) {
119286
+ if (config3.githubOwner && config3.githubRepo) {
119287
+ githubOwner = config3.githubOwner;
119288
+ githubRepo = config3.githubRepo;
119289
+ } else if (!config3.githubOwner && !config3.githubRepo) {
119183
119290
  githubOwner = this.githubRepo.owner;
119184
119291
  githubRepo = this.githubRepo.repo;
119185
119292
  } else {
@@ -119187,7 +119294,7 @@ var init_ghPages = __esm({
119187
119294
  "[gh-pages] Invalid repository configuration: check repo owner and name"
119188
119295
  );
119189
119296
  }
119190
- const branch = this.config.branch || DEFAULT_DEPLOY_BRANCH;
119297
+ const branch = config3.branch || DEFAULT_DEPLOY_BRANCH;
119191
119298
  return {
119192
119299
  branch,
119193
119300
  githubOwner,
@@ -121587,18 +121694,19 @@ var init_github3 = __esm({
121587
121694
  constructor(config3, artifactProvider, githubRepo) {
121588
121695
  super(config3, artifactProvider, githubRepo);
121589
121696
  this.githubRepo = githubRepo;
121590
- const owner = config3.owner || githubRepo.owner;
121591
- const repo = config3.repo || githubRepo.repo;
121697
+ const typedConfig = this.config;
121698
+ const owner = typedConfig.owner || githubRepo.owner;
121699
+ const repo = typedConfig.repo || githubRepo.repo;
121592
121700
  const configChangelog = getConfiguration().changelog;
121593
121701
  const changelog = typeof configChangelog === "string" ? configChangelog : configChangelog?.filePath || DEFAULT_CHANGELOG_PATH;
121594
121702
  this.githubConfig = {
121595
121703
  owner,
121596
121704
  repo,
121597
121705
  changelog,
121598
- previewReleases: this.config.previewReleases === void 0 || !!this.config.previewReleases,
121599
- tagPrefix: this.config.tagPrefix || "",
121600
- tagOnly: !!this.config.tagOnly,
121601
- floatingTags: this.config.floatingTags || []
121706
+ previewReleases: typedConfig.previewReleases === void 0 || !!typedConfig.previewReleases,
121707
+ tagPrefix: typedConfig.tagPrefix || "",
121708
+ tagOnly: !!typedConfig.tagOnly,
121709
+ floatingTags: typedConfig.floatingTags || []
121602
121710
  };
121603
121711
  this.github = getGitHubClient();
121604
121712
  }
@@ -121740,7 +121848,11 @@ var init_github3 = __esm({
121740
121848
  `
121741
121849
  );
121742
121850
  try {
121743
- const { url: url2 } = await this.handleGitHubUpload(release3, path26, contentType);
121851
+ const { url: url2 } = await this.handleGitHubUpload(
121852
+ release3,
121853
+ path26,
121854
+ contentType
121855
+ );
121744
121856
  process.stderr.write(`\u2714 Uploaded asset "${name2}".
121745
121857
  `);
121746
121858
  return url2;
@@ -121784,7 +121896,7 @@ var init_github3 = __esm({
121784
121896
  );
121785
121897
  }
121786
121898
  return ret;
121787
- } catch (err) {
121899
+ } catch {
121788
121900
  if (retries <= 0) {
121789
121901
  throw new Error(
121790
121902
  `Reached maximum retries for trying to upload asset "${params.name}.`
@@ -127922,7 +128034,7 @@ function fileExists(filePath) {
127922
128034
  try {
127923
128035
  (0, import_fs12.readFileSync)(filePath);
127924
128036
  return true;
127925
- } catch (err) {
128037
+ } catch {
127926
128038
  return false;
127927
128039
  }
127928
128040
  }
@@ -128080,7 +128192,7 @@ async function getLatestVersion(packageName, npmConfig, otp) {
128080
128192
  filePath,
128081
128193
  `//registry.npmjs.org/:_authToken=\${${NPM_TOKEN_ENV_VAR}}`
128082
128194
  );
128083
- return spawnProcess2(bin, args, spawnOptions);
128195
+ return spawnProcess(bin, args, spawnOptions);
128084
128196
  });
128085
128197
  if (!response) {
128086
128198
  return void 0;
@@ -128272,7 +128384,7 @@ var init_npm = __esm({
128272
128384
  const isWorkspace = workspaces.type !== "none" && workspaces.packages.length > 0;
128273
128385
  const baseArgs = isNpm ? ["version", newVersion, "--no-git-tag-version", "--allow-same-version"] : ["version", newVersion, "--no-git-tag-version"];
128274
128386
  logger.debug(`Running: ${bin} ${baseArgs.join(" ")}`);
128275
- await spawnProcess2(bin, baseArgs, { cwd: rootDir });
128387
+ await spawnProcess(bin, baseArgs, { cwd: rootDir });
128276
128388
  if (isWorkspace) {
128277
128389
  if (isNpm) {
128278
128390
  const workspaceArgs = [
@@ -128284,7 +128396,7 @@ var init_npm = __esm({
128284
128396
  `Running: ${bin} ${workspaceArgs.join(" ")} (for workspaces)`
128285
128397
  );
128286
128398
  try {
128287
- await spawnProcess2(bin, workspaceArgs, { cwd: rootDir });
128399
+ await spawnProcess(bin, workspaceArgs, { cwd: rootDir });
128288
128400
  } catch {
128289
128401
  logger.debug(
128290
128402
  "npm --workspaces failed, falling back to individual package bumping"
@@ -128313,7 +128425,7 @@ var init_npm = __esm({
128313
128425
  /**
128314
128426
  * Bump version in each workspace package individually
128315
128427
  */
128316
- static async bumpWorkspacePackagesIndividually(bin, packages, newVersion, baseArgs) {
128428
+ static async bumpWorkspacePackagesIndividually(bin, packages, _newVersion, baseArgs) {
128317
128429
  for (const pkg of packages) {
128318
128430
  const pkgJsonPath = (0, import_path11.join)(pkg.location, "package.json");
128319
128431
  if (!(0, import_fs13.existsSync)(pkgJsonPath)) {
@@ -128330,7 +128442,7 @@ var init_npm = __esm({
128330
128442
  continue;
128331
128443
  }
128332
128444
  logger.debug(`Bumping version for workspace package: ${pkg.name}`);
128333
- await spawnProcess2(bin, baseArgs, { cwd: pkg.location });
128445
+ await spawnProcess(bin, baseArgs, { cwd: pkg.location });
128334
128446
  }
128335
128447
  }
128336
128448
  constructor(config3, artifactProvider) {
@@ -128383,16 +128495,17 @@ var init_npm = __esm({
128383
128495
  if (!token) {
128384
128496
  throw new Error("NPM target: NPM_TOKEN not found in the environment");
128385
128497
  }
128498
+ const config3 = this.config;
128386
128499
  const npmConfig = {
128387
128500
  useYarn: !!process.env.USE_YARN || !hasExecutable(NPM_BIN),
128388
128501
  token
128389
128502
  };
128390
- if (this.config.access) {
128391
- if (Object.values(NpmPackageAccess).includes(this.config.access)) {
128392
- npmConfig.access = this.config.access;
128503
+ if (config3.access) {
128504
+ if (Object.values(NpmPackageAccess).includes(config3.access)) {
128505
+ npmConfig.access = config3.access;
128393
128506
  } else {
128394
128507
  throw new ConfigurationError(
128395
- `Invalid value for "npm.access" option: ${this.config.access}`
128508
+ `Invalid value for "npm.access" option: ${config3.access}`
128396
128509
  );
128397
128510
  }
128398
128511
  }
@@ -128437,7 +128550,7 @@ var init_npm = __esm({
128437
128550
  `//registry.npmjs.org/:_authToken=\${${NPM_TOKEN_ENV_VAR}}`
128438
128551
  );
128439
128552
  args.push(path26);
128440
- return spawnProcess2(bin, args, spawnOptions, {
128553
+ return spawnProcess(bin, args, spawnOptions, {
128441
128554
  showStdout: true
128442
128555
  });
128443
128556
  });
@@ -128461,9 +128574,10 @@ var init_npm = __esm({
128461
128574
  if (!isDryRun() && this.npmConfig.useOtp) {
128462
128575
  publishOptions.otp = await this.requestOtp();
128463
128576
  }
128577
+ const config3 = this.config;
128464
128578
  const tag2 = await getPublishTag(
128465
128579
  version2,
128466
- this.config.checkPackageName,
128580
+ config3.checkPackageName,
128467
128581
  this.npmConfig,
128468
128582
  this.logger,
128469
128583
  publishOptions.otp
@@ -128523,7 +128637,7 @@ var init_nuget = __esm({
128523
128637
  }
128524
128638
  if (hasExecutable(NUGET_DOTNET_BIN)) {
128525
128639
  try {
128526
- const result = await spawnProcess2(
128640
+ const result = await spawnProcess(
128527
128641
  NUGET_DOTNET_BIN,
128528
128642
  ["setversion", newVersion],
128529
128643
  { cwd: rootDir },
@@ -128537,7 +128651,9 @@ var init_nuget = __esm({
128537
128651
  if (!message.includes("not installed") && !message.includes("Could not execute")) {
128538
128652
  throw error3;
128539
128653
  }
128540
- logger.debug("dotnet-setversion not available, falling back to manual edit");
128654
+ logger.debug(
128655
+ "dotnet-setversion not available, falling back to manual edit"
128656
+ );
128541
128657
  }
128542
128658
  }
128543
128659
  let bumped = false;
@@ -128602,9 +128718,10 @@ var init_nuget = __esm({
128602
128718
  Please use NUGET_API_TOKEN environment variable.`
128603
128719
  );
128604
128720
  }
128721
+ const config3 = this.config;
128605
128722
  return {
128606
128723
  apiToken: process.env.NUGET_API_TOKEN,
128607
- serverUrl: this.config.serverUrl || DEFAULT_NUGET_SERVER_URL
128724
+ serverUrl: config3.serverUrl || DEFAULT_NUGET_SERVER_URL
128608
128725
  };
128609
128726
  }
128610
128727
  /**
@@ -128629,7 +128746,7 @@ var init_nuget = __esm({
128629
128746
  "--source",
128630
128747
  this.nugetConfig.serverUrl
128631
128748
  ];
128632
- return spawnProcess2(NUGET_DOTNET_BIN, args, DOTNET_SPAWN_OPTIONS);
128749
+ return spawnProcess(NUGET_DOTNET_BIN, args, DOTNET_SPAWN_OPTIONS);
128633
128750
  }
128634
128751
  /**
128635
128752
  * Publishes a package tarball to the Nuget registry
@@ -128651,9 +128768,9 @@ var init_nuget = __esm({
128651
128768
  );
128652
128769
  }
128653
128770
  this.logger.info(".NET Version:");
128654
- await spawnProcess2(NUGET_DOTNET_BIN, ["--version"], DOTNET_SPAWN_OPTIONS);
128771
+ await spawnProcess(NUGET_DOTNET_BIN, ["--version"], DOTNET_SPAWN_OPTIONS);
128655
128772
  this.logger.info("Nuget Version:");
128656
- await spawnProcess2(
128773
+ await spawnProcess(
128657
128774
  NUGET_DOTNET_BIN,
128658
128775
  ["nuget", "--version"],
128659
128776
  DOTNET_SPAWN_OPTIONS
@@ -128728,21 +128845,22 @@ var init_sentryPypi = __esm({
128728
128845
  return void 0;
128729
128846
  }
128730
128847
  const versions = uniquePackages(packageFiles.map((f4) => f4.filename));
128731
- const [owner, repo] = this.config.internalPypiRepo.split("/");
128848
+ const typedConfig = this.config;
128849
+ const [owner, repo] = typedConfig.internalPypiRepo.split("/");
128732
128850
  const [contents, tree, commit] = await withTempDir(async (directory) => {
128733
- await spawnProcess2(
128851
+ await spawnProcess(
128734
128852
  "git",
128735
128853
  [
128736
128854
  "clone",
128737
128855
  "--quiet",
128738
128856
  "--depth=1",
128739
- `https://github.com/${this.config.internalPypiRepo}`,
128857
+ `https://github.com/${typedConfig.internalPypiRepo}`,
128740
128858
  directory
128741
128859
  ],
128742
128860
  {},
128743
128861
  { enableInDryRunMode: true }
128744
128862
  );
128745
- await spawnProcess2(
128863
+ await spawnProcess(
128746
128864
  "python3",
128747
128865
  ["-m", "add_pkg", "--skip-resolve", ...versions],
128748
128866
  { cwd: directory },
@@ -128751,13 +128869,13 @@ var init_sentryPypi = __esm({
128751
128869
  const contents2 = import_fs16.default.readFileSync(import_path13.default.join(directory, "packages.ini"), {
128752
128870
  encoding: "utf-8"
128753
128871
  });
128754
- const tree2 = (await spawnProcess2(
128872
+ const tree2 = (await spawnProcess(
128755
128873
  "git",
128756
128874
  ["-C", directory, "rev-parse", "HEAD:"],
128757
128875
  {},
128758
128876
  { enableInDryRunMode: true }
128759
128877
  )).toString("utf-8").trim();
128760
- const commit2 = (await spawnProcess2(
128878
+ const commit2 = (await spawnProcess(
128761
128879
  "git",
128762
128880
  ["-C", directory, "rev-parse", "HEAD"],
128763
128881
  {},
@@ -129173,6 +129291,7 @@ async function getPackageManifest(baseDir, type2, canonicalName, version2, initi
129173
129291
  reportError(
129174
129292
  `Package "${canonicalName}" does not exist in the registry and no initial manifest data was provided.`
129175
129293
  );
129294
+ throw new Error("Unreachable");
129176
129295
  }
129177
129296
  if (!(0, import_fs18.existsSync)(fullPackageDir)) {
129178
129297
  logger.info(
@@ -129256,7 +129375,8 @@ var init_registry2 = __esm({
129256
129375
  githubRepo;
129257
129376
  constructor(config3, artifactProvider, githubRepo) {
129258
129377
  super(config3, artifactProvider, githubRepo);
129259
- const remote = this.config.remote;
129378
+ const typedConfig = this.config;
129379
+ const remote = typedConfig.remote;
129260
129380
  if (remote) {
129261
129381
  const [owner, repo] = remote.split("/", 2);
129262
129382
  this.remote = new GitHubRemote(owner, repo);
@@ -129271,8 +129391,11 @@ var init_registry2 = __esm({
129271
129391
  * Extracts Registry target options from the raw configuration.
129272
129392
  */
129273
129393
  getRegistryConfig() {
129394
+ const typedConfig = this.config;
129274
129395
  const items = Object.entries(BATCH_KEYS).flatMap(
129275
- ([key, type2]) => Object.entries(this.config[key] || {}).map(([canonicalName, conf]) => {
129396
+ ([key, type2]) => Object.entries(
129397
+ typedConfig[key] || {}
129398
+ ).map(([canonicalName, conf]) => {
129276
129399
  const config3 = conf;
129277
129400
  const result = Object.assign(/* @__PURE__ */ Object.create(null), config3, {
129278
129401
  type: type2,
@@ -129284,7 +129407,7 @@ var init_registry2 = __esm({
129284
129407
  return result;
129285
129408
  })
129286
129409
  );
129287
- if (items.length === 0 && this.config.type) {
129410
+ if (items.length === 0 && typedConfig.type) {
129288
129411
  this.logger.warn(
129289
129412
  "You are using a deprecated registry target config, please update."
129290
129413
  );
@@ -129294,8 +129417,9 @@ var init_registry2 = __esm({
129294
129417
  }
129295
129418
  }
129296
129419
  getLegacyRegistryConfig() {
129297
- const registryType = this.config.type;
129298
- if (["app" /* APP */, "sdk" /* SDK */].indexOf(
129420
+ const typedConfig = this.config;
129421
+ const registryType = typedConfig.type;
129422
+ if (!registryType || ["app" /* APP */, "sdk" /* SDK */].indexOf(
129299
129423
  registryType
129300
129424
  ) === -1) {
129301
129425
  throw new ConfigurationError(
@@ -129304,14 +129428,14 @@ var init_registry2 = __esm({
129304
129428
  }
129305
129429
  let urlTemplate;
129306
129430
  if (registryType === "app" /* APP */) {
129307
- urlTemplate = this.config.urlTemplate;
129431
+ urlTemplate = typedConfig.urlTemplate;
129308
129432
  if (urlTemplate && typeof urlTemplate !== "string") {
129309
129433
  throw new ConfigurationError(
129310
129434
  `Invalid "urlTemplate" specified: ${urlTemplate}`
129311
129435
  );
129312
129436
  }
129313
129437
  }
129314
- const releaseConfig = this.config.config;
129438
+ const releaseConfig = typedConfig.config;
129315
129439
  if (!releaseConfig) {
129316
129440
  throw new ConfigurationError(
129317
129441
  "Cannot find configuration dictionary for release registry"
@@ -129323,12 +129447,12 @@ var init_registry2 = __esm({
129323
129447
  "Canonical name not found in the configuration"
129324
129448
  );
129325
129449
  }
129326
- const linkPrereleases = this.config.linkPrereleases || false;
129450
+ const linkPrereleases = typedConfig.linkPrereleases || false;
129327
129451
  if (typeof linkPrereleases !== "boolean") {
129328
129452
  throw new ConfigurationError('Invlaid type of "linkPrereleases"');
129329
129453
  }
129330
- const checksums = castChecksums(this.config.checksums);
129331
- const onlyIfPresentStr = this.config.onlyIfPresent || void 0;
129454
+ const checksums = castChecksums(typedConfig.checksums);
129455
+ const onlyIfPresentStr = typedConfig.onlyIfPresent || void 0;
129332
129456
  let onlyIfPresent;
129333
129457
  if (onlyIfPresentStr) {
129334
129458
  if (typeof onlyIfPresentStr !== "string") {
@@ -129447,15 +129571,19 @@ var init_registry2 = __esm({
129447
129571
  "Adding extra data (checksums, download links) for available artifacts..."
129448
129572
  );
129449
129573
  const files = {};
129450
- await (0, import_async7.mapLimit)(artifacts, MAX_DOWNLOAD_CONCURRENCY, async (artifact) => {
129451
- const fileData = await this.getArtifactData(
129452
- registryConfig,
129453
- artifact,
129454
- version2,
129455
- revision
129456
- );
129457
- files[artifact.filename] = fileData;
129458
- });
129574
+ await (0, import_async7.mapLimit)(
129575
+ artifacts,
129576
+ MAX_DOWNLOAD_CONCURRENCY,
129577
+ async (artifact) => {
129578
+ const fileData = await this.getArtifactData(
129579
+ registryConfig,
129580
+ artifact,
129581
+ version2,
129582
+ revision
129583
+ );
129584
+ files[artifact.filename] = fileData;
129585
+ }
129586
+ );
129459
129587
  packageManifest.files = files;
129460
129588
  }
129461
129589
  /**
@@ -129574,12 +129702,9 @@ var init_registry2 = __esm({
129574
129702
  }
129575
129703
  const onlyIfPresentPattern = registryConfig.onlyIfPresent;
129576
129704
  if (onlyIfPresentPattern) {
129577
- const artifacts = await this.artifactProvider.filterArtifactsForRevision(
129578
- revision,
129579
- {
129580
- includeNames: onlyIfPresentPattern
129581
- }
129582
- );
129705
+ const artifacts = await this.artifactProvider.filterArtifactsForRevision(revision, {
129706
+ includeNames: onlyIfPresentPattern
129707
+ });
129583
129708
  if (artifacts.length === 0) {
129584
129709
  this.logger.warn(
129585
129710
  `No files found that match "${onlyIfPresentPattern.toString()}", skipping the target.`
@@ -159656,11 +159781,12 @@ var init_awsLambdaLayer = __esm({
159656
159781
  Please use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables.`
159657
159782
  );
159658
159783
  }
159784
+ const config3 = this.config;
159659
159785
  return {
159660
159786
  awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID,
159661
159787
  awsSecretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
159662
159788
  registryRemote: DEFAULT_REGISTRY_REMOTE,
159663
- linkPrereleases: this.config.linkPrereleases || false
159789
+ linkPrereleases: config3.linkPrereleases || false
159664
159790
  };
159665
159791
  }
159666
159792
  /**
@@ -159763,7 +159889,8 @@ var init_awsLambdaLayer = __esm({
159763
159889
  }, "publishRuntimes(...)");
159764
159890
  await git.add(["."]);
159765
159891
  await git.checkout("master");
159766
- const runtimeNames = this.config.compatibleRuntimes.map(
159892
+ const config3 = this.config;
159893
+ const runtimeNames = config3.compatibleRuntimes.map(
159767
159894
  (runtime) => runtime.name
159768
159895
  );
159769
159896
  await git.commit(
@@ -159826,13 +159953,14 @@ v${version2} for ${runtimeNames}`
159826
159953
  async publishRuntimes(version2, directory, awsRegions, artifactBuffer) {
159827
159954
  const resolvedLayerName = this.resolveLayerName(version2);
159828
159955
  this.logger.debug(`Resolved layer name: ${resolvedLayerName}`);
159956
+ const config3 = this.config;
159829
159957
  await Promise.all(
159830
- this.config.compatibleRuntimes.map(async (runtime) => {
159958
+ config3.compatibleRuntimes.map(async (runtime) => {
159831
159959
  this.logger.debug(`Publishing runtime ${runtime.name}...`);
159832
159960
  const layerManager = new AwsLambdaLayerManager(
159833
159961
  runtime,
159834
159962
  resolvedLayerName,
159835
- this.config.license,
159963
+ config3.license,
159836
159964
  artifactBuffer,
159837
159965
  awsRegions,
159838
159966
  version2
@@ -159986,19 +160114,21 @@ var init_upm = __esm({
159986
160114
  this.logger.info(
159987
160115
  `Found artifact: "${packageFile.filename}", downloading...`
159988
160116
  );
159989
- const artifactPath = await this.artifactProvider.downloadArtifact(
159990
- packageFile
159991
- );
160117
+ const artifactPath = await this.artifactProvider.downloadArtifact(packageFile);
160118
+ const typedConfig = this.config;
159992
160119
  const remote = new GitHubRemote(
159993
- this.config.releaseRepoOwner,
159994
- this.config.releaseRepoName,
160120
+ typedConfig.releaseRepoOwner,
160121
+ typedConfig.releaseRepoName,
159995
160122
  getGitHubApiToken()
159996
160123
  );
159997
160124
  const remoteAddr = remote.getRemoteString();
159998
160125
  this.logger.debug(`Target release repository: ${remoteAddr}`);
159999
160126
  await withTempDir(
160000
160127
  async (directory) => {
160001
- const git = await cloneRepo(remote.getRemoteStringWithAuth(), directory);
160128
+ const git = await cloneRepo(
160129
+ remote.getRemoteStringWithAuth(),
160130
+ directory
160131
+ );
160002
160132
  this.logger.info("Clearing the repository.");
160003
160133
  await git.rm(["-r", "-f", "."]);
160004
160134
  this.logger.info(`Extracting "${packageFile.filename}".`);
@@ -160521,7 +160651,7 @@ var init_env = __esm({
160521
160651
  async function importGPGKey(privateKey) {
160522
160652
  const PRIVATE_KEY_FILE = path24.join((0, import_os2.tmpdir)(), "private-key.asc");
160523
160653
  await import_fs20.promises.writeFile(PRIVATE_KEY_FILE, privateKey);
160524
- await spawnProcess2(`gpg`, ["--batch", "--import", PRIVATE_KEY_FILE]);
160654
+ await spawnProcess(`gpg`, ["--batch", "--import", PRIVATE_KEY_FILE]);
160525
160655
  await import_fs20.promises.unlink(PRIVATE_KEY_FILE);
160526
160656
  }
160527
160657
  var import_os2, import_fs20, path24;
@@ -160615,71 +160745,72 @@ var init_maven = __esm({
160615
160745
  }, {});
160616
160746
  }
160617
160747
  getOuterTargetSettings() {
160748
+ const config3 = this.config;
160618
160749
  const settings = targetOptions.map((setting) => {
160619
- if (!this.config[setting]) {
160750
+ if (!config3[setting]) {
160620
160751
  throw new ConfigurationError(
160621
160752
  `Required configuration ${setting} not found in configuration file. See the documentation for more details.`
160622
160753
  );
160623
160754
  }
160624
160755
  return {
160625
160756
  name: setting,
160626
- value: this.config[setting]
160757
+ value: config3[setting]
160627
160758
  };
160628
160759
  });
160629
160760
  return this.reduceConfig(settings);
160630
160761
  }
160631
160762
  getKotlinMultiplatformSettings() {
160632
- if (this.config.kmp === false || !this.config.kmp) {
160763
+ const config3 = this.config;
160764
+ if (config3.kmp === false || !config3.kmp) {
160633
160765
  return {
160634
160766
  kmp: false
160635
160767
  };
160636
160768
  }
160637
- if (!this.config.kmp.rootDistDirRegex) {
160769
+ if (!config3.kmp.rootDistDirRegex) {
160638
160770
  throw new ConfigurationError(
160639
160771
  "Required root configuration for Kotlin Multiplatform is incorrect. See the documentation for more details."
160640
160772
  );
160641
160773
  }
160642
- if (!this.config.kmp.appleDistDirRegex) {
160774
+ if (!config3.kmp.appleDistDirRegex) {
160643
160775
  throw new ConfigurationError(
160644
160776
  "Required apple configuration for Kotlin Multiplatform is incorrect. See the documentation for more details."
160645
160777
  );
160646
160778
  }
160647
- if (!this.config.kmp.klibDistDirRegex) {
160779
+ if (!config3.kmp.klibDistDirRegex) {
160648
160780
  throw new ConfigurationError(
160649
160781
  "Required klib configuration for Kotlin Multiplatform is incorrect. See the documentation for more details."
160650
160782
  );
160651
160783
  }
160652
160784
  return {
160653
160785
  kmp: {
160654
- appleDistDirRegex: stringToRegexp(this.config.kmp.appleDistDirRegex),
160655
- rootDistDirRegex: stringToRegexp(this.config.kmp.rootDistDirRegex),
160656
- klibDistDirRegex: stringToRegexp(this.config.kmp.klibDistDirRegex)
160786
+ appleDistDirRegex: stringToRegexp(config3.kmp.appleDistDirRegex),
160787
+ rootDistDirRegex: stringToRegexp(config3.kmp.rootDistDirRegex),
160788
+ klibDistDirRegex: stringToRegexp(config3.kmp.klibDistDirRegex)
160657
160789
  }
160658
160790
  };
160659
160791
  }
160660
160792
  getAndroidSettings() {
160661
- if (this.config.android === false) {
160793
+ const config3 = this.config;
160794
+ if (config3.android === false) {
160662
160795
  return {
160663
160796
  android: false
160664
160797
  };
160665
160798
  }
160666
- if (!this.config.android) {
160799
+ if (!config3.android) {
160667
160800
  throw new ConfigurationError(
160668
160801
  "Required Android configuration was not found in the configuration file. See the documentation for more details"
160669
160802
  );
160670
160803
  }
160671
- if (!this.config.android.distDirRegex || !this.config.android.fileReplaceeRegex || !this.config.android.fileReplacerStr) {
160804
+ if (!config3.android.distDirRegex || !config3.android.fileReplaceeRegex || !config3.android.fileReplacerStr) {
160672
160805
  throw new ConfigurationError(
160673
160806
  "Required Android configuration is incorrect. See the documentation for more details."
160674
160807
  );
160675
160808
  }
160676
160809
  return {
160677
160810
  android: {
160678
- distDirRegex: stringToRegexp(this.config.android.distDirRegex),
160679
- fileReplaceeRegex: stringToRegexp(
160680
- this.config.android.fileReplaceeRegex
160681
- ),
160682
- fileReplacerStr: this.config.android.fileReplacerStr
160811
+ distDirRegex: stringToRegexp(config3.android.distDirRegex),
160812
+ fileReplaceeRegex: stringToRegexp(config3.android.fileReplaceeRegex),
160813
+ fileReplacerStr: config3.android.fileReplacerStr
160683
160814
  }
160684
160815
  };
160685
160816
  }
@@ -160730,9 +160861,7 @@ var init_maven = __esm({
160730
160861
  */
160731
160862
  async uploadArtifact(artifact) {
160732
160863
  this.logger.debug("Downloading:", artifact.filename);
160733
- const downloadedPkgPath = await this.artifactProvider.downloadArtifact(
160734
- artifact
160735
- );
160864
+ const downloadedPkgPath = await this.artifactProvider.downloadArtifact(artifact);
160736
160865
  this.logger.debug(`Extracting ${artifact.filename}: `, downloadedPkgPath);
160737
160866
  await withTempDir(async (dir) => {
160738
160867
  await extractZipArchive(downloadedPkgPath, dir);
@@ -160814,22 +160943,12 @@ Error:
160814
160943
  async uploadKmpPomDistribution(distDir) {
160815
160944
  if (this.mavenConfig.kmp !== false) {
160816
160945
  const moduleName = (0, import_path16.parse)(distDir).base;
160817
- const isRootDistDir = this.mavenConfig.kmp.rootDistDirRegex.test(
160818
- moduleName
160819
- );
160820
- const isAppleDistDir = this.mavenConfig.kmp.appleDistDirRegex.test(
160821
- moduleName
160822
- );
160823
- const isKlibDistDir = this.mavenConfig.kmp.klibDistDirRegex.test(
160824
- moduleName
160825
- );
160946
+ const isRootDistDir = this.mavenConfig.kmp.rootDistDirRegex.test(moduleName);
160947
+ const isAppleDistDir = this.mavenConfig.kmp.appleDistDirRegex.test(moduleName);
160948
+ const isKlibDistDir = this.mavenConfig.kmp.klibDistDirRegex.test(moduleName);
160826
160949
  const files = await this.getFilesForKmpMavenPomDist(distDir);
160827
160950
  const { targetFile, pomFile } = files;
160828
- const {
160829
- sideArtifacts,
160830
- classifiers,
160831
- types: types3
160832
- } = this.transformKmpSideArtifacts(
160951
+ const { sideArtifacts, classifiers, types: types3 } = this.transformKmpSideArtifacts(
160833
160952
  isRootDistDir,
160834
160953
  isAppleDistDir,
160835
160954
  isKlibDistDir,
@@ -160940,7 +161059,7 @@ Error:
160940
161059
  if (stat.isFile()) {
160941
161060
  return pomFilepath;
160942
161061
  }
160943
- } catch (e4) {
161062
+ } catch {
160944
161063
  }
160945
161064
  return void 0;
160946
161065
  }
@@ -160953,7 +161072,7 @@ Error:
160953
161072
  if (stat.isFile()) {
160954
161073
  return true;
160955
161074
  }
160956
- } catch (e4) {
161075
+ } catch {
160957
161076
  }
160958
161077
  return false;
160959
161078
  }
@@ -160975,13 +161094,7 @@ Error:
160975
161094
  if (this.mavenConfig.kmp !== false) {
160976
161095
  await this.uploadKmpPomDistribution(distDir);
160977
161096
  } else {
160978
- const {
160979
- targetFile,
160980
- javadocFile,
160981
- sourcesFile,
160982
- pomFile,
160983
- moduleFile
160984
- } = this.getFilesForMavenPomDist(distDir);
161097
+ const { targetFile, javadocFile, sourcesFile, pomFile, moduleFile } = this.getFilesForMavenPomDist(distDir);
160985
161098
  await this.fixModuleFileName(distDir, moduleFile);
160986
161099
  const hasModule = await this.fileExists(moduleFile);
160987
161100
  await retrySpawnProcess(this.mavenConfig.mavenCliPath, [
@@ -161028,11 +161141,7 @@ Error:
161028
161141
  await this.fixModuleFileName(distDir, files.moduleFile);
161029
161142
  const moduleName = (0, import_path16.parse)(distDir).base;
161030
161143
  if (this.mavenConfig.kmp !== false) {
161031
- const {
161032
- klibDistDirRegex,
161033
- appleDistDirRegex,
161034
- rootDistDirRegex
161035
- } = this.mavenConfig.kmp;
161144
+ const { klibDistDirRegex, appleDistDirRegex, rootDistDirRegex } = this.mavenConfig.kmp;
161036
161145
  const isRootDistDir = rootDistDirRegex.test(moduleName);
161037
161146
  const isAppleDistDir = appleDistDirRegex.test(moduleName);
161038
161147
  const isKlibDistDir = klibDistDirRegex.test(moduleName);
@@ -161069,9 +161178,7 @@ Error:
161069
161178
  getTargetFilename(distDir) {
161070
161179
  const moduleName = (0, import_path16.parse)(distDir).base;
161071
161180
  if (this.mavenConfig.android !== false) {
161072
- const isAndroidDistDir = this.mavenConfig.android.distDirRegex.test(
161073
- moduleName
161074
- );
161181
+ const isAndroidDistDir = this.mavenConfig.android.distDirRegex.test(moduleName);
161075
161182
  if (isAndroidDistDir) {
161076
161183
  return moduleName.replace(
161077
161184
  this.mavenConfig.android.fileReplaceeRegex,
@@ -161252,20 +161359,21 @@ var init_symbolCollector = __esm({
161252
161359
  }
161253
161360
  getSymbolCollectorConfig() {
161254
161361
  checkExecutableIsPresent(SYM_COLLECTOR_BIN_NAME);
161255
- if (!this.config.batchType) {
161362
+ const config3 = this.config;
161363
+ if (!config3.batchType) {
161256
161364
  throw new ConfigurationError(
161257
161365
  "The required `batchType` parameter is missing in the configuration file. See the documentation for more details."
161258
161366
  );
161259
161367
  }
161260
- if (!this.config.bundleIdPrefix) {
161368
+ if (!config3.bundleIdPrefix) {
161261
161369
  throw new ConfigurationError(
161262
161370
  "The required `bundleIdPrefix` parameter is missing in the configuration file. See the documentation for more details."
161263
161371
  );
161264
161372
  }
161265
161373
  return {
161266
- serverEndpoint: this.config.serverEndpoint || DEFAULT_SYM_COLLECTOR_SERVER_ENDPOINT,
161267
- batchType: this.config.batchType,
161268
- bundleIdPrefix: this.config.bundleIdPrefix
161374
+ serverEndpoint: config3.serverEndpoint || DEFAULT_SYM_COLLECTOR_SERVER_ENDPOINT,
161375
+ batchType: config3.batchType,
161376
+ bundleIdPrefix: config3.bundleIdPrefix
161269
161377
  };
161270
161378
  }
161271
161379
  async publish(version2, revision) {
@@ -161288,7 +161396,7 @@ var init_symbolCollector = __esm({
161288
161396
  await this.artifactProvider.downloadArtifact(artifact, subdirPath);
161289
161397
  })
161290
161398
  );
161291
- const cmdOutput = await spawnProcess2(SYM_COLLECTOR_BIN_NAME, [
161399
+ const cmdOutput = await spawnProcess(SYM_COLLECTOR_BIN_NAME, [
161292
161400
  "--upload",
161293
161401
  "directory",
161294
161402
  "--path",
@@ -161379,11 +161487,12 @@ var init_pubDev = __esm({
161379
161487
  * @returns the pub-dev config for this target.
161380
161488
  */
161381
161489
  getPubDevConfig() {
161490
+ const targetConfig = this.config;
161382
161491
  const config3 = {
161383
- dartCliPath: this.config.dartCliPath || "dart",
161384
- packages: this.config.packages ? Object.keys(this.config.packages) : ["."],
161492
+ dartCliPath: targetConfig.dartCliPath || "dart",
161493
+ packages: targetConfig.packages ? Object.keys(targetConfig.packages) : ["."],
161385
161494
  ...this.getTargetSecrets(),
161386
- skipValidation: this.config.skipValidation ?? false
161495
+ skipValidation: targetConfig.skipValidation ?? false
161387
161496
  };
161388
161497
  this.checkRequiredSoftware(config3);
161389
161498
  return config3;
@@ -161508,7 +161617,7 @@ var init_pubDev = __esm({
161508
161617
  if (this.pubDevConfig.skipValidation) {
161509
161618
  args.push("--skip-validation");
161510
161619
  }
161511
- await spawnProcess2(
161620
+ await spawnProcess(
161512
161621
  this.pubDevConfig.dartCliPath,
161513
161622
  args,
161514
161623
  {
@@ -161636,25 +161745,25 @@ var init_hex = __esm({
161636
161745
  await this.cloneRepository(this.githubRepo, revision, directory);
161637
161746
  const spawnOptions = { cwd: directory };
161638
161747
  const spawnProcessOptions = { showStdout: true };
161639
- await spawnProcess2(
161748
+ await spawnProcess(
161640
161749
  MIX_BIN,
161641
161750
  ["local.hex", "--force"],
161642
161751
  spawnOptions,
161643
161752
  spawnProcessOptions
161644
161753
  );
161645
- await spawnProcess2(
161754
+ await spawnProcess(
161646
161755
  MIX_BIN,
161647
161756
  ["local.rebar", "--force"],
161648
161757
  spawnOptions,
161649
161758
  spawnProcessOptions
161650
161759
  );
161651
- await spawnProcess2(
161760
+ await spawnProcess(
161652
161761
  MIX_BIN,
161653
161762
  ["deps.get"],
161654
161763
  spawnOptions,
161655
161764
  spawnProcessOptions
161656
161765
  );
161657
- await spawnProcess2(
161766
+ await spawnProcess(
161658
161767
  MIX_BIN,
161659
161768
  ["hex.publish", "--yes"],
161660
161769
  spawnOptions,
@@ -161754,13 +161863,7 @@ var init_commitOnGitRepository = __esm({
161754
161863
  * @param revision Git commit SHA to be published
161755
161864
  */
161756
161865
  async publish(version2, revision) {
161757
- const {
161758
- archive,
161759
- branch,
161760
- repositoryUrl,
161761
- createTag,
161762
- stripComponents
161763
- } = this.getGitRepositoryTargetConfig();
161866
+ const { archive, branch, repositoryUrl, createTag, stripComponents } = this.getGitRepositoryTargetConfig();
161764
161867
  this.logger.info(`Finding archive with regexp "${archive}"...`);
161765
161868
  const archives = await this.getArtifactsForRevision(revision, {
161766
161869
  includeNames: archive
@@ -161804,12 +161907,13 @@ var init_commitOnGitRepository = __esm({
161804
161907
  `\`repositoryUrl\` option has invalid value ${this.config["branch"]}. Needs to be string.`
161805
161908
  );
161806
161909
  }
161910
+ const config3 = this.config;
161807
161911
  return {
161808
161912
  archive: this.config["archive"],
161809
161913
  repositoryUrl: this.config["repositoryUrl"],
161810
161914
  branch: this.config["branch"],
161811
- createTag: this.config["createTag"] ?? true,
161812
- stripComponents: this.config["stripComponents"]
161915
+ createTag: config3.createTag ?? true,
161916
+ stripComponents: config3.stripComponents
161813
161917
  };
161814
161918
  }
161815
161919
  };
@@ -161840,10 +161944,11 @@ var init_powershell = __esm({
161840
161944
  };
161841
161945
  constructor(config3, artifactProvider) {
161842
161946
  super(config3, artifactProvider);
161947
+ const typedConfig = this.config;
161843
161948
  this.psConfig = {
161844
161949
  apiKey: process.env.POWERSHELL_API_KEY || "",
161845
- repository: this.config.repository || DEFAULT_POWERSHELL_REPOSITORY,
161846
- module: this.config.module || ""
161950
+ repository: typedConfig.repository || DEFAULT_POWERSHELL_REPOSITORY,
161951
+ module: typedConfig.module || ""
161847
161952
  };
161848
161953
  checkExecutableIsPresent(POWERSHELL_BIN);
161849
161954
  }
@@ -161854,7 +161959,7 @@ var init_powershell = __esm({
161854
161959
  command10 = `$ErrorActionPreference = 'Stop'
161855
161960
  ` + command10;
161856
161961
  this.logger.trace("Executing PowerShell command:", command10);
161857
- return spawnProcess2(
161962
+ return spawnProcess(
161858
161963
  POWERSHELL_BIN,
161859
161964
  ["-Command", command10],
161860
161965
  {},
@@ -161891,7 +161996,7 @@ var init_powershell = __esm({
161891
161996
  async publish(_version, revision) {
161892
161997
  this.checkProjectConfig();
161893
161998
  this.logger.info(`PowerShell (${POWERSHELL_BIN}) info:`);
161894
- await spawnProcess2(
161999
+ await spawnProcess(
161895
162000
  POWERSHELL_BIN,
161896
162001
  ["--version"],
161897
162002
  {},
@@ -162331,7 +162436,7 @@ var require_package6 = __commonJS({
162331
162436
  "package.json"(exports2, module2) {
162332
162437
  module2.exports = {
162333
162438
  name: "@sentry/craft",
162334
- version: "2.21.1",
162439
+ version: "2.21.3",
162335
162440
  description: "The universal sentry workflow CLI",
162336
162441
  main: "dist/craft",
162337
162442
  repository: "https://github.com/getsentry/craft",
@@ -162364,6 +162469,7 @@ var require_package6 = __commonJS({
162364
162469
  "@types/ora": "^1.3.4",
162365
162470
  "@types/prompts": "^2.0.11",
162366
162471
  "@types/rimraf": "^2.0.2",
162472
+ "@types/semver": "^7.7.1",
162367
162473
  "@types/shell-quote": "^1.6.0",
162368
162474
  "@types/tar": "^4.0.0",
162369
162475
  "@types/tmp": "^0.0.33",
@@ -162399,6 +162505,7 @@ var require_package6 = __commonJS({
162399
162505
  "string-length": "3.1.0",
162400
162506
  tar: "7.5.7",
162401
162507
  tmp: "0.2.4",
162508
+ tslib: "^2.8.1",
162402
162509
  typescript: "^5.7.2",
162403
162510
  "typescript-eslint": "^8.18.2",
162404
162511
  vitest: "^3.0.2",
@@ -162416,6 +162523,7 @@ var require_package6 = __commonJS({
162416
162523
  fix: "pnpm lint --fix",
162417
162524
  test: "vitest run",
162418
162525
  "test:watch": "vitest",
162526
+ typecheck: "tsc --noEmit",
162419
162527
  "docs:dev": "cd docs && pnpm dev",
162420
162528
  "docs:build": "cd docs && pnpm build"
162421
162529
  },
@@ -162497,7 +162605,7 @@ function getPackage() {
162497
162605
  }
162498
162606
  function getPackageVersion() {
162499
162607
  const { version: version2 } = getPackage();
162500
- const buildInfo = "564d9f5a3186fd8685cc17e5fe9c6915531ff98d";
162608
+ const buildInfo = "5d154a7facb096e38889be2c6caf2fd23649aa92";
162501
162609
  return buildInfo ? `${version2} (${buildInfo})` : version2;
162502
162610
  }
162503
162611
  function semVerToString(s4) {
@@ -170821,7 +170929,7 @@ async function runPostReleaseCommand(newVersion, postReleaseCommand) {
170821
170929
  }
170822
170930
  args = [...args, "", newVersion];
170823
170931
  logger.info(`Running the post-release command...`);
170824
- await spawnProcess2(sysCommand, args, {
170932
+ await spawnProcess(sysCommand, args, {
170825
170933
  env: {
170826
170934
  CRAFT_NEW_VERSION: newVersion,
170827
170935
  CRAFT_OLD_VERSION: "",
@@ -170955,7 +171063,9 @@ async function publishMain(argv) {
170955
171063
  argv.mergeTarget,
170956
171064
  argv.keepBranch
170957
171065
  );
170958
- safeFs.unlink(publishStateFile).catch((err) => logger.trace("Couldn't remove publish state file: ", err));
171066
+ safeFs.unlink(publishStateFile).catch(
171067
+ (err) => logger.trace("Couldn't remove publish state file: ", err)
171068
+ );
170959
171069
  logger.success(`Version ${newVersion} has been published!`);
170960
171070
  } else {
170961
171071
  const msg = [
@@ -171131,7 +171241,7 @@ async function runCustomPreReleaseCommand(oldVersion, newVersion, preReleaseComm
171131
171241
  CRAFT_NEW_VERSION: newVersion,
171132
171242
  CRAFT_OLD_VERSION: nonEmptyOldVersion
171133
171243
  };
171134
- await spawnProcess2(sysCommand, args, {
171244
+ await spawnProcess(sysCommand, args, {
171135
171245
  env: { ...process.env, ...additionalEnv }
171136
171246
  });
171137
171247
  return true;
@@ -171658,6 +171768,7 @@ __export(changelog_exports, {
171658
171768
  });
171659
171769
  init_import_meta_url();
171660
171770
  init_logger2();
171771
+ init_config2();
171661
171772
  init_git();
171662
171773
  init_changelog();
171663
171774
  init_errors2();
@@ -171685,14 +171796,24 @@ async function changelogMain(argv) {
171685
171796
  if (since) {
171686
171797
  logger.debug(`Using latest tag as base revision: ${since}`);
171687
171798
  } else {
171688
- logger.debug("No tags found, generating changelog from beginning of history");
171799
+ logger.debug(
171800
+ "No tags found, generating changelog from beginning of history"
171801
+ );
171689
171802
  }
171690
171803
  }
171691
171804
  const result = argv.pr ? await generateChangelogWithHighlight(git, since, argv.pr) : await generateChangesetFromGit(git, since);
171692
171805
  if (argv.format === "json") {
171806
+ let versioningPolicy = "auto";
171807
+ try {
171808
+ if (findConfigFile()) {
171809
+ versioningPolicy = getVersioningPolicy();
171810
+ }
171811
+ } catch {
171812
+ }
171693
171813
  const output = {
171694
171814
  changelog: result.changelog || "",
171695
171815
  bumpType: result.bumpType,
171816
+ versioningPolicy,
171696
171817
  totalCommits: result.totalCommits,
171697
171818
  matchedCommitsWithSemver: result.matchedCommitsWithSemver,
171698
171819
  prSkipped: result.prSkipped ?? false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/craft",
3
- "version": "2.21.1",
3
+ "version": "2.21.3",
4
4
  "description": "The universal sentry workflow CLI",
5
5
  "main": "dist/craft",
6
6
  "repository": "https://github.com/getsentry/craft",
@@ -33,6 +33,7 @@
33
33
  "@types/ora": "^1.3.4",
34
34
  "@types/prompts": "^2.0.11",
35
35
  "@types/rimraf": "^2.0.2",
36
+ "@types/semver": "^7.7.1",
36
37
  "@types/shell-quote": "^1.6.0",
37
38
  "@types/tar": "^4.0.0",
38
39
  "@types/tmp": "^0.0.33",
@@ -68,6 +69,7 @@
68
69
  "string-length": "3.1.0",
69
70
  "tar": "7.5.7",
70
71
  "tmp": "0.2.4",
72
+ "tslib": "^2.8.1",
71
73
  "typescript": "^5.7.2",
72
74
  "typescript-eslint": "^8.18.2",
73
75
  "vitest": "^3.0.2",
@@ -85,6 +87,7 @@
85
87
  "fix": "pnpm lint --fix",
86
88
  "test": "vitest run",
87
89
  "test:watch": "vitest",
90
+ "typecheck": "tsc --noEmit",
88
91
  "docs:dev": "cd docs && pnpm dev",
89
92
  "docs:build": "cd docs && pnpm build"
90
93
  },