@sentry/craft 3.1.0 → 3.3.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/README.md +22 -111
- package/dist/craft +288 -89
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,38 +11,19 @@
|
|
|
11
11
|
|
|
12
12
|
Craft is a command line tool that helps automate and pipeline package releases. It enforces a specific workflow for managing release branches, changelogs, and artifact publishing.
|
|
13
13
|
|
|
14
|
-
📚 **[Full Documentation](https://
|
|
14
|
+
📚 **[Full Documentation](https://craft.sentry.dev/)**
|
|
15
15
|
|
|
16
16
|
## Quick Start
|
|
17
17
|
|
|
18
18
|
### Installation
|
|
19
19
|
|
|
20
|
-
Download a standalone executable for your OS and architecture from the
|
|
21
|
-
[latest release](https://github.com/getsentry/craft/releases/latest), or install
|
|
22
|
-
the portable JavaScript package via npm. Standalone executables embed Node;
|
|
23
|
-
npm installation requires Node. The legacy `craft` asset remains a JavaScript bundle.
|
|
24
|
-
|
|
25
|
-
```shell
|
|
26
|
-
npm install -g @sentry/craft
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Homebrew installation will be available after the first stable release publishing
|
|
30
|
-
these binaries and its formula:
|
|
31
|
-
|
|
32
|
-
```shell
|
|
33
|
-
brew install getsentry/tools/craft
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Once the first native release and installer website are published:
|
|
37
|
-
|
|
38
20
|
```shell
|
|
39
21
|
curl -fsSL https://craft.sentry.dev/install | bash
|
|
40
22
|
```
|
|
41
23
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
and running the script locally.
|
|
24
|
+
Homebrew (`brew install getsentry/tools/craft`), standalone binaries, and npm
|
|
25
|
+
(`npm install -g @sentry/craft`) are also available. See
|
|
26
|
+
[Installation](https://craft.sentry.dev/installation/).
|
|
46
27
|
|
|
47
28
|
### Usage
|
|
48
29
|
|
|
@@ -57,22 +38,24 @@ craft prepare 1.2.3
|
|
|
57
38
|
craft publish 1.2.3
|
|
58
39
|
```
|
|
59
40
|
|
|
41
|
+
See the [Quick Start](https://craft.sentry.dev/getting-started/) to set up a project.
|
|
42
|
+
|
|
60
43
|
## Features
|
|
61
44
|
|
|
62
|
-
- **Auto Versioning** -
|
|
63
|
-
- **Multiple Targets** - Publish to GitHub,
|
|
64
|
-
- **Changelog Management** - Auto-generate changelogs from
|
|
65
|
-
- **AI Changelog Summaries** -
|
|
66
|
-
- **
|
|
67
|
-
- **CI Integration** - Wait for CI to pass, download artifacts, and publish
|
|
68
|
-
- **GitHub Actions** -
|
|
45
|
+
- **[Auto Versioning](https://craft.sentry.dev/versioning/)** - Determine version bumps from conventional commits, or use CalVer
|
|
46
|
+
- **[Multiple Targets](https://craft.sentry.dev/targets/)** - Publish to GitHub, npm, PyPI, Docker, crates.io, NuGet, and more
|
|
47
|
+
- **[Changelog Management](https://craft.sentry.dev/changelogs/)** - Auto-generate changelogs from pull requests or validate manual entries
|
|
48
|
+
- **[AI Changelog Summaries](https://craft.sentry.dev/ai-summaries/)** - Optional release, category, and scope summaries on top of generated changelogs
|
|
49
|
+
- **[Monorepo Support](https://craft.sentry.dev/workspaces/)** - Release independently versioned products from one repository with release workspaces
|
|
50
|
+
- **[CI Integration](https://craft.sentry.dev/release-workflow/)** - Wait for CI to pass, download artifacts, and publish
|
|
51
|
+
- **[GitHub Actions](https://craft.sentry.dev/github-actions/)** - Reusable workflows for releases and changelog previews
|
|
69
52
|
|
|
70
53
|
## Configuration
|
|
71
54
|
|
|
72
55
|
Create a `.craft.yml` in your project root:
|
|
73
56
|
|
|
74
57
|
```yaml
|
|
75
|
-
minVersion: '2.
|
|
58
|
+
minVersion: '2.21.0'
|
|
76
59
|
changelog:
|
|
77
60
|
policy: auto
|
|
78
61
|
targets:
|
|
@@ -81,39 +64,10 @@ targets:
|
|
|
81
64
|
access: public
|
|
82
65
|
```
|
|
83
66
|
|
|
84
|
-
See the [configuration reference](https://
|
|
85
|
-
|
|
86
|
-
## Supported Targets
|
|
87
|
-
|
|
88
|
-
| Target | Description |
|
|
89
|
-
| ------------------ | ------------------------------------- |
|
|
90
|
-
| `github` | GitHub releases and tags |
|
|
91
|
-
| `npm` | NPM registry (with workspace support) |
|
|
92
|
-
| `pypi` | Python Package Index |
|
|
93
|
-
| `crates` | Rust crates.io |
|
|
94
|
-
| `nuget` | .NET NuGet |
|
|
95
|
-
| `docker` | Docker registries |
|
|
96
|
-
| `brew` | Homebrew formulas |
|
|
97
|
-
| `gcs` | Google Cloud Storage |
|
|
98
|
-
| `gh-pages` | GitHub Pages |
|
|
99
|
-
| `cocoapods` | CocoaPods |
|
|
100
|
-
| `gem` | RubyGems |
|
|
101
|
-
| `maven` | Maven Central |
|
|
102
|
-
| `hex` | Elixir Hex |
|
|
103
|
-
| `pub-dev` | Dart/Flutter pub.dev |
|
|
104
|
-
| `aws-lambda-layer` | AWS Lambda layers |
|
|
105
|
-
| `powershell` | PowerShell Gallery |
|
|
106
|
-
|
|
107
|
-
See the [targets documentation](https://getsentry.github.io/craft/targets/) for configuration details.
|
|
67
|
+
See the [configuration reference](https://craft.sentry.dev/configuration/) for all options.
|
|
108
68
|
|
|
109
69
|
## GitHub Actions
|
|
110
70
|
|
|
111
|
-
Craft provides GitHub Actions for automating releases and previewing changelog entries.
|
|
112
|
-
|
|
113
|
-
### Prepare Release Action
|
|
114
|
-
|
|
115
|
-
Automates the `craft prepare` workflow in GitHub Actions:
|
|
116
|
-
|
|
117
71
|
```yaml
|
|
118
72
|
name: Release
|
|
119
73
|
on:
|
|
@@ -125,59 +79,16 @@ on:
|
|
|
125
79
|
|
|
126
80
|
jobs:
|
|
127
81
|
release:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- uses: getsentry/craft@v2
|
|
134
|
-
with:
|
|
135
|
-
version: ${{ github.event.inputs.version }}
|
|
136
|
-
env:
|
|
137
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
**Inputs:**
|
|
141
|
-
|
|
142
|
-
| Input | Description | Default |
|
|
143
|
-
| --------------- | --------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
144
|
-
| `version` | Version to release (semver, "auto", "major", "minor", "patch") | Uses `versioning.policy` from config |
|
|
145
|
-
| `merge_target` | Target branch to merge into | Default branch |
|
|
146
|
-
| `force` | Force release even with blockers | `false` |
|
|
147
|
-
| `blocker_label` | Label that blocks releases | `release-blocker` |
|
|
148
|
-
| `publish_repo` | Repository for publish issues. Use `"self"` to create issues in the source repository itself. | `{owner}/publish` |
|
|
149
|
-
|
|
150
|
-
**Outputs:**
|
|
151
|
-
|
|
152
|
-
| Output | Description |
|
|
153
|
-
| ----------- | ------------------------------------ |
|
|
154
|
-
| `version` | The resolved version being released |
|
|
155
|
-
| `branch` | The release branch name |
|
|
156
|
-
| `sha` | The commit SHA on the release branch |
|
|
157
|
-
| `changelog` | The changelog for this release |
|
|
158
|
-
|
|
159
|
-
### Changelog Preview (Reusable Workflow)
|
|
160
|
-
|
|
161
|
-
Posts a preview comment on PRs showing how they'll appear in the changelog:
|
|
162
|
-
|
|
163
|
-
```yaml
|
|
164
|
-
name: Changelog Preview
|
|
165
|
-
on:
|
|
166
|
-
pull_request:
|
|
167
|
-
types: [opened, synchronize, reopened, edited, labeled]
|
|
168
|
-
|
|
169
|
-
jobs:
|
|
170
|
-
changelog-preview:
|
|
171
|
-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2
|
|
82
|
+
permissions:
|
|
83
|
+
contents: write
|
|
84
|
+
uses: getsentry/craft/.github/workflows/release.yml@v2
|
|
85
|
+
with:
|
|
86
|
+
version: ${{ inputs.version }}
|
|
172
87
|
secrets: inherit
|
|
173
88
|
```
|
|
174
89
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- Generate the upcoming changelog including the PR's changes
|
|
178
|
-
- Highlight entries from the PR using blockquote style (left border)
|
|
179
|
-
- Post a comment on the PR with the preview
|
|
180
|
-
- Automatically update when you update the PR (push, edit title/description, or change labels)
|
|
90
|
+
See [GitHub Actions](https://craft.sentry.dev/github-actions/) for all inputs,
|
|
91
|
+
the composite action, and the changelog preview workflow.
|
|
181
92
|
|
|
182
93
|
## Contributing
|
|
183
94
|
|
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);
|
|
@@ -61050,13 +61050,13 @@ async function getChangesSince(git, rev, until) {
|
|
|
61050
61050
|
const discovered = await discoverWorkspaces(root);
|
|
61051
61051
|
const ownedPaths = new Set(getWorkspaceNames());
|
|
61052
61052
|
for (const pkg of discovered.packages) {
|
|
61053
|
-
const
|
|
61054
|
-
if (
|
|
61053
|
+
const relative7 = import_node_path13.default.relative(root, pkg.location).split(import_node_path13.default.sep).join("/");
|
|
61054
|
+
if (relative7 === "" || relative7 === ".." || relative7.startsWith("../")) {
|
|
61055
61055
|
throw new ConfigurationError(
|
|
61056
61056
|
`Workspace package is outside the repository: ${pkg.name}`
|
|
61057
61057
|
);
|
|
61058
61058
|
}
|
|
61059
|
-
ownedPaths.add(
|
|
61059
|
+
ownedPaths.add(relative7);
|
|
61060
61060
|
}
|
|
61061
61061
|
const orderedOwners = [...ownedPaths].sort(
|
|
61062
61062
|
(left2, right2) => right2.length - left2.length
|
|
@@ -109186,21 +109186,21 @@ var init_Matcher = __esm({
|
|
|
109186
109186
|
* @returns {string}
|
|
109187
109187
|
*/
|
|
109188
109188
|
toString(separator, includeNamespace = true) {
|
|
109189
|
-
const
|
|
109190
|
-
const isDefault =
|
|
109189
|
+
const sep6 = separator || this.separator;
|
|
109190
|
+
const isDefault = sep6 === this.separator && includeNamespace === true;
|
|
109191
109191
|
if (isDefault) {
|
|
109192
109192
|
if (this._pathStringCache !== null) {
|
|
109193
109193
|
return this._pathStringCache;
|
|
109194
109194
|
}
|
|
109195
109195
|
const result = this.path.map(
|
|
109196
109196
|
(n5) => n5.namespace ? `${n5.namespace}:${n5.tag}` : n5.tag
|
|
109197
|
-
).join(
|
|
109197
|
+
).join(sep6);
|
|
109198
109198
|
this._pathStringCache = result;
|
|
109199
109199
|
return result;
|
|
109200
109200
|
}
|
|
109201
109201
|
return this.path.map(
|
|
109202
109202
|
(n5) => includeNamespace && n5.namespace ? `${n5.namespace}:${n5.tag}` : n5.tag
|
|
109203
|
-
).join(
|
|
109203
|
+
).join(sep6);
|
|
109204
109204
|
}
|
|
109205
109205
|
/**
|
|
109206
109206
|
* Get path as array of tag names.
|
|
@@ -121297,11 +121297,44 @@ async function fetchPRInfo(prNumber) {
|
|
|
121297
121297
|
title: pr3.title,
|
|
121298
121298
|
body: pr3.body ?? "",
|
|
121299
121299
|
author: pr3.user?.login ?? "",
|
|
121300
|
+
authorIsBot: pr3.user?.type === "Bot",
|
|
121300
121301
|
labels: labels.map((l8) => l8.name),
|
|
121301
121302
|
baseRef: pr3.base.ref,
|
|
121302
121303
|
headSha: pr3.head.sha
|
|
121303
121304
|
};
|
|
121304
121305
|
}
|
|
121306
|
+
function authorLogins(nodes = []) {
|
|
121307
|
+
return nodes.map((node3) => node3.user?.login).filter((login) => Boolean(login));
|
|
121308
|
+
}
|
|
121309
|
+
async function fetchPRCoAuthors(prNumber) {
|
|
121310
|
+
const { repo, owner } = await getGlobalGitHubConfig();
|
|
121311
|
+
try {
|
|
121312
|
+
const response = await getGitHubClient().graphql(
|
|
121313
|
+
`query($owner: String!, $repo: String!, $number: Int!) {
|
|
121314
|
+
repository(owner: $owner, name: $repo) {
|
|
121315
|
+
pullRequest(number: $number) {
|
|
121316
|
+
commits(first: ${MAX_PR_COMMITS}) {
|
|
121317
|
+
nodes {
|
|
121318
|
+
commit {
|
|
121319
|
+
authors(first: ${MAX_COMMIT_AUTHORS}) { nodes { user { login } } }
|
|
121320
|
+
}
|
|
121321
|
+
}
|
|
121322
|
+
}
|
|
121323
|
+
}
|
|
121324
|
+
}
|
|
121325
|
+
}`,
|
|
121326
|
+
{ owner, repo, number: prNumber }
|
|
121327
|
+
);
|
|
121328
|
+
return (response?.repository?.pullRequest?.commits.nodes ?? []).flatMap(
|
|
121329
|
+
(node3) => authorLogins(node3.commit.authors.nodes)
|
|
121330
|
+
);
|
|
121331
|
+
} catch (error3) {
|
|
121332
|
+
logger.warn(
|
|
121333
|
+
`Failed to fetch co-authors for PR #${prNumber}: ${error3.message || error3}`
|
|
121334
|
+
);
|
|
121335
|
+
return [];
|
|
121336
|
+
}
|
|
121337
|
+
}
|
|
121305
121338
|
function isBumpType(value) {
|
|
121306
121339
|
return BUMP_TYPES.has(value);
|
|
121307
121340
|
}
|
|
@@ -121540,12 +121573,37 @@ ${body}
|
|
|
121540
121573
|
const startIdx = firstHeading?.startIndex ?? markdown.length;
|
|
121541
121574
|
return markdown.slice(0, startIdx) + newSection + markdown.slice(startIdx);
|
|
121542
121575
|
}
|
|
121576
|
+
function authorKey(login) {
|
|
121577
|
+
return login.toLowerCase().replace(/\[bot\]$/, "");
|
|
121578
|
+
}
|
|
121579
|
+
function creditAuthors(author, authorIsBot = false, coAuthors = []) {
|
|
121580
|
+
const hidden = getNormalizedReleaseConfig()?.changelog.hideAuthors ?? /* @__PURE__ */ new Set();
|
|
121581
|
+
const seen = /* @__PURE__ */ new Set();
|
|
121582
|
+
const credits = { people: [], bots: [] };
|
|
121583
|
+
for (const login of [author, ...coAuthors]) {
|
|
121584
|
+
if (!login) {
|
|
121585
|
+
continue;
|
|
121586
|
+
}
|
|
121587
|
+
const key = authorKey(login);
|
|
121588
|
+
if (seen.has(key) || hidden.has(key)) {
|
|
121589
|
+
continue;
|
|
121590
|
+
}
|
|
121591
|
+
seen.add(key);
|
|
121592
|
+
if (login === author && authorIsBot || /\[bot\]$/i.test(login)) {
|
|
121593
|
+
credits.bots.push(login.replace(/\[bot\]$/i, ""));
|
|
121594
|
+
} else {
|
|
121595
|
+
credits.people.push(login);
|
|
121596
|
+
}
|
|
121597
|
+
}
|
|
121598
|
+
return credits;
|
|
121599
|
+
}
|
|
121543
121600
|
function createPREntriesFromRaw(raw, defaultTitle, important = false) {
|
|
121544
121601
|
const importantTitle = important || isImportantChangelogText(defaultTitle) ? defaultTitle : void 0;
|
|
121545
121602
|
const customEntries = extractChangelogEntry(raw.prBody);
|
|
121603
|
+
const credits = creditAuthors(raw.author, raw.authorIsBot, raw.coAuthors);
|
|
121546
121604
|
if (customEntries) {
|
|
121547
121605
|
return customEntries.map((entry) => ({
|
|
121548
|
-
|
|
121606
|
+
credits,
|
|
121549
121607
|
number: raw.pr ?? "",
|
|
121550
121608
|
hash: raw.hash,
|
|
121551
121609
|
body: entry.nestedContent ?? "",
|
|
@@ -121556,7 +121614,7 @@ function createPREntriesFromRaw(raw, defaultTitle, important = false) {
|
|
|
121556
121614
|
}
|
|
121557
121615
|
return [
|
|
121558
121616
|
{
|
|
121559
|
-
|
|
121617
|
+
credits,
|
|
121560
121618
|
number: raw.pr ?? "",
|
|
121561
121619
|
hash: raw.hash,
|
|
121562
121620
|
body: "",
|
|
@@ -121656,6 +121714,9 @@ function normalizeReleaseConfig(config) {
|
|
|
121656
121714
|
labels: /* @__PURE__ */ new Set(),
|
|
121657
121715
|
authors: /* @__PURE__ */ new Set()
|
|
121658
121716
|
},
|
|
121717
|
+
hideAuthors: new Set(
|
|
121718
|
+
(config.changelog.hide_authors ?? []).map(authorKey)
|
|
121719
|
+
),
|
|
121659
121720
|
categories: []
|
|
121660
121721
|
}
|
|
121661
121722
|
};
|
|
@@ -121721,7 +121782,7 @@ function getNormalizedReleaseConfig() {
|
|
|
121721
121782
|
const categoriesWithoutSemver = normalized.changelog.categories.filter((cat) => !cat.semver).map((cat) => cat.title);
|
|
121722
121783
|
if (categoriesWithoutSemver.length > 0) {
|
|
121723
121784
|
logger.warn(
|
|
121724
|
-
`The following changelog categories have no 'semver' field and won't contribute to version bump detection: ${categoriesWithoutSemver.map((t6) => `"${t6}"`).join(", ")}. See: https://
|
|
121785
|
+
`The following changelog categories have no 'semver' field and won't contribute to version bump detection: ${categoriesWithoutSemver.map((t6) => `"${t6}"`).join(", ")}. See: https://craft.sentry.dev/changelogs/#categories`
|
|
121725
121786
|
);
|
|
121726
121787
|
}
|
|
121727
121788
|
}
|
|
@@ -121839,7 +121900,19 @@ function formatChangelogEntry(entry, disableMentions = false, disablePRLinks = f
|
|
|
121839
121900
|
}
|
|
121840
121901
|
title = escapeLeadingUnderscores(title);
|
|
121841
121902
|
let text = `- ${title}`;
|
|
121842
|
-
const
|
|
121903
|
+
const formatAuthors = (authors) => {
|
|
121904
|
+
const refs = authors.map(
|
|
121905
|
+
(author) => disableMentions ? `**${author}**` : `@${author}`
|
|
121906
|
+
);
|
|
121907
|
+
const shown = refs.length > MAX_CREDITED_AUTHORS ? [
|
|
121908
|
+
...refs.slice(0, MAX_CREDITED_AUTHORS - 1),
|
|
121909
|
+
`${refs.length - MAX_CREDITED_AUTHORS + 1} others`
|
|
121910
|
+
] : refs;
|
|
121911
|
+
return shown.length > 1 ? `${shown.slice(0, -1).join(", ")} and ${shown.at(-1)}` : shown[0];
|
|
121912
|
+
};
|
|
121913
|
+
const peopleRef = formatAuthors(entry.credits.people);
|
|
121914
|
+
const botsRef = formatAuthors(entry.credits.bots);
|
|
121915
|
+
const authorRef = peopleRef && botsRef ? `${peopleRef} with ${botsRef}` : peopleRef || botsRef;
|
|
121843
121916
|
if (entry.prNumber) {
|
|
121844
121917
|
const prRef = disablePRLinks ? `\`#${entry.prNumber}\`` : `[#${entry.prNumber}](${entry.repoUrl}/pull/${entry.prNumber})`;
|
|
121845
121918
|
if (authorRef) {
|
|
@@ -121911,6 +121984,8 @@ async function generateChangelogWithHighlight(git, rev, currentPRNumber) {
|
|
|
121911
121984
|
title: prInfo.title.trim(),
|
|
121912
121985
|
body: prInfo.body,
|
|
121913
121986
|
author: prInfo.author,
|
|
121987
|
+
authorIsBot: prInfo.authorIsBot,
|
|
121988
|
+
coAuthors: await fetchPRCoAuthors(currentPRNumber),
|
|
121914
121989
|
pr: currentPRStr,
|
|
121915
121990
|
prTitle: prInfo.title,
|
|
121916
121991
|
prBody: prInfo.body,
|
|
@@ -121948,25 +122023,35 @@ async function fetchRawCommitInfo(git, rev, until) {
|
|
|
121948
122023
|
const githubCommits = await getPRAndLabelsFromCommit(
|
|
121949
122024
|
gitCommits.map(({ hash }) => hash)
|
|
121950
122025
|
);
|
|
121951
|
-
const seenPRs = /* @__PURE__ */ new
|
|
122026
|
+
const seenPRs = /* @__PURE__ */ new Map();
|
|
121952
122027
|
const result = [];
|
|
121953
122028
|
for (const gitCommit of gitCommits) {
|
|
121954
122029
|
const githubCommit = githubCommits[gitCommit.hash];
|
|
121955
122030
|
const pr3 = githubCommit?.pr ?? gitCommit.pr ?? void 0;
|
|
121956
|
-
|
|
121957
|
-
|
|
121958
|
-
|
|
122031
|
+
const seen = pr3 ? seenPRs.get(pr3) : void 0;
|
|
122032
|
+
if (seen) {
|
|
122033
|
+
seen.coAuthors = [
|
|
122034
|
+
...seen.coAuthors ?? [],
|
|
122035
|
+
...githubCommit?.coAuthors ?? []
|
|
122036
|
+
];
|
|
122037
|
+
continue;
|
|
121959
122038
|
}
|
|
121960
|
-
|
|
122039
|
+
const commit = {
|
|
121961
122040
|
hash: gitCommit.hash,
|
|
121962
122041
|
title: gitCommit.title,
|
|
121963
122042
|
body: gitCommit.body,
|
|
121964
122043
|
author: githubCommit?.author,
|
|
122044
|
+
authorIsBot: githubCommit?.authorIsBot,
|
|
122045
|
+
coAuthors: githubCommit?.coAuthors,
|
|
121965
122046
|
pr: pr3,
|
|
121966
122047
|
prTitle: githubCommit?.prTitle ?? void 0,
|
|
121967
122048
|
prBody: githubCommit?.prBody ?? void 0,
|
|
121968
122049
|
labels: githubCommit?.labels ?? []
|
|
121969
|
-
}
|
|
122050
|
+
};
|
|
122051
|
+
if (pr3) {
|
|
122052
|
+
seenPRs.set(pr3, commit);
|
|
122053
|
+
}
|
|
122054
|
+
result.push(commit);
|
|
121970
122055
|
}
|
|
121971
122056
|
return result;
|
|
121972
122057
|
}
|
|
@@ -122006,6 +122091,8 @@ function categorizeCommits(rawCommits) {
|
|
|
122006
122091
|
if (!categoryTitle) {
|
|
122007
122092
|
leftovers.push({
|
|
122008
122093
|
author: raw.author,
|
|
122094
|
+
authorIsBot: raw.authorIsBot,
|
|
122095
|
+
coAuthors: raw.coAuthors,
|
|
122009
122096
|
hash: raw.hash,
|
|
122010
122097
|
title: raw.title,
|
|
122011
122098
|
body: raw.body,
|
|
@@ -122163,7 +122250,7 @@ async function serializeChangelog(rawData, maxLeftovers, disableMentions = false
|
|
|
122163
122250
|
(pr3) => formatChangelogEntry(
|
|
122164
122251
|
{
|
|
122165
122252
|
title: stripTitle(pr3.title, pr3.matchedPattern, !showsScopeHeader),
|
|
122166
|
-
|
|
122253
|
+
credits: pr3.credits,
|
|
122167
122254
|
prNumber: pr3.number,
|
|
122168
122255
|
hash: pr3.hash,
|
|
122169
122256
|
body: pr3.body,
|
|
@@ -122198,6 +122285,8 @@ async function serializeChangelog(rawData, maxLeftovers, disableMentions = false
|
|
|
122198
122285
|
const prEntries = createPREntriesFromRaw(
|
|
122199
122286
|
{
|
|
122200
122287
|
author: commit.author,
|
|
122288
|
+
authorIsBot: commit.authorIsBot,
|
|
122289
|
+
coAuthors: commit.coAuthors,
|
|
122201
122290
|
pr: commit.pr ?? void 0,
|
|
122202
122291
|
hash: commit.hash,
|
|
122203
122292
|
prBody: commit.prBody,
|
|
@@ -122211,7 +122300,7 @@ async function serializeChangelog(rawData, maxLeftovers, disableMentions = false
|
|
|
122211
122300
|
formatChangelogEntry(
|
|
122212
122301
|
{
|
|
122213
122302
|
title: pr3.title,
|
|
122214
|
-
|
|
122303
|
+
credits: pr3.credits,
|
|
122215
122304
|
prNumber: pr3.number || void 0,
|
|
122216
122305
|
hash: pr3.hash,
|
|
122217
122306
|
repoUrl,
|
|
@@ -122305,9 +122394,14 @@ async function getPRAndLabelsFromCommit(hashes) {
|
|
|
122305
122394
|
author {
|
|
122306
122395
|
user { login }
|
|
122307
122396
|
}
|
|
122397
|
+
authors(first: ${MAX_COMMIT_AUTHORS}) {
|
|
122398
|
+
nodes { user { login } }
|
|
122399
|
+
}
|
|
122308
122400
|
associatedPullRequests(first: 1) {
|
|
122309
122401
|
nodes {
|
|
122310
122402
|
author {
|
|
122403
|
+
# Identifies bots, whose PR author login lacks the [bot] suffix
|
|
122404
|
+
__typename
|
|
122311
122405
|
login
|
|
122312
122406
|
}
|
|
122313
122407
|
number
|
|
@@ -122357,17 +122451,21 @@ async function getPRAndLabelsFromCommit(hashes) {
|
|
|
122357
122451
|
return Object.fromEntries(
|
|
122358
122452
|
Object.entries(commitInfo).map(([hash, commit]) => {
|
|
122359
122453
|
const pr3 = commit?.associatedPullRequests.nodes[0];
|
|
122454
|
+
const coAuthors = authorLogins(commit?.authors?.nodes.slice(1));
|
|
122360
122455
|
return [
|
|
122361
122456
|
// Strip the prefix on the hash we used to workaround in GraphQL
|
|
122362
122457
|
hash.slice(1),
|
|
122363
122458
|
pr3 ? {
|
|
122364
122459
|
author: pr3.author?.login,
|
|
122460
|
+
authorIsBot: pr3.author?.__typename === "Bot",
|
|
122461
|
+
coAuthors,
|
|
122365
122462
|
pr: pr3.number,
|
|
122366
122463
|
prTitle: pr3.title,
|
|
122367
122464
|
prBody: pr3.body,
|
|
122368
122465
|
labels: pr3.labels?.nodes?.map((label) => label.name) ?? []
|
|
122369
122466
|
} : {
|
|
122370
122467
|
author: commit?.author.user?.login,
|
|
122468
|
+
coAuthors,
|
|
122371
122469
|
pr: null,
|
|
122372
122470
|
prTitle: null,
|
|
122373
122471
|
prBody: null,
|
|
@@ -122377,7 +122475,7 @@ async function getPRAndLabelsFromCommit(hashes) {
|
|
|
122377
122475
|
})
|
|
122378
122476
|
);
|
|
122379
122477
|
}
|
|
122380
|
-
var import_fs12, import_path12, BUMP_TYPES, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, releaseConfigCache, SHORT_SHA_LENGTH, changesetCache, rawChangesetCache;
|
|
122478
|
+
var import_fs12, import_path12, BUMP_TYPES, DEFAULT_CHANGELOG_PATH, DEFAULT_UNRELEASED_TITLE, SKIP_CHANGELOG_MAGIC_WORD, DEFAULT_CHANGESET_BODY, VERSION_HEADER_LEVEL, SUBSECTION_HEADER_LEVEL, SCOPE_HEADER_LEVEL, MAX_COMMITS_PER_QUERY, MAX_PR_COMMITS, MAX_COMMIT_AUTHORS, MAX_CREDITED_AUTHORS, MAX_LEFTOVERS, DEFAULT_RELEASE_CONFIG, releaseConfigCache, SHORT_SHA_LENGTH, changesetCache, rawChangesetCache;
|
|
122381
122479
|
var init_changelog = __esm({
|
|
122382
122480
|
"src/utils/changelog.ts"() {
|
|
122383
122481
|
"use strict";
|
|
@@ -122406,6 +122504,9 @@ var init_changelog = __esm({
|
|
|
122406
122504
|
SUBSECTION_HEADER_LEVEL = VERSION_HEADER_LEVEL + 1;
|
|
122407
122505
|
SCOPE_HEADER_LEVEL = SUBSECTION_HEADER_LEVEL + 1;
|
|
122408
122506
|
MAX_COMMITS_PER_QUERY = 50;
|
|
122507
|
+
MAX_PR_COMMITS = 100;
|
|
122508
|
+
MAX_COMMIT_AUTHORS = 10;
|
|
122509
|
+
MAX_CREDITED_AUTHORS = 3;
|
|
122409
122510
|
MAX_LEFTOVERS = 24;
|
|
122410
122511
|
if (SUBSECTION_HEADER_LEVEL <= VERSION_HEADER_LEVEL) {
|
|
122411
122512
|
throw new Error("Subsection headers should nest under version headers!");
|
|
@@ -124317,8 +124418,12 @@ var init_nuget = __esm({
|
|
|
124317
124418
|
nugetConfig;
|
|
124318
124419
|
/**
|
|
124319
124420
|
* Expand a nuget target config into multiple targets if workspaces is enabled.
|
|
124421
|
+
*
|
|
124422
|
+
* The solution is always resolved from `rootDir` (the repository root), so
|
|
124423
|
+
* `solutionPath` keeps its meaning. When a release workspace is selected,
|
|
124424
|
+
* `releaseUnitDir` is its directory and only projects inside it are kept.
|
|
124320
124425
|
*/
|
|
124321
|
-
static async expand(config, rootDir) {
|
|
124426
|
+
static async expand(config, rootDir, releaseUnitDir = rootDir) {
|
|
124322
124427
|
if (!config.workspaces) {
|
|
124323
124428
|
return [config];
|
|
124324
124429
|
}
|
|
@@ -124328,7 +124433,17 @@ var init_nuget = __esm({
|
|
|
124328
124433
|
"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".'
|
|
124329
124434
|
);
|
|
124330
124435
|
}
|
|
124331
|
-
const
|
|
124436
|
+
const releaseUnitPath = (0, import_path15.relative)(rootDir, releaseUnitDir);
|
|
124437
|
+
const discoveredPackages = releaseUnitPath ? result.packages.filter((pkg) => {
|
|
124438
|
+
const projectPath = (0, import_path15.relative)(releaseUnitDir, pkg.projectPath);
|
|
124439
|
+
return projectPath !== ".." && !projectPath.startsWith(`..${import_path15.sep}`) && !(0, import_path15.isAbsolute)(projectPath);
|
|
124440
|
+
}) : result.packages;
|
|
124441
|
+
if (discoveredPackages.length === 0) {
|
|
124442
|
+
throw new ConfigurationError(
|
|
124443
|
+
`nuget target has workspaces enabled but none of the packable projects in ${result.solutionPath} are inside the selected workspace "${releaseUnitPath}".`
|
|
124444
|
+
);
|
|
124445
|
+
}
|
|
124446
|
+
const workspacePackages = discoveredPackages.map((pkg) => ({
|
|
124332
124447
|
name: pkg.packageId,
|
|
124333
124448
|
location: pkg.projectPath,
|
|
124334
124449
|
private: !pkg.isPackable,
|
|
@@ -124354,7 +124469,7 @@ var init_nuget = __esm({
|
|
|
124354
124469
|
);
|
|
124355
124470
|
}
|
|
124356
124471
|
const filteredNames = new Set(filteredWorkspacePackages.map((p8) => p8.name));
|
|
124357
|
-
const filteredPackages =
|
|
124472
|
+
const filteredPackages = discoveredPackages.filter(
|
|
124358
124473
|
(p8) => filteredNames.has(p8.packageId)
|
|
124359
124474
|
);
|
|
124360
124475
|
const sortedPackages = sortDotnetPackages(filteredPackages);
|
|
@@ -142683,12 +142798,12 @@ var require_fromHttp = __commonJS({
|
|
|
142683
142798
|
var fromHttp = (options = {}) => {
|
|
142684
142799
|
options.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
142685
142800
|
let host;
|
|
142686
|
-
const
|
|
142801
|
+
const relative7 = options.awsContainerCredentialsRelativeUri ?? process.env[AWS_CONTAINER_CREDENTIALS_RELATIVE_URI];
|
|
142687
142802
|
const full = options.awsContainerCredentialsFullUri ?? process.env[AWS_CONTAINER_CREDENTIALS_FULL_URI];
|
|
142688
142803
|
const token = options.awsContainerAuthorizationToken ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN];
|
|
142689
142804
|
const tokenFile = options.awsContainerAuthorizationTokenFile ?? process.env[AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE];
|
|
142690
142805
|
const warn3 = options.logger?.constructor?.name === "NoOpLogger" || !options.logger?.warn ? console.warn : options.logger.warn.bind(options.logger);
|
|
142691
|
-
if (
|
|
142806
|
+
if (relative7 && full) {
|
|
142692
142807
|
warn3("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.");
|
|
142693
142808
|
warn3("awsContainerCredentialsFullUri will take precedence.");
|
|
142694
142809
|
}
|
|
@@ -142698,8 +142813,8 @@ var require_fromHttp = __commonJS({
|
|
|
142698
142813
|
}
|
|
142699
142814
|
if (full) {
|
|
142700
142815
|
host = full;
|
|
142701
|
-
} else if (
|
|
142702
|
-
host = `${DEFAULT_LINK_LOCAL_HOST}${
|
|
142816
|
+
} else if (relative7) {
|
|
142817
|
+
host = `${DEFAULT_LINK_LOCAL_HOST}${relative7}`;
|
|
142703
142818
|
} else {
|
|
142704
142819
|
throw new property_provider_1.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
142705
142820
|
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`, { logger: options.logger });
|
|
@@ -160492,10 +160607,10 @@ var require_symlink = __commonJS({
|
|
|
160492
160607
|
pathExists(dstpath, (err, destinationExists) => {
|
|
160493
160608
|
if (err) return callback(err);
|
|
160494
160609
|
if (destinationExists) return callback(null);
|
|
160495
|
-
symlinkPaths(srcpath, dstpath, (err2,
|
|
160610
|
+
symlinkPaths(srcpath, dstpath, (err2, relative7) => {
|
|
160496
160611
|
if (err2) return callback(err2);
|
|
160497
|
-
srcpath =
|
|
160498
|
-
symlinkType(
|
|
160612
|
+
srcpath = relative7.toDst;
|
|
160613
|
+
symlinkType(relative7.toCwd, type2, (err3, type3) => {
|
|
160499
160614
|
if (err3) return callback(err3);
|
|
160500
160615
|
const dir = path20.dirname(dstpath);
|
|
160501
160616
|
pathExists(dir, (err4, dirExists) => {
|
|
@@ -160513,9 +160628,9 @@ var require_symlink = __commonJS({
|
|
|
160513
160628
|
function createSymlinkSync(srcpath, dstpath, type2) {
|
|
160514
160629
|
const destinationExists = fs16.existsSync(dstpath);
|
|
160515
160630
|
if (destinationExists) return void 0;
|
|
160516
|
-
const
|
|
160517
|
-
srcpath =
|
|
160518
|
-
type2 = symlinkTypeSync(
|
|
160631
|
+
const relative7 = symlinkPathsSync(srcpath, dstpath);
|
|
160632
|
+
srcpath = relative7.toDst;
|
|
160633
|
+
type2 = symlinkTypeSync(relative7.toCwd, type2);
|
|
160519
160634
|
const dir = path20.dirname(dstpath);
|
|
160520
160635
|
const exists = fs16.existsSync(dir);
|
|
160521
160636
|
if (exists) return fs16.symlinkSync(srcpath, dstpath, type2);
|
|
@@ -168581,10 +168696,10 @@ var require_symlink2 = __commonJS({
|
|
|
168581
168696
|
});
|
|
168582
168697
|
}
|
|
168583
168698
|
function _createSymlink(srcpath, dstpath, type2, callback) {
|
|
168584
|
-
symlinkPaths(srcpath, dstpath, (err,
|
|
168699
|
+
symlinkPaths(srcpath, dstpath, (err, relative7) => {
|
|
168585
168700
|
if (err) return callback(err);
|
|
168586
|
-
srcpath =
|
|
168587
|
-
symlinkType(
|
|
168701
|
+
srcpath = relative7.toDst;
|
|
168702
|
+
symlinkType(relative7.toCwd, type2, (err2, type3) => {
|
|
168588
168703
|
if (err2) return callback(err2);
|
|
168589
168704
|
const dir = path20.dirname(dstpath);
|
|
168590
168705
|
pathExists(dir, (err3, dirExists) => {
|
|
@@ -168609,9 +168724,9 @@ var require_symlink2 = __commonJS({
|
|
|
168609
168724
|
const dstStat = fs16.statSync(dstpath);
|
|
168610
168725
|
if (areIdentical(srcStat, dstStat)) return;
|
|
168611
168726
|
}
|
|
168612
|
-
const
|
|
168613
|
-
srcpath =
|
|
168614
|
-
type2 = symlinkTypeSync(
|
|
168727
|
+
const relative7 = symlinkPathsSync(srcpath, dstpath);
|
|
168728
|
+
srcpath = relative7.toDst;
|
|
168729
|
+
type2 = symlinkTypeSync(relative7.toCwd, type2);
|
|
168615
168730
|
const dir = path20.dirname(dstpath);
|
|
168616
168731
|
const exists = fs16.existsSync(dir);
|
|
168617
168732
|
if (exists) return fs16.symlinkSync(srcpath, dstpath, type2);
|
|
@@ -184563,7 +184678,7 @@ var require_dist12 = __commonJS({
|
|
|
184563
184678
|
var fs122 = require("fs");
|
|
184564
184679
|
var path82 = require("path");
|
|
184565
184680
|
var minimatch3 = require_minimatch2();
|
|
184566
|
-
var
|
|
184681
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
184567
184682
|
var Minimatch2 = minimatch3.Minimatch;
|
|
184568
184683
|
function alphasort(a5, b9) {
|
|
184569
184684
|
return a5.localeCompare(b9, "en");
|
|
@@ -184631,7 +184746,7 @@ var require_dist12 = __commonJS({
|
|
|
184631
184746
|
}
|
|
184632
184747
|
self2.root = options.root || path82.resolve(self2.cwd, "/");
|
|
184633
184748
|
self2.root = path82.resolve(self2.root);
|
|
184634
|
-
self2.cwdAbs =
|
|
184749
|
+
self2.cwdAbs = isAbsolute7(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
|
|
184635
184750
|
self2.nomount = !!options.nomount;
|
|
184636
184751
|
if (process.platform === "win32") {
|
|
184637
184752
|
self2.root = self2.root.replace(/\\/g, "/");
|
|
@@ -184714,7 +184829,7 @@ var require_dist12 = __commonJS({
|
|
|
184714
184829
|
var abs = f8;
|
|
184715
184830
|
if (f8.charAt(0) === "/") {
|
|
184716
184831
|
abs = path82.join(self2.root, f8);
|
|
184717
|
-
} else if (
|
|
184832
|
+
} else if (isAbsolute7(f8) || f8 === "") {
|
|
184718
184833
|
abs = f8;
|
|
184719
184834
|
} else if (self2.changedCwd) {
|
|
184720
184835
|
abs = path82.resolve(self2.cwd, f8);
|
|
@@ -184752,7 +184867,7 @@ var require_dist12 = __commonJS({
|
|
|
184752
184867
|
var util5 = require("util");
|
|
184753
184868
|
var path82 = require("path");
|
|
184754
184869
|
var assert7 = require("assert");
|
|
184755
|
-
var
|
|
184870
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
184756
184871
|
var common3 = require_common6();
|
|
184757
184872
|
var setopts = common3.setopts;
|
|
184758
184873
|
var ownProp = common3.ownProp;
|
|
@@ -184824,10 +184939,10 @@ var require_dist12 = __commonJS({
|
|
|
184824
184939
|
var read;
|
|
184825
184940
|
if (prefix === null)
|
|
184826
184941
|
read = ".";
|
|
184827
|
-
else if (
|
|
184942
|
+
else if (isAbsolute7(prefix) || isAbsolute7(pattern.map(function(p8) {
|
|
184828
184943
|
return typeof p8 === "string" ? p8 : "[*]";
|
|
184829
184944
|
}).join("/"))) {
|
|
184830
|
-
if (!prefix || !
|
|
184945
|
+
if (!prefix || !isAbsolute7(prefix))
|
|
184831
184946
|
prefix = "/" + prefix;
|
|
184832
184947
|
read = prefix;
|
|
184833
184948
|
} else
|
|
@@ -185024,7 +185139,7 @@ var require_dist12 = __commonJS({
|
|
|
185024
185139
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
185025
185140
|
if (!exists)
|
|
185026
185141
|
return;
|
|
185027
|
-
if (prefix &&
|
|
185142
|
+
if (prefix && isAbsolute7(prefix) && !this.nomount) {
|
|
185028
185143
|
var trail = /[\/\\]$/.test(prefix);
|
|
185029
185144
|
if (prefix.charAt(0) === "/") {
|
|
185030
185145
|
prefix = path82.join(this.root, prefix);
|
|
@@ -185146,7 +185261,7 @@ var require_dist12 = __commonJS({
|
|
|
185146
185261
|
var EE = require("events").EventEmitter;
|
|
185147
185262
|
var path82 = require("path");
|
|
185148
185263
|
var assert7 = require("assert");
|
|
185149
|
-
var
|
|
185264
|
+
var isAbsolute7 = require("path").isAbsolute;
|
|
185150
185265
|
var globSync2 = require_sync7();
|
|
185151
185266
|
var common3 = require_common6();
|
|
185152
185267
|
var setopts = common3.setopts;
|
|
@@ -185368,10 +185483,10 @@ var require_dist12 = __commonJS({
|
|
|
185368
185483
|
var read;
|
|
185369
185484
|
if (prefix === null)
|
|
185370
185485
|
read = ".";
|
|
185371
|
-
else if (
|
|
185486
|
+
else if (isAbsolute7(prefix) || isAbsolute7(pattern.map(function(p8) {
|
|
185372
185487
|
return typeof p8 === "string" ? p8 : "[*]";
|
|
185373
185488
|
}).join("/"))) {
|
|
185374
|
-
if (!prefix || !
|
|
185489
|
+
if (!prefix || !isAbsolute7(prefix))
|
|
185375
185490
|
prefix = "/" + prefix;
|
|
185376
185491
|
read = prefix;
|
|
185377
185492
|
} else
|
|
@@ -185456,7 +185571,7 @@ var require_dist12 = __commonJS({
|
|
|
185456
185571
|
this._emitQueue.push([index, e5]);
|
|
185457
185572
|
return;
|
|
185458
185573
|
}
|
|
185459
|
-
var abs =
|
|
185574
|
+
var abs = isAbsolute7(e5) ? e5 : this._makeAbs(e5);
|
|
185460
185575
|
if (this.mark)
|
|
185461
185576
|
e5 = this._mark(e5);
|
|
185462
185577
|
if (this.absolute)
|
|
@@ -185611,7 +185726,7 @@ var require_dist12 = __commonJS({
|
|
|
185611
185726
|
this.matches[index] = /* @__PURE__ */ Object.create(null);
|
|
185612
185727
|
if (!exists)
|
|
185613
185728
|
return cb();
|
|
185614
|
-
if (prefix &&
|
|
185729
|
+
if (prefix && isAbsolute7(prefix) && !this.nomount) {
|
|
185615
185730
|
var trail = /[\/\\]$/.test(prefix);
|
|
185616
185731
|
if (prefix.charAt(0) === "/") {
|
|
185617
185732
|
prefix = path82.join(this.root, prefix);
|
|
@@ -208978,7 +209093,7 @@ ${codeblock}`, options);
|
|
|
208978
209093
|
ptr++;
|
|
208979
209094
|
return banComments || c7 !== "#" ? ptr : skipVoid(str2, skipComment(str2, ptr), banNewLines);
|
|
208980
209095
|
}
|
|
208981
|
-
function skipUntil(str2, ptr,
|
|
209096
|
+
function skipUntil(str2, ptr, sep6, end, banNewLines = false) {
|
|
208982
209097
|
if (!end) {
|
|
208983
209098
|
ptr = indexOfNewline(str2, ptr);
|
|
208984
209099
|
return ptr < 0 ? str2.length : ptr;
|
|
@@ -208987,7 +209102,7 @@ ${codeblock}`, options);
|
|
|
208987
209102
|
let c7 = str2[i5];
|
|
208988
209103
|
if (c7 === "#") {
|
|
208989
209104
|
i5 = indexOfNewline(str2, i5);
|
|
208990
|
-
} else if (c7 ===
|
|
209105
|
+
} else if (c7 === sep6) {
|
|
208991
209106
|
return i5 + 1;
|
|
208992
209107
|
} else if (c7 === end || banNewLines && (c7 === "\n" || c7 === "\r" && str2[i5 + 1] === "\n")) {
|
|
208993
209108
|
return i5;
|
|
@@ -214345,15 +214460,15 @@ function getLocation(text, position) {
|
|
|
214345
214460
|
throw earlyReturnException;
|
|
214346
214461
|
}
|
|
214347
214462
|
},
|
|
214348
|
-
onSeparator: (
|
|
214463
|
+
onSeparator: (sep6, offset, length) => {
|
|
214349
214464
|
if (position <= offset) {
|
|
214350
214465
|
throw earlyReturnException;
|
|
214351
214466
|
}
|
|
214352
|
-
if (
|
|
214467
|
+
if (sep6 === ":" && previousNode && previousNode.type === "property") {
|
|
214353
214468
|
previousNode.colonOffset = offset;
|
|
214354
214469
|
isAtPropertyKey = false;
|
|
214355
214470
|
previousNode = void 0;
|
|
214356
|
-
} else if (
|
|
214471
|
+
} else if (sep6 === ",") {
|
|
214357
214472
|
const last = segments[segments.length - 1];
|
|
214358
214473
|
if (typeof last === "number") {
|
|
214359
214474
|
segments[segments.length - 1] = last + 1;
|
|
@@ -214468,11 +214583,11 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
214468
214583
|
onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });
|
|
214469
214584
|
ensurePropertyComplete(offset + length);
|
|
214470
214585
|
},
|
|
214471
|
-
onSeparator: (
|
|
214586
|
+
onSeparator: (sep6, offset, length) => {
|
|
214472
214587
|
if (currentParent.type === "property") {
|
|
214473
|
-
if (
|
|
214588
|
+
if (sep6 === ":") {
|
|
214474
214589
|
currentParent.colonOffset = offset;
|
|
214475
|
-
} else if (
|
|
214590
|
+
} else if (sep6 === ",") {
|
|
214476
214591
|
ensurePropertyComplete(offset);
|
|
214477
214592
|
}
|
|
214478
214593
|
}
|
|
@@ -218695,21 +218810,21 @@ var require_pattern = __commonJS({
|
|
|
218695
218810
|
exports2.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
218696
218811
|
function partitionAbsoluteAndRelative(patterns) {
|
|
218697
218812
|
const absolute = [];
|
|
218698
|
-
const
|
|
218813
|
+
const relative7 = [];
|
|
218699
218814
|
for (const pattern of patterns) {
|
|
218700
|
-
if (
|
|
218815
|
+
if (isAbsolute7(pattern)) {
|
|
218701
218816
|
absolute.push(pattern);
|
|
218702
218817
|
} else {
|
|
218703
|
-
|
|
218818
|
+
relative7.push(pattern);
|
|
218704
218819
|
}
|
|
218705
218820
|
}
|
|
218706
|
-
return [absolute,
|
|
218821
|
+
return [absolute, relative7];
|
|
218707
218822
|
}
|
|
218708
218823
|
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
218709
|
-
function
|
|
218824
|
+
function isAbsolute7(pattern) {
|
|
218710
218825
|
return path20.isAbsolute(pattern);
|
|
218711
218826
|
}
|
|
218712
|
-
exports2.isAbsolute =
|
|
218827
|
+
exports2.isAbsolute = isAbsolute7;
|
|
218713
218828
|
}
|
|
218714
218829
|
});
|
|
218715
218830
|
|
|
@@ -229038,7 +229153,68 @@ function resolveWorkspaceConfig(base, workspaceName, workspaceDirectory) {
|
|
|
229038
229153
|
resolved[key] = value;
|
|
229039
229154
|
}
|
|
229040
229155
|
}
|
|
229041
|
-
return
|
|
229156
|
+
return expandWorkspacePlaceholders(
|
|
229157
|
+
resolved,
|
|
229158
|
+
getWorkspacePlaceholderResolver(workspaceName, workspaceDirectory)
|
|
229159
|
+
);
|
|
229160
|
+
}
|
|
229161
|
+
function getWorkspacePlaceholderResolver(workspaceName, workspaceDirectory) {
|
|
229162
|
+
let packageName;
|
|
229163
|
+
const readPackageName = (placeholder) => {
|
|
229164
|
+
if (packageName !== void 0) {
|
|
229165
|
+
return packageName;
|
|
229166
|
+
}
|
|
229167
|
+
const packageJsonPath = import_path24.default.posix.join(workspaceName, "package.json");
|
|
229168
|
+
let name;
|
|
229169
|
+
try {
|
|
229170
|
+
name = JSON.parse(
|
|
229171
|
+
(0, import_fs26.readFileSync)(import_path24.default.join(workspaceDirectory, packageJsonPath), "utf-8")
|
|
229172
|
+
)?.name;
|
|
229173
|
+
} catch (error3) {
|
|
229174
|
+
throw new ConfigurationError(
|
|
229175
|
+
`Workspace "${workspaceName}" uses {{${placeholder}}}, but ${packageJsonPath} could not be read: ${error3.message}`
|
|
229176
|
+
);
|
|
229177
|
+
}
|
|
229178
|
+
if (typeof name !== "string" || name === "") {
|
|
229179
|
+
throw new ConfigurationError(
|
|
229180
|
+
`Workspace "${workspaceName}" uses {{${placeholder}}}, but ${packageJsonPath} has no "name".`
|
|
229181
|
+
);
|
|
229182
|
+
}
|
|
229183
|
+
packageName = name;
|
|
229184
|
+
return name;
|
|
229185
|
+
};
|
|
229186
|
+
return (placeholder) => {
|
|
229187
|
+
switch (placeholder) {
|
|
229188
|
+
case "workspace":
|
|
229189
|
+
return workspaceName;
|
|
229190
|
+
case "workspaceName":
|
|
229191
|
+
return import_path24.default.posix.basename(workspaceName);
|
|
229192
|
+
case "packageName":
|
|
229193
|
+
return readPackageName(placeholder);
|
|
229194
|
+
case "packageSimpleName":
|
|
229195
|
+
return readPackageName(placeholder).replace(/^@/, "").replace(/\//g, "-");
|
|
229196
|
+
}
|
|
229197
|
+
};
|
|
229198
|
+
}
|
|
229199
|
+
function expandWorkspacePlaceholders(value, resolve10) {
|
|
229200
|
+
if (typeof value === "string") {
|
|
229201
|
+
return value.replace(
|
|
229202
|
+
WORKSPACE_PLACEHOLDER_REGEX,
|
|
229203
|
+
(_match, placeholder) => resolve10(placeholder)
|
|
229204
|
+
);
|
|
229205
|
+
}
|
|
229206
|
+
if (Array.isArray(value)) {
|
|
229207
|
+
return value.map((item) => expandWorkspacePlaceholders(item, resolve10));
|
|
229208
|
+
}
|
|
229209
|
+
if (value !== null && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
|
|
229210
|
+
return Object.fromEntries(
|
|
229211
|
+
Object.entries(value).map(([key, item]) => [
|
|
229212
|
+
key,
|
|
229213
|
+
expandWorkspacePlaceholders(item, resolve10)
|
|
229214
|
+
])
|
|
229215
|
+
);
|
|
229216
|
+
}
|
|
229217
|
+
return value;
|
|
229042
229218
|
}
|
|
229043
229219
|
function getWorkspaceConfig(workspaces, workspaceName, workspaceDirectory) {
|
|
229044
229220
|
if (isWorkspacePattern(workspaceName)) {
|
|
@@ -229504,10 +229680,10 @@ async function getStatusProviderFromConfig() {
|
|
|
229504
229680
|
}
|
|
229505
229681
|
}
|
|
229506
229682
|
}
|
|
229507
|
-
function
|
|
229683
|
+
function getActiveWorkspaceDirectory() {
|
|
229508
229684
|
const workspace = getActiveWorkspace();
|
|
229509
229685
|
if (!workspace) {
|
|
229510
|
-
return
|
|
229686
|
+
return void 0;
|
|
229511
229687
|
}
|
|
229512
229688
|
if (!isSafeWorkspacePath(workspace)) {
|
|
229513
229689
|
throw new ConfigurationError(`Invalid workspace path: "${workspace}"`);
|
|
@@ -229515,7 +229691,7 @@ function getDefaultChangelogFilePath() {
|
|
|
229515
229691
|
const root = getConfigFileDir() || process.cwd();
|
|
229516
229692
|
const directory = import_path24.default.resolve(root, workspace);
|
|
229517
229693
|
if (!(0, import_fs26.existsSync)(directory) || !(0, import_fs26.lstatSync)(directory).isDirectory()) {
|
|
229518
|
-
return
|
|
229694
|
+
return void 0;
|
|
229519
229695
|
}
|
|
229520
229696
|
const realRoot = (0, import_fs26.realpathSync)(root);
|
|
229521
229697
|
const realDirectory = (0, import_fs26.realpathSync)(directory);
|
|
@@ -229524,7 +229700,16 @@ function getDefaultChangelogFilePath() {
|
|
|
229524
229700
|
`Workspace directory escapes the repository: "${workspace}"`
|
|
229525
229701
|
);
|
|
229526
229702
|
}
|
|
229527
|
-
return
|
|
229703
|
+
return workspace;
|
|
229704
|
+
}
|
|
229705
|
+
function getReleaseUnitDir() {
|
|
229706
|
+
const root = getConfigFileDir() || process.cwd();
|
|
229707
|
+
const workspaceDirectory = getActiveWorkspaceDirectory();
|
|
229708
|
+
return workspaceDirectory ? import_path24.default.resolve(root, workspaceDirectory) : root;
|
|
229709
|
+
}
|
|
229710
|
+
function getDefaultChangelogFilePath() {
|
|
229711
|
+
const workspaceDirectory = getActiveWorkspaceDirectory();
|
|
229712
|
+
return workspaceDirectory ? import_path24.default.posix.join(workspaceDirectory, DEFAULT_CHANGELOG_FILE_PATH) : DEFAULT_CHANGELOG_FILE_PATH;
|
|
229528
229713
|
}
|
|
229529
229714
|
function getChangelogConfig() {
|
|
229530
229715
|
const config = getConfiguration();
|
|
@@ -229598,11 +229783,16 @@ function isExpandableTarget(targetClass) {
|
|
|
229598
229783
|
async function expandWorkspaceTargets(targets) {
|
|
229599
229784
|
const { getTargetByName: getTargetByName2 } = (init_targets(), __toCommonJS(targets_exports));
|
|
229600
229785
|
const rootDir = getConfigFileDir() || process.cwd();
|
|
229786
|
+
const releaseUnitDir = getReleaseUnitDir();
|
|
229601
229787
|
const expandedTargets = [];
|
|
229602
229788
|
for (const target of targets) {
|
|
229603
229789
|
const targetClass = getTargetByName2(target.name);
|
|
229604
229790
|
if (targetClass && isExpandableTarget(targetClass)) {
|
|
229605
|
-
const expanded = await targetClass.expand(
|
|
229791
|
+
const expanded = await targetClass.expand(
|
|
229792
|
+
target,
|
|
229793
|
+
rootDir,
|
|
229794
|
+
releaseUnitDir
|
|
229795
|
+
);
|
|
229606
229796
|
expandedTargets.push(...expanded);
|
|
229607
229797
|
} else {
|
|
229608
229798
|
expandedTargets.push(target);
|
|
@@ -229610,7 +229800,7 @@ async function expandWorkspaceTargets(targets) {
|
|
|
229610
229800
|
}
|
|
229611
229801
|
return expandedTargets;
|
|
229612
229802
|
}
|
|
229613
|
-
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;
|
|
229803
|
+
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;
|
|
229614
229804
|
var init_config2 = __esm({
|
|
229615
229805
|
"src/config.ts"() {
|
|
229616
229806
|
"use strict";
|
|
@@ -229634,6 +229824,16 @@ var init_config2 = __esm({
|
|
|
229634
229824
|
CONFIG_FILE_NAME = ".craft.yml";
|
|
229635
229825
|
DEFAULT_RELEASE_BRANCH_NAME = "release";
|
|
229636
229826
|
WORKSPACES_MIN_VERSION = "2.29.0";
|
|
229827
|
+
WORKSPACE_PLACEHOLDERS = [
|
|
229828
|
+
"workspace",
|
|
229829
|
+
"workspaceName",
|
|
229830
|
+
"packageName",
|
|
229831
|
+
"packageSimpleName"
|
|
229832
|
+
];
|
|
229833
|
+
WORKSPACE_PLACEHOLDER_REGEX = new RegExp(
|
|
229834
|
+
`\\{\\{(${WORKSPACE_PLACEHOLDERS.join("|")})\\}\\}`,
|
|
229835
|
+
"g"
|
|
229836
|
+
);
|
|
229637
229837
|
AUTO_VERSION_MIN_VERSION = "2.14.0";
|
|
229638
229838
|
DEFAULT_CHANGELOG_FILE_PATH = "CHANGELOG.md";
|
|
229639
229839
|
}
|
|
@@ -229644,7 +229844,7 @@ var require_package7 = __commonJS({
|
|
|
229644
229844
|
"package.json"(exports2, module2) {
|
|
229645
229845
|
module2.exports = {
|
|
229646
229846
|
name: "@sentry/craft",
|
|
229647
|
-
version: "3.
|
|
229847
|
+
version: "3.3.0",
|
|
229648
229848
|
description: "The universal sentry workflow CLI",
|
|
229649
229849
|
main: "dist/craft",
|
|
229650
229850
|
repository: "https://github.com/getsentry/craft",
|
|
@@ -229851,7 +230051,7 @@ function getPackage() {
|
|
|
229851
230051
|
}
|
|
229852
230052
|
function getPackageVersion3() {
|
|
229853
230053
|
const { version: version2 } = getPackage();
|
|
229854
|
-
const buildInfo = "
|
|
230054
|
+
const buildInfo = "4b763f5419255bb520e3e5a49f5b91426dcd374d";
|
|
229855
230055
|
return buildInfo ? `${version2} (${buildInfo})` : version2;
|
|
229856
230056
|
}
|
|
229857
230057
|
function semVerToString(s8) {
|
|
@@ -235821,13 +236021,13 @@ function usage(yargs, shim3) {
|
|
|
235821
236021
|
};
|
|
235822
236022
|
self2.stringifiedValues = function stringifiedValues(values, separator) {
|
|
235823
236023
|
let string2 = "";
|
|
235824
|
-
const
|
|
236024
|
+
const sep6 = separator || ", ";
|
|
235825
236025
|
const array2 = [].concat(values);
|
|
235826
236026
|
if (!values || !array2.length)
|
|
235827
236027
|
return string2;
|
|
235828
236028
|
array2.forEach((value) => {
|
|
235829
236029
|
if (string2.length)
|
|
235830
|
-
string2 +=
|
|
236030
|
+
string2 += sep6;
|
|
235831
236031
|
string2 += JSON.stringify(value);
|
|
235832
236032
|
});
|
|
235833
236033
|
return string2;
|
|
@@ -239456,13 +239656,12 @@ async function prepareMain(argv) {
|
|
|
239456
239656
|
const resolvedChangelogPath = (0, import_path31.relative)("", changelogPath);
|
|
239457
239657
|
await git.add(resolvedChangelogPath);
|
|
239458
239658
|
}
|
|
239459
|
-
const rootDir = getConfigFileDir() || process.cwd();
|
|
239460
239659
|
const preReleaseCommandRan = await runPreReleaseCommand({
|
|
239461
239660
|
oldVersion,
|
|
239462
239661
|
newVersion,
|
|
239463
239662
|
preReleaseCommand: config.preReleaseCommand,
|
|
239464
239663
|
targets: config.targets,
|
|
239465
|
-
rootDir
|
|
239664
|
+
rootDir: getReleaseUnitDir()
|
|
239466
239665
|
});
|
|
239467
239666
|
await commitChanges(git, newVersion, preReleaseCommandRan);
|
|
239468
239667
|
await isolation.showDiff();
|