@sentry/craft 3.2.0 → 3.4.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 +356 -127
- package/package.json +1 -1
package/dist/craft
CHANGED
|
@@ -42537,7 +42537,7 @@ var init_esm11 = __esm({
|
|
|
42537
42537
|
*
|
|
42538
42538
|
* @internal
|
|
42539
42539
|
*/
|
|
42540
|
-
constructor(cwd = process.cwd(), pathImpl,
|
|
42540
|
+
constructor(cwd = process.cwd(), pathImpl, sep6, { nocase, childrenCacheSize = 16 * 1024, fs: fs16 = defaultFS } = {}) {
|
|
42541
42541
|
this.#fs = fsFromOption(fs16);
|
|
42542
42542
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
42543
42543
|
cwd = (0, import_node_url5.fileURLToPath)(cwd);
|
|
@@ -42548,7 +42548,7 @@ var init_esm11 = __esm({
|
|
|
42548
42548
|
this.#resolveCache = new ResolveCache();
|
|
42549
42549
|
this.#resolvePosixCache = new ResolveCache();
|
|
42550
42550
|
this.#children = new ChildrenCache(childrenCacheSize);
|
|
42551
|
-
const split2 = cwdPath.substring(this.rootPath.length).split(
|
|
42551
|
+
const split2 = cwdPath.substring(this.rootPath.length).split(sep6);
|
|
42552
42552
|
if (split2.length === 1 && !split2[0]) {
|
|
42553
42553
|
split2.pop();
|
|
42554
42554
|
}
|
|
@@ -44268,10 +44268,10 @@ var init_ignore = __esm({
|
|
|
44268
44268
|
ignored(p8) {
|
|
44269
44269
|
const fullpath = p8.fullpath();
|
|
44270
44270
|
const fullpaths = `${fullpath}/`;
|
|
44271
|
-
const
|
|
44272
|
-
const relatives = `${
|
|
44271
|
+
const relative7 = p8.relative() || ".";
|
|
44272
|
+
const relatives = `${relative7}/`;
|
|
44273
44273
|
for (const m10 of this.relative) {
|
|
44274
|
-
if (m10.match(
|
|
44274
|
+
if (m10.match(relative7) || m10.match(relatives))
|
|
44275
44275
|
return true;
|
|
44276
44276
|
}
|
|
44277
44277
|
for (const m10 of this.absolute) {
|
|
@@ -44282,9 +44282,9 @@ var init_ignore = __esm({
|
|
|
44282
44282
|
}
|
|
44283
44283
|
childrenIgnored(p8) {
|
|
44284
44284
|
const fullpath = p8.fullpath() + "/";
|
|
44285
|
-
const
|
|
44285
|
+
const relative7 = (p8.relative() || ".") + "/";
|
|
44286
44286
|
for (const m10 of this.relativeChildren) {
|
|
44287
|
-
if (m10.match(
|
|
44287
|
+
if (m10.match(relative7))
|
|
44288
44288
|
return true;
|
|
44289
44289
|
}
|
|
44290
44290
|
for (const m10 of this.absoluteChildren) {
|
|
@@ -57537,9 +57537,9 @@ var require_prompts = __commonJS({
|
|
|
57537
57537
|
$5.date = (args) => toPrompt("DatePrompt", args);
|
|
57538
57538
|
$5.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
57539
57539
|
$5.list = (args) => {
|
|
57540
|
-
const
|
|
57540
|
+
const sep6 = args.separator || ",";
|
|
57541
57541
|
return toPrompt("TextPrompt", args, {
|
|
57542
|
-
onSubmit: (str2) => str2.split(
|
|
57542
|
+
onSubmit: (str2) => str2.split(sep6).map((s8) => s8.trim())
|
|
57543
57543
|
});
|
|
57544
57544
|
};
|
|
57545
57545
|
$5.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -59857,9 +59857,9 @@ var require_prompts2 = __commonJS({
|
|
|
59857
59857
|
$5.date = (args) => toPrompt("DatePrompt", args);
|
|
59858
59858
|
$5.confirm = (args) => toPrompt("ConfirmPrompt", args);
|
|
59859
59859
|
$5.list = (args) => {
|
|
59860
|
-
const
|
|
59860
|
+
const sep6 = args.separator || ",";
|
|
59861
59861
|
return toPrompt("TextPrompt", args, {
|
|
59862
|
-
onSubmit: (str2) => str2.split(
|
|
59862
|
+
onSubmit: (str2) => str2.split(sep6).map((s8) => s8.trim())
|
|
59863
59863
|
});
|
|
59864
59864
|
};
|
|
59865
59865
|
$5.toggle = (args) => toPrompt("TogglePrompt", args);
|
|
@@ -61043,28 +61043,13 @@ async function getChangesSince(git, rev, until) {
|
|
|
61043
61043
|
body: commit.body,
|
|
61044
61044
|
pr: commit.message.match(PRExtractor)?.[0] || null
|
|
61045
61045
|
}));
|
|
61046
|
-
if (
|
|
61046
|
+
if (changes.length === 0) {
|
|
61047
61047
|
return changes;
|
|
61048
61048
|
}
|
|
61049
|
-
const
|
|
61050
|
-
|
|
61051
|
-
|
|
61052
|
-
for (const pkg of discovered.packages) {
|
|
61053
|
-
const relative6 = import_node_path13.default.relative(root, pkg.location).split(import_node_path13.default.sep).join("/");
|
|
61054
|
-
if (relative6 === "" || relative6 === ".." || relative6.startsWith("../")) {
|
|
61055
|
-
throw new ConfigurationError(
|
|
61056
|
-
`Workspace package is outside the repository: ${pkg.name}`
|
|
61057
|
-
);
|
|
61058
|
-
}
|
|
61059
|
-
ownedPaths.add(relative6);
|
|
61049
|
+
const belongsToWorkspace = await getWorkspaceChangeFilter();
|
|
61050
|
+
if (!belongsToWorkspace) {
|
|
61051
|
+
return changes;
|
|
61060
61052
|
}
|
|
61061
|
-
const orderedOwners = [...ownedPaths].sort(
|
|
61062
|
-
(left2, right2) => right2.length - left2.length
|
|
61063
|
-
);
|
|
61064
|
-
const { includePaths, unownedPaths } = getChangelogConfig();
|
|
61065
|
-
const unownedPathsOwner = getUnownedPathsOwner();
|
|
61066
|
-
const includesUnowned = unownedPathsOwner ? unownedPathsOwner === workspace : unownedPaths !== "exclude";
|
|
61067
|
-
const contains2 = (directory, file) => file === directory || file.startsWith(`${directory}/`);
|
|
61068
61053
|
const raw = await git.raw([
|
|
61069
61054
|
"log",
|
|
61070
61055
|
"--no-merges",
|
|
@@ -61096,13 +61081,39 @@ async function getChangesSince(git, rev, until) {
|
|
|
61096
61081
|
if (!files) {
|
|
61097
61082
|
throw new Error(`Missing changelog paths for commit ${commit.hash}`);
|
|
61098
61083
|
}
|
|
61099
|
-
return files
|
|
61100
|
-
|
|
61101
|
-
|
|
61102
|
-
|
|
61103
|
-
|
|
61104
|
-
|
|
61105
|
-
|
|
61084
|
+
return belongsToWorkspace(files);
|
|
61085
|
+
});
|
|
61086
|
+
}
|
|
61087
|
+
async function getWorkspaceChangeFilter() {
|
|
61088
|
+
const workspace = getActiveWorkspace();
|
|
61089
|
+
if (!workspace) {
|
|
61090
|
+
return void 0;
|
|
61091
|
+
}
|
|
61092
|
+
const root = getConfigFileDir() || process.cwd();
|
|
61093
|
+
const discovered = await discoverWorkspaces(root);
|
|
61094
|
+
const ownedPaths = new Set(getWorkspaceNames());
|
|
61095
|
+
for (const pkg of discovered.packages) {
|
|
61096
|
+
const relative7 = import_node_path13.default.relative(root, pkg.location).split(import_node_path13.default.sep).join("/");
|
|
61097
|
+
if (relative7 === "" || relative7 === ".." || relative7.startsWith("../")) {
|
|
61098
|
+
throw new ConfigurationError(
|
|
61099
|
+
`Workspace package is outside the repository: ${pkg.name}`
|
|
61100
|
+
);
|
|
61101
|
+
}
|
|
61102
|
+
ownedPaths.add(relative7);
|
|
61103
|
+
}
|
|
61104
|
+
const orderedOwners = [...ownedPaths].sort(
|
|
61105
|
+
(left2, right2) => right2.length - left2.length
|
|
61106
|
+
);
|
|
61107
|
+
const { includePaths, unownedPaths } = getChangelogConfig();
|
|
61108
|
+
const unownedPathsOwner = getUnownedPathsOwner();
|
|
61109
|
+
const includesUnowned = unownedPathsOwner ? unownedPathsOwner === workspace : unownedPaths !== "exclude";
|
|
61110
|
+
const contains2 = (directory, file) => file === directory || file.startsWith(`${directory}/`);
|
|
61111
|
+
return (files) => files.some((file) => {
|
|
61112
|
+
if (includePaths.some((directory) => contains2(directory, file))) {
|
|
61113
|
+
return true;
|
|
61114
|
+
}
|
|
61115
|
+
const owner = orderedOwners.find((directory) => contains2(directory, file));
|
|
61116
|
+
return owner === void 0 ? includesUnowned : owner === workspace;
|
|
61106
61117
|
});
|
|
61107
61118
|
}
|
|
61108
61119
|
async function findWorkspaceIntroduction(git, workspace, until) {
|
|
@@ -109186,21 +109197,21 @@ var init_Matcher = __esm({
|
|
|
109186
109197
|
* @returns {string}
|
|
109187
109198
|
*/
|
|
109188
109199
|
toString(separator, includeNamespace = true) {
|
|
109189
|
-
const
|
|
109190
|
-
const isDefault =
|
|
109200
|
+
const sep6 = separator || this.separator;
|
|
109201
|
+
const isDefault = sep6 === this.separator && includeNamespace === true;
|
|
109191
109202
|
if (isDefault) {
|
|
109192
109203
|
if (this._pathStringCache !== null) {
|
|
109193
109204
|
return this._pathStringCache;
|
|
109194
109205
|
}
|
|
109195
109206
|
const result = this.path.map(
|
|
109196
109207
|
(n5) => n5.namespace ? `${n5.namespace}:${n5.tag}` : n5.tag
|
|
109197
|
-
).join(
|
|
109208
|
+
).join(sep6);
|
|
109198
109209
|
this._pathStringCache = result;
|
|
109199
109210
|
return result;
|
|
109200
109211
|
}
|
|
109201
109212
|
return this.path.map(
|
|
109202
109213
|
(n5) => includeNamespace && n5.namespace ? `${n5.namespace}:${n5.tag}` : n5.tag
|
|
109203
|
-
).join(
|
|
109214
|
+
).join(sep6);
|
|
109204
109215
|
}
|
|
109205
109216
|
/**
|
|
109206
109217
|
* Get path as array of tag names.
|
|
@@ -121303,6 +121314,30 @@ async function fetchPRInfo(prNumber) {
|
|
|
121303
121314
|
headSha: pr3.head.sha
|
|
121304
121315
|
};
|
|
121305
121316
|
}
|
|
121317
|
+
async function fetchPRFiles(prNumber) {
|
|
121318
|
+
const { repo, owner } = await getGlobalGitHubConfig();
|
|
121319
|
+
const github = getGitHubClient();
|
|
121320
|
+
const perPage = 100;
|
|
121321
|
+
const files = [];
|
|
121322
|
+
for (let page = 1; ; page++) {
|
|
121323
|
+
const { data: data2 } = await github.pulls.listFiles({
|
|
121324
|
+
owner,
|
|
121325
|
+
repo,
|
|
121326
|
+
pull_number: prNumber,
|
|
121327
|
+
per_page: perPage,
|
|
121328
|
+
page
|
|
121329
|
+
});
|
|
121330
|
+
for (const file of data2) {
|
|
121331
|
+
files.push(file.filename);
|
|
121332
|
+
if (file.previous_filename) {
|
|
121333
|
+
files.push(file.previous_filename);
|
|
121334
|
+
}
|
|
121335
|
+
}
|
|
121336
|
+
if (data2.length < perPage) {
|
|
121337
|
+
return files;
|
|
121338
|
+
}
|
|
121339
|
+
}
|
|
121340
|
+
}
|
|
121306
121341
|
function authorLogins(nodes = []) {
|
|
121307
121342
|
return nodes.map((node3) => node3.user?.login).filter((login) => Boolean(login));
|
|
121308
121343
|
}
|
|
@@ -121964,6 +121999,17 @@ async function generateChangesetFromGit(git, rev, maxLeftovers = MAX_LEFTOVERS,
|
|
|
121964
121999
|
async function generateChangelogWithHighlight(git, rev, currentPRNumber) {
|
|
121965
122000
|
const prInfo = await fetchPRInfo(currentPRNumber);
|
|
121966
122001
|
const prBumpType = getBumpTypeForPR(prInfo);
|
|
122002
|
+
const belongsToWorkspace = await getWorkspaceChangeFilter();
|
|
122003
|
+
if (belongsToWorkspace && !belongsToWorkspace(await fetchPRFiles(currentPRNumber))) {
|
|
122004
|
+
return {
|
|
122005
|
+
changelog: "",
|
|
122006
|
+
bumpType: null,
|
|
122007
|
+
totalCommits: 0,
|
|
122008
|
+
matchedCommitsWithSemver: 0,
|
|
122009
|
+
prSkipped: false,
|
|
122010
|
+
prOutsideWorkspace: true
|
|
122011
|
+
};
|
|
122012
|
+
}
|
|
121967
122013
|
if (shouldSkipCurrentPR(prInfo)) {
|
|
121968
122014
|
return {
|
|
121969
122015
|
changelog: "",
|
|
@@ -122007,10 +122053,18 @@ async function generateChangelogWithHighlight(git, rev, currentPRNumber) {
|
|
|
122007
122053
|
true,
|
|
122008
122054
|
true
|
|
122009
122055
|
);
|
|
122056
|
+
const prEntry = currentPRSurvived ? await serializeChangelog(
|
|
122057
|
+
categorizeCommits(filteredCommits.filter((c7) => c7.highlight)).data,
|
|
122058
|
+
MAX_LEFTOVERS,
|
|
122059
|
+
true,
|
|
122060
|
+
true,
|
|
122061
|
+
false
|
|
122062
|
+
) : "";
|
|
122010
122063
|
const bumpType = currentPRSurvived ? prBumpType : stats.bumpType;
|
|
122011
122064
|
return {
|
|
122012
122065
|
changelog,
|
|
122013
122066
|
prSkipped: false,
|
|
122067
|
+
prEntry,
|
|
122014
122068
|
bumpType,
|
|
122015
122069
|
totalCommits: stats.totalCommits,
|
|
122016
122070
|
matchedCommitsWithSemver: stats.matchedCommitsWithSemver
|
|
@@ -124418,8 +124472,12 @@ var init_nuget = __esm({
|
|
|
124418
124472
|
nugetConfig;
|
|
124419
124473
|
/**
|
|
124420
124474
|
* Expand a nuget target config into multiple targets if workspaces is enabled.
|
|
124475
|
+
*
|
|
124476
|
+
* The solution is always resolved from `rootDir` (the repository root), so
|
|
124477
|
+
* `solutionPath` keeps its meaning. When a release workspace is selected,
|
|
124478
|
+
* `releaseUnitDir` is its directory and only projects inside it are kept.
|
|
124421
124479
|
*/
|
|
124422
|
-
static async expand(config, rootDir) {
|
|
124480
|
+
static async expand(config, rootDir, releaseUnitDir = rootDir) {
|
|
124423
124481
|
if (!config.workspaces) {
|
|
124424
124482
|
return [config];
|
|
124425
124483
|
}
|
|
@@ -124429,7 +124487,17 @@ var init_nuget = __esm({
|
|
|
124429
124487
|
"nuget target has workspaces enabled but no packable projects were found" + (result ? ` in ${result.solutionPath}` : "") + '. Check that the solution file exists and lists your projects, or set "solutionPath".'
|
|
124430
124488
|
);
|
|
124431
124489
|
}
|
|
124432
|
-
const
|
|
124490
|
+
const releaseUnitPath = (0, import_path15.relative)(rootDir, releaseUnitDir);
|
|
124491
|
+
const discoveredPackages = releaseUnitPath ? result.packages.filter((pkg) => {
|
|
124492
|
+
const projectPath = (0, import_path15.relative)(releaseUnitDir, pkg.projectPath);
|
|
124493
|
+
return projectPath !== ".." && !projectPath.startsWith(`..${import_path15.sep}`) && !(0, import_path15.isAbsolute)(projectPath);
|
|
124494
|
+
}) : result.packages;
|
|
124495
|
+
if (discoveredPackages.length === 0) {
|
|
124496
|
+
throw new ConfigurationError(
|
|
124497
|
+
`nuget target has workspaces enabled but none of the packable projects in ${result.solutionPath} are inside the selected workspace "${releaseUnitPath}".`
|
|
124498
|
+
);
|
|
124499
|
+
}
|
|
124500
|
+
const workspacePackages = discoveredPackages.map((pkg) => ({
|
|
124433
124501
|
name: pkg.packageId,
|
|
124434
124502
|
location: pkg.projectPath,
|
|
124435
124503
|
private: !pkg.isPackable,
|
|
@@ -124455,7 +124523,7 @@ var init_nuget = __esm({
|
|
|
124455
124523
|
);
|
|
124456
124524
|
}
|
|
124457
124525
|
const filteredNames = new Set(filteredWorkspacePackages.map((p8) => p8.name));
|
|
124458
|
-
const filteredPackages =
|
|
124526
|
+
const filteredPackages = discoveredPackages.filter(
|
|
124459
124527
|
(p8) => filteredNames.has(p8.packageId)
|
|
124460
124528
|
);
|
|
124461
124529
|
const sortedPackages = sortDotnetPackages(filteredPackages);
|
|
@@ -142784,12 +142852,12 @@ var require_fromHttp = __commonJS({
|
|
|
142784
142852
|
var fromHttp = (options = {}) => {
|
|
142785
142853
|
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
142786
142854
|
let host;
|
|
142787
|
-
const
|
|
142855
|
+
const relative7 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
142788
142856
|
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
142789
142857
|
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
142790
142858
|
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
142791
142859
|
const warn3 = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger);
|
|
142792
|
-
if (
|
|
142860
|
+
if (relative7 && full) {
|
|
142793
142861
|
warn3("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
142794
142862
|
warn3("awsContainerCredentialsFullUri will take precedence.");
|
|
142795
142863
|
}
|
|
@@ -142799,8 +142867,8 @@ var require_fromHttp = __commonJS({
|
|
|
142799
142867
|
}
|
|
142800
142868
|
if (full) {
|
|
142801
142869
|
host = full;
|
|
142802
|
-
} else if (
|
|
142803
|
-
host = `${DEFAULT_LINK_LOCAL_HOST}${
|
|
142870
|
+
} else if (relative7) {
|
|
142871
|
+
host = `${DEFAULT_LINK_LOCAL_HOST}${relative7}`;
|
|
142804
142872
|
} else {
|
|
142805
142873
|
throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
142806
142874
|
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
|
|
@@ -160593,10 +160661,10 @@ var require_symlink = __commonJS({
|
|
|
160593
160661
|
pathExists(dstpath, (err, destinationExists) => {
|
|
160594
160662
|
if (err) return callback(err);
|
|
160595
160663
|
if (destinationExists) return callback(null);
|
|
160596
|
-
symlinkPaths(srcpath, dstpath, (err2,
|
|
160664
|
+
symlinkPaths(srcpath, dstpath, (err2, relative7) => {
|
|
160597
160665
|
if (err2) return callback(err2);
|
|
160598
|
-
srcpath =
|
|
160599
|
-
symlinkType(
|
|
160666
|
+
srcpath = relative7.toDst;
|
|
160667
|
+
symlinkType(relative7.toCwd, type2, (err3, type3) => {
|
|
160600
160668
|
if (err3) return callback(err3);
|
|
160601
160669
|
const dir = path20.dirname(dstpath);
|
|
160602
160670
|
pathExists(dir, (err4, dirExists) => {
|
|
@@ -160614,9 +160682,9 @@ var require_symlink = __commonJS({
|
|
|
160614
160682
|
function createSymlinkSync(srcpath, dstpath, type2) {
|
|
160615
160683
|
const destinationExists = fs16.existsSync(dstpath);
|
|
160616
160684
|
if (destinationExists) return void 0;
|
|
160617
|
-
const
|
|
160618
|
-
srcpath =
|
|
160619
|
-
type2 = symlinkTypeSync(
|
|
160685
|
+
const relative7 = symlinkPathsSync(srcpath, dstpath);
|
|
160686
|
+
srcpath = relative7.toDst;
|
|
160687
|
+
type2 = symlinkTypeSync(relative7.toCwd, type2);
|
|
160620
160688
|
const dir = path20.dirname(dstpath);
|
|
160621
160689
|
const exists = fs16.existsSync(dir);
|
|
160622
160690
|
if (exists) return fs16.symlinkSync(srcpath, dstpath, type2);
|
|
@@ -168682,10 +168750,10 @@ var require_symlink2 = __commonJS({
|
|
|
168682
168750
|
});
|
|
168683
168751
|
}
|
|
168684
168752
|
function _createSymlink(srcpath, dstpath, type2, callback) {
|
|
168685
|
-
symlinkPaths(srcpath, dstpath, (err,
|
|
168753
|
+
symlinkPaths(srcpath, dstpath, (err, relative7) => {
|
|
168686
168754
|
if (err) return callback(err);
|
|
168687
|
-
srcpath =
|
|
168688
|
-
symlinkType(
|
|
168755
|
+
srcpath = relative7.toDst;
|
|
168756
|
+
symlinkType(relative7.toCwd, type2, (err2, type3) => {
|
|
168689
168757
|
if (err2) return callback(err2);
|
|
168690
168758
|
const dir = path20.dirname(dstpath);
|
|
168691
168759
|
pathExists(dir, (err3, dirExists) => {
|
|
@@ -168710,9 +168778,9 @@ var require_symlink2 = __commonJS({
|
|
|
168710
168778
|
const dstStat = fs16.statSync(dstpath);
|
|
168711
168779
|
if (areIdentical(srcStat, dstStat)) return;
|
|
168712
168780
|
}
|
|
168713
|
-
const
|
|
168714
|
-
srcpath =
|
|
168715
|
-
type2 = symlinkTypeSync(
|
|
168781
|
+
const relative7 = symlinkPathsSync(srcpath, dstpath);
|
|
168782
|
+
srcpath = relative7.toDst;
|
|
168783
|
+
type2 = symlinkTypeSync(relative7.toCwd, type2);
|
|
168716
168784
|
const dir = path20.dirname(dstpath);
|
|
168717
168785
|
const exists = fs16.existsSync(dir);
|
|
168718
168786
|
if (exists) return fs16.symlinkSync(srcpath, dstpath, type2);
|
|
@@ -184664,7 +184732,7 @@ var require_dist12 = __commonJS({
|
|
|
184664
184732
|
var fs122 = require("fs");
|
|
184665
184733
|
var path82 = require("path");
|
|
184666
184734
|
var minimatch3 = require_minimatch2();
|
|
184667
|
-
var
|
|
184735
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
184668
184736
|
var Minimatch2 = minimatch3.Minimatch;
|
|
184669
184737
|
function alphasort(a5, b9) {
|
|
184670
184738
|
return a5.localeCompare(b9, "en");
|
|
@@ -184732,7 +184800,7 @@ var require_dist12 = __commonJS({
|
|
|
184732
184800
|
}
|
|
184733
184801
|
self2.root = options.root || path82.resolve(self2.cwd, "/");
|
|
184734
184802
|
self2.root = path82.resolve(self2.root);
|
|
184735
|
-
self2.cwdAbs =
|
|
184803
|
+
self2.cwdAbs = isAbsolute7(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
|
|
184736
184804
|
self2.nomount = !!options.nomount;
|
|
184737
184805
|
if (process.platform === "win32") {
|
|
184738
184806
|
self2.root = self2.root.replace(/\\/g, "/");
|
|
@@ -184815,7 +184883,7 @@ var require_dist12 = __commonJS({
|
|
|
184815
184883
|
var abs = f8;
|
|
184816
184884
|
if (f8.charAt(0) === "/") {
|
|
184817
184885
|
abs = path82.join(self2.root, f8);
|
|
184818
|
-
} else if (
|
|
184886
|
+
} else if (isAbsolute7(f8) || f8 === "") {
|
|
184819
184887
|
abs = f8;
|
|
184820
184888
|
} else if (self2.changedCwd) {
|
|
184821
184889
|
abs = path82.resolve(self2.cwd, f8);
|
|
@@ -184853,7 +184921,7 @@ var require_dist12 = __commonJS({
|
|
|
184853
184921
|
var util5 = require("util");
|
|
184854
184922
|
var path82 = require("path");
|
|
184855
184923
|
var assert7 = require("assert");
|
|
184856
|
-
var
|
|
184924
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
184857
184925
|
var common3 = require_common6();
|
|
184858
184926
|
var setopts = common3.setopts;
|
|
184859
184927
|
var ownProp = common3.ownProp;
|
|
@@ -184925,10 +184993,10 @@ var require_dist12 = __commonJS({
|
|
|
184925
184993
|
var read;
|
|
184926
184994
|
if (prefix === null)
|
|
184927
184995
|
read = ".";
|
|
184928
|
-
else if (
|
|
184996
|
+
else if (isAbsolute7(prefix) || isAbsolute7(pattern.map(function(p8) {
|
|
184929
184997
|
return typeof p8 === "string" ? p8 : "[*]";
|
|
184930
184998
|
}).join("/"))) {
|
|
184931
|
-
if (!prefix || !
|
|
184999
|
+
if (!prefix || !isAbsolute7(prefix))
|
|
184932
185000
|
prefix = "/" + prefix;
|
|
184933
185001
|
read = prefix;
|
|
184934
185002
|
} else
|
|
@@ -185125,7 +185193,7 @@ var require_dist12 = __commonJS({
|
|
|
185125
185193
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
185126
185194
|
if (!exists)
|
|
185127
185195
|
return;
|
|
185128
|
-
if (prefix &&
|
|
185196
|
+
if (prefix && isAbsolute7(prefix) && !this.nomount) {
|
|
185129
185197
|
var trail = /[\/\\]$/.test(prefix);
|
|
185130
185198
|
if (prefix.charAt(0) === "/") {
|
|
185131
185199
|
prefix = path82.join(this.root, prefix);
|
|
@@ -185247,7 +185315,7 @@ var require_dist12 = __commonJS({
|
|
|
185247
185315
|
var EE = require("events").EventEmitter;
|
|
185248
185316
|
var path82 = require("path");
|
|
185249
185317
|
var assert7 = require("assert");
|
|
185250
|
-
var
|
|
185318
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
185251
185319
|
var globSync2 = require_sync7();
|
|
185252
185320
|
var common3 = require_common6();
|
|
185253
185321
|
var setopts = common3.setopts;
|
|
@@ -185469,10 +185537,10 @@ var require_dist12 = __commonJS({
|
|
|
185469
185537
|
var read;
|
|
185470
185538
|
if (prefix === null)
|
|
185471
185539
|
read = ".";
|
|
185472
|
-
else if (
|
|
185540
|
+
else if (isAbsolute7(prefix) || isAbsolute7(pattern.map(function(p8) {
|
|
185473
185541
|
return typeof p8 === "string" ? p8 : "[*]";
|
|
185474
185542
|
}).join("/"))) {
|
|
185475
|
-
if (!prefix || !
|
|
185543
|
+
if (!prefix || !isAbsolute7(prefix))
|
|
185476
185544
|
prefix = "/" + prefix;
|
|
185477
185545
|
read = prefix;
|
|
185478
185546
|
} else
|
|
@@ -185557,7 +185625,7 @@ var require_dist12 = __commonJS({
|
|
|
185557
185625
|
this._emitQueue.push([index, e5]);
|
|
185558
185626
|
return;
|
|
185559
185627
|
}
|
|
185560
|
-
var abs =
|
|
185628
|
+
var abs = isAbsolute7(e5) ? e5 : this._makeAbs(e5);
|
|
185561
185629
|
if (this.mark)
|
|
185562
185630
|
e5 = this._mark(e5);
|
|
185563
185631
|
if (this.absolute)
|
|
@@ -185712,7 +185780,7 @@ var require_dist12 = __commonJS({
|
|
|
185712
185780
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
185713
185781
|
if (!exists)
|
|
185714
185782
|
return cb();
|
|
185715
|
-
if (prefix &&
|
|
185783
|
+
if (prefix && isAbsolute7(prefix) && !this.nomount) {
|
|
185716
185784
|
var trail = /[\/\\]$/.test(prefix);
|
|
185717
185785
|
if (prefix.charAt(0) === "/") {
|
|
185718
185786
|
prefix = path82.join(this.root, prefix);
|
|
@@ -209079,7 +209147,7 @@ ${codeblock}`, options);
|
|
|
209079
209147
|
ptr++;
|
|
209080
209148
|
return banComments || c7 !== "#" ? ptr : skipVoid(str2, skipComment(str2, ptr), banNewLines);
|
|
209081
209149
|
}
|
|
209082
|
-
function skipUntil(str2, ptr,
|
|
209150
|
+
function skipUntil(str2, ptr, sep6, end, banNewLines = false) {
|
|
209083
209151
|
if (!end) {
|
|
209084
209152
|
ptr = indexOfNewline(str2, ptr);
|
|
209085
209153
|
return ptr < 0 ? str2.length : ptr;
|
|
@@ -209088,7 +209156,7 @@ ${codeblock}`, options);
|
|
|
209088
209156
|
let c7 = str2[i5];
|
|
209089
209157
|
if (c7 === "#") {
|
|
209090
209158
|
i5 = indexOfNewline(str2, i5);
|
|
209091
|
-
} else if (c7 ===
|
|
209159
|
+
} else if (c7 === sep6) {
|
|
209092
209160
|
return i5 + 1;
|
|
209093
209161
|
} else if (c7 === end || banNewLines && (c7 === "\n" || c7 === "\r" && str2[i5 + 1] === "\n")) {
|
|
209094
209162
|
return i5;
|
|
@@ -214446,15 +214514,15 @@ function getLocation(text, position) {
|
|
|
214446
214514
|
throw earlyReturnException;
|
|
214447
214515
|
}
|
|
214448
214516
|
},
|
|
214449
|
-
onSeparator: (
|
|
214517
|
+
onSeparator: (sep6, offset, length) => {
|
|
214450
214518
|
if (position <= offset) {
|
|
214451
214519
|
throw earlyReturnException;
|
|
214452
214520
|
}
|
|
214453
|
-
if (
|
|
214521
|
+
if (sep6 === ":" && previousNode && previousNode.type === "property") {
|
|
214454
214522
|
previousNode.colonOffset = offset;
|
|
214455
214523
|
isAtPropertyKey = false;
|
|
214456
214524
|
previousNode = void 0;
|
|
214457
|
-
} else if (
|
|
214525
|
+
} else if (sep6 === ",") {
|
|
214458
214526
|
const last = segments[segments.length - 1];
|
|
214459
214527
|
if (typeof last === "number") {
|
|
214460
214528
|
segments[segments.length - 1] = last + 1;
|
|
@@ -214569,11 +214637,11 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
214569
214637
|
onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
|
|
214570
214638
|
ensurePropertyComplete(offset + length);
|
|
214571
214639
|
},
|
|
214572
|
-
onSeparator: (
|
|
214640
|
+
onSeparator: (sep6, offset, length) => {
|
|
214573
214641
|
if (currentParent.type === "property") {
|
|
214574
|
-
if (
|
|
214642
|
+
if (sep6 === ":") {
|
|
214575
214643
|
currentParent.colonOffset = offset;
|
|
214576
|
-
} else if (
|
|
214644
|
+
} else if (sep6 === ",") {
|
|
214577
214645
|
ensurePropertyComplete(offset);
|
|
214578
214646
|
}
|
|
214579
214647
|
}
|
|
@@ -218796,21 +218864,21 @@ var require_pattern = __commonJS({
|
|
|
218796
218864
|
exports2.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
218797
218865
|
function partitionAbsoluteAndRelative(patterns) {
|
|
218798
218866
|
const absolute = [];
|
|
218799
|
-
const
|
|
218867
|
+
const relative7 = [];
|
|
218800
218868
|
for (const pattern of patterns) {
|
|
218801
|
-
if (
|
|
218869
|
+
if (isAbsolute7(pattern)) {
|
|
218802
218870
|
absolute.push(pattern);
|
|
218803
218871
|
} else {
|
|
218804
|
-
|
|
218872
|
+
relative7.push(pattern);
|
|
218805
218873
|
}
|
|
218806
218874
|
}
|
|
218807
|
-
return [absolute,
|
|
218875
|
+
return [absolute, relative7];
|
|
218808
218876
|
}
|
|
218809
218877
|
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
218810
|
-
function
|
|
218878
|
+
function isAbsolute7(pattern) {
|
|
218811
218879
|
return path20.isAbsolute(pattern);
|
|
218812
218880
|
}
|
|
218813
|
-
exports2.isAbsolute =
|
|
218881
|
+
exports2.isAbsolute = isAbsolute7;
|
|
218814
218882
|
}
|
|
218815
218883
|
});
|
|
218816
218884
|
|
|
@@ -229139,7 +229207,68 @@ function resolveWorkspaceConfig(base, workspaceName, workspaceDirectory) {
|
|
|
229139
229207
|
resolved[key] = value;
|
|
229140
229208
|
}
|
|
229141
229209
|
}
|
|
229142
|
-
return
|
|
229210
|
+
return expandWorkspacePlaceholders(
|
|
229211
|
+
resolved,
|
|
229212
|
+
getWorkspacePlaceholderResolver(workspaceName, workspaceDirectory)
|
|
229213
|
+
);
|
|
229214
|
+
}
|
|
229215
|
+
function getWorkspacePlaceholderResolver(workspaceName, workspaceDirectory) {
|
|
229216
|
+
let packageName;
|
|
229217
|
+
const readPackageName = (placeholder) => {
|
|
229218
|
+
if (packageName !== void 0) {
|
|
229219
|
+
return packageName;
|
|
229220
|
+
}
|
|
229221
|
+
const packageJsonPath = import_path24.default.posix.join(workspaceName, "package.json");
|
|
229222
|
+
let name;
|
|
229223
|
+
try {
|
|
229224
|
+
name = JSON.parse(
|
|
229225
|
+
(0, import_fs26.readFileSync)(import_path24.default.join(workspaceDirectory, packageJsonPath), "utf-8")
|
|
229226
|
+
)?.name;
|
|
229227
|
+
} catch (error3) {
|
|
229228
|
+
throw new ConfigurationError(
|
|
229229
|
+
`Workspace "${workspaceName}" uses {{${placeholder}}}, but ${packageJsonPath} could not be read: ${error3.message}`
|
|
229230
|
+
);
|
|
229231
|
+
}
|
|
229232
|
+
if (typeof name !== "string" || name === "") {
|
|
229233
|
+
throw new ConfigurationError(
|
|
229234
|
+
`Workspace "${workspaceName}" uses {{${placeholder}}}, but ${packageJsonPath} has no "name".`
|
|
229235
|
+
);
|
|
229236
|
+
}
|
|
229237
|
+
packageName = name;
|
|
229238
|
+
return name;
|
|
229239
|
+
};
|
|
229240
|
+
return (placeholder) => {
|
|
229241
|
+
switch (placeholder) {
|
|
229242
|
+
case "workspace":
|
|
229243
|
+
return workspaceName;
|
|
229244
|
+
case "workspaceName":
|
|
229245
|
+
return import_path24.default.posix.basename(workspaceName);
|
|
229246
|
+
case "packageName":
|
|
229247
|
+
return readPackageName(placeholder);
|
|
229248
|
+
case "packageSimpleName":
|
|
229249
|
+
return readPackageName(placeholder).replace(/^@/, "").replace(/\//g, "-");
|
|
229250
|
+
}
|
|
229251
|
+
};
|
|
229252
|
+
}
|
|
229253
|
+
function expandWorkspacePlaceholders(value, resolve10) {
|
|
229254
|
+
if (typeof value === "string") {
|
|
229255
|
+
return value.replace(
|
|
229256
|
+
WORKSPACE_PLACEHOLDER_REGEX,
|
|
229257
|
+
(_match, placeholder) => resolve10(placeholder)
|
|
229258
|
+
);
|
|
229259
|
+
}
|
|
229260
|
+
if (Array.isArray(value)) {
|
|
229261
|
+
return value.map((item) => expandWorkspacePlaceholders(item, resolve10));
|
|
229262
|
+
}
|
|
229263
|
+
if (value !== null && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
|
|
229264
|
+
return Object.fromEntries(
|
|
229265
|
+
Object.entries(value).map(([key, item]) => [
|
|
229266
|
+
key,
|
|
229267
|
+
expandWorkspacePlaceholders(item, resolve10)
|
|
229268
|
+
])
|
|
229269
|
+
);
|
|
229270
|
+
}
|
|
229271
|
+
return value;
|
|
229143
229272
|
}
|
|
229144
229273
|
function getWorkspaceConfig(workspaces, workspaceName, workspaceDirectory) {
|
|
229145
229274
|
if (isWorkspacePattern(workspaceName)) {
|
|
@@ -229605,10 +229734,10 @@ async function getStatusProviderFromConfig() {
|
|
|
229605
229734
|
}
|
|
229606
229735
|
}
|
|
229607
229736
|
}
|
|
229608
|
-
function
|
|
229737
|
+
function getActiveWorkspaceDirectory() {
|
|
229609
229738
|
const workspace = getActiveWorkspace();
|
|
229610
229739
|
if (!workspace) {
|
|
229611
|
-
return
|
|
229740
|
+
return void 0;
|
|
229612
229741
|
}
|
|
229613
229742
|
if (!isSafeWorkspacePath(workspace)) {
|
|
229614
229743
|
throw new ConfigurationError(`Invalid workspace path: "${workspace}"`);
|
|
@@ -229616,7 +229745,7 @@ function getDefaultChangelogFilePath() {
|
|
|
229616
229745
|
const root = getConfigFileDir() || process.cwd();
|
|
229617
229746
|
const directory = import_path24.default.resolve(root, workspace);
|
|
229618
229747
|
if (!(0, import_fs26.existsSync)(directory) || !(0, import_fs26.lstatSync)(directory).isDirectory()) {
|
|
229619
|
-
return
|
|
229748
|
+
return void 0;
|
|
229620
229749
|
}
|
|
229621
229750
|
const realRoot = (0, import_fs26.realpathSync)(root);
|
|
229622
229751
|
const realDirectory = (0, import_fs26.realpathSync)(directory);
|
|
@@ -229625,7 +229754,16 @@ function getDefaultChangelogFilePath() {
|
|
|
229625
229754
|
`Workspace directory escapes the repository: "${workspace}"`
|
|
229626
229755
|
);
|
|
229627
229756
|
}
|
|
229628
|
-
return
|
|
229757
|
+
return workspace;
|
|
229758
|
+
}
|
|
229759
|
+
function getReleaseUnitDir() {
|
|
229760
|
+
const root = getConfigFileDir() || process.cwd();
|
|
229761
|
+
const workspaceDirectory = getActiveWorkspaceDirectory();
|
|
229762
|
+
return workspaceDirectory ? import_path24.default.resolve(root, workspaceDirectory) : root;
|
|
229763
|
+
}
|
|
229764
|
+
function getDefaultChangelogFilePath() {
|
|
229765
|
+
const workspaceDirectory = getActiveWorkspaceDirectory();
|
|
229766
|
+
return workspaceDirectory ? import_path24.default.posix.join(workspaceDirectory, DEFAULT_CHANGELOG_FILE_PATH) : DEFAULT_CHANGELOG_FILE_PATH;
|
|
229629
229767
|
}
|
|
229630
229768
|
function getChangelogConfig() {
|
|
229631
229769
|
const config = getConfiguration();
|
|
@@ -229699,11 +229837,16 @@ function isExpandableTarget(targetClass) {
|
|
|
229699
229837
|
async function expandWorkspaceTargets(targets) {
|
|
229700
229838
|
const { getTargetByName: getTargetByName2 } = (init_targets(), __toCommonJS(targets_exports));
|
|
229701
229839
|
const rootDir = getConfigFileDir() || process.cwd();
|
|
229840
|
+
const releaseUnitDir = getReleaseUnitDir();
|
|
229702
229841
|
const expandedTargets = [];
|
|
229703
229842
|
for (const target of targets) {
|
|
229704
229843
|
const targetClass = getTargetByName2(target.name);
|
|
229705
229844
|
if (targetClass && isExpandableTarget(targetClass)) {
|
|
229706
|
-
const expanded = await targetClass.expand(
|
|
229845
|
+
const expanded = await targetClass.expand(
|
|
229846
|
+
target,
|
|
229847
|
+
rootDir,
|
|
229848
|
+
releaseUnitDir
|
|
229849
|
+
);
|
|
229707
229850
|
expandedTargets.push(...expanded);
|
|
229708
229851
|
} else {
|
|
229709
229852
|
expandedTargets.push(target);
|
|
@@ -229711,7 +229854,7 @@ async function expandWorkspaceTargets(targets) {
|
|
|
229711
229854
|
}
|
|
229712
229855
|
return expandedTargets;
|
|
229713
229856
|
}
|
|
229714
|
-
var import_fs26, import_path24, import_git_url_parse, CONFIG_FILE_NAME, DEFAULT_RELEASE_BRANCH_NAME, _configPathCache, _configCache, WORKSPACES_MIN_VERSION, _activeWorkspaceName, AUTO_VERSION_MIN_VERSION, _globalGitHubConfigCache, DEFAULT_CHANGELOG_FILE_PATH;
|
|
229857
|
+
var import_fs26, import_path24, import_git_url_parse, CONFIG_FILE_NAME, DEFAULT_RELEASE_BRANCH_NAME, _configPathCache, _configCache, WORKSPACES_MIN_VERSION, _activeWorkspaceName, WORKSPACE_PLACEHOLDERS, WORKSPACE_PLACEHOLDER_REGEX, AUTO_VERSION_MIN_VERSION, _globalGitHubConfigCache, DEFAULT_CHANGELOG_FILE_PATH;
|
|
229715
229858
|
var init_config2 = __esm({
|
|
229716
229859
|
"src/config.ts"() {
|
|
229717
229860
|
"use strict";
|
|
@@ -229735,6 +229878,16 @@ var init_config2 = __esm({
|
|
|
229735
229878
|
CONFIG_FILE_NAME = ".craft.yml";
|
|
229736
229879
|
DEFAULT_RELEASE_BRANCH_NAME = "release";
|
|
229737
229880
|
WORKSPACES_MIN_VERSION = "2.29.0";
|
|
229881
|
+
WORKSPACE_PLACEHOLDERS = [
|
|
229882
|
+
"workspace",
|
|
229883
|
+
"workspaceName",
|
|
229884
|
+
"packageName",
|
|
229885
|
+
"packageSimpleName"
|
|
229886
|
+
];
|
|
229887
|
+
WORKSPACE_PLACEHOLDER_REGEX = new RegExp(
|
|
229888
|
+
`\\{\\{(${WORKSPACE_PLACEHOLDERS.join("|")})\\}\\}`,
|
|
229889
|
+
"g"
|
|
229890
|
+
);
|
|
229738
229891
|
AUTO_VERSION_MIN_VERSION = "2.14.0";
|
|
229739
229892
|
DEFAULT_CHANGELOG_FILE_PATH = "CHANGELOG.md";
|
|
229740
229893
|
}
|
|
@@ -229745,7 +229898,7 @@ var require_package7 = __commonJS({
|
|
|
229745
229898
|
"package.json"(exports2, module2) {
|
|
229746
229899
|
module2.exports = {
|
|
229747
229900
|
name: "@sentry/craft",
|
|
229748
|
-
version: "3.
|
|
229901
|
+
version: "3.4.0",
|
|
229749
229902
|
description: "The universal sentry workflow CLI",
|
|
229750
229903
|
main: "dist/craft",
|
|
229751
229904
|
repository: "https://github.com/getsentry/craft",
|
|
@@ -229952,7 +230105,7 @@ function getPackage() {
|
|
|
229952
230105
|
}
|
|
229953
230106
|
function getPackageVersion3() {
|
|
229954
230107
|
const { version: version2 } = getPackage();
|
|
229955
|
-
const buildInfo = "
|
|
230108
|
+
const buildInfo = "4a8dba2a45b09f4e3fcfc86a79c94d0dd93295bb";
|
|
229956
230109
|
return buildInfo ? `${version2} (${buildInfo})` : version2;
|
|
229957
230110
|
}
|
|
229958
230111
|
function semVerToString(s8) {
|
|
@@ -235922,13 +236075,13 @@ function usage(yargs, shim3) {
|
|
|
235922
236075
|
};
|
|
235923
236076
|
self2.stringifiedValues = function stringifiedValues(values, separator) {
|
|
235924
236077
|
let string2 = "";
|
|
235925
|
-
const
|
|
236078
|
+
const sep6 = separator || ", ";
|
|
235926
236079
|
const array2 = [].concat(values);
|
|
235927
236080
|
if (!values || !array2.length)
|
|
235928
236081
|
return string2;
|
|
235929
236082
|
array2.forEach((value) => {
|
|
235930
236083
|
if (string2.length)
|
|
235931
|
-
string2 +=
|
|
236084
|
+
string2 += sep6;
|
|
235932
236085
|
string2 += JSON.stringify(value);
|
|
235933
236086
|
});
|
|
235934
236087
|
return string2;
|
|
@@ -239557,13 +239710,12 @@ async function prepareMain(argv) {
|
|
|
239557
239710
|
const resolvedChangelogPath = (0, import_path31.relative)("", changelogPath);
|
|
239558
239711
|
await git.add(resolvedChangelogPath);
|
|
239559
239712
|
}
|
|
239560
|
-
const rootDir = getConfigFileDir() || process.cwd();
|
|
239561
239713
|
const preReleaseCommandRan = await runPreReleaseCommand({
|
|
239562
239714
|
oldVersion,
|
|
239563
239715
|
newVersion,
|
|
239564
239716
|
preReleaseCommand: config.preReleaseCommand,
|
|
239565
239717
|
targets: config.targets,
|
|
239566
|
-
rootDir
|
|
239718
|
+
rootDir: getReleaseUnitDir()
|
|
239567
239719
|
});
|
|
239568
239720
|
await commitChanges(git, newVersion, preReleaseCommandRan);
|
|
239569
239721
|
await isolation.showDiff();
|
|
@@ -239880,40 +240032,25 @@ var builder5 = (yargs) => yargs.option("since", {
|
|
|
239880
240032
|
});
|
|
239881
240033
|
async function changelogMain(argv) {
|
|
239882
240034
|
const git = await getGitClient();
|
|
239883
|
-
|
|
239884
|
-
if (
|
|
239885
|
-
|
|
239886
|
-
|
|
239887
|
-
|
|
239888
|
-
|
|
239889
|
-
|
|
239890
|
-
|
|
239891
|
-
|
|
239892
|
-
|
|
239893
|
-
);
|
|
239894
|
-
}
|
|
239895
|
-
since = await getLatestTag(git, tagPrefix);
|
|
239896
|
-
if (since) {
|
|
239897
|
-
logger.debug(`Using latest tag as base revision: ${since}`);
|
|
239898
|
-
} else {
|
|
239899
|
-
logger.debug(
|
|
239900
|
-
"No tags found, generating changelog from beginning of history"
|
|
239901
|
-
);
|
|
239902
|
-
}
|
|
240035
|
+
const workspaces = argv.pr && !getActiveWorkspace() ? listWorkspaces() : [];
|
|
240036
|
+
if (argv.pr && workspaces.length > 0) {
|
|
240037
|
+
const previews = await previewInWorkspaces(
|
|
240038
|
+
git,
|
|
240039
|
+
workspaces,
|
|
240040
|
+
argv.pr,
|
|
240041
|
+
argv.since
|
|
240042
|
+
);
|
|
240043
|
+
printWorkspacePreviews(previews, argv.format);
|
|
240044
|
+
return;
|
|
239903
240045
|
}
|
|
240046
|
+
const since = argv.since ?? await getDefaultBase(git);
|
|
239904
240047
|
const result = argv.pr ? await generateChangelogWithHighlight(git, since, argv.pr) : await generateChangesetFromGit(git, since);
|
|
239905
240048
|
if (argv.format === "json") {
|
|
239906
|
-
let versioningPolicy = "auto";
|
|
239907
|
-
try {
|
|
239908
|
-
if (findConfigFile()) {
|
|
239909
|
-
versioningPolicy = getVersioningPolicy();
|
|
239910
|
-
}
|
|
239911
|
-
} catch {
|
|
239912
|
-
}
|
|
239913
240049
|
const output = {
|
|
239914
240050
|
changelog: result.changelog || "",
|
|
239915
240051
|
bumpType: result.bumpType,
|
|
239916
|
-
|
|
240052
|
+
// Lets consumers (e.g. the changelog-preview workflow) tailor their display
|
|
240053
|
+
versioningPolicy: readVersioningPolicy(),
|
|
239917
240054
|
totalCommits: result.totalCommits,
|
|
239918
240055
|
matchedCommitsWithSemver: result.matchedCommitsWithSemver,
|
|
239919
240056
|
prSkipped: result.prSkipped ?? false
|
|
@@ -239927,6 +240064,98 @@ async function changelogMain(argv) {
|
|
|
239927
240064
|
console.log(result.changelog);
|
|
239928
240065
|
}
|
|
239929
240066
|
}
|
|
240067
|
+
async function getDefaultBase(git) {
|
|
240068
|
+
let tagPrefix = "";
|
|
240069
|
+
try {
|
|
240070
|
+
if (findConfigFile()) {
|
|
240071
|
+
tagPrefix = getGitTagPrefix();
|
|
240072
|
+
}
|
|
240073
|
+
} catch {
|
|
240074
|
+
logger.debug(
|
|
240075
|
+
"Could not read tag prefix from config; using latest tag overall"
|
|
240076
|
+
);
|
|
240077
|
+
}
|
|
240078
|
+
const since = await getLatestTag(git, tagPrefix);
|
|
240079
|
+
if (since) {
|
|
240080
|
+
logger.debug(`Using latest tag as base revision: ${since}`);
|
|
240081
|
+
} else {
|
|
240082
|
+
logger.debug(
|
|
240083
|
+
"No tags found, generating changelog from beginning of history"
|
|
240084
|
+
);
|
|
240085
|
+
}
|
|
240086
|
+
return since;
|
|
240087
|
+
}
|
|
240088
|
+
function readVersioningPolicy() {
|
|
240089
|
+
try {
|
|
240090
|
+
if (findConfigFile()) {
|
|
240091
|
+
return getVersioningPolicy();
|
|
240092
|
+
}
|
|
240093
|
+
} catch {
|
|
240094
|
+
}
|
|
240095
|
+
return "auto";
|
|
240096
|
+
}
|
|
240097
|
+
function listWorkspaces() {
|
|
240098
|
+
try {
|
|
240099
|
+
return findConfigFile() ? getWorkspaceNames() : [];
|
|
240100
|
+
} catch {
|
|
240101
|
+
return [];
|
|
240102
|
+
}
|
|
240103
|
+
}
|
|
240104
|
+
async function previewInWorkspaces(git, workspaces, pr3, since) {
|
|
240105
|
+
const previews = [];
|
|
240106
|
+
try {
|
|
240107
|
+
for (const name of workspaces) {
|
|
240108
|
+
setActiveWorkspace(name);
|
|
240109
|
+
const result = await generateChangelogWithHighlight(
|
|
240110
|
+
git,
|
|
240111
|
+
since ?? await getDefaultBase(git),
|
|
240112
|
+
pr3
|
|
240113
|
+
);
|
|
240114
|
+
if (!result.prOutsideWorkspace) {
|
|
240115
|
+
previews.push({
|
|
240116
|
+
name,
|
|
240117
|
+
versioningPolicy: readVersioningPolicy(),
|
|
240118
|
+
result
|
|
240119
|
+
});
|
|
240120
|
+
}
|
|
240121
|
+
}
|
|
240122
|
+
} finally {
|
|
240123
|
+
setActiveWorkspace(void 0);
|
|
240124
|
+
}
|
|
240125
|
+
return previews;
|
|
240126
|
+
}
|
|
240127
|
+
function printWorkspacePreviews(previews, format7) {
|
|
240128
|
+
if (format7 === "json") {
|
|
240129
|
+
const bumpTypes = previews.map(({ result }) => result.bumpType).filter((bumpType) => bumpType !== null).sort((a5, b9) => BUMP_TYPES.get(a5) - BUMP_TYPES.get(b9));
|
|
240130
|
+
const policies = new Set(previews.map((p8) => p8.versioningPolicy));
|
|
240131
|
+
const output = {
|
|
240132
|
+
// The PR's entry reads the same in every workspace, so show it once
|
|
240133
|
+
changelog: previews.find((p8) => p8.result.prEntry)?.result.prEntry ?? "",
|
|
240134
|
+
bumpType: bumpTypes[0] ?? null,
|
|
240135
|
+
versioningPolicy: policies.size === 1 ? [...policies][0] : "auto",
|
|
240136
|
+
prSkipped: previews.some((p8) => p8.result.prSkipped),
|
|
240137
|
+
workspaces: previews.map(({ name, versioningPolicy, result }) => ({
|
|
240138
|
+
name,
|
|
240139
|
+
bumpType: result.bumpType,
|
|
240140
|
+
versioningPolicy
|
|
240141
|
+
}))
|
|
240142
|
+
};
|
|
240143
|
+
console.log(JSON.stringify(output, null, 2));
|
|
240144
|
+
return;
|
|
240145
|
+
}
|
|
240146
|
+
if (previews.length === 0) {
|
|
240147
|
+
console.log("This PR is not listed in any workspace changelog.");
|
|
240148
|
+
return;
|
|
240149
|
+
}
|
|
240150
|
+
for (const { name, result } of previews) {
|
|
240151
|
+
console.log(`# ${name}
|
|
240152
|
+
`);
|
|
240153
|
+
console.log(
|
|
240154
|
+
result.prSkipped ? "This PR will not appear in the changelog.\n" : `${result.changelog || "No changelog entries found."}
|
|
240155
|
+
`
|
|
240156
|
+
);
|
|
240157
|
+
}
|
|
240158
|
+
}
|
|
239930
240159
|
var handler9 = async (args) => {
|
|
239931
240160
|
try {
|
|
239932
240161
|
return await changelogMain(args);
|