Check for pnpm v10 `pnpm.onlyBuiltDependencies` for certain packages

Aperta
#620 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
next.js, typescript

Direzione di ricerca

Start by tracing the existing Preflight checks and how they read package.json. Identify packages such as sharp and bcrypt that require lifecycle builds, then validate the pnpm.onlyBuiltDependencies configuration against those packages. Done means pnpm v10 projects receive a useful failure or warning when required entries are missing.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Alternative to https://github.com/upleveled/eslint-config-upleveled/issues/488

Currently, some lifecycle scripts (build scripts) of packages like sharp and bcrypt are not allowed in pnpm v10, and result in errors like the following Ignored build scripts error:

$ pnpm install
Lockfile is up to date, resolution step is skipped
Progress: resolved 1, reused 0, downloaded 0, added 0
Packages: +814
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 814, reused 0, downloaded 69, added 66

...

Ignored build scripts: sharp. Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.

Done in 13.8s

A student not including sharp in their Next.js project will mostly appear to work properly, but pages will most likely be slow to load, due to Next.js falling back to slower non-native image optimization.

To avoid this, add a Preflight check to:

  1. Check package.json for packages which should be built, like sharp and bcrypt
  2. Make sure that students have configured the pnpm.onlyBuiltDependencies correctly (like the example below) for such packages
{
  "pnpm": {
    "overrides": {
      "@emotion/react": "11.14.0",
      "@emotion/styled": "11.14.0",
      "@tailwindcss/node": "4.0.1",
      "@tailwindcss/oxide": "4.0.1",
      "@types/react": "19.0.8",
      "@types/react-dom": "19.0.3"
    },
    "patchedDependencies": {
      "next": "patches/next.patch"
    },
    "onlyBuiltDependencies": [
      "sharp"
    ]
  }
}
Lingua principale
TypeScript
Stelle
14
Fork
3
Merge medio
11h 46m
PR unite (30g)
10

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di upleveled/preflight

Tutte le issue di upleveled/preflight

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.