Route all feature requests through business API modules, sync generated DTOs, and add communication tests and architecture documentation. BREAKING CHANGE: migrate the client to plural resource paths, canonical snake_case fields, ISO timestamps, and explicit paginated responses.
17 lines
651 B
JavaScript
17 lines
651 B
JavaScript
import { registerHooks } from 'node:module'
|
|
import { existsSync } from 'node:fs'
|
|
|
|
const source = new URL('../src/', import.meta.url)
|
|
registerHooks({
|
|
resolve(specifier, context, nextResolve) {
|
|
if (specifier.startsWith('@/')) {
|
|
return nextResolve(new URL(`${specifier.slice(2)}.ts`, source).href, context)
|
|
}
|
|
if (specifier.startsWith('.') && context.parentURL?.startsWith(source.href)) {
|
|
const candidate = new URL(`${specifier}.ts`, context.parentURL)
|
|
if (existsSync(candidate)) return nextResolve(candidate.href, context)
|
|
}
|
|
return nextResolve(specifier, context)
|
|
},
|
|
})
|