Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
abbreviateCommitHash,
extractOwnerAndRepo,
extractRepository,
installCommands,
} from "@pkg-pr-new/utils";
import { glob } from "tinyglobby";
import ignore from "ignore";
Expand Down Expand Up @@ -544,7 +545,7 @@ const main = defineCommand({
return `${packageName}:
- sha: ${shasums[packageName]}
- publint: ${publintUrl}
- npm: npm i ${url}`;
- ${packMethod}: ${installCommands[packMethod]} ${url}`;
})
.join("\n\n");

Expand Down
7 changes: 7 additions & 0 deletions packages/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export function isPullRequest(ref: string) {
export type Comment = "off" | "create" | "update";
export type PackageManager = "npm" | "pnpm" | "yarn" | "bun";

export const installCommands: Record<PackageManager, string> = {
npm: "npm i",
pnpm: "pnpm add",
yarn: "yarn add",
bun: "bun add",
};

const whitelist =
"https://raw.githubusercontent.com/stackblitz-labs/pkg.pr.new/main/.whitelist";

Expand Down
Loading