mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
misc sdk changes (#2934)
* misc sdk changes * delete the store ☠️ * port comments * fix build * fix removing * fix tests * beta.20 --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
import { Actions } from "../../../base/lib/actions/setupActions"
|
||||
import { ExtendedVersion } from "../../../base/lib/exver"
|
||||
import { UpdateServiceInterfaces } from "../../../base/lib/interfaces/setupInterfaces"
|
||||
import { ExposedStorePaths } from "../../../base/lib/types"
|
||||
import * as T from "../../../base/lib/types"
|
||||
import { StorePath } from "../util"
|
||||
import { VersionGraph } from "../version/VersionGraph"
|
||||
import { PostInstall, PreInstall } from "./setupInstall"
|
||||
import { Uninstall } from "./setupUninstall"
|
||||
|
||||
export function setupInit<Manifest extends T.SDKManifest, Store>(
|
||||
export function setupInit<Manifest extends T.SDKManifest>(
|
||||
versions: VersionGraph<string>,
|
||||
preInstall: PreInstall<Manifest, Store>,
|
||||
postInstall: PostInstall<Manifest, Store>,
|
||||
uninstall: Uninstall<Manifest, Store>,
|
||||
preInstall: PreInstall<Manifest>,
|
||||
postInstall: PostInstall<Manifest>,
|
||||
uninstall: Uninstall<Manifest>,
|
||||
setServiceInterfaces: UpdateServiceInterfaces<any>,
|
||||
setDependencies: (options: {
|
||||
effects: T.Effects
|
||||
}) => Promise<null | void | undefined>,
|
||||
actions: Actions<Store, any>,
|
||||
initStore: Store,
|
||||
exposedStore: ExposedStorePaths,
|
||||
actions: Actions<any>,
|
||||
): {
|
||||
packageInit: T.ExpectedExports.packageInit
|
||||
packageUninit: T.ExpectedExports.packageUninit
|
||||
@@ -58,17 +54,12 @@ export function setupInit<Manifest extends T.SDKManifest, Store>(
|
||||
containerInit: async (opts) => {
|
||||
const prev = await opts.effects.getDataVersion()
|
||||
if (!prev) {
|
||||
await opts.effects.store.set({
|
||||
path: "" as StorePath,
|
||||
value: initStore,
|
||||
})
|
||||
await preInstall.preInstall(opts)
|
||||
}
|
||||
await setServiceInterfaces({
|
||||
...opts,
|
||||
})
|
||||
await actions.update({ effects: opts.effects })
|
||||
await opts.effects.exposeForDependents({ paths: exposedStore })
|
||||
await setDependencies({ effects: opts.effects })
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user