mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-31 04:33:40 +00:00
chore: Return of set config
This commit is contained in:
@@ -22,7 +22,7 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
write(options: {
|
||||
effects: Effects;
|
||||
input: TypeFromProps<A>;
|
||||
}): Promise<[ConfigType, Dependencies]>;
|
||||
}): Promise<{ config?: ConfigType; dependencies?: Dependencies }>;
|
||||
read(options: {
|
||||
effects: Effects;
|
||||
config: ConfigType;
|
||||
@@ -35,10 +35,10 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
await effects.error(String(validator.errorMessage(input)));
|
||||
return { error: "Set config type error for config" };
|
||||
}
|
||||
const [output, dependencies] = await options.write({ input, effects });
|
||||
const { config, dependencies } = await options.write({ input, effects });
|
||||
|
||||
await effects.setDependencies(dependencies);
|
||||
await effects.setWrapperData({ path: "config", value: output });
|
||||
await effects.setDependencies(dependencies || []);
|
||||
await effects.setWrapperData({ path: "config", value: config || null });
|
||||
}) as ExpectedExports.setConfig,
|
||||
getConfig: (async ({ effects, config }) => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user