Skip to content

Migrate frontend/cordova to pnpm 11 + add CI#47

Open
Gabrielpanga wants to merge 1 commit into
masterfrom
feat/cordova-pnpm
Open

Migrate frontend/cordova to pnpm 11 + add CI#47
Gabrielpanga wants to merge 1 commit into
masterfrom
feat/cordova-pnpm

Conversation

@Gabrielpanga
Copy link
Copy Markdown
Member

Summary

Last npm-only project in the frontend tree. Brings `frontend/cordova` onto the same pnpm 11 supply-chain hardening every other migrated project uses, plus adds the per-project CI workflow.

pnpm setup

`package.json`

  • `packageManager: pnpm@11.1.1`
  • `engines: { node: >=24.0.0, pnpm: >=11.0.0 }`
  • `devEngines.runtime` with `onFail: error`
  • `scripts.preinstall: pnpm audit && pnpm audit signatures`
  • `scripts.lint:lockfile: pnpm install --frozen-lockfile`
  • `lint` / `test` / `build` → echo-only stubs with messages explaining why CI can't really lint/test/build a Cordova project. `www/` is plain HTML/CSS/JS and `cordova build ios` requires Xcode on macOS — not what GitHub-hosted Linux runners can do.

`pnpm-workspace.yaml` — full safety stack: `minimumReleaseAge: 20160` (14d), `engineStrict`, `trustPolicy: no-downgrade` + 90d ignore, `blockExoticSubdeps`, `savePrefix: ""`, `resolutionMode: highest`, `minimumReleaseAgeExclude: ['@pluggyai/*']`, `allowBuilds: {}`.

`.gitignore` — blocks `package-lock.json` and `yarn.lock`. `.npmrc` removed.

Why no overrides / minimumReleaseAgeExclude entries for the source-level findings

Dependabot's open alerts against this project's old `package-lock.json` flagged `lodash`, `@xmldom/xmldom`, `braces`, `minimatch` as high. All four are transitives of `cordova-ios@7.0.0` (via `cordova-common`, `plist`, `fast-glob`, `micromatch`). With pnpm's fresh resolution they pick the latest patched versions automatically — `pnpm audit` against the new `pnpm-lock.yaml` reports 0 vulnerabilities, no manual overrides needed.

CI workflow

`.github/workflows/cordova-ci.yml` — path-filtered, concurrency-cancelled. Same shape as the other per-project workflows (`pnpm install --frozen-lockfile` → lint → test → build). The three echo steps are deliberate placeholders; the actual gate is the `preinstall` audit + signature check.

Verification

  • `pnpm install --frozen-lockfile` succeeds, preinstall hook clean
  • `pnpm audit` reports 0 vulnerabilities (was 7 high on the old npm lockfile)
  • `pnpm run lint` / `test` / `build` all exit 0

Last npm-only project in the frontend tree. Same pnpm 11
supply-chain hardening as the rest of the migrated projects.

package.json
- packageManager: pnpm@11.1.1
- engines: node >=24.0.0, pnpm >=11.0.0
- devEngines.runtime with onFail: error
- preinstall: pnpm audit && pnpm audit signatures
- lint:lockfile: pnpm install --frozen-lockfile
- lint / test / build: echo-only stubs with messages explaining why
  CI can't really lint/test/build a Cordova project (www/ is plain
  HTML/CSS/JS; cordova build ios needs Xcode on macOS)

pnpm-workspace.yaml — full safety stack:
- minimumReleaseAge: 20160 (14d)
- minimumReleaseAgeIgnoreMissingTime: true
- minimumReleaseAgeExclude: @pluggyai/*
- engineStrict: true
- trustPolicy: no-downgrade, trustPolicyIgnoreAfter 90d
- blockExoticSubdeps: true
- savePrefix: ""
- resolutionMode: highest
- allowBuilds: {} (no postinstall scripts in resolved tree)

.gitignore — block package-lock.json and yarn.lock
.npmrc removed
package-lock.json removed; pnpm-lock.yaml added

The previously-Dependabot-flagged transitives (lodash, @xmldom/xmldom,
braces, minimatch) are present in the dep tree only because cordova-ios
pulls them in, but the pnpm-resolved versions are all patched
(`pnpm audit` reports 0 vulnerabilities).

CI workflow: install with preinstall audit + signatures, then run the
echo-only lint/test/build for parity with the other project workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant