Files
ARTEX/web/scripts/alias-loader.mjs
T
BaaRaiandsisantaChhatoi 759802d41e refactor(web): shared reducer slices; useReducer for the function pages (#603)
Rebased onto origin/main (becc47a) keeping URL query state (useQueryState /
useRecordHistory from #641) as the single source of truth across all six
function pages (assets, commands, findings, llm-records, traffic, workspace):
each reducer initializes from and resynchronizes with the URL (including
back/forward), and handlers write to the URL then dispatch.

Preserves all existing web test scripts and wires test:reducers into CI and
scripts/verify.sh.

Co-authored-by: sisantaChhatoi <sisantachhatoi@gmail.com>
2026-11-29 01:02:27 +01:00

20 lines
712 B
JavaScript

// Node module hooks for running TypeScript tests with `node --test`: resolves the
// "@/..." path alias (tsconfig "paths") to src/, adding the ".ts" extension that the
// bundler normally infers. Registered by scripts/register-alias.mjs.
const SRC = new URL("../src/", import.meta.url);
export async function resolve(specifier, context, nextResolve) {
if (specifier.startsWith("@/")) {
const base = new URL(specifier.slice(2), SRC).href;
for (const candidate of [base, `${base}.ts`, `${base}.tsx`, `${base}/index.ts`]) {
try {
return await nextResolve(candidate, context);
} catch {
// try the next candidate
}
}
}
return nextResolve(specifier, context);
}