@mui/internal-code-infra 0.0.4-canary.22 ā 0.0.4-canary.23
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/build/cli/cmdPublish.d.mts +1 -0
- package/package.json +2 -2
- package/src/cli/cmdPublish.mjs +15 -10
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
export type PublicPackage = import('../utils/pnpm.mjs').PublicPackage;
|
|
3
3
|
export type PublishOptions = import('../utils/pnpm.mjs').PublishOptions;
|
|
4
|
+
export type PublishSummaryEntry = import('../utils/pnpm.mjs').PublishSummaryEntry;
|
|
4
5
|
export type Args = {
|
|
5
6
|
dry-run: boolean;
|
|
6
7
|
github-release: boolean;
|
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.23",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"publishConfig": {
|
|
167
167
|
"access": "public"
|
|
168
168
|
},
|
|
169
|
-
"gitSha": "
|
|
169
|
+
"gitSha": "63e59979dc6273f97e9a27831ed341b8bc32f1cb",
|
|
170
170
|
"scripts": {
|
|
171
171
|
"build": "tsgo -p tsconfig.build.json",
|
|
172
172
|
"typescript": "tsgo -noEmit",
|
package/src/cli/cmdPublish.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {import('../utils/pnpm.mjs').PublicPackage} PublicPackage
|
|
7
7
|
* @typedef {import('../utils/pnpm.mjs').PublishOptions} PublishOptions
|
|
8
|
+
* @typedef {import('../utils/pnpm.mjs').PublishSummaryEntry} PublishSummaryEntry
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
import select from '@inquirer/select';
|
|
@@ -194,18 +195,11 @@ async function validateGitHubRelease(version) {
|
|
|
194
195
|
* Publish packages to npm
|
|
195
196
|
* @param {PublicPackage[]} packages - Packages to publish
|
|
196
197
|
* @param {PublishOptions} options - Publishing options
|
|
197
|
-
* @returns {Promise<
|
|
198
|
+
* @returns {Promise<PublishSummaryEntry[]>}
|
|
198
199
|
*/
|
|
199
200
|
async function publishToNpm(packages, options) {
|
|
200
|
-
console.log('\nš¦ Publishing packages to npm...');
|
|
201
|
-
console.log(`š Found ${packages.length} packages:`);
|
|
202
|
-
packages.forEach((pkg) => {
|
|
203
|
-
console.log(` ⢠${pkg.name}@${pkg.version}`);
|
|
204
|
-
});
|
|
205
|
-
|
|
206
201
|
// Use pnpm's built-in duplicate checking - no need to check versions ourselves
|
|
207
|
-
|
|
208
|
-
console.log('ā
Successfully published to npm');
|
|
202
|
+
return publishPackages(packages, options);
|
|
209
203
|
}
|
|
210
204
|
|
|
211
205
|
/**
|
|
@@ -355,7 +349,18 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
|
|
|
355
349
|
|
|
356
350
|
// Publish to npm (pnpm handles duplicate checking automatically)
|
|
357
351
|
// No git checks, we'll do our own
|
|
358
|
-
|
|
352
|
+
console.log('\nš¦ Publishing packages to npm...');
|
|
353
|
+
const publishedPackages = await publishToNpm(allPackages, { dryRun, noGitChecks: true, tag });
|
|
354
|
+
|
|
355
|
+
if (publishedPackages.length === 0) {
|
|
356
|
+
console.log('ā¹ļø No packages were published (all may already be up to date on npm)');
|
|
357
|
+
console.log('\nš Nothing to publish, skipping git tag and GitHub release.');
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
publishedPackages.forEach((pkg) => {
|
|
362
|
+
console.log(`ā
Published ${pkg.name}@${pkg.version}`);
|
|
363
|
+
});
|
|
359
364
|
|
|
360
365
|
await createGitTag(version, dryRun);
|
|
361
366
|
|