@sentry/craft 2.24.1 → 2.24.2
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 +66 -115
- package/package.json +3 -2
package/dist/craft
CHANGED
|
@@ -157896,7 +157896,7 @@ var require_package6 = __commonJS({
|
|
|
157896
157896
|
"package.json"(exports2, module2) {
|
|
157897
157897
|
module2.exports = {
|
|
157898
157898
|
name: "@sentry/craft",
|
|
157899
|
-
version: "2.24.
|
|
157899
|
+
version: "2.24.2",
|
|
157900
157900
|
description: "The universal sentry workflow CLI",
|
|
157901
157901
|
main: "dist/craft",
|
|
157902
157902
|
repository: "https://github.com/getsentry/craft",
|
|
@@ -158000,7 +158000,8 @@ var require_package6 = __commonJS({
|
|
|
158000
158000
|
"fast-xml-parser": "^5.3.4",
|
|
158001
158001
|
minimatch: "^10.2.1",
|
|
158002
158002
|
"ajv@<6.14.0": "^6.14.0",
|
|
158003
|
-
rollup: "^4.59.0"
|
|
158003
|
+
rollup: "^4.59.0",
|
|
158004
|
+
flatted: "^3.4.0"
|
|
158004
158005
|
}
|
|
158005
158006
|
}
|
|
158006
158007
|
};
|
|
@@ -158064,7 +158065,7 @@ function getPackage() {
|
|
|
158064
158065
|
}
|
|
158065
158066
|
function getPackageVersion() {
|
|
158066
158067
|
const { version: version2 } = getPackage();
|
|
158067
|
-
const buildInfo = "
|
|
158068
|
+
const buildInfo = "78da70b88de5cf6245d5d7e3263a9e8952667dec";
|
|
158068
158069
|
return buildInfo ? `${version2} (${buildInfo})` : version2;
|
|
158069
158070
|
}
|
|
158070
158071
|
function semVerToString(s6) {
|
|
@@ -165978,55 +165979,12 @@ __export(prepare_exports, {
|
|
|
165978
165979
|
init_import_meta_url();
|
|
165979
165980
|
var import_fs30 = require("fs");
|
|
165980
165981
|
var import_path28 = require("path");
|
|
165981
|
-
init_dryRun();
|
|
165982
165982
|
var shellQuote2 = __toESM(require_shell_quote());
|
|
165983
|
+
init_dryRun();
|
|
165983
165984
|
init_config2();
|
|
165984
165985
|
init_logger2();
|
|
165985
165986
|
init_project_config();
|
|
165986
|
-
|
|
165987
|
-
// src/utils/calver.ts
|
|
165988
|
-
init_import_meta_url();
|
|
165989
|
-
init_config2();
|
|
165990
|
-
init_logger2();
|
|
165991
|
-
var DEFAULT_CALVER_CONFIG = {
|
|
165992
|
-
offset: 14,
|
|
165993
|
-
format: "%y.%-m"
|
|
165994
|
-
};
|
|
165995
|
-
function formatCalVerDate(date2, format5) {
|
|
165996
|
-
const year2 = date2.getFullYear();
|
|
165997
|
-
const month = date2.getMonth() + 1;
|
|
165998
|
-
const day = date2.getDate();
|
|
165999
|
-
return format5.replace("%Y", String(year2)).replace("%y", String(year2).slice(-2)).replace("%-m", String(month)).replace("%m", String(month).padStart(2, "0")).replace("%-d", String(day)).replace("%d", String(day).padStart(2, "0"));
|
|
166000
|
-
}
|
|
166001
|
-
async function calculateCalVer(git, config3) {
|
|
166002
|
-
const date2 = /* @__PURE__ */ new Date();
|
|
166003
|
-
date2.setDate(date2.getDate() - config3.offset);
|
|
166004
|
-
const datePart = formatCalVerDate(date2, config3.format);
|
|
166005
|
-
logger.debug(`CalVer: using date ${date2.toISOString()}, date part: ${datePart}`);
|
|
166006
|
-
const gitTagPrefix = getGitTagPrefix();
|
|
166007
|
-
const searchPrefix = `${gitTagPrefix}${datePart}.`;
|
|
166008
|
-
logger.debug(`CalVer: searching for tags with prefix: ${searchPrefix}`);
|
|
166009
|
-
const tags = await git.tags();
|
|
166010
|
-
let patch = 0;
|
|
166011
|
-
for (const tag2 of tags.all) {
|
|
166012
|
-
if (tag2.startsWith(searchPrefix)) {
|
|
166013
|
-
const patchStr = tag2.slice(searchPrefix.length);
|
|
166014
|
-
const patchNum = parseInt(patchStr, 10);
|
|
166015
|
-
if (!isNaN(patchNum) && patchNum >= patch) {
|
|
166016
|
-
patch = patchNum + 1;
|
|
166017
|
-
}
|
|
166018
|
-
}
|
|
166019
|
-
}
|
|
166020
|
-
const version2 = `${datePart}.${patch}`;
|
|
166021
|
-
logger.info(`CalVer: determined version ${version2}`);
|
|
166022
|
-
return version2;
|
|
166023
|
-
}
|
|
166024
|
-
|
|
166025
|
-
// src/commands/prepare.ts
|
|
166026
165987
|
init_async();
|
|
166027
|
-
init_changelog();
|
|
166028
|
-
init_errors2();
|
|
166029
|
-
init_git();
|
|
166030
165988
|
|
|
166031
165989
|
// src/utils/autoVersion.ts
|
|
166032
165990
|
init_import_meta_url();
|
|
@@ -166068,10 +166026,52 @@ function validateBumpType(result) {
|
|
|
166068
166026
|
}
|
|
166069
166027
|
}
|
|
166070
166028
|
|
|
166029
|
+
// src/utils/calver.ts
|
|
166030
|
+
init_import_meta_url();
|
|
166031
|
+
init_config2();
|
|
166032
|
+
init_logger2();
|
|
166033
|
+
var DEFAULT_CALVER_CONFIG = {
|
|
166034
|
+
offset: 14,
|
|
166035
|
+
format: "%y.%-m"
|
|
166036
|
+
};
|
|
166037
|
+
function formatCalVerDate(date2, format5) {
|
|
166038
|
+
const year2 = date2.getFullYear();
|
|
166039
|
+
const month = date2.getMonth() + 1;
|
|
166040
|
+
const day = date2.getDate();
|
|
166041
|
+
return format5.replace("%Y", String(year2)).replace("%y", String(year2).slice(-2)).replace("%-m", String(month)).replace("%m", String(month).padStart(2, "0")).replace("%-d", String(day)).replace("%d", String(day).padStart(2, "0"));
|
|
166042
|
+
}
|
|
166043
|
+
async function calculateCalVer(git, config3) {
|
|
166044
|
+
const date2 = /* @__PURE__ */ new Date();
|
|
166045
|
+
date2.setDate(date2.getDate() - config3.offset);
|
|
166046
|
+
const datePart = formatCalVerDate(date2, config3.format);
|
|
166047
|
+
logger.debug(`CalVer: using date ${date2.toISOString()}, date part: ${datePart}`);
|
|
166048
|
+
const gitTagPrefix = getGitTagPrefix();
|
|
166049
|
+
const searchPrefix = `${gitTagPrefix}${datePart}.`;
|
|
166050
|
+
logger.debug(`CalVer: searching for tags with prefix: ${searchPrefix}`);
|
|
166051
|
+
const tags = await git.tags();
|
|
166052
|
+
let patch = 0;
|
|
166053
|
+
for (const tag2 of tags.all) {
|
|
166054
|
+
if (tag2.startsWith(searchPrefix)) {
|
|
166055
|
+
const patchStr = tag2.slice(searchPrefix.length);
|
|
166056
|
+
const patchNum = parseInt(patchStr, 10);
|
|
166057
|
+
if (!isNaN(patchNum) && patchNum >= patch) {
|
|
166058
|
+
patch = patchNum + 1;
|
|
166059
|
+
}
|
|
166060
|
+
}
|
|
166061
|
+
}
|
|
166062
|
+
const version2 = `${datePart}.${patch}`;
|
|
166063
|
+
logger.info(`CalVer: determined version ${version2}`);
|
|
166064
|
+
return version2;
|
|
166065
|
+
}
|
|
166066
|
+
|
|
166071
166067
|
// src/commands/prepare.ts
|
|
166068
|
+
init_changelog();
|
|
166069
|
+
init_errors2();
|
|
166070
|
+
init_git();
|
|
166072
166071
|
init_helpers();
|
|
166073
166072
|
init_strings();
|
|
166074
166073
|
init_system();
|
|
166074
|
+
init_tracing3();
|
|
166075
166075
|
init_version9();
|
|
166076
166076
|
|
|
166077
166077
|
// src/utils/versionBump.ts
|
|
@@ -166124,9 +166124,6 @@ async function runAutomaticVersionBumps(targets, rootDir, newVersion) {
|
|
|
166124
166124
|
return { anyBumped, bumpableTargets, skippedTargets };
|
|
166125
166125
|
}
|
|
166126
166126
|
|
|
166127
|
-
// src/commands/prepare.ts
|
|
166128
|
-
init_tracing3();
|
|
166129
|
-
|
|
166130
166127
|
// src/commands/publish.ts
|
|
166131
166128
|
var publish_exports = {};
|
|
166132
166129
|
__export(publish_exports, {
|
|
@@ -166709,11 +166706,7 @@ async function runPreReleaseCommand(options) {
|
|
|
166709
166706
|
return false;
|
|
166710
166707
|
}
|
|
166711
166708
|
if (preReleaseCommand) {
|
|
166712
|
-
return runCustomPreReleaseCommand(
|
|
166713
|
-
oldVersion,
|
|
166714
|
-
newVersion,
|
|
166715
|
-
preReleaseCommand
|
|
166716
|
-
);
|
|
166709
|
+
return runCustomPreReleaseCommand(oldVersion, newVersion, preReleaseCommand);
|
|
166717
166710
|
}
|
|
166718
166711
|
if (requiresMinVersion(AUTO_BUMP_MIN_VERSION) && targets && targets.length > 0) {
|
|
166719
166712
|
logger.info("Running automatic version bumping from targets...");
|
|
@@ -166758,15 +166751,10 @@ function checkGitStatus(repoStatus, rev) {
|
|
|
166758
166751
|
logger.info("Checking the local repository status...");
|
|
166759
166752
|
logger.debug("Repository status:", formatJson(repoStatus));
|
|
166760
166753
|
if (isRepoDirty(repoStatus)) {
|
|
166761
|
-
reportError(
|
|
166762
|
-
"Your repository is in a dirty state. Please stash or commit the pending changes.",
|
|
166763
|
-
logger
|
|
166764
|
-
);
|
|
166754
|
+
reportError("Your repository is in a dirty state. Please stash or commit the pending changes.", logger);
|
|
166765
166755
|
}
|
|
166766
166756
|
if (repoStatus.current !== rev) {
|
|
166767
|
-
logger.warn(
|
|
166768
|
-
`You are releasing from '${rev}', not '${repoStatus.current}' which you are currently on.`
|
|
166769
|
-
);
|
|
166757
|
+
logger.warn(`You are releasing from '${rev}', not '${repoStatus.current}' which you are currently on.`);
|
|
166770
166758
|
}
|
|
166771
166759
|
}
|
|
166772
166760
|
async function execPublish(remote, newVersion, noGitChecks) {
|
|
@@ -166780,9 +166768,7 @@ async function execPublish(remote, newVersion, noGitChecks) {
|
|
|
166780
166768
|
noStatusCheck: false,
|
|
166781
166769
|
noGitChecks
|
|
166782
166770
|
};
|
|
166783
|
-
logger.info(
|
|
166784
|
-
`Sleeping for ${SLEEP_BEFORE_PUBLISH_SECONDS} seconds before publishing...`
|
|
166785
|
-
);
|
|
166771
|
+
logger.info(`Sleeping for ${SLEEP_BEFORE_PUBLISH_SECONDS} seconds before publishing...`);
|
|
166786
166772
|
if (!isDryRun()) {
|
|
166787
166773
|
await sleep(SLEEP_BEFORE_PUBLISH_SECONDS * 1e3);
|
|
166788
166774
|
} else {
|
|
@@ -166802,15 +166788,11 @@ async function execPublish(remote, newVersion, noGitChecks) {
|
|
|
166802
166788
|
}
|
|
166803
166789
|
async function prepareChangelog(git, oldVersion, newVersion, changelogPolicy = "none" /* None */, changelogPath = DEFAULT_CHANGELOG_PATH) {
|
|
166804
166790
|
if (changelogPolicy === "none" /* None */) {
|
|
166805
|
-
logger.debug(
|
|
166806
|
-
`Changelog policy is set to "${changelogPolicy}", nothing to do.`
|
|
166807
|
-
);
|
|
166791
|
+
logger.debug(`Changelog policy is set to "${changelogPolicy}", nothing to do.`);
|
|
166808
166792
|
return void 0;
|
|
166809
166793
|
}
|
|
166810
166794
|
if (changelogPolicy !== "auto" /* Auto */ && changelogPolicy !== "simple" /* Simple */) {
|
|
166811
|
-
throw new ConfigurationError(
|
|
166812
|
-
`Invalid changelog policy: "${changelogPolicy}"`
|
|
166813
|
-
);
|
|
166795
|
+
throw new ConfigurationError(`Invalid changelog policy: "${changelogPolicy}"`);
|
|
166814
166796
|
}
|
|
166815
166797
|
logger.info("Checking the changelog...");
|
|
166816
166798
|
logger.debug(`Changelog policy: "${changelogPolicy}".`);
|
|
@@ -166824,17 +166806,11 @@ async function prepareChangelog(git, oldVersion, newVersion, changelogPolicy = "
|
|
|
166824
166806
|
logger.info(`Creating changelog file: ${relativePath}`);
|
|
166825
166807
|
await safeFs.writeFile(relativePath, "# Changelog\n");
|
|
166826
166808
|
} else {
|
|
166827
|
-
throw new ConfigurationError(
|
|
166828
|
-
`Changelog does not exist: "${changelogPath}"`
|
|
166829
|
-
);
|
|
166809
|
+
throw new ConfigurationError(`Changelog does not exist: "${changelogPath}"`);
|
|
166830
166810
|
}
|
|
166831
166811
|
}
|
|
166832
166812
|
let changelogString = (await import_fs30.promises.readFile(relativePath)).toString();
|
|
166833
|
-
let changeset = findChangeset(
|
|
166834
|
-
changelogString,
|
|
166835
|
-
newVersion,
|
|
166836
|
-
changelogPolicy === "auto" /* Auto */
|
|
166837
|
-
);
|
|
166813
|
+
let changeset = findChangeset(changelogString, newVersion, changelogPolicy === "auto" /* Auto */);
|
|
166838
166814
|
switch (changelogPolicy) {
|
|
166839
166815
|
case "auto" /* Auto */:
|
|
166840
166816
|
let replaceSection;
|
|
@@ -166850,9 +166826,7 @@ async function prepareChangelog(git, oldVersion, newVersion, changelogPolicy = "
|
|
|
166850
166826
|
replaceSection = changeset.name;
|
|
166851
166827
|
changeset.name = newVersion;
|
|
166852
166828
|
}
|
|
166853
|
-
logger.debug(
|
|
166854
|
-
`Updating the changelog file for the new version: ${newVersion}`
|
|
166855
|
-
);
|
|
166829
|
+
logger.debug(`Updating the changelog file for the new version: ${newVersion}`);
|
|
166856
166830
|
if (replaceSection) {
|
|
166857
166831
|
changelogString = removeChangeset(changelogString, replaceSection);
|
|
166858
166832
|
changelogString = prependChangeset(changelogString, changeset);
|
|
@@ -166861,9 +166835,7 @@ async function prepareChangelog(git, oldVersion, newVersion, changelogPolicy = "
|
|
|
166861
166835
|
break;
|
|
166862
166836
|
default:
|
|
166863
166837
|
if (!changeset?.body) {
|
|
166864
|
-
throw new ConfigurationError(
|
|
166865
|
-
`No changelog entry found for version "${newVersion}"`
|
|
166866
|
-
);
|
|
166838
|
+
throw new ConfigurationError(`No changelog entry found for version "${newVersion}"`);
|
|
166867
166839
|
}
|
|
166868
166840
|
}
|
|
166869
166841
|
logger.debug("Changelog entry found:", changeset.name);
|
|
@@ -166874,9 +166846,7 @@ async function getChangelogLineRange(git, changelogPath, version2) {
|
|
|
166874
166846
|
try {
|
|
166875
166847
|
const content = await git.show([`HEAD:${changelogPath}`]);
|
|
166876
166848
|
const lines = content.split("\n");
|
|
166877
|
-
const startIdx = lines.findIndex(
|
|
166878
|
-
(l4) => l4.trimEnd() === `## ${version2}` || l4.trimEnd() === version2
|
|
166879
|
-
);
|
|
166849
|
+
const startIdx = lines.findIndex((l4) => l4.trimEnd() === `## ${version2}` || l4.trimEnd() === version2);
|
|
166880
166850
|
if (startIdx < 0) {
|
|
166881
166851
|
return "";
|
|
166882
166852
|
}
|
|
@@ -166929,7 +166899,7 @@ async function resolveVersion(git, options) {
|
|
|
166929
166899
|
`CalVer versioning requires minVersion >= ${AUTO_VERSION_MIN_VERSION2} in .craft.yml. Please update your configuration or specify the version explicitly.`
|
|
166930
166900
|
);
|
|
166931
166901
|
}
|
|
166932
|
-
const calverOffset = options.calverOffset ?? (process.env.CRAFT_CALVER_OFFSET ? parseInt(process.env.CRAFT_CALVER_OFFSET, 10) : void 0) ?? config3.versioning?.calver?.offset ?? DEFAULT_CALVER_CONFIG.offset;
|
|
166902
|
+
const calverOffset = options.calverOffset ?? (process.env.CRAFT_CALVER_OFFSET ? Number.parseInt(process.env.CRAFT_CALVER_OFFSET, 10) : void 0) ?? config3.versioning?.calver?.offset ?? DEFAULT_CALVER_CONFIG.offset;
|
|
166933
166903
|
const calverFormat = config3.versioning?.calver?.format ?? DEFAULT_CALVER_CONFIG.format;
|
|
166934
166904
|
return calculateCalVer(git, {
|
|
166935
166905
|
offset: calverOffset,
|
|
@@ -166952,11 +166922,9 @@ async function resolveVersion(git, options) {
|
|
|
166952
166922
|
} else {
|
|
166953
166923
|
bumpType = version2;
|
|
166954
166924
|
}
|
|
166955
|
-
const currentVersion = latestTag &&
|
|
166925
|
+
const currentVersion = latestTag && getVersion(latestTag) || "0.0.0";
|
|
166956
166926
|
const newVersion = calculateNextVersion(currentVersion, bumpType);
|
|
166957
|
-
logger.info(
|
|
166958
|
-
`Version bump: ${currentVersion} -> ${newVersion} (${bumpType} bump)`
|
|
166959
|
-
);
|
|
166927
|
+
logger.info(`Version bump: ${currentVersion} -> ${newVersion} (${bumpType} bump)`);
|
|
166960
166928
|
return newVersion;
|
|
166961
166929
|
}
|
|
166962
166930
|
return version2;
|
|
@@ -166967,9 +166935,7 @@ async function prepareMain(argv) {
|
|
|
166967
166935
|
logger.info(`Loading configuration from remote branch: ${argv.configFrom}`);
|
|
166968
166936
|
try {
|
|
166969
166937
|
await git.fetch([argv.remote, argv.configFrom]);
|
|
166970
|
-
const configContent = await git.show([
|
|
166971
|
-
`${argv.remote}/${argv.configFrom}:${CONFIG_FILE_NAME}`
|
|
166972
|
-
]);
|
|
166938
|
+
const configContent = await git.show([`${argv.remote}/${argv.configFrom}:${CONFIG_FILE_NAME}`]);
|
|
166973
166939
|
loadConfigurationFromString(configContent);
|
|
166974
166940
|
} catch (error3) {
|
|
166975
166941
|
throw new ConfigurationError(
|
|
@@ -167002,13 +166968,7 @@ async function prepareMain(argv) {
|
|
|
167002
166968
|
const isolation = await createDryRunIsolation(git, rev);
|
|
167003
166969
|
git = isolation.git;
|
|
167004
166970
|
try {
|
|
167005
|
-
const branchName = await createReleaseBranch(
|
|
167006
|
-
git,
|
|
167007
|
-
rev,
|
|
167008
|
-
newVersion,
|
|
167009
|
-
argv.remote,
|
|
167010
|
-
config3.releaseBranchPrefix
|
|
167011
|
-
);
|
|
166971
|
+
const branchName = await createReleaseBranch(git, rev, newVersion, argv.remote, config3.releaseBranchPrefix);
|
|
167012
166972
|
const oldVersion = await getLatestTag(git);
|
|
167013
166973
|
const changelogPath = typeof config3.changelog === "string" ? config3.changelog : config3.changelog?.filePath;
|
|
167014
166974
|
const changelogPolicy = typeof config3.changelog === "object" && config3.changelog?.policy ? config3.changelog.policy : config3.changelogPolicy;
|
|
@@ -167043,20 +167003,11 @@ async function prepareMain(argv) {
|
|
|
167043
167003
|
const issueChangelog = isCalVer ? disableChangelogMentions(changelogBody) : changelogBody;
|
|
167044
167004
|
writeGitHubActionsFile("changelog", issueChangelog);
|
|
167045
167005
|
const resolvedChangelogPath = changelogPath || DEFAULT_CHANGELOG_PATH;
|
|
167046
|
-
const lineRange = await getChangelogLineRange(
|
|
167047
|
-
git,
|
|
167048
|
-
resolvedChangelogPath,
|
|
167049
|
-
newVersion
|
|
167050
|
-
);
|
|
167006
|
+
const lineRange = await getChangelogLineRange(git, resolvedChangelogPath, newVersion);
|
|
167051
167007
|
const changelogFileUrl = `https://github.com/${githubConfig.owner}/${githubConfig.repo}/blob/${branchName}/${resolvedChangelogPath}` + lineRange;
|
|
167052
|
-
setGitHubActionsOutput(
|
|
167053
|
-
"changelog",
|
|
167054
|
-
truncateForOutput(issueChangelog, changelogFileUrl)
|
|
167055
|
-
);
|
|
167008
|
+
setGitHubActionsOutput("changelog", truncateForOutput(issueChangelog, changelogFileUrl));
|
|
167056
167009
|
}
|
|
167057
|
-
logger.info(
|
|
167058
|
-
`View diff at: https://github.com/${githubConfig.owner}/${githubConfig.repo}/compare/${branchName}`
|
|
167059
|
-
);
|
|
167010
|
+
logger.info(`View diff at: https://github.com/${githubConfig.owner}/${githubConfig.repo}/compare/${branchName}`);
|
|
167060
167011
|
if (argv.publish) {
|
|
167061
167012
|
if (isolation.isIsolated) {
|
|
167062
167013
|
logger.info(`[dry-run] Would run: craft publish ${newVersion}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/craft",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.2",
|
|
4
4
|
"description": "The universal sentry workflow CLI",
|
|
5
5
|
"main": "dist/craft",
|
|
6
6
|
"repository": "https://github.com/getsentry/craft",
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
"fast-xml-parser": "^5.3.4",
|
|
105
105
|
"minimatch": "^10.2.1",
|
|
106
106
|
"ajv@<6.14.0": "^6.14.0",
|
|
107
|
-
"rollup": "^4.59.0"
|
|
107
|
+
"rollup": "^4.59.0",
|
|
108
|
+
"flatted": "^3.4.0"
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
}
|