PAIR-code / PAIR-code/deliberate-lab

build: Add root-level `build:all` / `test:all` npm scripts

Open Beginner friendly
#1,179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:build
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 utils first" 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. The functions workspace's test script is
test:unit && test:firestore, and test:firestore launches the Firebase
emulator, which requires Java 21. Therefore test:all will 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 both build and test scripts, so --if-present on test:all is
    belt-and-suspenders but future-proof.
  • Tests strictly only need utils built (they import
    @deliberation-lab/utils from dist/); functions/frontend compile on
    the fly under jest. build:all is 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:all and test:all added to root package.json.
  • npm ci && npm run build:all && npm run test:all succeeds on a machine
    with Java 21.
  • Root AGENTS.md "Testing" section updated to mention the new scripts
    (optional but recommended).

Contributor guide

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.