mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
feat: Making the auto config
This commit is contained in:
@@ -1,8 +1,49 @@
|
||||
import { StartSdk } from "../StartSdk"
|
||||
import { setupManifest } from "../manifest/setupManifest"
|
||||
|
||||
export type Manifest = any
|
||||
export const sdk = StartSdk.of()
|
||||
.withManifest({} as any)
|
||||
.withManifest(
|
||||
setupManifest({
|
||||
id: "testOutput",
|
||||
title: "",
|
||||
version: "1.0",
|
||||
releaseNotes: "",
|
||||
license: "",
|
||||
replaces: [],
|
||||
wrapperRepo: "",
|
||||
upstreamRepo: "",
|
||||
supportSite: "",
|
||||
marketingSite: "",
|
||||
donationUrl: null,
|
||||
description: {
|
||||
short: "",
|
||||
long: "",
|
||||
},
|
||||
assets: {
|
||||
icon: "",
|
||||
instructions: "",
|
||||
license: "",
|
||||
},
|
||||
containers: {},
|
||||
volumes: {},
|
||||
alerts: {
|
||||
install: null,
|
||||
update: null,
|
||||
uninstall: null,
|
||||
restore: null,
|
||||
start: null,
|
||||
stop: null,
|
||||
},
|
||||
dependencies: {
|
||||
remoteTest: {
|
||||
description: "",
|
||||
requirement: { how: "", type: "opt-in" },
|
||||
version: "1.0",
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
.withStore<{ storeRoot: { storeLeaf: "value" } }>()
|
||||
.withVault<{ vaultRoot: "value" }>()
|
||||
.build(true)
|
||||
|
||||
27
lib/test/setupAutoConfig.test.ts
Normal file
27
lib/test/setupAutoConfig.test.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { sdk } from "./output.sdk"
|
||||
|
||||
describe("setupAutoConfig", () => {
|
||||
test("test", () => {
|
||||
const testConfig = sdk.Config.of({
|
||||
test: sdk.Value.text({
|
||||
name: "testValue",
|
||||
required: false,
|
||||
}),
|
||||
})
|
||||
|
||||
const testConfig2 = sdk.Config.of({
|
||||
test2: sdk.Value.text({
|
||||
name: "testValue2",
|
||||
required: false,
|
||||
}),
|
||||
})
|
||||
const remoteTest = sdk.AutoConfig.of({
|
||||
localConfig: testConfig,
|
||||
remoteConfig: testConfig2,
|
||||
autoconfig: async ({}) => {},
|
||||
})
|
||||
sdk.setupAutoConfig(testConfig, {
|
||||
remoteTest,
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user