pubm 0.1.5 → 0.1.7

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.
Files changed (4) hide show
  1. package/bin/cli.js +237 -174
  2. package/dist/index.cjs +257 -194
  3. package/dist/index.js +254 -191
  4. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -5289,9 +5289,71 @@ function createListr(...args) {
5289
5289
  }
5290
5290
 
5291
5291
  // src/utils/package.ts
5292
+ import { readFile as readFile2, stat as stat3, writeFile as writeFile2 } from "node:fs/promises";
5293
+ import path8 from "node:path";
5294
+ import process11 from "node:process";
5295
+
5296
+ // src/ecosystem/rust.ts
5292
5297
  import { readFile, stat as stat2, writeFile } from "node:fs/promises";
5293
5298
  import path7 from "node:path";
5294
- import process11 from "node:process";
5299
+ import { parse, stringify } from "smol-toml";
5300
+
5301
+ // src/ecosystem/ecosystem.ts
5302
+ var Ecosystem = class {
5303
+ constructor(packagePath) {
5304
+ this.packagePath = packagePath;
5305
+ }
5306
+ };
5307
+
5308
+ // src/ecosystem/rust.ts
5309
+ var RustEcosystem = class extends Ecosystem {
5310
+ static async detect(packagePath) {
5311
+ try {
5312
+ return (await stat2(path7.join(packagePath, "Cargo.toml"))).isFile();
5313
+ } catch {
5314
+ return false;
5315
+ }
5316
+ }
5317
+ async readCargoToml() {
5318
+ const raw = await readFile(
5319
+ path7.join(this.packagePath, "Cargo.toml"),
5320
+ "utf-8"
5321
+ );
5322
+ return parse(raw);
5323
+ }
5324
+ async packageName() {
5325
+ const cargo = await this.readCargoToml();
5326
+ const pkg = cargo.package;
5327
+ return pkg.name;
5328
+ }
5329
+ async readVersion() {
5330
+ const cargo = await this.readCargoToml();
5331
+ const pkg = cargo.package;
5332
+ return pkg.version;
5333
+ }
5334
+ async writeVersion(newVersion) {
5335
+ const filePath = path7.join(this.packagePath, "Cargo.toml");
5336
+ const raw = await readFile(filePath, "utf-8");
5337
+ const cargo = parse(raw);
5338
+ const pkg = cargo.package;
5339
+ pkg.version = newVersion;
5340
+ await writeFile(filePath, stringify(cargo));
5341
+ }
5342
+ manifestFiles() {
5343
+ return ["Cargo.toml"];
5344
+ }
5345
+ defaultTestCommand() {
5346
+ return "cargo test";
5347
+ }
5348
+ defaultBuildCommand() {
5349
+ return "cargo build --release";
5350
+ }
5351
+ supportedRegistries() {
5352
+ return ["crates"];
5353
+ }
5354
+ };
5355
+
5356
+ // src/utils/package.ts
5295
5357
  var cachedPackageJson = {};
5296
5358
  var cachedJsrJson = {};
5297
5359
  function patchCachedJsrJson(contents, { cwd = process11.cwd() } = {}) {
@@ -5300,16 +5362,16 @@ function patchCachedJsrJson(contents, { cwd = process11.cwd() } = {}) {
5300
5362
  async function findOutFile(file, { cwd = process11.cwd() } = {}) {
5301
5363
  let directory = cwd;
5302
5364
  let filePath = "";
5303
- const { root } = path7.parse(cwd);
5365
+ const { root } = path8.parse(cwd);
5304
5366
  while (directory) {
5305
- filePath = path7.join(directory, file);
5367
+ filePath = path8.join(directory, file);
5306
5368
  try {
5307
- if ((await stat2(filePath)).isFile()) {
5369
+ if ((await stat3(filePath)).isFile()) {
5308
5370
  break;
5309
5371
  }
5310
5372
  } catch {
5311
5373
  }
5312
- directory = path7.dirname(directory);
5374
+ directory = path8.dirname(directory);
5313
5375
  if (directory === root) return null;
5314
5376
  }
5315
5377
  return filePath;
@@ -5321,7 +5383,7 @@ async function getPackageJson({
5321
5383
  if (cachedPackageJson[cwd]) return cachedPackageJson[cwd];
5322
5384
  try {
5323
5385
  const packageJsonPath = await findOutFile("package.json");
5324
- const raw = packageJsonPath && (await readFile(packageJsonPath)).toString();
5386
+ const raw = packageJsonPath && (await readFile2(packageJsonPath)).toString();
5325
5387
  if (!raw) {
5326
5388
  if (!fallbackJsr) {
5327
5389
  throw new Error(
@@ -5354,7 +5416,7 @@ async function getJsrJson({
5354
5416
  if (cachedJsrJson[cwd]) return cachedJsrJson[cwd];
5355
5417
  try {
5356
5418
  const jsrJsonPath = await findOutFile("jsr.json");
5357
- const raw = jsrJsonPath && (await readFile(jsrJsonPath)).toString();
5419
+ const raw = jsrJsonPath && (await readFile2(jsrJsonPath)).toString();
5358
5420
  if (!raw) {
5359
5421
  if (!fallbackPackage) {
5360
5422
  throw new Error(
@@ -5438,14 +5500,14 @@ async function version({ cwd = process11.cwd() } = {}) {
5438
5500
  return version2;
5439
5501
  }
5440
5502
  var versionRegex = /("version"\s*:\s*")[^"]*(")/;
5441
- async function replaceVersion(version2) {
5503
+ async function replaceVersion(version2, packages) {
5442
5504
  const results = await Promise.all([
5443
5505
  (async () => {
5444
5506
  const packageJsonPath = await findOutFile("package.json");
5445
5507
  if (!packageJsonPath) return void 0;
5446
- const packageJson = (await readFile(packageJsonPath)).toString();
5508
+ const packageJson = (await readFile2(packageJsonPath)).toString();
5447
5509
  try {
5448
- await writeFile(
5510
+ await writeFile2(
5449
5511
  packageJsonPath,
5450
5512
  packageJson.replace(versionRegex, `$1${version2}$2`)
5451
5513
  );
@@ -5460,9 +5522,9 @@ async function replaceVersion(version2) {
5460
5522
  (async () => {
5461
5523
  const jsrJsonPath = await findOutFile("jsr.json");
5462
5524
  if (!jsrJsonPath) return void 0;
5463
- const jsrJson = (await readFile(jsrJsonPath)).toString();
5525
+ const jsrJson = (await readFile2(jsrJsonPath)).toString();
5464
5526
  try {
5465
- await writeFile(
5527
+ await writeFile2(
5466
5528
  jsrJsonPath,
5467
5529
  jsrJson.replace(versionRegex, `$1${version2}$2`)
5468
5530
  );
@@ -5473,7 +5535,19 @@ async function replaceVersion(version2) {
5473
5535
  );
5474
5536
  }
5475
5537
  return "jsr.json";
5476
- })()
5538
+ })(),
5539
+ ...(packages ?? []).filter((pkg) => pkg.registries.includes("crates")).map(async (pkg) => {
5540
+ const eco = new RustEcosystem(path8.resolve(pkg.path));
5541
+ try {
5542
+ await eco.writeVersion(version2);
5543
+ } catch (error) {
5544
+ throw new AbstractError(
5545
+ `Failed to write version to Cargo.toml at ${pkg.path}: ${error instanceof Error ? error.message : error}`,
5546
+ { cause: error }
5547
+ );
5548
+ }
5549
+ return path8.join(pkg.path, "Cargo.toml");
5550
+ })
5477
5551
  ]);
5478
5552
  return results.filter((v) => v);
5479
5553
  }
@@ -5494,67 +5568,26 @@ async function getPackageManager() {
5494
5568
  return "npm";
5495
5569
  }
5496
5570
 
5497
- // src/ecosystem/rust.ts
5498
- import { readFile as readFile2, stat as stat3, writeFile as writeFile2 } from "node:fs/promises";
5499
- import path8 from "node:path";
5500
- import { parse, stringify } from "smol-toml";
5501
-
5502
- // src/ecosystem/ecosystem.ts
5503
- var Ecosystem = class {
5504
- constructor(packagePath) {
5505
- this.packagePath = packagePath;
5506
- }
5507
- };
5508
-
5509
- // src/ecosystem/rust.ts
5510
- var RustEcosystem = class extends Ecosystem {
5511
- static async detect(packagePath) {
5512
- try {
5513
- return (await stat3(path8.join(packagePath, "Cargo.toml"))).isFile();
5514
- } catch {
5515
- return false;
5571
+ // src/utils/registries.ts
5572
+ function collectRegistries(ctx) {
5573
+ if (ctx.packages?.length) {
5574
+ const seen = /* @__PURE__ */ new Set();
5575
+ const result = [];
5576
+ for (const pkg of ctx.packages) {
5577
+ for (const reg of pkg.registries) {
5578
+ if (!seen.has(reg)) {
5579
+ seen.add(reg);
5580
+ result.push(reg);
5581
+ }
5582
+ }
5516
5583
  }
5584
+ return result;
5517
5585
  }
5518
- async readCargoToml() {
5519
- const raw = await readFile2(
5520
- path8.join(this.packagePath, "Cargo.toml"),
5521
- "utf-8"
5522
- );
5523
- return parse(raw);
5524
- }
5525
- async packageName() {
5526
- const cargo = await this.readCargoToml();
5527
- const pkg = cargo.package;
5528
- return pkg.name;
5529
- }
5530
- async readVersion() {
5531
- const cargo = await this.readCargoToml();
5532
- const pkg = cargo.package;
5533
- return pkg.version;
5534
- }
5535
- async writeVersion(newVersion) {
5536
- const filePath = path8.join(this.packagePath, "Cargo.toml");
5537
- const raw = await readFile2(filePath, "utf-8");
5538
- const cargo = parse(raw);
5539
- const pkg = cargo.package;
5540
- pkg.version = newVersion;
5541
- await writeFile2(filePath, stringify(cargo));
5542
- }
5543
- manifestFiles() {
5544
- return ["Cargo.toml"];
5545
- }
5546
- defaultTestCommand() {
5547
- return "cargo test";
5548
- }
5549
- defaultBuildCommand() {
5550
- return "cargo build --release";
5551
- }
5552
- supportedRegistries() {
5553
- return ["crates"];
5554
- }
5555
- };
5586
+ return ctx.registries;
5587
+ }
5556
5588
 
5557
5589
  // src/registry/crates.ts
5590
+ import path9 from "node:path";
5558
5591
  import { exec as exec3 } from "tinyexec";
5559
5592
 
5560
5593
  // src/registry/registry.ts
@@ -5628,9 +5661,13 @@ var CratesRegistry = class extends Registry {
5628
5661
  );
5629
5662
  }
5630
5663
  }
5631
- async publish() {
5664
+ async publish(manifestDir) {
5632
5665
  try {
5633
- await exec3("cargo", ["publish"], { throwOnError: true });
5666
+ const args = ["publish"];
5667
+ if (manifestDir) {
5668
+ args.push("--manifest-path", path9.join(manifestDir, "Cargo.toml"));
5669
+ }
5670
+ await exec3("cargo", args, { throwOnError: true });
5634
5671
  return true;
5635
5672
  } catch (error) {
5636
5673
  throw new CratesError("Failed to run `cargo publish`", {
@@ -5686,35 +5723,43 @@ var CratesError2 = class extends AbstractError {
5686
5723
  this.stack = "";
5687
5724
  }
5688
5725
  };
5689
- async function getCrateName() {
5690
- const eco = new RustEcosystem(process.cwd());
5726
+ async function getCrateName(packagePath) {
5727
+ const eco = new RustEcosystem(packagePath ?? process.cwd());
5691
5728
  return await eco.packageName();
5692
5729
  }
5693
- var cratesAvailableCheckTasks = {
5694
- title: "Checking crates.io availability",
5695
- task: async () => {
5696
- const packageName = await getCrateName();
5697
- const registry = new CratesRegistry(packageName);
5698
- if (!await registry.isInstalled()) {
5699
- throw new CratesError2(
5700
- "cargo is not installed. Please install Rust toolchain to proceed."
5701
- );
5730
+ function createCratesAvailableCheckTask(packagePath) {
5731
+ const label = packagePath ? ` (${packagePath})` : "";
5732
+ return {
5733
+ title: `Checking crates.io availability${label}`,
5734
+ task: async () => {
5735
+ const packageName = await getCrateName(packagePath);
5736
+ const registry = new CratesRegistry(packageName);
5737
+ if (!await registry.isInstalled()) {
5738
+ throw new CratesError2(
5739
+ "cargo is not installed. Please install Rust toolchain to proceed."
5740
+ );
5741
+ }
5742
+ if (!await registry.hasPermission()) {
5743
+ throw new CratesError2(
5744
+ "No crates.io credentials found. Run `cargo login` or set CARGO_REGISTRY_TOKEN."
5745
+ );
5746
+ }
5702
5747
  }
5703
- if (!await registry.hasPermission()) {
5704
- throw new CratesError2(
5705
- "No crates.io credentials found. Run `cargo login` or set CARGO_REGISTRY_TOKEN."
5706
- );
5748
+ };
5749
+ }
5750
+ function createCratesPublishTask(packagePath) {
5751
+ const label = packagePath ? ` (${packagePath})` : "";
5752
+ return {
5753
+ title: `Publishing to crates.io${label}`,
5754
+ task: async () => {
5755
+ const packageName = await getCrateName(packagePath);
5756
+ const registry = new CratesRegistry(packageName);
5757
+ await registry.publish(packagePath);
5707
5758
  }
5708
- }
5709
- };
5710
- var cratesPublishTasks = {
5711
- title: "Publishing to crates.io",
5712
- task: async () => {
5713
- const packageName = await getCrateName();
5714
- const registry = new CratesRegistry(packageName);
5715
- await registry.publish();
5716
- }
5717
- };
5759
+ };
5760
+ }
5761
+ var cratesAvailableCheckTasks = createCratesAvailableCheckTask();
5762
+ var cratesPublishTasks = createCratesPublishTask();
5718
5763
 
5719
5764
  // src/tasks/jsr.ts
5720
5765
  import process12 from "node:process";
@@ -5727,7 +5772,7 @@ import { exec as exec4, NonZeroExitError } from "tinyexec";
5727
5772
  // src/utils/db.ts
5728
5773
  import { createCipheriv, createDecipheriv, createHash } from "node:crypto";
5729
5774
  import { mkdirSync as mkdirSync5, readFileSync as readFileSync3, statSync, writeFileSync as writeFileSync4 } from "node:fs";
5730
- import path9 from "node:path";
5775
+ import path10 from "node:path";
5731
5776
  var a = "aes-256-cbc";
5732
5777
  var n = statSync(import.meta.dirname);
5733
5778
  var k = `${n.rdev}${n.birthtimeMs}${n.nlink}${n.gid}`;
@@ -5742,7 +5787,7 @@ function d(g, h) {
5742
5787
  }
5743
5788
  var Db = class {
5744
5789
  constructor() {
5745
- __publicField(this, "path", path9.resolve(import.meta.dirname, ".pubm"));
5790
+ __publicField(this, "path", path10.resolve(import.meta.dirname, ".pubm"));
5746
5791
  try {
5747
5792
  if (!statSync(this.path).isDirectory()) {
5748
5793
  mkdirSync5(this.path);
@@ -5760,7 +5805,7 @@ var Db = class {
5760
5805
  set(field, value) {
5761
5806
  try {
5762
5807
  writeFileSync4(
5763
- path9.resolve(
5808
+ path10.resolve(
5764
5809
  this.path,
5765
5810
  Buffer.from(e(field, field)).toString("base64")
5766
5811
  ),
@@ -5774,7 +5819,7 @@ var Db = class {
5774
5819
  }
5775
5820
  }
5776
5821
  get(field) {
5777
- const filePath = path9.resolve(
5822
+ const filePath = path10.resolve(
5778
5823
  this.path,
5779
5824
  Buffer.from(e(field, field)).toString("base64")
5780
5825
  );
@@ -6611,9 +6656,7 @@ var npmAvailableCheckTasks = {
6611
6656
  child.stderr?.on("data", onData);
6612
6657
  child.on(
6613
6658
  "close",
6614
- (code) => code === 0 ? resolve() : reject(
6615
- new Error(`npm login exited with code ${code}`)
6616
- )
6659
+ (code) => code === 0 ? resolve() : reject(new Error(`npm login exited with code ${code}`))
6617
6660
  );
6618
6661
  child.on("error", reject);
6619
6662
  });
@@ -6916,7 +6959,7 @@ var requiredConditionsCheckTask = (options) => createListr({
6916
6959
  {
6917
6960
  title: "Ping registries",
6918
6961
  task: (ctx, parentTask2) => parentTask2.newListr(
6919
- ctx.registries.map((registryKey) => ({
6962
+ collectRegistries(ctx).map((registryKey) => ({
6920
6963
  title: `Ping to ${registryKey}`,
6921
6964
  task: async () => {
6922
6965
  const registry = await getRegistry(registryKey);
@@ -6933,8 +6976,8 @@ var requiredConditionsCheckTask = (options) => createListr({
6933
6976
  task: async (_2, parentTask2) => parentTask2.newListr(
6934
6977
  [
6935
6978
  {
6936
- enabled: (ctx) => ctx.registries.some((registry) => registry !== "jsr"),
6937
- title: "Verifying if npm are installed",
6979
+ enabled: (ctx) => collectRegistries(ctx).includes("npm"),
6980
+ title: "Verifying if npm is installed",
6938
6981
  task: async () => {
6939
6982
  const npm = await npmRegistry();
6940
6983
  if (!await npm.isInstalled()) {
@@ -6945,7 +6988,9 @@ var requiredConditionsCheckTask = (options) => createListr({
6945
6988
  }
6946
6989
  },
6947
6990
  {
6948
- enabled: (ctx) => ctx.registries.some((registry) => registry === "jsr"),
6991
+ enabled: (ctx) => collectRegistries(ctx).some(
6992
+ (registry) => registry === "jsr"
6993
+ ),
6949
6994
  title: "Verifying if jsr are installed",
6950
6995
  task: async (_3, task) => {
6951
6996
  const jsr = await jsrRegistry();
@@ -6976,7 +7021,7 @@ var requiredConditionsCheckTask = (options) => createListr({
6976
7021
  },
6977
7022
  {
6978
7023
  title: "Checking if test and build scripts exist",
6979
- skip: (ctx) => !needsPackageScripts(ctx.registries),
7024
+ skip: (ctx) => !needsPackageScripts(collectRegistries(ctx)),
6980
7025
  task: async (ctx) => {
6981
7026
  const { scripts } = await getPackageJson();
6982
7027
  const errors = [];
@@ -7004,23 +7049,42 @@ var requiredConditionsCheckTask = (options) => createListr({
7004
7049
  },
7005
7050
  {
7006
7051
  title: "Checking available registries for publishing",
7007
- task: (ctx, parentTask2) => parentTask2.newListr(
7008
- ctx.registries.map((registryKey) => {
7009
- switch (registryKey) {
7010
- case "npm":
7011
- return npmAvailableCheckTasks;
7012
- case "jsr":
7013
- return jsrAvailableCheckTasks;
7014
- case "crates":
7015
- return cratesAvailableCheckTasks;
7016
- default:
7017
- return npmAvailableCheckTasks;
7018
- }
7019
- }),
7020
- {
7021
- concurrent: true
7052
+ task: (ctx, parentTask2) => {
7053
+ if (ctx.packages?.length) {
7054
+ const tasks = ctx.packages.flatMap(
7055
+ (pkg) => pkg.registries.map((registryKey) => {
7056
+ switch (registryKey) {
7057
+ case "npm":
7058
+ return npmAvailableCheckTasks;
7059
+ case "jsr":
7060
+ return jsrAvailableCheckTasks;
7061
+ case "crates":
7062
+ return createCratesAvailableCheckTask(pkg.path);
7063
+ default:
7064
+ return npmAvailableCheckTasks;
7065
+ }
7066
+ })
7067
+ );
7068
+ return parentTask2.newListr(tasks, { concurrent: true });
7022
7069
  }
7023
- )
7070
+ return parentTask2.newListr(
7071
+ collectRegistries(ctx).map((registryKey) => {
7072
+ switch (registryKey) {
7073
+ case "npm":
7074
+ return npmAvailableCheckTasks;
7075
+ case "jsr":
7076
+ return jsrAvailableCheckTasks;
7077
+ case "crates":
7078
+ return cratesAvailableCheckTasks;
7079
+ default:
7080
+ return npmAvailableCheckTasks;
7081
+ }
7082
+ }),
7083
+ {
7084
+ concurrent: true
7085
+ }
7086
+ );
7087
+ }
7024
7088
  }
7025
7089
  ],
7026
7090
  {
@@ -7032,21 +7096,27 @@ var requiredConditionsCheckTask = (options) => createListr({
7032
7096
  // src/tasks/runner.ts
7033
7097
  var { open: open3 } = npmCli3;
7034
7098
  var { prerelease } = SemVer;
7035
- function collectRegistries(ctx) {
7099
+ function registryTask(registry) {
7100
+ switch (registry) {
7101
+ case "npm":
7102
+ return npmPublishTasks;
7103
+ case "jsr":
7104
+ return jsrPublishTasks;
7105
+ case "crates":
7106
+ return cratesPublishTasks;
7107
+ default:
7108
+ return npmPublishTasks;
7109
+ }
7110
+ }
7111
+ function collectPublishTasks(ctx) {
7036
7112
  if (ctx.packages?.length) {
7037
- const seen = /* @__PURE__ */ new Set();
7038
- const result = [];
7039
- for (const pkg of ctx.packages) {
7040
- for (const reg of pkg.registries) {
7041
- if (!seen.has(reg)) {
7042
- seen.add(reg);
7043
- result.push(reg);
7044
- }
7045
- }
7046
- }
7047
- return result;
7113
+ return ctx.packages.flatMap(
7114
+ (pkg) => pkg.registries.map(
7115
+ (reg) => reg === "crates" ? createCratesPublishTask(pkg.path) : registryTask(reg)
7116
+ )
7117
+ );
7048
7118
  }
7049
- return ctx.registries;
7119
+ return collectRegistries(ctx).map(registryTask);
7050
7120
  }
7051
7121
  async function run(options) {
7052
7122
  const ctx = {
@@ -7066,21 +7136,9 @@ async function run(options) {
7066
7136
  await createListr(
7067
7137
  options.publishOnly ? {
7068
7138
  title: "Publishing",
7069
- task: (ctx2, parentTask) => parentTask.newListr(
7070
- collectRegistries(ctx2).map((registry) => {
7071
- switch (registry) {
7072
- case "npm":
7073
- return npmPublishTasks;
7074
- case "jsr":
7075
- return jsrPublishTasks;
7076
- case "crates":
7077
- return cratesPublishTasks;
7078
- default:
7079
- return npmPublishTasks;
7080
- }
7081
- }),
7082
- { concurrent: true }
7083
- )
7139
+ task: (ctx2, parentTask) => parentTask.newListr(collectPublishTasks(ctx2), {
7140
+ concurrent: true
7141
+ })
7084
7142
  } : [
7085
7143
  {
7086
7144
  skip: options.skipTests,
@@ -7149,7 +7207,10 @@ async function run(options) {
7149
7207
  }
7150
7208
  }, ctx2);
7151
7209
  await git.reset();
7152
- const replaced = await replaceVersion(ctx2.version);
7210
+ const replaced = await replaceVersion(
7211
+ ctx2.version,
7212
+ ctx2.packages
7213
+ );
7153
7214
  for (const replacedFile of replaced) {
7154
7215
  await git.stage(replacedFile);
7155
7216
  }
@@ -7164,21 +7225,9 @@ async function run(options) {
7164
7225
  {
7165
7226
  skip: (ctx2) => options.skipPublish || !!ctx2.preview,
7166
7227
  title: "Publishing",
7167
- task: (ctx2, parentTask) => parentTask.newListr(
7168
- collectRegistries(ctx2).map((registry) => {
7169
- switch (registry) {
7170
- case "npm":
7171
- return npmPublishTasks;
7172
- case "jsr":
7173
- return jsrPublishTasks;
7174
- case "crates":
7175
- return cratesPublishTasks;
7176
- default:
7177
- return npmPublishTasks;
7178
- }
7179
- }),
7180
- { concurrent: true }
7181
- )
7228
+ task: (ctx2, parentTask) => parentTask.newListr(collectPublishTasks(ctx2), {
7229
+ concurrent: true
7230
+ })
7182
7231
  },
7183
7232
  {
7184
7233
  title: "Pushing tags to GitHub",
@@ -7223,12 +7272,26 @@ ${repositoryUrl}/compare/${lastRev}...${latestTag}`;
7223
7272
  }
7224
7273
  ]
7225
7274
  ).run(ctx);
7226
- const npmPackageName = (await getPackageJson()).name;
7227
- const jsrPackageName = (await getJsrJson()).name;
7275
+ const registries = collectRegistries(ctx);
7276
+ const parts = [];
7277
+ if (registries.includes("npm")) {
7278
+ const npmPackageName = (await getPackageJson()).name;
7279
+ parts.push(`${color.bold(npmPackageName)} on ${color.green("npm")}`);
7280
+ }
7281
+ if (registries.includes("jsr")) {
7282
+ const jsrPackageName = (await getJsrJson()).name;
7283
+ parts.push(`${color.bold(jsrPackageName)} on ${color.yellow("jsr")}`);
7284
+ }
7285
+ if (registries.includes("crates")) {
7286
+ const crateNames = ctx.packages?.filter((pkg) => pkg.registries.includes("crates")).map((pkg) => pkg.path) ?? ["crate"];
7287
+ for (const name of crateNames) {
7288
+ parts.push(`${color.bold(name)} on ${color.red("crates.io")}`);
7289
+ }
7290
+ }
7228
7291
  console.log(
7229
7292
  `
7230
7293
 
7231
- \u{1F680} Successfully published ${color.bold(npmPackageName)} on ${color.green("npm")} and ${color.bold(jsrPackageName)} on ${color.yellow("jsr")} ${color.blueBright(`v${ctx.version}`)} \u{1F680}
7294
+ \u{1F680} Successfully published ${parts.join(", ")} ${color.blueBright(`v${ctx.version}`)} \u{1F680}
7232
7295
  `
7233
7296
  );
7234
7297
  } catch (e2) {
@@ -7244,7 +7307,7 @@ import { inc } from "semver";
7244
7307
 
7245
7308
  // src/monorepo/discover.ts
7246
7309
  import { existsSync as existsSync6, readdirSync as readdirSync3, statSync as statSync2 } from "node:fs";
7247
- import path10 from "node:path";
7310
+ import path11 from "node:path";
7248
7311
  import micromatch from "micromatch";
7249
7312
 
7250
7313
  // src/monorepo/workspace.ts
@@ -7257,7 +7320,7 @@ import micromatch2 from "micromatch";
7257
7320
 
7258
7321
  // src/validate/entry-points.ts
7259
7322
  import { existsSync as existsSync7 } from "node:fs";
7260
- import path11 from "node:path";
7323
+ import path12 from "node:path";
7261
7324
 
7262
7325
  // src/validate/extraneous-files.ts
7263
7326
  import micromatch3 from "micromatch";