Skip to main content

findFloorViolations

Modules a distribution ships older than its parent, or not at all.

findFloorViolations(ours: Distribution, parent: Distribution): FloorViolation[]

The comparison behind inspectExtends, taking both sides directly.

findFloorViolations(
  { name: 'ours', version: '24.12.01', modules: { '@fg/id': '1.1.0' }, extends: undefined },
  { name: 'parent', version: '24.06.01', modules: { '@fg/id': '1.2.3' }, extends: undefined }
)
// [{ module: '@fg/id', parent: '1.2.3', ours: '1.1.0', reason: 'behind' }]

How versions compare

By the oldest version the range allows, since that is the oldest thing the distribution could resolve to. ^1.1.0 against a parent's ^1.2.0 is a violation even though both could resolve to the same version.

An exact version compares as itself. Anything unparseable is left alone rather than guessed at.

Reasons

reason
behindshipped, but older than the parent's
missingthe parent ships it and this does not

Modules the parent does not ship are ignored — an extension is free to add whatever it likes.