mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
feat: respect pnpm minimumReleaseAge from pnpm-workspace.yaml
When invoked as the pnpm/pnpx shim, walk up from cwd looking for pnpm-workspace.yaml (or a pnpm field in package.json) and use its minimumReleaseAge and minimumReleaseAgeExclude as the floor and exclusion list. Existing CLI args, env vars, and ~/.safe-chain/config.json still override, so the project's pnpm config can act as a single source of truth without forcing users to duplicate settings across two systems. Fixes #460 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
65a8075b0e
commit
8ac7c722b8
7 changed files with 906 additions and 3 deletions
23
packages/safe-chain/src/config/packageManagerName.js
Normal file
23
packages/safe-chain/src/config/packageManagerName.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* Tracks the package manager name (e.g. "pnpm", "npm", "yarn") that this
|
||||
* invocation is shimming. Stored as a small standalone module so that
|
||||
* lightweight config readers can branch on it without transitively importing
|
||||
* the heavy package-manager creator graph.
|
||||
*/
|
||||
|
||||
/** @type {{name: string | null}} */
|
||||
const state = { name: null };
|
||||
|
||||
/**
|
||||
* @param {string | null} name
|
||||
*/
|
||||
export function setPackageManagerName(name) {
|
||||
state.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string | null}
|
||||
*/
|
||||
export function getPackageManagerName() {
|
||||
return state.name;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue