@mui/internal-code-infra 0.0.4-canary.102 → 0.0.4-canary.104
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 +4 -0
- package/package.json +4 -4
- package/src/cli/cmdPublish.mjs +22 -16
package/README.md
CHANGED
|
@@ -70,3 +70,7 @@ pnpm code-infra publish-new-package --otp=123456
|
|
|
70
70
|
7. Finally, save the changes by clicking on `Update Package Settings` button.
|
|
71
71
|
|
|
72
72
|
After following these steps, the `Publish` workflow can be invoked again.
|
|
73
|
+
|
|
74
|
+
## Agent skills
|
|
75
|
+
|
|
76
|
+
The agent skills previously shipped with this package now live at the repository root. See [Install instructions](../../README.md#agent-skills).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-code-infra",
|
|
3
|
-
"version": "0.0.4-canary.
|
|
3
|
+
"version": "0.0.4-canary.104",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -138,8 +138,8 @@
|
|
|
138
138
|
"yaml": "^2.9.0",
|
|
139
139
|
"yargs": "^18.0.0",
|
|
140
140
|
"@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.30",
|
|
141
|
-
"@mui/internal-babel-plugin-
|
|
142
|
-
"@mui/internal-babel-plugin-
|
|
141
|
+
"@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.42",
|
|
142
|
+
"@mui/internal-babel-plugin-display-name": "1.0.4-canary.23"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
145
|
"@next/eslint-plugin-next": "*",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"publishConfig": {
|
|
191
191
|
"access": "public"
|
|
192
192
|
},
|
|
193
|
-
"gitSha": "
|
|
193
|
+
"gitSha": "ca208252db281df15433e1fe6af6b95324b18dc9",
|
|
194
194
|
"scripts": {
|
|
195
195
|
"build": "tsgo -p tsconfig.build.json",
|
|
196
196
|
"typescript": "tsgo -noEmit",
|
package/src/cli/cmdPublish.mjs
CHANGED
|
@@ -498,6 +498,8 @@ async function determineGitSha(octokit, repoInfo) {
|
|
|
498
498
|
await octokit.search.issuesAndPullRequests({
|
|
499
499
|
advanced_search: 'true',
|
|
500
500
|
q: `is:pr is:merged label:release repo:${repoInfo.owner}/${repoInfo.repo}`,
|
|
501
|
+
sort: 'created',
|
|
502
|
+
order: 'desc',
|
|
501
503
|
per_page: 1,
|
|
502
504
|
})
|
|
503
505
|
).data.items;
|
|
@@ -510,29 +512,33 @@ async function determineGitSha(octokit, repoInfo) {
|
|
|
510
512
|
` Found the latest merged release PR: ${chalk.bold(pulls[0].title)} (${pulls[0].html_url})`,
|
|
511
513
|
);
|
|
512
514
|
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
})
|
|
518
|
-
).data.items;
|
|
519
|
-
|
|
520
|
-
if (!commits.length) {
|
|
521
|
-
console.error(
|
|
522
|
-
`❌🚨 Could not find any commits associated with the release PR: ${pulls[0].html_url}`,
|
|
523
|
-
);
|
|
515
|
+
const pull = (await octokit.pulls.get({ ...repoInfo, pull_number: pulls[0].number })).data;
|
|
516
|
+
const mergeCommitSha = pull.merge_commit_sha;
|
|
517
|
+
if (!mergeCommitSha) {
|
|
518
|
+
console.error(`❌🚨 Could not determine the merge commit of ${pulls[0].html_url}.`);
|
|
524
519
|
return undefined;
|
|
525
520
|
}
|
|
526
|
-
|
|
521
|
+
|
|
522
|
+
// Recent commits on the PR's target branch, to allow releasing from a different commit.
|
|
523
|
+
const commits = (
|
|
524
|
+
await octokit.repos.listCommits({ ...repoInfo, sha: pull.base.ref, per_page: 20 })
|
|
525
|
+
).data;
|
|
526
|
+
|
|
527
|
+
const toChoice = (/** @type {(typeof commits)[number]} */ commit) => ({
|
|
527
528
|
value: commit.sha,
|
|
528
529
|
name: `(${commit.sha.slice(0, 7)}) ${commit.commit.message.split('\n')[0]} by ${commit.author?.login ?? 'no author'} on ${new Date(commit.commit.committer?.date ?? '').toISOString()}`,
|
|
529
|
-
|
|
530
|
-
})
|
|
530
|
+
description: commit.commit.message,
|
|
531
|
+
});
|
|
532
|
+
const choices = commits.map(toChoice);
|
|
533
|
+
if (!choices.some((choice) => choice.value === mergeCommitSha)) {
|
|
534
|
+
const mergeCommit = (await octokit.repos.getCommit({ ...repoInfo, ref: mergeCommitSha })).data;
|
|
535
|
+
choices.unshift(toChoice(mergeCommit));
|
|
536
|
+
}
|
|
531
537
|
|
|
532
538
|
const result = await select({
|
|
533
539
|
message: 'Select the commit to release from:',
|
|
534
|
-
choices
|
|
535
|
-
default:
|
|
540
|
+
choices,
|
|
541
|
+
default: mergeCommitSha,
|
|
536
542
|
pageSize: 10,
|
|
537
543
|
});
|
|
538
544
|
return result;
|