From eea3bb0224a9b2402a8bdfb219f0afa8f92c7859 Mon Sep 17 00:00:00 2001 From: Meno Abels Date: Mon, 2 Feb 2026 10:53:00 +0100 Subject: [PATCH] chore: added core-cli feature to publish --- cli/build-cmd.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cli/build-cmd.ts b/cli/build-cmd.ts index cca54436f..417d06d0c 100644 --- a/cli/build-cmd.ts +++ b/cli/build-cmd.ts @@ -476,6 +476,11 @@ export function buildCmd(sthis: SuperThis) { defaultValueIsSerializable: true, description: "Package manager to use (pnpm, npm, yarn, bun), defaults to 'pnpm'.", }), + usePkgPrNew: flag({ + long: "use-pkg-pr-new", + defaultValue: () => !!process.env.CI, + description: "Publish via pkg-pr-new (defaults to true in CI environments).", + }), }, handler: async (args) => { const top = await findUp("tsconfig.dist.json"); @@ -648,6 +653,14 @@ export function buildCmd(sthis: SuperThis) { console.error(`Failed to publish the package.`); //, JSON.stringify(process.env, null, 2)); process.exit(res.exitCode); } + if (args.usePkgPrNew) { + console.log(`Publishing via pkg-pr-new...`); + const pkgPrNewRes = await $`npx pkg-pr-new publish`.nothrow(); + if (pkgPrNewRes.exitCode !== 0) { + console.error(`Failed to publish via pkg-pr-new.`); + process.exit(pkgPrNewRes.exitCode); + } + } } }, });