refactor(packages): extract utils package

This commit is contained in:
YeonGyu-Kim
2026-05-21 00:31:03 +09:00
parent c4fe747e15
commit a5c1d71001
52 changed files with 717 additions and 508 deletions
+8 -2
View File
@@ -283,7 +283,10 @@ export function loadPluginConfig(
): OhMyOpenCodeConfig {
const userConfigDirs = [...getOpenCodeConfigDirs({ binary: "opencode" })].reverse()
const userConfigLayers = userConfigDirs.map((configDir) => {
const detected = detectPluginConfigFile(configDir)
const detected = detectPluginConfigFile(configDir, {
basenames: [CONFIG_BASENAME],
legacyBasenames: [LEGACY_CONFIG_BASENAME],
})
if (detected.legacyPath) {
log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
@@ -318,7 +321,10 @@ export function loadPluginConfig(
const canonicalAncestorPathsNearestFirst = ancestorConfigPathsNearestFirst.map(
(ancestorPath) => {
const opencodeDir = path.dirname(ancestorPath)
const ancestorDetected = detectPluginConfigFile(opencodeDir)
const ancestorDetected = detectPluginConfigFile(opencodeDir, {
basenames: [CONFIG_BASENAME],
legacyBasenames: [LEGACY_CONFIG_BASENAME],
})
if (ancestorDetected.legacyPath) {
log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
canonicalPath: ancestorDetected.path,