PAIR-code / PAIR-code/deliberate-lab
build: Add root-level `build:all` / `test:all` npm scripts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 96
- Forks
- 40
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 20
Description
Summary
The root package.json currently exposes only three
scripts (doctor, prepare, update-schemas). There is no single command
to build and test the whole monorepo. Contributors evaluating a PR must
manually chain per-workspace commands and remember the correct ordering
(utils must build first).
This issue proposes adding two convenience aggregate scripts to the root
package.json so a full local check mirrors what CI does.
Motivation
- Discoverability: A newcomer can run one command instead of learning the
workspace build/test ordering. - Correctness: Encodes the "build
utilsfirst" rule so downstream
workspaces (functions,frontend) pick up compiled output in
utils/dist/. - PR evaluation: Gives a canonical "full test" invocation.
Proposed changes
Add the following entries to the scripts block of the root package.json:
"build:all": "npm run build -w utils && npm run build -w functions && npm run build -w frontend",
"test:all": "npm test --workspaces --if-present"
Rationale per script
| Script | What it does | Notes |
|---|---|---|
build:all |
Builds utils, then functions, then frontend, in order |
Explicit ordering guarantees utils/dist/ exists before downstream builds. Avoided npm run build --workspaces because it would build utils twice. |
test:all |
Runs each workspace's test script |
Faithful to CI's test deployment type. Requires Java 21 (see caveat). |
Full-test invocation
The intended "run everything" command becomes:
npm ci && npm run build:all && npm run test:all
Caveats / things to verify
[!IMPORTANT]
Java 21 requirement. Thefunctionsworkspace'stestscript is
test:unit && test:firestore, andtest:firestorelaunches the Firebase
emulator, which requires Java 21. Thereforetest:allwill fail on a
machine without Java 21. This is intentional: a full test run mirrors CI.
Contributors who need to scope down (e.g. a PR that doesn't touch
functions) can run individual workspace commands directly, e.g.
npm run test:unit -w functions.
- The three workspaces (
utils,functions,frontend) each currently
define bothbuildandtestscripts, so--if-presentontest:allis
belt-and-suspenders but future-proof. - Tests strictly only need
utilsbuilt (they import
@deliberation-lab/utilsfromdist/);functions/frontendcompile on
the fly under jest.build:allis intentionally broader so it also catches
build/compile errors during a PR eval. - Consider whether the documented workflow in the root
AGENTS.md
("Testing" section) should be updated to reference these new scripts.
Acceptance criteria
-
build:allandtest:alladded to rootpackage.json. -
npm ci && npm run build:all && npm run test:allsucceeds on a machine
with Java 21. - Root
AGENTS.md"Testing" section updated to mention the new scripts
(optional but recommended).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Edit the scripts block in the root package.json, and review the Testing section of AGENTS.md for the optional documentation update. Start by inspecting the existing workspace scripts, then run npm ci followed by npm run build:all and npm run test:all on a machine with Java 21. Done means both aggregate scripts exist and the full command succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100