Jobber/scripts/smoke-resolve-shared.mjs
ilia f5179304c1
Some checks failed
CI / Linting (Biome) (push) Failing after 41s
CI / Tests (push) Successful in 5m27s
CI / Type Check (adzuna-extractor) (push) Successful in 1m9s
CI / Type Check (gradcracker-extractor) (push) Successful in 1m13s
CI / Type Check (hiringcafe-extractor) (push) Successful in 1m9s
CI / Type Check (orchestrator) (push) Successful in 1m24s
CI / Type Check (startupjobs-extractor) (push) Successful in 1m8s
CI / Type Check (ukvisajobs-extractor) (push) Successful in 1m9s
CI / Documentation (push) Successful in 1m59s
feat(discovery): blocked countries filter and smoke subprocess fixes
Add blockedCountries in Settings so pipeline discovery drops jobs whose
location mentions listed countries (existing discovered rows are kept).
Document the feature, fix smoke tsconfig inheritance for nested extractors,
and run smoke via an absolute-tsconfig wrapper.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 11:41:29 -04:00

29 lines
1.0 KiB
JavaScript

/**
* ESM resolve hook: map `@shared/foo.js` → `shared/src/foo.ts` for smoke-extractors.
* Extractor manifests use tsconfig path aliases; plain `tsx` does not apply them to
* dynamic `import()` unless each package's tsconfig includes `manifest.ts`.
*/
import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), "..");
const sharedSrc = join(repoRoot, "shared", "src");
export async function resolve(specifier, context, nextResolve) {
if (specifier.startsWith("@shared/")) {
const subpath = specifier.slice("@shared/".length).replace(/\.js$/i, "");
const candidates = [
join(sharedSrc, `${subpath}.ts`),
join(sharedSrc, `${subpath}.tsx`),
join(sharedSrc, subpath, "index.ts"),
];
for (const filePath of candidates) {
if (existsSync(filePath)) {
return nextResolve(pathToFileURL(filePath).href, context);
}
}
}
return nextResolve(specifier, context);
}