@mui/internal-code-infra 0.0.2-canary.34 โ†’ 0.0.2-canary.36

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 CHANGED
@@ -1,3 +1,3 @@
1
1
  # @mui/internal-code-infra
2
2
 
3
- Scripts and configs to be used across MUI repos.
3
+ Build scripts and configs to be used across MUI repos.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-code-infra",
3
- "version": "0.0.2-canary.34",
3
+ "version": "0.0.2-canary.36",
4
4
  "description": "Infra scripts and configs to be used across MUI repos.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -20,7 +20,7 @@
20
20
  "code-infra": "./bin/code-infra.mjs"
21
21
  },
22
22
  "dependencies": {
23
- "@argos-ci/core": "^3.2.3",
23
+ "@argos-ci/core": "^4.0.3",
24
24
  "@babel/core": "^7.28.0",
25
25
  "@babel/plugin-transform-runtime": "^7.28.0",
26
26
  "@babel/plugin-syntax-typescript": "^7.27.1",
@@ -57,8 +57,8 @@
57
57
  "semver": "^7.7.2",
58
58
  "typescript-eslint": "^8.35.1",
59
59
  "yargs": "^17.7.2",
60
- "@mui/internal-babel-plugin-display-name": "1.0.4-canary.3",
61
60
  "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.4",
61
+ "@mui/internal-babel-plugin-display-name": "1.0.4-canary.3",
62
62
  "@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.13"
63
63
  },
64
64
  "peerDependencies": {
@@ -89,7 +89,7 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitSha": "5ed847881c8cf90a3f943edfa9161b7c74d4c98a",
92
+ "gitSha": "8057b46e298367274dbec2091f1868179fc26a1d",
93
93
  "scripts": {
94
94
  "typescript": "tsc -p tsconfig.json",
95
95
  "test": "pnpm -w test --project @mui/internal-code-infra",
@@ -22,12 +22,19 @@ import { getWorkspacePackages, publishPackages } from './pnpm.mjs';
22
22
 
23
23
  /**
24
24
  * Get the version to release from the root package.json
25
- * @returns {Promise<string | null>} Version string
25
+ * @returns {Promise<string>} Version string
26
26
  */
27
27
  async function getReleaseVersion() {
28
28
  const result = await $`pnpm pkg get version`;
29
- const version = JSON.parse(result.stdout.trim());
30
- return semver.valid(version);
29
+ const versionData = JSON.parse(result.stdout.trim());
30
+ const version = versionData.version;
31
+
32
+ const validVersion = semver.valid(version);
33
+ if (!validVersion) {
34
+ throw new Error(`Invalid version in root package.json: ${version}`);
35
+ }
36
+
37
+ return validVersion;
31
38
  }
32
39
 
33
40
  /**
@@ -164,20 +171,15 @@ async function createGitTag(version, dryRun = false) {
164
171
 
165
172
  /**
166
173
  * Validate GitHub release requirements
167
- * @param {string | null} version - Version to validate
168
- * @returns {Promise<{changelogContent: string, version: string, repoInfo: {owner: string, repo: string}}>}
174
+ * @param {string} version - Version to validate
175
+ * @returns {Promise<{changelogContent: string, repoInfo: {owner: string, repo: string}}>}
169
176
  */
170
177
  async function validateGitHubRelease(version) {
171
178
  console.log('๐Ÿ” Validating GitHub release requirements...');
172
179
 
173
- const validVersion = semver.valid(version);
174
- if (!validVersion) {
175
- throw new Error(`Invalid version in root package.json: ${version}`);
176
- }
177
-
178
180
  // Check if CHANGELOG.md exists and parse it
179
- console.log(`๐Ÿ“„ Parsing CHANGELOG.md for version ${validVersion}...`);
180
- const changelogContent = await parseChangelog('CHANGELOG.md', validVersion);
181
+ console.log(`๐Ÿ“„ Parsing CHANGELOG.md for version ${version}...`);
182
+ const changelogContent = await parseChangelog('CHANGELOG.md', version);
181
183
  console.log('โœ… Found changelog content for version');
182
184
 
183
185
  // Get repository info
@@ -189,20 +191,20 @@ async function validateGitHubRelease(version) {
189
191
  auth: process.env.GITHUB_TOKEN,
190
192
  });
191
193
 
192
- console.log(`๐Ÿ” Checking if GitHub release v${validVersion} already exists...`);
194
+ console.log(`๐Ÿ” Checking if GitHub release v${version} already exists...`);
193
195
  const releaseExists = await checkGitHubReleaseExists(
194
196
  octokit,
195
197
  repoInfo.owner,
196
198
  repoInfo.repo,
197
- validVersion,
199
+ version,
198
200
  );
199
201
 
200
202
  if (releaseExists) {
201
- throw new Error(`GitHub release v${validVersion} already exists`);
203
+ throw new Error(`GitHub release v${version} already exists`);
202
204
  }
203
205
  console.log('โœ… GitHub release does not exist yet');
204
206
 
205
- return { changelogContent, repoInfo, version: validVersion };
207
+ return { changelogContent, repoInfo };
206
208
  }
207
209
 
208
210
  /**
@@ -259,7 +261,6 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
259
261
  describe: 'Publish packages to npm',
260
262
  builder: (yargs) => {
261
263
  return yargs
262
- .parserConfiguration({ 'boolean-negation': false })
263
264
  .option('dry-run', {
264
265
  type: 'boolean',
265
266
  default: false,
@@ -272,9 +273,9 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
272
273
  });
273
274
  },
274
275
  handler: async (argv) => {
275
- const { dryRun = false, githubRelease = false, noGitChecks = false } = argv;
276
+ const { dryRun = false, githubRelease = false } = argv;
276
277
 
277
- const options = { dryRun, noGitChecks };
278
+ const options = { dryRun };
278
279
 
279
280
  if (dryRun) {
280
281
  console.log('๐Ÿงช Running in DRY RUN mode - no actual publishing will occur\n');
@@ -291,11 +292,11 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
291
292
 
292
293
  // Get version from root package.json
293
294
  const version = await getReleaseVersion();
295
+ console.log(`๐Ÿ“‹ Release version: ${version}`);
294
296
 
295
297
  // Early validation for GitHub release (before any publishing)
296
298
  let githubReleaseData = null;
297
299
  if (githubRelease) {
298
- console.log(`๐Ÿ“‹ Release version: ${version}`);
299
300
  githubReleaseData = await validateGitHubRelease(version);
300
301
  }
301
302
 
@@ -303,18 +304,11 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
303
304
  await publishToNpm(allPackages, options);
304
305
 
305
306
  // Create GitHub release or git tag after successful npm publishing
306
- if (githubRelease && githubReleaseData) {
307
- if (dryRun) {
308
- console.log('\n๐Ÿš€ Would create GitHub draft release (dry-run)');
309
- console.log(githubReleaseData?.changelogContent);
310
- } else {
311
- await createRelease(
312
- githubReleaseData.version,
313
- githubReleaseData.changelogContent,
314
- githubReleaseData.repoInfo,
315
- );
316
- }
317
- } else if (version) {
307
+ if (githubRelease && githubReleaseData && !dryRun) {
308
+ await createRelease(version, githubReleaseData.changelogContent, githubReleaseData.repoInfo);
309
+ } else if (githubRelease && dryRun) {
310
+ console.log('\n๐Ÿš€ Would create GitHub draft release (dry-run)');
311
+ } else {
318
312
  // Create git tag when not doing GitHub release
319
313
  await createGitTag(version, dryRun);
320
314
  }