Add prepare to ensure dist is published by RobbieTheWagner · Pull Request #1705 · shipshapecode/tether

Walkthrough

Adds a prepare script to package.json to run pnpm build, and updates the GitHub Actions workflow to add dependency installation, a Cypress binary cache/restore step, and an explicit Cypress binary installation step before tests.

Changes

Cohort / File(s) Change Summary
Package configuration
package.json
Added "prepare": "pnpm build" script to run build during package preparation.
CI workflow
.github/workflows/main.yml
Reworked steps after Node setup: added an explicit "Install dependencies" step, introduced Cypress binary caching (cache key based on OS and pnpm-lock.yaml with restore-keys), and added an "Install Cypress binary" step before tests.
sequenceDiagram
    autonumber
    participant Runner as GitHub Actions runner
    participant Node as Setup Node
    participant PNPM as pnpm install
    participant Cache as Cypress cache (~/​.cache/Cypress)
    participant Cypress as Cypress binary install
    participant Test as Test step (cypress run)

    Runner->>Node: setup-node (use node-version)
    Node-->>Runner: node available
    Runner->>PNPM: install dependencies (pnpm install)
    PNPM-->>Runner: dependencies installed
    Runner->>Cache: restore cache (key: OS + pnpm-lock.yaml hash)
    alt cache hit
        Cache-->>Runner: cache restored
    else cache miss
        Cache-->>Runner: no cache
    end
    Runner->>Cypress: install Cypress binary
    Cypress-->>Runner: binary installed (and possibly update cache)
    Runner->>Test: run tests (cypress)
    Test-->>Runner: test results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review .github/workflows/main.yml for correctness of cache keys, path, and ordering.
  • Verify prepare script in package.json doesn't cause unexpected build side-effects during installs.
  • Confirm pnpm-related steps and Cypress binary install commands match repository expectations and secrets (if any).

Poem

🐇 I nibbled scripts beneath the tree,
A "prepare" hop for builds to be,
CI caches saved a sprightly cheer,
Cypress wakes — the tests appear! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Add prepare to ensure dist is published' directly reflects the main change: adding a prepare script to package.json that runs 'pnpm build'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prepare

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.