Skip to content

Migrate to nmr script runner #376

Description

@williamthorsen

Problem

The repo uses a hand-rolled scripts/run-workspace-script.ts and custom utility scripts inherited from templates.node-monorepo. These are now superseded by @williamthorsen/nmr, which provides the same functionality as a shared package.

Context

  • Migration guide: Write nmr migration guide for repos based on templates.node-monorepo node-monorepo-tools#82
  • This repo has 3 script files to delete (no helpers/ directory, no sync-pnpm-version.ts)
  • nmr 0.3.0 defaults match existing CI ordering (check:strict then build) — no config override needed
  • fmt:all and fmt:sh are being added to nmr defaults (node-monorepo-tools#83) — omit from repo-specific scripts
  • demo:catwalk is obsolete — remove it
  • @williamthorsen/toolbelt.objects is only used in scripts being deleted — remove from root devDependencies

Solution

Follow the nmr migration guide (steps 1, 3–9; step 2 skipped since no config override is needed):

  1. Install @williamthorsen/nmr as root devDependency
  2. Reduce root package.json scripts to lifecycle hooks + repo-specific scripts:
    • postinstall: nmr report-overrides --quiet; nmr sync-pnpm-version
    • prepare: lefthook install
    • Repo-specific: agents:install, agents:install-launchers
    • Remove: preinstall, demo:catwalk, and all scripts nmr provides as defaults
  3. Update workspace packages: remove ws script, remove default-matching scripts, keep genuine overrides (agents build, factory build/dev/etc.)
  4. Replace consistency tests with runConsistencyChecks(import.meta.dirname)
  5. Delete scripts/run-workspace-script.ts, scripts/assertIsPackageJson.ts, scripts/report-overrides.ts
  6. Remove orphaned root devDep: @williamthorsen/toolbelt.objects
  7. Update .agents/PROJECT.md

Acceptance criteria

  • pnpm install completes (postinstall hook works)
  • nmr ci passes
  • nmr build succeeds per package
  • nmr root:test passes (consistency checks via nmr)
  • No references to run-workspace-script.ts remain
  • No ws script in any workspace package.json
  • @williamthorsen/toolbelt.objects removed from root devDependencies
  • preinstall and demo:catwalk scripts removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions