Skip to content

Standardize Makefile commands to package.json scripts #362

Description

@masch

Summary

Currently, several Makefile targets execute tools or scripts directly via bunx, bun run <path-to-script>, or inline bun -e commands instead of invoking defined package scripts. To ensure deterministic environments, version control, and consistent configuration across local development and CI, all executable tool invocations should be encapsulated in package scripts within their respective workspace package.json files (or root package.json).

Problem Description

  • Direct calls to bunx (e.g., bunx expo-doctor, bunx vitest) bypass explicit npm script definitions and risk version drift or unmanaged configuration.
  • Standalone script executions (e.g., bun run scripts/pin-deps.ts) and inline evaluation scripts (bun -e) run outside defined package.json targets.

Proposed Changes

  1. Add explicit npm scripts to workspace/root package.json files for all external tools and internal helper scripts currently executed directly in the Makefile:
    • Mobile app (apps/mobile/package.json): add scripts for Expo tools (prebuild, expo-doctor).
    • API app (apps/api/package.json): add scripts for vitest, sync-translations, test-mp-polling, and DB seeds.
    • Shared/Root (package.json): add root scripts for repository utility scripts (pin-deps, verify-openspec-archived, migrations).
  2. Update Makefile targets to route exclusively through bun run <script-name> or workspace-scoped package scripts (bun --filter <package> run <script-name>).
  3. Audit and remove any raw bunx or direct bun run path/file.ts invocations across all Makefile rules.

Acceptance Criteria

  • All Makefile targets delegate to a corresponding script in a package.json.
  • No direct bunx or loose file path executions remain in Makefile.
  • CI pipeline and local make validate pass cleanly after migration.

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