- Created src/shared/config-errors.ts to isolate config error state management - Removed function re-exports (getConfigLoadErrors, clearConfigLoadErrors) from main index.ts - Only ConfigLoadError type is re-exported from main module to avoid OpenCode calling it as a plugin - Updated auto-update-checker hook to import from shared/config-errors instead of main index - Fixes "TypeError: undefined is not an object" crash when OpenCode iterated through ALL exports and called clearConfigLoadErrors(input) which returned undefined 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
19 lines
375 B
TypeScript
19 lines
375 B
TypeScript
export type ConfigLoadError = {
|
|
path: string
|
|
error: string
|
|
}
|
|
|
|
let configLoadErrors: ConfigLoadError[] = []
|
|
|
|
export function getConfigLoadErrors(): ConfigLoadError[] {
|
|
return configLoadErrors
|
|
}
|
|
|
|
export function clearConfigLoadErrors(): void {
|
|
configLoadErrors = []
|
|
}
|
|
|
|
export function addConfigLoadError(error: ConfigLoadError): void {
|
|
configLoadErrors.push(error)
|
|
}
|