mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
chore: Change the expected export
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { AutoConfigure, DeepPartial, Effects, ExpectedExports } from "../types"
|
||||
import {
|
||||
DependencyConfig as DependencyConfigType,
|
||||
DeepPartial,
|
||||
Effects,
|
||||
} from "../types"
|
||||
import { Utils, utils } from "../util/utils"
|
||||
import { deepEqual } from "../util/deepEqual"
|
||||
import { deepMerge } from "../util/deepMerge"
|
||||
@@ -19,8 +23,8 @@ export class DependencyConfig<
|
||||
) {}
|
||||
|
||||
async check(
|
||||
options: Parameters<AutoConfigure["check"]>[0],
|
||||
): ReturnType<AutoConfigure["check"]> {
|
||||
options: Parameters<DependencyConfigType["check"]>[0],
|
||||
): ReturnType<DependencyConfigType["check"]> {
|
||||
const origConfig = JSON.parse(JSON.stringify(options.localConfig))
|
||||
const newOptions = {
|
||||
...options,
|
||||
@@ -41,8 +45,8 @@ export class DependencyConfig<
|
||||
throw new Error(`Check failed`)
|
||||
}
|
||||
async autoConfigure(
|
||||
options: Parameters<AutoConfigure["autoConfigure"]>[0],
|
||||
): ReturnType<AutoConfigure["autoConfigure"]> {
|
||||
options: Parameters<DependencyConfigType["autoConfigure"]>[0],
|
||||
): ReturnType<DependencyConfigType["autoConfigure"]> {
|
||||
const newOptions = {
|
||||
...options,
|
||||
utils: utils<Store, Vault>(options.effects),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Config } from "../config/builder/config"
|
||||
import { SDKManifest } from "../manifest/ManifestTypes"
|
||||
import { ExpectedExports } from "../types"
|
||||
import { DependencyConfig } from "./DependencyConfig"
|
||||
|
||||
export function setupDependencyConfig<
|
||||
@@ -17,6 +18,6 @@ export function setupDependencyConfig<
|
||||
any
|
||||
>
|
||||
},
|
||||
) {
|
||||
): ExpectedExports.dependencyConfig {
|
||||
return autoConfigs
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export namespace ExpectedExports {
|
||||
/** Auto configure is used to make sure that other dependencies have the values t
|
||||
* that this service could use.
|
||||
*/
|
||||
export type autoConfig = Record<PackageId, AutoConfigure>
|
||||
export type dependencyConfig = Record<PackageId, DependencyConfig>
|
||||
}
|
||||
export type TimeMs = number
|
||||
export type VersionString = string
|
||||
@@ -94,7 +94,7 @@ export type VersionString = string
|
||||
* AutoConfigure is used as the value to the key of package id,
|
||||
* this is used to make sure that other dependencies have the values that this service could use.
|
||||
*/
|
||||
export type AutoConfigure = {
|
||||
export type DependencyConfig = {
|
||||
/** Checks are called to make sure that our dependency is in the correct shape. If a known error is returned we know that the dependency needs modification */
|
||||
check(options: {
|
||||
effects: Effects
|
||||
|
||||
Reference in New Issue
Block a user