Skip to content

Commit

Permalink
feat: added @oh/config - fix #96 (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
pagoru authored Oct 3, 2024
1 parent f172c41 commit 4dbbb91
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 45 deletions.
1 change: 1 addition & 0 deletions app/server/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"imports": {
"@oh/queue": "jsr:@oh/[email protected]",
"@oh/updater": "jsr:@oh/[email protected]",
"@oh/config": "jsr:@oh/[email protected]",

"shared/": "./src/shared/",
"system/": "./src/system/",
Expand Down
32 changes: 31 additions & 1 deletion app/server/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 0 additions & 41 deletions app/server/src/shared/utils/config.utils.ts

This file was deleted.

1 change: 0 additions & 1 deletion app/server/src/shared/utils/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from "./request.utils.ts";
export * from "./cors.utils.ts";
export * from "./random.utils.ts";
export * from "./config.utils.ts";
export * from "./directory.utils.ts";
export * from "./yaml.utils.ts";
export * from "./envs.utils.ts";
Expand Down
5 changes: 3 additions & 2 deletions app/server/src/system/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { db } from "./db.ts";
import { api } from "./api.ts";
import { ConfigTypes, Envs } from "shared/types/main.ts";
import { getConfig as $getConfig } from "shared/utils/main.ts";
import { getConfig as $getConfig } from "@oh/config";
import { load as loadUpdater } from "modules/updater/main.ts";
import { captcha } from "./captcha.ts";
import { email } from "./email.ts";
import { otp } from "./otp.ts";
import { tasks } from "./tasks.ts";
import { sessions } from "./sessions.ts";
import { CONFIG_DEFAULT } from "shared/consts/config.consts.ts";

export const System = (() => {
const $db = db();
Expand All @@ -24,7 +25,7 @@ export const System = (() => {
const load = async (envs: Envs) => {
if (await loadUpdater(envs)) return;

$config = await $getConfig();
$config = await $getConfig<ConfigTypes>(CONFIG_DEFAULT);
$envs = envs;

$tasks.load();
Expand Down

0 comments on commit 4dbbb91

Please sign in to comment.