mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-30 20:00:55 +08:00
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>
20 lines
712 B
JavaScript
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);
|
|
}
|