chore: Change the expected export

This commit is contained in:
BluJ
2023-05-10 16:52:44 -06:00
parent 9521865c59
commit a76344d95f
3 changed files with 13 additions and 8 deletions

View File

@@ -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),

View File

@@ -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
}

View File

@@ -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