@mui/internal-code-infra 0.0.4-canary.4 → 0.0.4-canary.5
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/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.5",
|
|
4
4
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"publishConfig": {
|
|
165
165
|
"access": "public"
|
|
166
166
|
},
|
|
167
|
-
"gitSha": "
|
|
167
|
+
"gitSha": "993d672e95892fc2f0e64b730dca5a79644b8d0a",
|
|
168
168
|
"scripts": {
|
|
169
169
|
"build": "tsgo -p tsconfig.build.json",
|
|
170
170
|
"typescript": "tsgo -noEmit",
|
|
@@ -28,6 +28,7 @@ import { getCurrentGitSha, getRepositoryInfo } from '../utils/git.mjs';
|
|
|
28
28
|
* @typedef {Object} Args
|
|
29
29
|
* @property {boolean} [dryRun] - Whether to run in dry-run mode
|
|
30
30
|
* @property {boolean} [githubRelease] - Whether to create GitHub releases for canary packages
|
|
31
|
+
* @property {string[]} [package] - Only publish canary versions for specified packages (by name)
|
|
31
32
|
*/
|
|
32
33
|
|
|
33
34
|
const CANARY_TAG = 'canary';
|
|
@@ -132,7 +133,7 @@ async function getPackageToDependencyMap() {
|
|
|
132
133
|
if (!pkg.name) {
|
|
133
134
|
return acc;
|
|
134
135
|
}
|
|
135
|
-
const deps = Object.keys(pkg.dependencies
|
|
136
|
+
const deps = pkg.dependencies ? Object.keys(pkg.dependencies) : [];
|
|
136
137
|
if (!deps.length) {
|
|
137
138
|
return acc;
|
|
138
139
|
}
|
|
@@ -495,7 +496,11 @@ async function publishCanaryVersions(
|
|
|
495
496
|
let publishSuccess = false;
|
|
496
497
|
try {
|
|
497
498
|
console.log(`📤 Publishing ${packagesToPublish.length} canary versions...`);
|
|
498
|
-
await publishPackages(packagesToPublish, {
|
|
499
|
+
await publishPackages(packagesToPublish, {
|
|
500
|
+
dryRun: options.dryRun,
|
|
501
|
+
noGitChecks: true,
|
|
502
|
+
tag: CANARY_TAG,
|
|
503
|
+
});
|
|
499
504
|
|
|
500
505
|
packagesToPublish.forEach((pkg) => {
|
|
501
506
|
const canaryVersion = canaryVersions.get(pkg.name);
|
|
@@ -542,10 +547,15 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
|
|
|
542
547
|
type: 'boolean',
|
|
543
548
|
default: false,
|
|
544
549
|
description: 'Create GitHub releases for published packages',
|
|
550
|
+
})
|
|
551
|
+
.option('package', {
|
|
552
|
+
type: 'string',
|
|
553
|
+
array: true,
|
|
554
|
+
description: 'Only publish canary versions for specified packages (by name)',
|
|
545
555
|
});
|
|
546
556
|
},
|
|
547
557
|
handler: async (argv) => {
|
|
548
|
-
const { dryRun = false, githubRelease = false } = argv;
|
|
558
|
+
const { dryRun = false, githubRelease = false, package: explicitPackages = [] } = argv;
|
|
549
559
|
|
|
550
560
|
const options = { dryRun, githubRelease };
|
|
551
561
|
|
|
@@ -566,14 +576,40 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
|
|
|
566
576
|
return;
|
|
567
577
|
}
|
|
568
578
|
|
|
579
|
+
// Validate that all workspace dependencies are explicitly passed by the user
|
|
580
|
+
if (explicitPackages.length > 0) {
|
|
581
|
+
const pkgDepMap = await getPackageToDependencyMap();
|
|
582
|
+
const missingDeps = new Set();
|
|
583
|
+
for (const pkg of explicitPackages) {
|
|
584
|
+
const deps = pkgDepMap[pkg] || [];
|
|
585
|
+
deps.forEach((dep) => {
|
|
586
|
+
if (!explicitPackages.includes(dep)) {
|
|
587
|
+
missingDeps.add(dep);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
if (missingDeps.size > 0) {
|
|
592
|
+
throw new Error(
|
|
593
|
+
`Missing required workspace dependencies:
|
|
594
|
+
${Array.from(missingDeps).join('\n ')}
|
|
595
|
+
Pass all workspace dependencies explicitly through the --package argument.`,
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
|
|
569
600
|
// Check for canary tag to determine selective publishing
|
|
570
601
|
const canaryTag = await getLastCanaryTag();
|
|
571
602
|
|
|
572
603
|
console.log('🔍 Checking for packages changed since canary tag...');
|
|
573
|
-
|
|
604
|
+
let packages = canaryTag
|
|
574
605
|
? await getWorkspacePackages({ sinceRef: canaryTag, publicOnly: true })
|
|
575
606
|
: allPackages;
|
|
576
607
|
|
|
608
|
+
// If user provided package list, filter to only those in packageNames
|
|
609
|
+
if (explicitPackages.length > 0) {
|
|
610
|
+
packages = packages.filter((pkg) => explicitPackages.includes(pkg.name));
|
|
611
|
+
}
|
|
612
|
+
|
|
577
613
|
console.log(`📋 Found ${packages.length} packages(s) for canary publishing:`);
|
|
578
614
|
packages.forEach((pkg) => {
|
|
579
615
|
console.log(` • ${pkg.name}@${pkg.version}`);
|