(Init): Added shit
This commit is contained in:
106
crates/shared/mod.ts
Normal file
106
crates/shared/mod.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* @elly/shared — Public API barrel.
|
||||
*
|
||||
* Both `@elly/core` and `@elly/bot` import from here. This barrel is the only
|
||||
* sanctioned cross-crate surface. Anything not re-exported is considered
|
||||
* implementation detail and may change without notice.
|
||||
*/
|
||||
|
||||
// ----- Config --------------------------------------------------------
|
||||
export {
|
||||
ApiSchema,
|
||||
BotSchema,
|
||||
ChannelsSchema,
|
||||
ColorsSchema,
|
||||
ConfigSchema,
|
||||
DatabaseSchema,
|
||||
FeaturesSchema,
|
||||
GuildSchema,
|
||||
IpcSchema,
|
||||
KvSchema,
|
||||
LimitsSchema,
|
||||
LoggingSchema,
|
||||
RolesSchema,
|
||||
} from "./src/config/schema.ts";
|
||||
export type { Config } from "./src/config/schema.ts";
|
||||
export type {
|
||||
ApiConfig,
|
||||
BotConfig,
|
||||
ChannelsConfig,
|
||||
ColorsConfig,
|
||||
ConfigInput,
|
||||
DatabaseConfig,
|
||||
FeaturesConfig,
|
||||
GuildConfig,
|
||||
IpcConfig,
|
||||
KvConfig,
|
||||
LimitsConfig,
|
||||
LoggingConfig,
|
||||
RolesConfig,
|
||||
} from "./src/config/types.ts";
|
||||
export { loadConfig, validateConfig } from "./src/config/loader.ts";
|
||||
export {
|
||||
BotEnvSchema,
|
||||
CoreEnvSchema,
|
||||
loadEnv,
|
||||
SharedEnvSchema,
|
||||
} from "./src/config/env.ts";
|
||||
export type { BotEnv, CoreEnv, SharedEnv } from "./src/config/env.ts";
|
||||
export {
|
||||
ConfigError,
|
||||
ConfigValidationError,
|
||||
EnvValidationError,
|
||||
} from "./src/config/errors.ts";
|
||||
export type { ConfigValidationIssue } from "./src/config/errors.ts";
|
||||
|
||||
// ----- Logger --------------------------------------------------------
|
||||
export { createConsoleLogger, createLogger } from "./src/logger/factory.ts";
|
||||
export { LOG_LEVEL_ORDER } from "./src/logger/types.ts";
|
||||
export type {
|
||||
LogFileOptions,
|
||||
Logger,
|
||||
LoggerOptions,
|
||||
LogLevel,
|
||||
LogRecord,
|
||||
} from "./src/logger/types.ts";
|
||||
|
||||
// ----- IPC contract --------------------------------------------------
|
||||
export {
|
||||
IPC_AUTH_HEADER,
|
||||
IPC_REQUEST_ID_HEADER,
|
||||
IpcRoutes,
|
||||
} from "./src/ipc/routes.ts";
|
||||
export type { IpcRoute } from "./src/ipc/routes.ts";
|
||||
export {
|
||||
IPC_ERROR_STATUS,
|
||||
IpcError,
|
||||
IpcErrorBodySchema,
|
||||
IpcErrorCode,
|
||||
} from "./src/ipc/errors.ts";
|
||||
export type { IpcErrorBody } from "./src/ipc/errors.ts";
|
||||
export {
|
||||
AnyDomainEventSchema,
|
||||
HeartbeatEventSchema,
|
||||
ServerReadyEventSchema,
|
||||
} from "./src/ipc/events.ts";
|
||||
export type {
|
||||
AnyDomainEvent,
|
||||
BaseDomainEvent,
|
||||
DomainEventType,
|
||||
HeartbeatEvent,
|
||||
ServerReadyEvent,
|
||||
} from "./src/ipc/events.ts";
|
||||
|
||||
// ----- Util ----------------------------------------------------------
|
||||
export {
|
||||
err,
|
||||
isErr,
|
||||
isOk,
|
||||
map,
|
||||
mapErr,
|
||||
ok,
|
||||
tryCatch,
|
||||
tryCatchAsync,
|
||||
unwrap,
|
||||
} from "./src/util/result.ts";
|
||||
export type { Err, Ok, Result } from "./src/util/result.ts";
|
||||
Reference in New Issue
Block a user