Qiskit / Qiskit/documentation

Call node-based checks from a node script rather than Python

Open
#3,699 1 comment 0 reactions 1 assignee View on GitHub

@GantaRoja is already working on this.

Since Aug 12, 2025.

infra 🏗️
Dominant language
Jupyter Notebook
Stars
106
Forks
223
Avg merge
1d 8h
Merged PRs (30d)
72

Description

There's quite a large overhead to starting up a node script. For example, npm run check:orphan-pages takes ~1.4s on my machine, but console.time shows we only spend ~30ms in the main function. Some of that will be transpiling time, which we can't improve, but some it is avoidable overhead of running many scripts.

We could trim quite a few seconds off ./check simply by having a single node script that calls many checks' main functions, rather than having many separate node scripts.

That is, rather than

npm run check:markdown
npm run check:spelling
npm run check:orphan-pages
# etc.

We'd just have one command (name TBD) that has a single script that calls the main functions of each of these scripts:

zxMain(async () => {
  await checkSpelling();
  await checkMarkdown();
  await checkOrphanPages()
  // etc.
});

This should be a relatively simple fix:

  • First, remove process.exit from the scripts and have them export their main function rather than executing it. You could maybe have each main function return it's exit code instead.
  • For the checks that accept it, pass through the apis argument as an input to their function
  • Update ./check and .github/workflows to use this new meta-script

Once that's working, consider using Promise.all to run the checks asynchronously.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.