From 06e01c7e832e4326169222704efbf4eb5a4dc9f8 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 2 Nov 2026 09:58:39 -0500 Subject: [PATCH 1/2] 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: + + .: {} From f90aec9fca1fec5dcab64dbcf7ad01505f6c79a5 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 2 Nov 2026 09:59:59 -0500 Subject: [PATCH 2/2] chore: add oxlint - add oxlint and a minimal .oxlintrc.json - add lint, lint:check, and lint:ci (GitHub annotations) - run pnpm lint:ci in CI - document the lint commands --- .github/workflows/ci.yml | 2 + .oxlintrc.json | 4 + CONTRIBUTING.md | 3 + package.json | 8 +- pnpm-lock.yaml | 224 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 .oxlintrc.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eed55ef..57e07d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: node-version-file: .nvmrc cache: true require-lockfile: true + - name: Lint + run: pnpm lint:ci - name: Check syntax and placement behavior run: | node --check gitify/contents/code/main.js diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..01172ab --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,4 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "ignorePatterns": ["dist/**"] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcadd54..26ef3ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,10 +14,13 @@ pnpm install ``` ```sh +pnpm lint:check pnpm test pnpm bundle ``` +CI runs `pnpm lint:ci`, which adds GitHub annotations to lint findings. + 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 `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. diff --git a/package.json b/package.json index 1804545..bfa9666 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,9 @@ "license": "MIT", "type": "module", "scripts": { + "lint": "oxlint --fix", + "lint:check": "oxlint", + "lint:ci": "oxlint --format=github", "test": "node --test --test-isolation=none tests/*.test.js", "test:live": "python3 scripts/test-live.py", "bundle": "bash scripts/bundle.sh" @@ -22,5 +25,8 @@ "onFail": "download" } }, - "engines": { "node": ">=24" } + "engines": { "node": ">=24" }, + "devDependencies": { + "oxlint": "1.90.0" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9b60ae1..3fa3dbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,4 +6,226 @@ settings: importers: - .: {} + .: + devDependencies: + oxlint: + specifier: 1.90.0 + version: 1.90.0 + +packages: + + '@oxlint/binding-android-arm-eabi@1.90.0': + resolution: {integrity: sha512-sgfalb1HuxYjiAa4wESZ626z1FGusqNcXYHyB5oIOEprS2sbPg0UYEfo83uF1GNG70DIfZxHkXuE6KFrlSdn8Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.90.0': + resolution: {integrity: sha512-RcKhz1ETMq+fazE9TKS2+5NIRGwigm/nW8egqF0LI+A8Yw2iW5r0E/C3XAPRiwIm/vcPiutIRIa6IQCIKhZsTQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.90.0': + resolution: {integrity: sha512-PSrxMvP6mx+p1karZcUxLdy9lpaP+JWQPti4al9FgTaPhxE+pT/BjhGExloVVSWgZgIfOlLOjVyyq8BXlodhLQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.90.0': + resolution: {integrity: sha512-OLbU9qsrV2Q8QxT2OEzOPdO8zCCpyI8qB+hDI8yr6RsYELtkf0FAZhJdfjM/RnLHKzt44HWwAPnk92vBtKofvw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.90.0': + resolution: {integrity: sha512-fBA4pWyVDARmNucQqpyFuPC49xYf1r+sX7dxPL5fNPQrSMLum39Sn56tZ9JPleWC7FzLPwSQ7plYYfirYBHF8A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.90.0': + resolution: {integrity: sha512-zhxH78eP2nR6/pGdhBc7MIfjhhcgATeu8fkmkFJbuzfk6Cj0FzBxyEhL85yDqrCybjx+G2YDzZGsxIO9kvO4Iw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.90.0': + resolution: {integrity: sha512-MvYmpHyJqUJjEvkZbJHdwfdL45cGn8EVBkYmoXFiaYFW9suoD3dbJl5mBdpy0DVgdjlyddmldbRtk3cCgETadQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.90.0': + resolution: {integrity: sha512-L13Sy+Kg0nZhwTsToniqjUFPA2TuM6962qCZ5Wp5KeB517Tw7ApdLTTtlb+bF86fcZZa2EtvCVvAJxk4Dya/MQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-arm64-musl@1.90.0': + resolution: {integrity: sha512-wFDdZWGpzIPFdJFjSLWnKB0TGzFriTKUIrl04iMqMyM9BBIJTuerfCHYa0WpDSjr5x3lcW/CHLyacSt886WpGg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-ppc64-gnu@1.90.0': + resolution: {integrity: sha512-FRywfn+MoKn8xpBSzgNwNVliSKRI2QXkxi/iF7o6FEQs8Bh8z2RpVTaFAcO3pchXjvB2eGNFIoLLQABIQ+u7VA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.90.0': + resolution: {integrity: sha512-IS2PaUgpc/qeLADTyhUNmdx3x4ijs9pjJdPKBYHaT+mAE7k3FsjnHPTjhpsak1b++h6CIPhv6WX9Z+y7Pw0voQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.90.0': + resolution: {integrity: sha512-s7JFKRkGS8O7i2ZVODfuO++NC7sH6HDqpMn8lYxw91w0SXJOxnAVjQ8utvmDwLMMT0jaSkuOKuUYJDGDtu4sHQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.90.0': + resolution: {integrity: sha512-b0GxrOQr5VONCkd7KLSqmP6b6nqZuTpuS8QPQHzltmqdXP5bY0Jl0CZ0QmlCTrS3ExaLYbioFYOARzNbYvcApQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.90.0': + resolution: {integrity: sha512-iaJeShJtgUp8rZbt9YUdTAGOpmX5KogCLba17Jp1tWdJ3F4M3D2g2TKUyI1FMTHxKH9NNHuQcuC2kZRg6IV7yQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-musl@1.90.0': + resolution: {integrity: sha512-/aZoXnL5WBLCXuzfHqvEFXcm4iwYmr/cYByHDTXzLFzJdE5DC7bm6phpWqHv6BeqpVgY9IpBAxGDv2WEkl5JCg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxlint/binding-openharmony-arm64@1.90.0': + resolution: {integrity: sha512-SMhk7ozwoxYDKfYqGZCQEfULOKDneF9uhaoIf2neoDLWvNtjY9yVeL7YHmE5L9WdKvMpWNwwZxhenxBu6AgfOg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.90.0': + resolution: {integrity: sha512-KBvR3A9fO7fCi2vCP8ifWvlia7tGEQV9NaYh+IGwa/7Groy48Mt/UaYqMK9/zOtAWl20BUCf6RPqzJ32fRw33Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.90.0': + resolution: {integrity: sha512-+x42rDHQGbTCuT3EzpWAzhP3NoVPE/cJsG4gnrakOSg0olV+GCdMpPU23Nvrl3zZMnXxFZdTtDv4D3SuaA5ZeQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.90.0': + resolution: {integrity: sha512-30JiaFEBUB9peEOcvVM8ggo88SoN/IdSr9DW505JdBji/R6dM66gKEiG65hw6qcaF2f4mO0cEJ+RwRZprmun9g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + oxlint@1.90.0: + resolution: {integrity: sha512-RkTN9EmgIUpLuhNoLhO3OliMGJlvb3Dk7XVjBZnfoMCHrVpuz5ESd97klfiyYeV7XfA2lNLnDCPMkUI+Qw5How==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=7.0.2005' + vite-plus: '*' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + vite-plus: + optional: true + +snapshots: + + '@oxlint/binding-android-arm-eabi@1.90.0': + optional: true + + '@oxlint/binding-android-arm64@1.90.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.90.0': + optional: true + + '@oxlint/binding-darwin-x64@1.90.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.90.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.90.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.90.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.90.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.90.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.90.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.90.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.90.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.90.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.90.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.90.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.90.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.90.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.90.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.90.0': + optional: true + + oxlint@1.90.0: + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.90.0 + '@oxlint/binding-android-arm64': 1.90.0 + '@oxlint/binding-darwin-arm64': 1.90.0 + '@oxlint/binding-darwin-x64': 1.90.0 + '@oxlint/binding-freebsd-x64': 1.90.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.90.0 + '@oxlint/binding-linux-arm-musleabihf': 1.90.0 + '@oxlint/binding-linux-arm64-gnu': 1.90.0 + '@oxlint/binding-linux-arm64-musl': 1.90.0 + '@oxlint/binding-linux-ppc64-gnu': 1.90.0 + '@oxlint/binding-linux-riscv64-gnu': 1.90.0 + '@oxlint/binding-linux-riscv64-musl': 1.90.0 + '@oxlint/binding-linux-s390x-gnu': 1.90.0 + '@oxlint/binding-linux-x64-gnu': 1.90.0 + '@oxlint/binding-linux-x64-musl': 1.90.0 + '@oxlint/binding-openharmony-arm64': 1.90.0 + '@oxlint/binding-win32-arm64-msvc': 1.90.0 + '@oxlint/binding-win32-ia32-msvc': 1.90.0 + '@oxlint/binding-win32-x64-msvc': 1.90.0