mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 12:21:57 +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: {
|
write(options: {
|
||||||
effects: Effects;
|
effects: Effects;
|
||||||
input: TypeFromProps<A>;
|
input: TypeFromProps<A>;
|
||||||
}): Promise<[ConfigType, Dependencies]>;
|
}): Promise<{ config?: ConfigType; dependencies?: Dependencies }>;
|
||||||
read(options: {
|
read(options: {
|
||||||
effects: Effects;
|
effects: Effects;
|
||||||
config: ConfigType;
|
config: ConfigType;
|
||||||
@@ -35,10 +35,10 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
|||||||
await effects.error(String(validator.errorMessage(input)));
|
await effects.error(String(validator.errorMessage(input)));
|
||||||
return { error: "Set config type error for config" };
|
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.setDependencies(dependencies || []);
|
||||||
await effects.setWrapperData({ path: "config", value: output });
|
await effects.setWrapperData({ path: "config", value: config || null });
|
||||||
}) as ExpectedExports.setConfig,
|
}) as ExpectedExports.setConfig,
|
||||||
getConfig: (async ({ effects, config }) => {
|
getConfig: (async ({ effects, config }) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie23",
|
"version": "0.4.0-lib0.charlie24",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie23",
|
"version": "0.4.0-lib0.charlie24",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iarna/toml": "^2.2.5",
|
"@iarna/toml": "^2.2.5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "start-sdk",
|
"name": "start-sdk",
|
||||||
"version": "0.4.0-lib0.charlie23",
|
"version": "0.4.0-lib0.charlie24",
|
||||||
"description": "For making the patterns that are wanted in making services for the startOS.",
|
"description": "For making the patterns that are wanted in making services for the startOS.",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user