Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cli/build-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
}
}
},
});
Expand Down
Loading