build: one tsc -b build and a source export condition (P2.1)

- tsconfig.build.json references the nine in-scope packages; each package
  is composite and references the workspace packages it depends on.
  build:packages is now `tsc -b tsconfig.build.json` instead of a chain
  of cd commands.
- Every in-scope package exports its TypeScript entry under a `source`
  condition next to the dist/ entries. Vitest, tsx (dev:server, the
  Tauri dev launch, the e2e server), the sidecar and launcher bundles and
  the web app resolve it, so none of them needs build:packages first or
  can pick up a stale dist/. The vitest src aliases remain only for the
  excluded packages that have no source export.
- Published packages with a files list (agent, cli, marketplace) pack
  src/ too, so the source condition never points at a missing file.
- tsconfig.tests.json and `npm run typecheck:tests` type-check the test
  suites of the in-scope packages. They report 426 existing errors, so
  the CI step is advisory for now.
- The root test run leaves out the excluded and postponed packages
  (hive-mind-*, memory-mcp, wiki-compiler, team-server, waggle-dance,
  worker, weaver); they are not built either.
- CI runs the test job on Ubuntu, macOS and Windows with Node 22.23.2
  (ADR-0008), and no longer builds the hook runtime and the memory MCP
  server.
This commit is contained in:
shumeiko.it
2026-10-24 17:14:29 +02:00
parent bbfb3c7f82
commit 23431550ae
32 changed files with 205 additions and 103 deletions

View File

@@ -6,14 +6,20 @@ on:
branches: [main]
jobs:
# Runs on the three desktop platforms of the community edition (P1.3b, P2.1).
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
# The Node version the installer and the desktop app ship (ADR-0008).
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4
@@ -23,24 +29,23 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-
# NOTE: the switch to `npm ci` (deterministic, lockfile-faithful) is deferred
# to the deps/lockfile hardening pass, after the root package-lock.json is
# regenerated in sync with every workspace manifest. `npm install` is the
# safe, lockfile-tolerant install until then.
- run: npm install
env:
ONNXRUNTIME_NODE_INSTALL_CUDA: skip
# Real typecheck gate. The old step ran `npx tsc --noEmit` against the root
# tsconfig.json, whose `"files": ["apps/web/src/vite-env.d.ts"]` (and no
# `include`) typechecks essentially nothing. build:packages is the actual
# `tsc --build` chain for every @waggle/* package (shared → hive-mind-core →
# core → agent → server) and also emits the dist/ that apps/web unit tests
# import; typecheck:web is the real apps/web check (tsc -p tsconfig.app.json).
- name: Type check — workspace packages (tsc --build chain)
# One `tsc -b` over the project references in tsconfig.build.json: every
# in-scope @waggle/* package, in dependency order.
- name: Type check — workspace packages (tsc -b)
run: npm run build:packages
- name: Type check — web (apps/web, tsc -p tsconfig.app.json)
run: npm run typecheck:web
# Advisory until the existing test type errors are fixed.
- name: Type check — tests (tsconfig.tests.json)
run: npm run typecheck:tests
continue-on-error: true
- name: Lint (root flat config)
run: npm run lint
@@ -54,39 +59,31 @@ jobs:
# dist/ payload explicitly so CI proves a fresh checkout.
- name: Build package-install test runtimes
run: |
npm run build:hook-runtime
npm run build --workspace @waggle/cli
npm run build --workspace @waggle-ai/waggle
npm run build --workspace waggle-memory-mcp
- name: Unit tests — packages + cross-cutting (root vitest)
run: |
npm test -- \
--exclude=packages/cli/tests/cli-runtime.test.ts \
--exclude=packages/marketplace/tests/cli-runtime.test.ts \
--exclude=packages/hive-mind-cli/tests/cli-help.test.ts \
--exclude=packages/hive-mind-mcp-server/tests/runtime.test.ts \
--exclude=packages/launcher/tests/cli.test.ts \
--exclude=packages/memory-mcp/tests/runtime.test.ts \
--maxWorkers=2
run: >-
npm test --
--exclude=packages/cli/tests/cli-runtime.test.ts
--exclude=packages/marketplace/tests/cli-runtime.test.ts
--exclude=packages/launcher/tests/cli.test.ts
--maxWorkers=2
# These tests each create a temporary project and run npm install. Running
# several cold installs in parallel makes individual test timeouts measure
# runner contention rather than package correctness.
- name: Package-install runtime tests (serial)
run: |
npx vitest run \
packages/cli/tests/cli-runtime.test.ts \
packages/marketplace/tests/cli-runtime.test.ts \
packages/hive-mind-cli/tests/cli-help.test.ts \
packages/hive-mind-mcp-server/tests/runtime.test.ts \
packages/launcher/tests/cli.test.ts \
packages/memory-mcp/tests/runtime.test.ts \
--maxWorkers=1 \
--no-file-parallelism
run: >-
npx vitest run
packages/cli/tests/cli-runtime.test.ts
packages/marketplace/tests/cli-runtime.test.ts
packages/launcher/tests/cli.test.ts
--maxWorkers=1
--no-file-parallelism
# The root vitest.config.ts excludes `apps/**`, so apps/web's own 131-file
# suite never ran in CI. Run it via its own vitest config (jsdom). Blocking.
# The root vitest.config.ts excludes `apps/**`; apps/web runs its own
# suite (jsdom).
- name: Unit tests — apps/web
run: npm run test -w apps/web
@@ -110,7 +107,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4
@@ -143,7 +140,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22.23.2
- name: Cache npm dependencies
uses: actions/cache@v4