Skip to content

Commit

Permalink
fix(config): only use node-compatible packages
Browse files Browse the repository at this point in the history
  • Loading branch information
finxol committed Dec 15, 2024
1 parent cf540c5 commit 855cb46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/config/deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"imports": {
"@std/fs": "jsr:@std/fs@^1.0.6",
"@std/path": "jsr:@std/path@^1.0.8",
"@std/yaml": "jsr:@std/yaml@^1.0.5"
"yaml": "npm:yaml@^2.6.1"
}
}
2 changes: 1 addition & 1 deletion packages/config/karr_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
application_name: Karr Auth
application_name: Karr Demo

database:
name: karr
Expand Down
12 changes: 8 additions & 4 deletions packages/config/src/importer.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { parse } from "@std/yaml"
import { dirname, fromFileUrl, join } from "@std/path"
import { existsSync } from "@std/fs"
import { parse } from "yaml"
//deno-lint-ignore no-external-import
import { dirname, join } from "node:path"
//deno-lint-ignore no-external-import
import { existsSync } from "node:fs"
//deno-lint-ignore no-external-import
import { fileURLToPath } from "node:url"
import { logger } from "@util"

import defaultConfig from "./default_config.json" with { type: "json" }

type Config = typeof defaultConfig

function resolvePath(file: string) {
return join(dirname(fromFileUrl(import.meta.url)), file)
return join(dirname(fileURLToPath(import.meta.url)), file)
}

function parseFile(file: string = "../karr_config.yaml") {
Expand Down

0 comments on commit 855cb46

Please sign in to comment.