2 minutes read
Declaring lifecycle for your package
Package maintainers can ship a CLE (ECMA-428) document inside their published package. Offing reads that file offline from installed dependencies and reports matching lifecycle events as findings, with the CLE document as evidence.
What to ship
- Add a
cle.jsonfile at the package root (next topackage.json), and include it in the published tarball (filesinpackage.json, or do not.npmignoreit). - Set
$schematohttps://tc54.org/schemas/cle/cle-1.0.0.schema.json. - Set
identifierto the package’s Package URL without a version, for examplepkg:npm/your-packageorpkg:npm/%40scope/your-package. - List dated events with VERS ranges for the versions they apply to. Offing reports
endOfSupport,endOfLife,endOfDevelopment, andendOfDistributionwhen the installed version matches a range.
Minimal example:
{
"$schema": "https://tc54.org/schemas/cle/cle-1.0.0.schema.json",
"identifier": "pkg:npm/legacy-widget",
"updatedAt": "2024-06-01T00:00:00Z",
"definitions": {
"support": [
{
"id": "standard",
"description": "Standard product support for the 1.x line."
}
]
},
"events": [
{
"id": 1,
"type": "endOfLife",
"effective": "2024-01-01T00:00:00Z",
"published": "2023-06-01T00:00:00Z",
"versions": [{ "range": "vers:npm/<2.0.0" }],
"description": "The 1.x line is end of life; migrate to 2.x.",
"references": ["https://example.com/legacy-widget/eol"]
}
]
}
How Offing uses it
- Scans look under
node_modulesonly. They never fetch CLE over the network. - The CLE
identifiermust match the installed package name (as a PURL). A mismatched document is ignored. - The installed
package.jsonversion must fall in an event’s VERS range. - Each finding points at the shipped
cle.json, cites it as a maintainer declaration, and keeps anyhttp(s)referencesfrom the event as extra evidence. - Severity follows decision 0010 using the scan timestamp (not a live clock read inside the detector): when
effectiveis still in the future, the finding is reported as scheduled at severitylowand keeps itsdeadline; wheneffectiveis on or before the scan time, severity is by event type (endOfLife/endOfDistribution→ high;endOfSupport/endOfDevelopment→ medium). Finding identity does not change with the clock.
Exporting Offing’s own registry as CLE snapshots is separate: offing export --format cle.
What not to put in CLE
Do not invent lifecycle claims. CLE has no faithful representation for a soft deprecation that is not end of support, development, life, or distribution. Prefer an authoritative URL in references when one exists.
README contributors list
The all-contributors badge and list were removed from the README while the project has fewer than ten contributors (#1658). When the repository reaches ten or more contributors, restore them (revert #1658, or re-apply what #1569 added): .all-contributorsrc, tests/all-contributors.test.ts, and the badge and Contributors section in README.md.