From ec5b0906ba090e253927bbf97f259863c6730b69 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sun, 8 Feb 2026 08:04:24 +0100 Subject: [PATCH] fix(loadConfig): correct config file extensions from .js to .json and update loading method --- src/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 57d39e3..7514208 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ +import { readFile } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import { pathToFileURL } from "node:url"; export function getUserConfigDir() { if (process.platform === "win32") { @@ -18,11 +18,11 @@ export async function loadConfig(type) { switch (configType) { case "public": case "p": - configFileName = "public-config.js"; + configFileName = "public-config.json"; break; case "confidential": case "c": - configFileName = "confidential-config.js"; + configFileName = "confidential-config.json"; break; default: configFileName = null; @@ -35,7 +35,6 @@ export async function loadConfig(type) { } const configPath = path.join(configBaseDir, "sk-az-tools", configFileName); - const configUrl = pathToFileURL(configPath).href; - const { config } = await import(configUrl); - return config; + const configJson = await readFile(configPath, "utf8"); + return JSON.parse(configJson); }