mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
* feat(node): add support for package.json5 - 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 * feat(example): add node-pnpm-json5 project * 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 * chore: bump node and pnpm versions in json5 example Generated-by: aiautocommit * test: add build plan snapshot for pnpm-json5 project Generated-by: aiautocommit * test: update snapshots * chore(examples): update engine versions and test expectations Generated-by: aiautocommit * chore(deps): update pnpm-lock.yaml Generated-by: aiautocommit * docs: update mise configuration documentation and add package resolution 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 * feat(example): log pnpm version in pnpm workspaces example - 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 * feat(node): support more pnpm lockfile version mapping - 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 * test(node): add tests for pnpm version resolution logic - 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 * docs: move mise installation instruction to workflow section Generated-by: aiautocommit * fix(node): ensure engines.pnpm overrides lockfile version inference - 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
23 lines
674 B
JavaScript
23 lines
674 B
JavaScript
const { execSync } = require('child_process');
|
|
|
|
function getPnpmVersion() {
|
|
const ua = process.env.npm_config_user_agent || "";
|
|
return /\bpnpm\/([^\s]+)/.exec(ua)?.[1] ?? null;
|
|
}
|
|
|
|
console.log(`Node.js version: ${process.version}`);
|
|
|
|
const pnpmVersionFromUA = getPnpmVersion();
|
|
if (pnpmVersionFromUA) {
|
|
console.log(`PNPM version (from user agent): v${pnpmVersionFromUA}`);
|
|
} else {
|
|
console.log('PNPM version (from user agent): not detected');
|
|
}
|
|
|
|
try {
|
|
const pnpmVersion = execSync('pnpm --version', { encoding: 'utf8' }).trim();
|
|
console.log(`PNPM version (from CLI): v${pnpmVersion}`);
|
|
} catch (error) {
|
|
console.log('PNPM version (from CLI): not available');
|
|
}
|