Skip to main content
chaptertechnical-review

Toolchains, package contracts and reproducible delivery

Learning outcome​

Explain what the build consumes, what it emits, and which inputs determine correctness. Reproduce a release from a clean lockfile before comparing developer-server speed.

Modern tooling model​

The workbench uses Vite with React, Tailwind and StyleX transforms; the Next project uses its framework-native production build; the Worker uses Wrangler's bundling and compatibility configuration. These are versioned tracks, not a claim that one bundler should replace every other project. A compiler migration must preserve module resolution, CSS extraction, environment replacement, source maps and deployment output.

Keep Node and package-manager requirements explicit. Install from lockfiles in CI. A monorepo task cache is correct only if its key covers source, dependencies, tool versions, relevant environment/configuration and generated inputs. A green cache hit can serve the wrong brand stylesheet when the brand input was omitted.

Package boundary experiment​

A workspace import can accidentally read source files absent from the package tarball. Test the packed artifact with declared exports, peers and distributed CSS in independent consumers. Check both runtime and type resolution. Mark side-effectful stylesheet imports correctly so production tree shaking does not silently remove them.

Avoid exporting internal server modules from a browser entry point. A server-only guard in the Next data module helps expose an accidental client import during build. Package boundaries and lint rules complement this guard; they do not replace endpoint authorization.

Tests chosen by failure cost​

LayerValuable assertionWeak substitute
Pure unitReplay, parser, token graph, cache racesTests that duplicate a helper's implementation
Service/databaseAtomic receipt and authorization invariantsMocking away every database operation
HTTPLost response, status, cookie/header contractChecking that an API function exists
BrowserFocus, identity switch, queued edits, reconnectScreenshot of the initial happy state
Build/packageIndependent production consumersDevelopment server starts

Use fault injection for meaningful boundary failures. Keep tests deterministic where possible and attach traces for browser failures. Installing a browser is an environment prerequisite; a missing executable is not a successful test or an application defect.

Exercise and expected answer​

Create a generated theme file controlled by a configuration input. Reproduce a stale build by omitting that input from a sample task key; repair the key and prove the artifact changes. Then inspect a package tarball and build a second consumer from it. Record the dependency versions and commands alongside the result.

For release, preserve old assets, make schema changes backward-compatible during overlap, and define a rollback that does not discard accepted work. Agent-assisted changes need the same evidence: bounded diff, explicit commands, failure fixtures and review. Human technical/editorial review and learner pilots remain separate from automated checks.

Executable reference and sources​

Implementation · Behavioral evidence · Primary source.

Run the projects and assessment. Human review is pending.