Skip to content

Commit

Permalink
remove ensure kysely installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed May 17, 2024
1 parent 3ea0d1c commit 7f58ec2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/kysely/get-migrator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { join } from "pathe";
import type { ResolvedKyselyCTLConfig } from "../config/kysely-ctl-config.mjs";
import { getKysely } from "./get-kysely.mjs";
import { TSFileMigrationProvider } from "./ts-file-migration-provider.mjs";
import { ensureDependenciesInstalled } from "../utils/package-manager.mjs";

export async function getMigrator(
config: ResolvedKyselyCTLConfig
): Promise<Migrator> {
await ensureDependenciesInstalled(config);

const kysely = await getKysely(config);

const { migrationFolder, migrator, provider, ...migrations } =
Expand Down
16 changes: 2 additions & 14 deletions src/utils/package-manager.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { isBun, isDeno, runtime } from "std-env";
import {
detectPackageManager,
ensureDependencyInstalled,
type PackageManager,
} from "nypm";
import { isBun, isDeno } from "std-env";
import { detectPackageManager, type PackageManager } from "nypm";
import { type HasCWD, getCWD } from "../config/get-cwd.mjs";

export interface EnrichedPackageManager {
Expand All @@ -28,11 +24,3 @@ export async function getPackageManager(

return { name, command: name, inProject: false };
}

export async function ensureDependenciesInstalled(
args?: HasCWD
): Promise<void> {
if (runtime === "node") {
await ensureDependencyInstalled("kysely", { cwd: getCWD(args) });
}
}

0 comments on commit 7f58ec2

Please sign in to comment.