mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
chore: update the version and add the setupInit section
This commit is contained in:
24
lib/inits/setupInit.ts
Normal file
24
lib/inits/setupInit.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ExpectedExports } from "../types";
|
||||
import { Migrations } from "./migrations/setupMigrations";
|
||||
import { Install } from "./setupInstall";
|
||||
import { Uninstall } from "./setupUninstall";
|
||||
|
||||
export function setupInit<WrapperData>(
|
||||
migrations: Migrations,
|
||||
install: Install<WrapperData>,
|
||||
uninstall: Uninstall<WrapperData>,
|
||||
): {
|
||||
init: ExpectedExports.init;
|
||||
uninit: ExpectedExports.uninit;
|
||||
} {
|
||||
return {
|
||||
init: async (opts) => {
|
||||
await migrations.init(opts);
|
||||
await install.init(opts);
|
||||
},
|
||||
uninit: async (opts) => {
|
||||
await migrations.uninit(opts);
|
||||
await uninstall.uninit(opts);
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user