Skip to content

Commit 3b17ae9

Browse files
committed
refactor: update bunPackageManager
1 parent 1138897 commit 3b17ae9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/bun-package-manager.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ import { execa } from "execa";
33
import { InstallPackageError } from "./errors.ts";
44
import { PackageManager } from "./package-manager.ts";
55

6-
/** @internal */
7-
export const bunPackageManager = (bunPath = "bun") =>
8-
PackageManager.of({
6+
/** `bunPackageManager` implements the {@link PackageManager} service using bun. */
7+
export function bunPackageManager(bunPath = "bun") {
8+
return PackageManager.of({
99
installPackage: ({ pkg, cwd }) =>
1010
Effect.gen(function* () {
1111
// Run `bun add <pkg> --verbose`.
1212
// See https://bun.sh/docs/cli/add.
1313
const { stdout } = yield* Effect.tryPromise({
1414
try: () => execa(bunPath, ["add", pkg, "--verbose"], { cwd }),
15-
catch: (e) => new InstallPackageError({ cause: e }),
15+
catch: (err) => new InstallPackageError({ cause: err }),
1616
});
1717

1818
// With verbose output on, bun prints one line per installed package
@@ -26,3 +26,4 @@ export const bunPackageManager = (bunPath = "bun") =>
2626
return installedPackages;
2727
}),
2828
});
29+
}

0 commit comments

Comments
 (0)