Vendored pnpm deployments
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- go, node.js
- Bereich
- build-system
Rechercherichtung
Start in src/nodejs/supply/supply.go, especially BuildDependencies(), the PNPM interface, and the package-manager selection cases. Compare the existing NPM.Rebuild() implementation in src/nodejs/npm/npm.go; then inspect the supply tests for vendored and pnpm behavior. Done means a vendored pnpm deployment invokes pnpm rebuild rather than pnpm install.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Vendored pnpm deployments run pnpm install instead of pnpm rebuild
Summary
Since v1.9.5 pnpm is officially supported (big thanks) but pnpm projects with a pre-populated node_modules/ (vendored deployments) incorrectly run pnpm install --no-frozen-lockfile instead of pnpm rebuild.
There are two distinct bugs in BuildDependencies().
Bug 1 — case s.UsePNPM has priority over case s.IsVendored
switch {
case s.UseYarn: // L343
s.Yarn.Build(...)
case s.UsePNPM: // L348 ← matched first, PNPM.Build() runs
s.PNPM.Build(...)
case s.IsVendored: // L353 ← never reached when pnpm-lock.yaml is present
s.NPM.Rebuild(...)
...
}
When both flags are set:
s.UsePNPM = true—pnpm-lock.yamlexistss.IsVendored = true—node_modules/exists
PNPM.Build() runs pnpm install, ignoring the pre-populated node_modules/.
Bug 2 — case s.IsVendored hardcodes NPM.Rebuild() regardless of package manager
Even if the ordering were fixed, case s.IsVendored at
supply.go#L353
always calls s.NPM.Rebuild(). A vendored pnpm project should call PNPM.Rebuild(),
which would also require adding Rebuild(string) error to the
PNPM interface at L51–L53
(today only Build(string, string) error exists),
mirroring npm/npm.go#L34–L51.
The same gap likely exists for Yarn vendored deployments.
Use case
We use pnpm deploy --prod to produce a flat node_modules/ layout compatible with the CF buildpack, then push the archive.
The buildpack should detect the pre-populated node_modules/ and skip the install phase, running pnpm rebuild instead to recompile any native addons for the CF stack.
How to reproduce
- Create a minimal pnpm workspace with a
pnpm-lock.yamland a pre-populatednode_modules/. - Run the buildpack supply step.
- Expected:
pnpm rebuildis called. - Actual:
pnpm install --no-frozen-lockfileis called.
- Vorherrschende Sprache
- Go
- Sterne
- 173
- Forks
- 389
- Ø Merge
- 2 T. 14 Std.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudfoundry/nodejs-buildpack
-
unscheduled
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
cloudfoundry/nodejs-buildpack#683 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
cloudfoundry/nodejs-buildpack#923 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 48/100
cloudfoundry/nodejs-buildpack#852 ·
Maintainer antworten meist innerhalb von 1 Tag
-
unscheduled
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
cloudfoundry/nodejs-buildpack#655 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Supply step do not retry when error is connection reset by peerEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenunscheduled
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
cloudfoundry/nodejs-buildpack#626 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in cloudfoundry/nodejs-buildpack
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
praetorian-inc/augustus#334 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
TestTOMLBigFileParsesInLinearTime: a 1s wall-clock bound on a 3 MB parse fails under load (1.27s)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
peasant-labs/village#293 ·
Maintainer antworten meist innerhalb von 1 Tag