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