mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
@@ -974,7 +974,7 @@ export class SystemForEmbassy implements System {
|
|||||||
})) as U.Config
|
})) as U.Config
|
||||||
if (!oldConfig) return
|
if (!oldConfig) return
|
||||||
const moduleCode = await this.moduleCode
|
const moduleCode = await this.moduleCode
|
||||||
const method = moduleCode.dependencies?.[id]?.autoConfigure
|
const method = moduleCode?.dependencies?.[id]?.autoConfigure
|
||||||
if (!method) return
|
if (!method) return
|
||||||
const newConfig = (await method(
|
const newConfig = (await method(
|
||||||
polyfillEffects(effects, this.manifest),
|
polyfillEffects(effects, this.manifest),
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ export function transformOldConfigToNew(
|
|||||||
spec: OldConfigSpec,
|
spec: OldConfigSpec,
|
||||||
config: Record<string, any>,
|
config: Record<string, any>,
|
||||||
): Record<string, any> {
|
): Record<string, any> {
|
||||||
|
if (!config) return config
|
||||||
return Object.entries(spec).reduce((obj, [key, val]) => {
|
return Object.entries(spec).reduce((obj, [key, val]) => {
|
||||||
let newVal = config[key]
|
let newVal = config[key]
|
||||||
|
|
||||||
@@ -157,7 +158,12 @@ export function transformOldConfigToNew(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isUnion(val)) {
|
if (isUnion(val)) {
|
||||||
const selection = config[key][val.tag.id]
|
if (!config[key]) return obj
|
||||||
|
|
||||||
|
const selection = config[key]?.[val.tag.id]
|
||||||
|
|
||||||
|
if (!selection) return obj
|
||||||
|
|
||||||
delete config[key][val.tag.id]
|
delete config[key][val.tag.id]
|
||||||
|
|
||||||
newVal = {
|
newVal = {
|
||||||
@@ -170,6 +176,8 @@ export function transformOldConfigToNew(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isList(val) && isObjectList(val)) {
|
if (isList(val) && isObjectList(val)) {
|
||||||
|
if (!config[key]) return obj
|
||||||
|
|
||||||
newVal = (config[key] as object[]).map((obj) =>
|
newVal = (config[key] as object[]).map((obj) =>
|
||||||
transformOldConfigToNew(
|
transformOldConfigToNew(
|
||||||
matchOldConfigSpec.unsafeCast(val.spec.spec),
|
matchOldConfigSpec.unsafeCast(val.spec.spec),
|
||||||
|
|||||||
Reference in New Issue
Block a user