mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 04:11:57 +00:00
feat: Remove aggregator in index for export
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
export { CreatedAction, createAction } from "./createAction"
|
import "./createAction"
|
||||||
|
|
||||||
export { setupActions } from "./setupActions"
|
import "./setupActions"
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ export type ReadonlyDeep<A> =
|
|||||||
export type MaybePromise<A> = Promise<A> | A
|
export type MaybePromise<A> = Promise<A> | A
|
||||||
export type Message = string
|
export type Message = string
|
||||||
|
|
||||||
export { AutoConfig } from "./AutoConfig"
|
import "./AutoConfig"
|
||||||
export { setupAutoConfig } from "./setupAutoConfig"
|
import "./setupAutoConfig"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export { Backups } from "./Backups"
|
import "./Backups"
|
||||||
|
|
||||||
export { setupBackups } from "./setupBackups"
|
import "./setupBackups"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { string } from "ts-matches"
|
import { string } from "ts-matches"
|
||||||
import { Backups } from "."
|
import { Backups } from "./Backups"
|
||||||
import { SDKManifest } from "../manifest/ManifestTypes"
|
import { SDKManifest } from "../manifest/ManifestTypes"
|
||||||
import { BackupOptions, ExpectedExports } from "../types"
|
import { BackupOptions, ExpectedExports } from "../types"
|
||||||
import { _ } from "../util"
|
import { _ } from "../util"
|
||||||
|
|||||||
@@ -1,14 +1,4 @@
|
|||||||
import { Config, topConfig } from "./config"
|
import "./config"
|
||||||
import { List } from "./list"
|
import "./list"
|
||||||
import { Value } from "./value"
|
import "./value"
|
||||||
import { Variants } from "./variants"
|
import "./variants"
|
||||||
|
|
||||||
export {
|
|
||||||
/** @typedef { import("./config").Config } Pet
|
|
||||||
*/
|
|
||||||
Config,
|
|
||||||
List,
|
|
||||||
Value,
|
|
||||||
Variants,
|
|
||||||
topConfig,
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
ValueSpecText,
|
ValueSpecText,
|
||||||
ValueSpecTextarea,
|
ValueSpecTextarea,
|
||||||
} from "../configTypes"
|
} from "../configTypes"
|
||||||
import { once } from "../../util"
|
|
||||||
import { DefaultString } from "../configTypes"
|
import { DefaultString } from "../configTypes"
|
||||||
import { _ } from "../../util"
|
import { _ } from "../../util"
|
||||||
import {
|
import {
|
||||||
@@ -23,6 +22,7 @@ import {
|
|||||||
string,
|
string,
|
||||||
unknown,
|
unknown,
|
||||||
} from "ts-matches"
|
} from "ts-matches"
|
||||||
|
import { once } from "../../util/once"
|
||||||
|
|
||||||
type RequiredDefault<A> =
|
type RequiredDefault<A> =
|
||||||
| false
|
| false
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { InputSpec, ValueSpecUnion } from "../configTypes"
|
import { InputSpec, ValueSpecUnion } from "../configTypes"
|
||||||
import { Config } from "."
|
import { LazyBuild, Config } from "./config"
|
||||||
import { LazyBuild } from "./config"
|
|
||||||
import { Parser, anyOf, literals, object } from "ts-matches"
|
import { Parser, anyOf, literals, object } from "ts-matches"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { SmtpValue } from "../types"
|
import { SmtpValue } from "../types"
|
||||||
import { Config, Value, Variants, topConfig } from "./builder"
|
import { Config } from "./builder/config"
|
||||||
|
import { Value } from "./builder/value"
|
||||||
|
import { Variants } from "./builder/variants"
|
||||||
|
|
||||||
export const smtpConfig = Value.union(
|
export const smtpConfig = Value.union(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export * as configBuilder from "./builder"
|
import "./builder"
|
||||||
|
|
||||||
export { setupConfig } from "./setupConfig"
|
import "./setupConfig"
|
||||||
export * as dependencies from "./dependencies"
|
import "./dependencies"
|
||||||
export * as constants from "./constants"
|
import "./constants"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Config } from "./builder"
|
|
||||||
import { DeepPartial, Dependencies, Effects, ExpectedExports } from "../types"
|
import { DeepPartial, Dependencies, Effects, ExpectedExports } from "../types"
|
||||||
import { InputSpec } from "./configTypes"
|
import { InputSpec } from "./configTypes"
|
||||||
import { Utils, nullIfEmpty, once, utils } from "../util"
|
|
||||||
import { SDKManifest } from "../manifest/ManifestTypes"
|
import { SDKManifest } from "../manifest/ManifestTypes"
|
||||||
import * as D from "./dependencies"
|
import * as D from "./dependencies"
|
||||||
import { ExtractConfigType } from "./builder/config"
|
import { Config, ExtractConfigType } from "./builder/config"
|
||||||
|
import { Utils, utils } from "../util"
|
||||||
|
import nullIfEmpty from "../util/nullIfEmpty"
|
||||||
|
|
||||||
declare const dependencyProof: unique symbol
|
declare const dependencyProof: unique symbol
|
||||||
export type DependenciesReceipt = void & {
|
export type DependenciesReceipt = void & {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export * as checkFns from "./checkFns"
|
import "./checkFns"
|
||||||
export * as trigger from "./trigger"
|
import "./trigger"
|
||||||
|
|
||||||
export { TriggerInput } from "./trigger/TriggerInput"
|
import "./trigger/TriggerInput"
|
||||||
export { HealthReceipt } from "./HealthReceipt"
|
import "./HealthReceipt"
|
||||||
export { ReadyProof } from "../mainFn/ReadyProof"
|
import "../mainFn/ReadyProof"
|
||||||
|
|||||||
36
lib/index.ts
36
lib/index.ts
@@ -1,18 +1,18 @@
|
|||||||
export * as backup from "./backup"
|
import "./backup"
|
||||||
export * as config from "./config"
|
import "./config"
|
||||||
export * as configBuilder from "./config/builder"
|
import "./config/builder"
|
||||||
export * as configTypes from "./config/configTypes"
|
import "./config/configTypes"
|
||||||
export * as health from "./health"
|
import "./health"
|
||||||
export * as healthUtil from "./health/checkFns"
|
import "./health/checkFns"
|
||||||
export * as mainFn from "./mainFn"
|
import "./mainFn"
|
||||||
export * as matches from "ts-matches"
|
import "ts-matches"
|
||||||
export * as T from "./types"
|
import "./types"
|
||||||
export * as TOML from "@iarna/toml"
|
import "@iarna/toml"
|
||||||
export * as Types from "./types"
|
import "./types"
|
||||||
export * as util from "./util"
|
import "./util"
|
||||||
export * as YAML from "yaml"
|
import "yaml"
|
||||||
export * as properties from "./properties"
|
import "./properties"
|
||||||
export * as autoconfig from "./autoconfig"
|
import "./autoconfig"
|
||||||
export * as actions from "./actions"
|
import "./actions"
|
||||||
export * as manifest from "./manifest"
|
import "./manifest"
|
||||||
export * as inits from "./inits"
|
import "./inits"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export { setupInit } from "./setupInit"
|
import "./setupInit"
|
||||||
export { setupUninstall } from "./setupUninstall"
|
import "./setupUninstall"
|
||||||
export { setupInstall } from "./setupInstall"
|
import "./setupInstall"
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Effects, ExpectedExports } from "../types"
|
import { Effects, ExpectedExports } from "../types"
|
||||||
import { Utils, utils } from "../util"
|
import { Utils, utils } from "../util"
|
||||||
import { Daemons } from "./Daemons"
|
import { Daemons } from "./Daemons"
|
||||||
export * as network from "./exportInterfaces"
|
import "./exportInterfaces"
|
||||||
export { LocalBinding } from "./LocalBinding"
|
import "./LocalBinding"
|
||||||
export { LocalPort } from "./LocalPort"
|
import "./LocalPort"
|
||||||
export { NetworkBuilder } from "./NetworkBuilder"
|
import "./NetworkBuilder"
|
||||||
export { NetworkInterfaceBuilder } from "./NetworkInterfaceBuilder"
|
import "./NetworkInterfaceBuilder"
|
||||||
export { Origin } from "./Origin"
|
import "./Origin"
|
||||||
export { TorBinding } from "./TorBinding"
|
import "./TorBinding"
|
||||||
export { TorHostname } from "./TorHostname"
|
import "./TorHostname"
|
||||||
|
|
||||||
export { Daemons } from "./Daemons"
|
import "./Daemons"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to ensure that the main function is running with the valid proofs.
|
* Used to ensure that the main function is running with the valid proofs.
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { setupManifest } from "./setupManifest"
|
import "./setupManifest"
|
||||||
export * as ManifestTypes from "./ManifestTypes"
|
import "./ManifestTypes"
|
||||||
|
|||||||
@@ -2,10 +2,8 @@ import { ExpectedExports, Properties } from "../types"
|
|||||||
|
|
||||||
import { PropertyGroup } from "./PropertyGroup"
|
import { PropertyGroup } from "./PropertyGroup"
|
||||||
import { PropertyString } from "./PropertyString"
|
import { PropertyString } from "./PropertyString"
|
||||||
export { PropertyGroup } from "./PropertyGroup"
|
import "./PropertyGroup"
|
||||||
export { PropertyString } from "./PropertyString"
|
import "./PropertyString"
|
||||||
|
|
||||||
export const test = ""
|
|
||||||
|
|
||||||
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any
|
export type UnionToIntersection<T> = ((x: T) => any) extends (x: infer R) => any
|
||||||
? R
|
? R
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import {
|
|||||||
UnionValueKey,
|
UnionValueKey,
|
||||||
unionValueKey,
|
unionValueKey,
|
||||||
} from "../config/configTypes"
|
} from "../config/configTypes"
|
||||||
import { deepMerge } from "../util"
|
|
||||||
import { ConfigSpec, matchConfigSpec } from "./output"
|
import { ConfigSpec, matchConfigSpec } from "./output"
|
||||||
import * as _I from "../index"
|
import * as _I from "../index"
|
||||||
import { camelCase } from "../../scripts/oldSpecToBuilder"
|
import { camelCase } from "../../scripts/oldSpecToBuilder"
|
||||||
|
import { deepMerge } from "../util/deepMerge"
|
||||||
|
|
||||||
export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T
|
export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T
|
||||||
? 1
|
? 1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { deepEqual } from "../util"
|
import { deepEqual } from "../util/deepEqual"
|
||||||
import { deepMerge } from "../util/deepMerge"
|
import { deepMerge } from "../util/deepMerge"
|
||||||
|
|
||||||
describe("deepMerge", () => {
|
describe("deepMerge", () => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { T } from ".."
|
import { Effects } from "../types"
|
||||||
import { utils } from "../util"
|
import { utils } from "../util"
|
||||||
|
|
||||||
type WrapperType = {
|
type WrapperType = {
|
||||||
@@ -13,106 +13,101 @@ const noop = () => {}
|
|||||||
describe("wrapperData", () => {
|
describe("wrapperData", () => {
|
||||||
test("types", async () => {
|
test("types", async () => {
|
||||||
;async () => {
|
;async () => {
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("/config", {
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData("/config", {
|
||||||
someValue: "a",
|
someValue: "a",
|
||||||
})
|
})
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData(
|
||||||
"/config/someValue",
|
"/config/someValue",
|
||||||
"b",
|
"b",
|
||||||
)
|
)
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData("", {
|
||||||
config: { someValue: "b" },
|
config: { someValue: "b" },
|
||||||
})
|
})
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData(
|
||||||
"/config/someValue",
|
"/config/someValue",
|
||||||
|
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
5,
|
5,
|
||||||
)
|
)
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData(
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
"/config/someVae3lue",
|
"/config/someVae3lue",
|
||||||
"someValue",
|
"someValue",
|
||||||
)
|
)
|
||||||
|
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
todo<Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
||||||
path: "/config/someValue",
|
path: "/config/someValue",
|
||||||
value: "b",
|
value: "b",
|
||||||
})
|
})
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/some2Value">({
|
todo<Effects>().setWrapperData<WrapperType, "/config/some2Value">({
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
path: "/config/someValue",
|
path: "/config/someValue",
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
value: "someValueIn",
|
value: "someValueIn",
|
||||||
})
|
})
|
||||||
todo<T.Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
todo<Effects>().setWrapperData<WrapperType, "/config/someValue">({
|
||||||
//@ts-expect-error Path is wrong
|
//@ts-expect-error Path is wrong
|
||||||
path: "/config/some2Value",
|
path: "/config/some2Value",
|
||||||
value: "a",
|
value: "a",
|
||||||
})
|
})
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
.const()) satisfies string
|
.const()) satisfies string
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<Effects>())
|
||||||
.getOwnWrapperData("/config")
|
.getOwnWrapperData("/config")
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
await utils<WrapperType, {}>(todo<T.Effects>())
|
await utils<WrapperType, {}>(todo<Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/somdsfeValue")
|
.getOwnWrapperData("/config/somdsfeValue")
|
||||||
.const()
|
.const()
|
||||||
/// ----------------- ERRORS -----------------
|
/// ----------------- ERRORS -----------------
|
||||||
|
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData("", {
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData("", {
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
config: { someValue: "notInAOrB" },
|
config: { someValue: "notInAOrB" },
|
||||||
})
|
})
|
||||||
utils<WrapperType>(todo<T.Effects>()).setOwnWrapperData(
|
utils<WrapperType>(todo<Effects>()).setOwnWrapperData(
|
||||||
"/config/someValue",
|
"/config/someValue",
|
||||||
// @ts-expect-error Type is wrong for the setting value
|
// @ts-expect-error Type is wrong for the setting value
|
||||||
"notInAOrB",
|
"notInAOrB",
|
||||||
)
|
)
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()) satisfies string
|
.const()) satisfies string
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<Effects>())
|
||||||
.getOwnWrapperData("/config")
|
.getOwnWrapperData("/config")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
await utils<WrapperType>(todo<T.Effects>())
|
await utils<WrapperType>(todo<Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/somdsfeValue")
|
.getOwnWrapperData("/config/somdsfeValue")
|
||||||
// @ts-expect-error Const should normally not be callable
|
// @ts-expect-error Const should normally not be callable
|
||||||
.const()
|
.const()
|
||||||
|
|
||||||
///
|
///
|
||||||
;(await utils<WrapperType>(todo<T.Effects>())
|
;(await utils<WrapperType>(todo<Effects>())
|
||||||
.getOwnWrapperData("/config/someValue")
|
.getOwnWrapperData("/config/someValue")
|
||||||
// @ts-expect-error satisfies type is wrong
|
// @ts-expect-error satisfies type is wrong
|
||||||
.const()) satisfies number
|
.const()) satisfies number
|
||||||
;(await utils<WrapperType, {}>(todo<T.Effects>())
|
;(await utils<WrapperType, {}>(todo<Effects>())
|
||||||
// @ts-expect-error Path is wrong
|
// @ts-expect-error Path is wrong
|
||||||
.getOwnWrapperData("/config/")
|
.getOwnWrapperData("/config/")
|
||||||
.const()) satisfies WrapperType["config"]
|
.const()) satisfies WrapperType["config"]
|
||||||
;(await todo<T.Effects>().getWrapperData<
|
;(await todo<Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
||||||
WrapperType,
|
|
||||||
"/config/someValue"
|
|
||||||
>({
|
|
||||||
path: "/config/someValue",
|
path: "/config/someValue",
|
||||||
callback: noop,
|
callback: noop,
|
||||||
})) satisfies string
|
})) satisfies string
|
||||||
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
await todo<Effects>().getWrapperData<WrapperType, "/config/someValue">({
|
||||||
// @ts-expect-error Path is wrong as in it doesn't match above
|
// @ts-expect-error Path is wrong as in it doesn't match above
|
||||||
path: "/config/someV2alue",
|
path: "/config/someV2alue",
|
||||||
callback: noop,
|
callback: noop,
|
||||||
})
|
})
|
||||||
await todo<T.Effects>().getWrapperData<WrapperType, "/config/someV2alue">(
|
await todo<Effects>().getWrapperData<WrapperType, "/config/someV2alue">({
|
||||||
{
|
// @ts-expect-error Path is wrong as in it doesn't exists in wrapper type
|
||||||
// @ts-expect-error Path is wrong as in it doesn't exists in wrapper type
|
path: "/config/someV2alue",
|
||||||
path: "/config/someV2alue",
|
callback: noop,
|
||||||
callback: noop,
|
})
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,16 +8,19 @@ import {
|
|||||||
checkPortListening,
|
checkPortListening,
|
||||||
checkWebUrl,
|
checkWebUrl,
|
||||||
} from "../health/checkFns"
|
} from "../health/checkFns"
|
||||||
import { LocalBinding, LocalPort, NetworkBuilder, TorHostname } from "../mainFn"
|
|
||||||
import { ExtractWrapperData } from "../types"
|
import { ExtractWrapperData } from "../types"
|
||||||
import { GetSystemSmtp } from "./GetSystemSmtp"
|
import { GetSystemSmtp } from "./GetSystemSmtp"
|
||||||
|
|
||||||
export { default as nullIfEmpty } from "./nullIfEmpty"
|
import "./nullIfEmpty"
|
||||||
export { FileHelper } from "./fileHelper"
|
import "./fileHelper"
|
||||||
export { getWrapperData } from "./getWrapperData"
|
import "./getWrapperData"
|
||||||
export { deepEqual } from "./deepEqual"
|
import "./deepEqual"
|
||||||
export { deepMerge } from "./deepMerge"
|
import "./deepMerge"
|
||||||
export { once } from "./once"
|
import "./once"
|
||||||
|
import { LocalBinding } from "../mainFn/LocalBinding"
|
||||||
|
import { LocalPort } from "../mainFn/LocalPort"
|
||||||
|
import { NetworkBuilder } from "../mainFn/NetworkBuilder"
|
||||||
|
import { TorHostname } from "../mainFn/TorHostname"
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
export type FlattenIntersection<T> =
|
export type FlattenIntersection<T> =
|
||||||
|
|||||||
Reference in New Issue
Block a user