mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 02:11:56 +00:00
chore: Move the location of the dependencies
This commit is contained in:
@@ -22,11 +22,17 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
write(options: {
|
||||
effects: Effects;
|
||||
input: TypeFromProps<A>;
|
||||
}): Promise<{ config?: ConfigType; dependencies?: Dependencies }>;
|
||||
}): Promise<ConfigType>;
|
||||
read(options: {
|
||||
effects: Effects;
|
||||
config: ConfigType;
|
||||
}): Promise<null | DeepPartial<TypeFromProps<A>>>;
|
||||
|
||||
dependencies(options: {
|
||||
effects: Effects;
|
||||
input: TypeFromProps<A>;
|
||||
config: ConfigType;
|
||||
}): Promise<Dependencies | void>;
|
||||
}) {
|
||||
const validator = options.spec.validator();
|
||||
return {
|
||||
@@ -35,9 +41,13 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
await effects.error(String(validator.errorMessage(input)));
|
||||
return { error: "Set config type error for config" };
|
||||
}
|
||||
const { config, dependencies } = await options.write({ input, effects });
|
||||
|
||||
await effects.setDependencies(dependencies || []);
|
||||
const config = await options.write({
|
||||
input: JSON.parse(JSON.stringify(input)),
|
||||
effects,
|
||||
});
|
||||
const dependencies =
|
||||
(await options.dependencies({ effects, input, config })) || [];
|
||||
await effects.setDependencies(dependencies);
|
||||
await effects.setWrapperData({ path: "config", value: config || null });
|
||||
}) as ExpectedExports.setConfig,
|
||||
getConfig: (async ({ effects, config }) => {
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "start-sdk",
|
||||
"version": "0.4.0-lib0.charlie25",
|
||||
"version": "0.4.0-lib0.charlie26",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "start-sdk",
|
||||
"version": "0.4.0-lib0.charlie25",
|
||||
"version": "0.4.0-lib0.charlie26",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@iarna/toml": "^2.2.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "start-sdk",
|
||||
"version": "0.4.0-lib0.charlie25",
|
||||
"version": "0.4.0-lib0.charlie26",
|
||||
"description": "For making the patterns that are wanted in making services for the startOS.",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user