-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove adapter function wrappers from Effect gen functions
- Loading branch information
Showing
5 changed files
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,13 @@ import { InstallPackageError, PackageManager } from "./package-manager"; | |
export const bunPackageManager = (bunPath = "bun") => | ||
PackageManager.of({ | ||
installPackage: ({ pkg, cwd }) => | ||
Effect.gen(function* (_) { | ||
Effect.gen(function* () { | ||
// Run `bun add <pkg> --verbose`. | ||
// See https://bun.sh/docs/cli/add. | ||
const { stdout } = yield* _( | ||
Effect.tryPromise({ | ||
try: () => execa(bunPath, ["add", pkg, "--verbose"], { cwd }), | ||
catch: (e) => new InstallPackageError({ cause: e }), | ||
}), | ||
); | ||
const { stdout } = yield* Effect.tryPromise({ | ||
try: () => execa(bunPath, ["add", pkg, "--verbose"], { cwd }), | ||
catch: (e) => new InstallPackageError({ cause: e }), | ||
}); | ||
|
||
// With verbose output on, bun prints one line per installed package | ||
// (e.g., "[email protected]"), including all installed dependencies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters