From 06e01c7e832e4326169222704efbf4eb5a4dc9f8 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 2 Nov 2026 09:58:39 -0500 Subject: [PATCH] chore: use pnpm and pnpm/setup - replace npm with pnpm in CI and docs - use pnpm/setup with .nvmrc, devEngines.packageManager, and the pnpm lockfile - let pnpm/setup install dependencies with the frozen lockfile - keep Python system-managed for the PyGObject live test --- .github/workflows/actions.lock | 12 ++++++------ .github/workflows/ci.yml | 8 +++++--- CONTRIBUTING.md | 12 +++++++++--- README.md | 2 +- package.json | 5 +++++ pnpm-lock.yaml | 9 +++++++++ 6 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 pnpm-lock.yaml diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 0e9a1e7..c5e76da 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -5,8 +5,8 @@ version: 'v0.0.3' workflows: '.github/workflows/ci.yml': - 'actions/checkout@v7.0.1' - - 'actions/setup-node@v7.1.0' - 'actions/upload-artifact@v7.0.2' + - 'pnpm/setup@v3.1.2' '.github/workflows/renovate.yml': [] dependencies: 'actions/checkout@v7.0.1': @@ -14,13 +14,13 @@ dependencies: commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1' owner_id: 44036562 repo_id: 197814629 - 'actions/setup-node@v7.1.0': - ref: 'v7.1.0' - commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1' - owner_id: 44036562 - repo_id: 189476904 'actions/upload-artifact@v7.0.2': ref: 'v7.0.2' commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9' owner_id: 44036562 repo_id: 192625955 + 'pnpm/setup@v3.1.2': + ref: 'v3.1.2' + commit: 'sha1-fa36a5ef7dcdefc3a7cb25655c122e00cf6e636e' + owner_id: 21320719 + repo_id: 1235693694 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df8c739..eed55ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,17 +17,19 @@ jobs: - uses: actions/checkout@v7.0.1 with: persist-credentials: false - - uses: actions/setup-node@v7.1.0 + - uses: pnpm/setup@v3.1.2 with: node-version-file: .nvmrc + cache: true + require-lockfile: true - name: Check syntax and placement behavior run: | node --check gitify/contents/code/main.js bash -n scripts/install.sh scripts/bundle.sh python3 -m py_compile scripts/test-live.py - npm test + pnpm test - name: Bundle KWin script - run: npm run bundle + run: pnpm bundle - uses: actions/upload-artifact@v7.0.2 with: name: gitify-kwin-script diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc5e84c..dcadd54 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,14 +7,20 @@ it does and how to install it, and [Gitify][gitify-repo] for the app itself. ## 🛠️ Development +Install dependencies (Node version from `.nvmrc`): + +```sh +pnpm install +``` + ```sh -npm test -npm run bundle +pnpm test +pnpm bundle ``` Tests run the same script in a JavaScript VM with compositor events and cover panel placement, display boundaries, resizing, repeated opens, and window filtering. -With Gitify installed, run `npm run test:live` inside a Plasma Wayland session. This needs Node 24, Python 3, and PyGObject, provided by `python-gobject` on Arch. It launches Gitify with a temporary profile, measures the window through KWin, and checks placement, resizing, and tray hide/reopen. It tests the installed script if enabled; otherwise, it temporarily loads this checkout's script. It unloads its temporary script and closes the test app when finished. +With Gitify installed, run `pnpm test:live` inside a Plasma Wayland session. This needs Node (see `.nvmrc`), plus system Python 3 and PyGObject, provided by `python-gobject` on Arch. Python is intentionally system-managed because the live test imports the distro's PyGObject. It launches Gitify with a temporary profile, measures the window through KWin, and checks placement, resizing, and tray hide/reopen. It tests the installed script if enabled; otherwise, it temporarily loads this checkout's script. It unloads its temporary script and closes the test app when finished. Building the `.kwinscript` bundle requires Python 3. The bundle contains only the metadata and JavaScript; users do not need Node or Python to run the installed script. diff --git a/README.md b/README.md index de2dfb2..bccff01 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ The installer uses `kpackagetool6`, `kwriteconfig6`, and `qdbus6`. It installs f To update, run `git pull --ff-only` in this checkout and rerun `bash scripts/install.sh`. -Alternatively, build the bundle with `npm run bundle`, which needs Node 24 or newer and Python 3. Import `dist/gitify.kwinscript` through **System Settings → Window Management → KWin Scripts → Install from File**, then enable Gitify and apply. +Alternatively, build the bundle with `pnpm bundle`. The Node version is pinned in `.nvmrc`; Python 3 is provided by your system. Import `dist/gitify.kwinscript` through **System Settings → Window Management → KWin Scripts → Install from File**, then enable Gitify and apply. ### ✅ Check that it works diff --git a/package.json b/package.json index f2e0e5c..1804545 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,11 @@ "name": "node", "version": "26.13.0", "onFail": "warn" + }, + "packageManager": { + "name": "pnpm", + "version": "12.16.1", + "onFail": "download" } }, "engines": { "node": ">=24" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..9b60ae1 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,9 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {}