Skip to content

Commit

Permalink
Use typecheck rule in configure.mjs
Browse files Browse the repository at this point in the history
Use the fact that the new `typecheck` rule will return an object
carrying the validation with it so it can be forwarded into dependent
rules without having to manually specify the `validations` property.

This should have no effect on the `build.ninja` file.
  • Loading branch information
elliotgoodrich committed Mar 24, 2024
1 parent 3dcd46a commit bdaca7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 2 additions & 6 deletions configure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ toposort(
// Type check all the tests
const testTargets = (() => {
if (tests.length !== 0) {
const typechecked = typecheck({
return typecheck({
in: tests,
out: join(cwd, "dist", "typechecked.stamp"),
compilerOptions,
Expand All @@ -297,15 +297,11 @@ toposort(
// Only run this after generating all the TypeScript definition files for the
// library files.
[orderOnlyDeps]: dist,
});

// Individually transpile and run each test
return tests.map((t) => {
}).map((t) => {
const file = getInput(t);
const js = transpile({
in: t,
out: join(cwd, "dist", basename(file, extname(file)) + ".mjs"),
[validations]: () => typechecked,
args: transpileArgs,
});
return test({
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@ninjutsu-build/bun": "^0.1.0",
"@ninjutsu-build/core": "^0.8.5",
"@ninjutsu-build/node": "^0.8.0",
"@ninjutsu-build/tsc": "^0.10.5",
"@ninjutsu-build/tsc": "^0.11.1",
"@types/toposort": "^2.0.7",
"glob": "^10.3.10",
"swc": "^1.0.11",
Expand Down

0 comments on commit bdaca7f

Please sign in to comment.