pkg-pr-new 0.0.60 → 0.0.61
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/dist/index.js +22 -7
- package/index.ts +18 -12
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
abbreviateCommitHash,
|
|
14
14
|
extractOwnerAndRepo,
|
|
15
15
|
extractRepository,
|
|
16
|
+
installCommands,
|
|
16
17
|
} from "@pkg-pr-new/utils";
|
|
17
18
|
import { glob } from "tinyglobby";
|
|
18
19
|
import ignore from "ignore";
|
|
@@ -143,20 +144,25 @@ const main = defineCommand({
|
|
|
143
144
|
const isOnlyTemplates = !!args["only-templates"];
|
|
144
145
|
const isBinaryApplication = !!args.bin;
|
|
145
146
|
const comment: Comment = args.comment as Comment;
|
|
146
|
-
const selectedPackageManager = args.packageManager as
|
|
147
|
-
|
|
148
|
-
| "bun"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (
|
|
153
|
-
!["npm", "bun", "pnpm", "yarn"].includes(selectedPackageManager)
|
|
154
|
-
) {
|
|
147
|
+
const selectedPackageManager = (args.packageManager as string)
|
|
148
|
+
.split(",")
|
|
149
|
+
.filter((s) => s.trim()) as Array<"npm" | "bun" | "pnpm" | "yarn">;
|
|
150
|
+
const packageManagers = ["npm", "bun", "pnpm", "yarn"];
|
|
151
|
+
|
|
152
|
+
if (!selectedPackageManager.length) {
|
|
155
153
|
console.error(
|
|
156
|
-
`Unsupported package manager: ${
|
|
154
|
+
`Unsupported package manager: ${args.packageManager}. Supported managers are npm, bun, pnpm, yarn.`,
|
|
157
155
|
);
|
|
158
156
|
process.exit(1);
|
|
159
157
|
}
|
|
158
|
+
for (let i = 0; i < packageManagers.length; i++) {
|
|
159
|
+
if (!packageManagers.includes(packageManagers[i])) {
|
|
160
|
+
console.error(
|
|
161
|
+
`Unsupported package manager: ${packageManagers[i]}. Supported managers are npm, bun, pnpm, yarn.`,
|
|
162
|
+
);
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
160
166
|
|
|
161
167
|
if (!process.env.TEST && process.env.GITHUB_ACTIONS !== "true") {
|
|
162
168
|
console.error(
|
|
@@ -511,7 +517,7 @@ const main = defineCommand({
|
|
|
511
517
|
"sb-shasums": JSON.stringify(shasums),
|
|
512
518
|
"sb-run-id": GITHUB_RUN_ID,
|
|
513
519
|
"sb-bin": `${isBinaryApplication}`,
|
|
514
|
-
"sb-package-manager": selectedPackageManager,
|
|
520
|
+
"sb-package-manager": selectedPackageManager[0],
|
|
515
521
|
"sb-only-templates": `${isOnlyTemplates}`,
|
|
516
522
|
},
|
|
517
523
|
body: formData,
|
|
@@ -544,7 +550,7 @@ const main = defineCommand({
|
|
|
544
550
|
return `${packageName}:
|
|
545
551
|
- sha: ${shasums[packageName]}
|
|
546
552
|
- publint: ${publintUrl}
|
|
547
|
-
-
|
|
553
|
+
- ${packMethod}: ${installCommands[packMethod]} ${url}`;
|
|
548
554
|
})
|
|
549
555
|
.join("\n\n");
|
|
550
556
|
|