← Back to issue list

build: use pnpm as package management system

View original Github issue

Metadata

Project
craft-actions
Number
#63
Type
pull request
State
merged
Author
bepri
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #63 overhauled craft-actions dev tooling: npm to pnpm, Jest to Vitest, added tsc --noEmit typecheck, updated/deprecated eslint, dropped custom prettier config, fixed test linting, removed redundant pack/all scripts. All CI checks passed.

Resolution: closed resolved

Reason: PR #63 was approved by mr-cal ("LGTM") and merged into main with all CI checks green; the codebase now uses pnpm, vitest and the new tsc/eslint setup. Follow-up restructuring promised in the PR description landed separately in PR #73.

Evaluated by: mr-cal-bot

No scores available.

Issue body

A major overhaul of the dev tooling for this repository. - Switches from "bare" npm to the more modern pnpm - I chose between three options: yarn, pnpm, and bun. yarn was the slowest of the three, so I ruled it out early. Between the remaining two, bun has a long history of vibe coding and recently merged a 1M+ LoC diff of vibe-coded rewriting in Rust from Zig, which does not particularly inspire confidence. Thus, pnpm. - Updates the non-prod features - Switched from jest to the drop-in vitest replacement. This is because jest only supports JS, and therefore needed the TS tests to be transpiled first. From what I can tell, vitest is generally more modern and popular today. - Added `tsc --noEmit` to the linting steps, which does the typechecking - Deleted the bespoke prettier config. I still am using prettier, I just hugely prefer the defaults (particularly, I like using double-quotes for strings) - Fixed an issue where tests were not being properly linted - Updated eslint, the version we were using was officially deprecated - Switched to the opinionated defaults for eslint -- the only errors this actually surfaced were "unused var" errors in the tests and requiring me to add `.ts` to import paths of project-local modules. - Updated the TS compiler config to be closer to the defaults so that each individual action can provide their own `indir` and `outdir`s, which will simplify adding more actions in the future. - Removed the `pack` and `all` project scripts - `pack` and `build` were largely redundant in function so I removed one and kept the other - `all` just didn't seem useful as a command ## Remaining work In a future PR, I am going to refactor the file structure of this repository. This will make each individual action in the repository have just one folder associated with it, rather than there being a `src/` and a `rockcraft-pack`, there will just be `rockcraft/pack/src`. Likewise, `dist/` will go away and we will just have `rockcraft/pack/dist/`. Because of these planned changes, this PR intentionally leaves some kind of ugly patterns behind (particularly with the build command) so that work can happen entirely in a separate, focused PR.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #63 overhauled craft-actions dev tooling: npm to pnpm, Jest to Vitest, added tsc --noEmit typecheck, updated/deprecated eslint, dropped custom prettier config, fixed test linting, removed redundant pack/all scripts. All CI checks passed.
stealth/space-bunny-alpha — closed resolved Merged. craft-actions#63 overhauled dev tooling: npm to pnpm, Jest to Vitest, added tsc --noEmit typecheck, modernized ESLint, dropped the custom Prettier config, fixed test linting, and removed the redundant pack/all scripts.
stealth/space-bunny-alpha — closed resolved Merged in canonical/craft-actions#63: replaced npm with pnpm and Jest with Vitest, updated lint/TypeScript tooling, fixed test linting, and removed redundant scripts; file restructuring was deferred.
qwen/qwen3.6-35b-a3b — — Merged. Replaced npm with pnpm, jest with vitest, and updated eslint and TypeScript configs. Removed redundant scripts and fixed test linting. CI passed and review approved. File structure refactoring is deferred to a separate PR.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-actions#73 (confidence 88%)

    Merged follow-up implementing the deferred file-layout refactor (per-action folders, dist/ under each action) explicitly left out of #63.

  • Related To: canonical/craft-actions#61 (confidence 45%)

    Earlier refactor extracting shareable components into common modules, the components #63's TS config change was meant to support.

Related issues

Issue Project State Summary Similarity
#112 chore(deps): update pnpm to v12 craft-actions merged Renovate PR canonical/craft-actions#112 bumped pnpm 11.25.0 -> 12.3.4 (major). Approved by 1 reviewer and merged into main (2 files, +42/-140); all rockcraft-pack-action, test-action-code and Canonical CLA checks passed.
70%