Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build/tasks/verify/verify-html-valid-for-vnu.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import vnu from 'vnu-jar';

const htmlFiles = await glob(['_site/**.html', '!node_modules/']);

// vnu responds to being given no files by printing its entire usage page and
// exiting non-zero, which buries the actual problem: this task checks the
// built site, and there is nothing built to check.
if (htmlFiles.length === 0) {
console.error('No HTML under _site/ to check. Run `nps build` first.');
process.exit(1);
}

let exitCode = 0;
const scripts = [`java -jar ${vnu} ${htmlFiles.join(' ')}`];

Expand Down
5 changes: 4 additions & 1 deletion package-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ scripts:
buildStyles: tsx build/tasks/compile/build-styles.mts
siteifyHealthFiles: tsx build/tasks/compile/siteify-health-files.mts
verify:
all: 'rc=0; for i in build/tasks/verify/*.mts; do tsx "$i" || rc=1; done; exit $rc'
# Announces each task and names the ones that failed. Without this the
# output is a wall of tool chatter with no indication of which of the
# thirteen produced it.
all: 'rc=0; failed=; for i in build/tasks/verify/*.mts; do echo "==> $i"; tsx "$i" || { rc=1; failed="$failed $i"; }; done; [ -z "$failed" ] || echo "FAILED:$failed" >&2; exit $rc'
browserslist: tsx build/tasks/verify/verify-browserslist.mts
scss: tsx build/tasks/verify/verify-scss.mts
dockerfile: tsx build/tasks/verify/verify-dockerfile.mts
Expand Down