pkg-pr-new 0.0.59 → 0.0.60
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 +11 -3
- package/index.ts +10 -2
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -74,6 +74,10 @@ const main = defineCommand({
|
|
|
74
74
|
type: "boolean",
|
|
75
75
|
description: "use `yarn pack` instead of `npm pack --json`",
|
|
76
76
|
},
|
|
77
|
+
bun: {
|
|
78
|
+
type: "boolean",
|
|
79
|
+
description: "use `bun pm pack` instead of `npm pack --json`",
|
|
80
|
+
},
|
|
77
81
|
template: {
|
|
78
82
|
type: "string",
|
|
79
83
|
description:
|
|
@@ -131,6 +135,8 @@ const main = defineCommand({
|
|
|
131
135
|
packMethod = "pnpm";
|
|
132
136
|
} else if (args.yarn) {
|
|
133
137
|
packMethod = "yarn";
|
|
138
|
+
} else if (args.bun) {
|
|
139
|
+
packMethod = "bun";
|
|
134
140
|
}
|
|
135
141
|
|
|
136
142
|
const isPeerDepsEnabled = !!args.peerDeps;
|
|
@@ -582,13 +588,15 @@ runMain(main)
|
|
|
582
588
|
.then(() => process.exit(0))
|
|
583
589
|
.catch(() => process.exit(1));
|
|
584
590
|
|
|
585
|
-
type PackMethod = "npm" | "pnpm" | "yarn";
|
|
591
|
+
type PackMethod = "npm" | "pnpm" | "yarn" | "bun";
|
|
586
592
|
|
|
587
593
|
async function resolveTarball(pm: PackMethod, p: string, pJson: PackageJson) {
|
|
588
594
|
let cmd = `${pm} pack`;
|
|
589
595
|
let filename = `${pJson.name!.replace("/", "-")}-${pJson.version}.tgz`;
|
|
590
596
|
if (pm === "yarn") {
|
|
591
597
|
cmd += ` --filename ${filename}`;
|
|
598
|
+
} else if (pm === "bun") {
|
|
599
|
+
cmd = `bun pm pack --filename ${filename}`;
|
|
592
600
|
}
|
|
593
601
|
const { stdout } = await ezSpawn.async(cmd, {
|
|
594
602
|
stdio: "overlapped",
|
|
@@ -596,7 +604,7 @@ async function resolveTarball(pm: PackMethod, p: string, pJson: PackageJson) {
|
|
|
596
604
|
});
|
|
597
605
|
const lines = stdout.split("\n").filter(Boolean);
|
|
598
606
|
|
|
599
|
-
if (pm !== "yarn") {
|
|
607
|
+
if (pm !== "yarn" && pm !== "bun") {
|
|
600
608
|
filename = lines[lines.length - 1].trim();
|
|
601
609
|
}
|
|
602
610
|
|