Skip to content

ci: allow devDependencies that are production transitives - #3671

Merged
setchy merged 1 commit into
mainfrom
ci/fix-dev-dependency-check
Nov 10, 2026
Merged

setchy merged 1 commit into
mainfrom
ci/fix-dev-dependency-check

Conversation

@setchy

@setchy setchy commented Nov 10, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the false positive that is currently failing every build: [FAIL] Packaged dependency surface is invalid: Dev-only package must not ship: semver.

A package can be both a direct devDependency and a production transitive. FORBIDDEN_PACKAGES is now derived as:

devDependencies − production closure

where the production closure comes from pnpm list --prod --depth Infinity --json (everything reachable from dependencies, including transitives).

Why

semver is declared as a devDependency for tooling and pulled in by electron-updater, so electron-builder ships it legitimately. The previous rule rejected it purely because the name appears in devDependencies. The same would happen for any shared transitive (debug, ms, js-yaml, sax, …).

Genuinely dev-only packages are still rejected: renderer libraries that Vite bundles, build tooling, and type packages.

Verification

Run against a real packaged asar (a sibling Electron app using this same script):

  • baseline → [PASS] Packaged dependency surface is valid.
  • with semver added to devDependencies (the failing case) → [PASS], because semver is in the production closure
  • against an artifact that shipped renderer packages → still [FAIL], naming each of them

oxfmt --check passes; no runtime or packaging changes.

The packaged dependency check treated every `devDependencies` entry as
forbidden. A package can legitimately be both: a direct devDependency used by
build scripts and a transitive of a runtime dependency. `semver` is one
example — declared for tooling and also pulled in by electron-updater — and it
currently fails the check on every build.

Subtract the production closure (`pnpm list --prod --depth Infinity --json`)
from `devDependencies`, so only packages that exist purely for development are
rejected. Genuinely dev-only packages (renderer libraries Vite bundles, build
tooling, type packages) are still flagged.
@setchy
setchy requested a review from afonsojramos as a code owner November 10, 2026 06:43
@github-actions github-actions Bot added the build Build, action or package manager changes label Nov 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@setchy
setchy merged commit 370d19d into main Nov 10, 2026
19 checks passed
@setchy
setchy deleted the ci/fix-dev-dependency-check branch November 10, 2026 06:56
@github-actions github-actions Bot added this to the Release 8.1.0 milestone Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in Gitify v8.1.0! 🎉

Downloads for macOS, Windows, and Linux are available on the release page.

Thanks for helping make Gitify better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, action or package manager changes

Development

Successfully merging this pull request may close these issues.

1 participant