Skip to content
Website

Cross-Platform Rules

This page is for contributors writing code, scripts, or tests in Patchwork.

  1. No Docker: Everything runs natively on Windows 10/11 and Linux (Ubuntu 22.04/24.04, Debian 12; x64 & arm64).
  2. All scripts are Node.js: Write all tooling in .mjs or .ts. Do not add .sh, .bat, or .ps1 scripts. Keep package.json scripts shell-agnostic (cross-env, scripts/run-chain.mjs).
  3. Single platform helper: Only scripts/lib/platform.mjs and src/lib/platform.ts may read process.platform or process.arch.
  4. Path & process safety: Always use Node path APIs, os.tmpdir(), shell: false on spawn/execFileSync, and sanitizeFilename() for user-facing or exported filenames.
  5. LF line endings: Keep LF (\n) across code, generated configs, and SQL per .gitattributes and .editorconfig.
  6. Testing & CI: Run tests against patchwork_test and a temporary MinIO data directory. CI (.github/workflows/ci.yml and .github/workflows/docs.yml) verifies both ubuntu-latest and windows-latest.

Every script, build, and test suite runs identically on Windows PowerShell and Linux bash.