MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / isPackageManaged

Function isPackageManaged

packages/bumpy/src/core/config.ts:184–212  ·  view source on GitHub ↗
(
  pkgName: string,
  isPrivate: boolean,
  config: BumpyConfig,
  pkgBumpy?: PackageConfig,
)

Source from the content-addressed store, hash-verified

182
183/**
184 * Determine if a package should be managed by bumpy.
185 * Resolution order:
186 * 1. Per-package `managed: false` → skip (explicit opt-out)
187 * 2. `config.ignore` glob match → skip
188 * 3. Per-package `managed: true` → include (explicit opt-in, overrides private)
189 * 4. `config.include` glob match → include (overrides private)
190 * 5. Private package + `config.privatePackages.version` false → skip
191 * 6. Otherwise → include
192 */
193export function isPackageManaged(
194 pkgName: string,
195 isPrivate: boolean,
196 config: BumpyConfig,
197 pkgBumpy?: PackageConfig,
198): boolean {
199 // 1. Explicit opt-out via per-package config
200 if (pkgBumpy?.managed === false) return false;
201
202 // 2. Ignored by glob
203 if (config.ignore.some((pattern) => matchGlob(pkgName, pattern))) {
204 // ...unless explicitly opted in
205 if (pkgBumpy?.managed === true) return true;
206 if (config.include.some((pattern) => matchGlob(pkgName, pattern))) return true;
207 return false;
208 }
209
210 // 3. Explicit opt-in via per-package config
211 if (pkgBumpy?.managed === true) return true;
212
213 // 4. Included by glob (overrides private)
214 if (config.include.some((pattern) => matchGlob(pkgName, pattern))) return true;
215

Callers 2

config.test.tsFile · 0.90
discoverWorkspaceFunction · 0.90

Calls 1

matchGlobFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…