feat(node): support package.json5 manifests#566
Merged
Conversation
- introduce findPackageManifest to prioritize package.json over package.json5 - update dependency detection and installation logic to include package.json5 - ensure local file detection and workspace parsing support the new manifest format Generated-by: aiautocommit
* Add a new example project to demonstrate native pnpm support for package.json5 manifests. * Include a test configuration to verify environment detection and CLI version reporting. Generated-by: aiautocommit
Generated-by: aiautocommit
Generated-by: aiautocommit
Generated-by: aiautocommit
Generated-by: aiautocommit
…ion notes * Update the `install_before` setting name to `minimum_release_age` to match current configuration. * Add clarification on how Railpack handles semver constraints from manifest files by simplifying ranges to major versions. Generated-by: aiautocommit
- Add checks for pnpm version via npm_config_user_agent and the pnpm CLI. - Update test expectations to verify pnpm version reporting. Generated-by: aiautocommit
- Add support for pnpm lockfile versions 6.1 and 9.0 to ensure correct tool version detection. - Refactor the lockfile version check into a switch statement to improve readability and maintainability. - Add logging for cases where the pnpm lockfile version cannot be identified. Generated-by: aiautocommit
- Verify that pnpm versions are correctly derived from pnpm-lock.yaml versioning. - Ensure proper precedence hierarchy between lockfile, engines, and packageManager fields. Generated-by: aiautocommit
Generated-by: aiautocommit
- Reprioritize pnpm version resolution to prefer `engines` over lockfile-based inference. - Lockfile version parsing can be ambiguous across major versions, whereas `engines` provides an explicit developer intent. Generated-by: aiautocommit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pnpm reads
package.json5natively, but Railpack only detected and parsedpackage.json, so JSON5-based Node projects were not recognized.Description
findPackageManifesthelper that searchespackage.jsonthenpackage.json5, withpackage.jsontaking precedence when both exist, and route detection, dependency parsing, install copying, workspace parsing, and local-file detection through it. JSON5 manifests work becauseApp.ReadJSONpipes through hujson, which accepts the comments and trailing commas commonly used in real manifests.engines.pnpmoverrides lockfile-based inference, sincelockfileVersionis ambiguous across major versions whileenginesreflects explicit developer intent.6.0/6.1and9.0formats, including quoted and unquoted forms) and refactor the checks into a switch that warns when a lockfile version can't be identified.Test
node-pnpm-json5example project with a build plan snapshot to exercise nativepackage.json5support end to end.engines, andpackageManagerprecedence hierarchy.node-pnpm-workspacesexample to report the resolved pnpm version for verification.