mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
- Enforce oxlint and oxfmt for owned JavaScript and TypeScript with independent CI checks. - Preserve compiler import boundaries and protected fixtures while cleaning up lint findings. - Standardize source formatting and validate import, fixture, and embedded-source protections.
29 lines
918 B
TypeScript
29 lines
918 B
TypeScript
import { globSync } from "node:fs";
|
|
import { basename, join } from "node:path";
|
|
import { test } from "vitest";
|
|
import { balancedShardSelect } from "./shard.js";
|
|
import { checkEffectFixture } from "./effect-runner.js";
|
|
import fixtureCosts from "./effect-costs.json";
|
|
|
|
const sanitize = process.env["SCRIPTC_SAN"] === "1";
|
|
const fixtures = globSync(join(import.meta.dirname, "../fixtures/effect/*.ts")).sort();
|
|
const costs: Record<string, number> = fixtureCosts;
|
|
const cases = balancedShardSelect(
|
|
fixtures,
|
|
(file) => basename(file),
|
|
(file) => costs[basename(file)] ?? 120,
|
|
);
|
|
const concurrent = process.env["SCRIPTC_EFFECT_TEST_CONCURRENCY"] === "2";
|
|
|
|
test.for(cases)(
|
|
"published Effect %s matches Node statically",
|
|
{ concurrent, timeout: 600_000 },
|
|
async (entry) => {
|
|
await checkEffectFixture(
|
|
entry,
|
|
["effect", "fast-check", "pure-rand"],
|
|
sanitize ? "dev" : "release",
|
|
);
|
|
},
|
|
);
|