Repository navigation
fix(ranges): leave empty security and LTS fields undefined instead of "undefined" - #92
Merged
Merged
Conversation
Starting with 27.x, every Node.js release line gets Alpha releases, versioned as `vN.0.0-alpha.X.Y.Z`, before its first Current release, and schedule.json has an `alpha` date for it. Releases now keep their pre-release identifiers. Coercing them turned every Alpha release into `vN.0.0`, so they would overwrite each other, and `vN.0.0` itself once it ships. Every release has an `alpha.isAlpha` flag, like `lts.isLts`, and `support.phases` has the `alpha` date, with `alpha` as the current phase until the release line becomes Current. Release lines on the previous schedule get the same data as before, besides `alpha.isAlpha` being `false` on their releases. This holds for all 872 releases in today's index.json. Refs: https://nodejs.org/en/blog/announcements/evolving-the-nodejs-release-schedule Refs: nodejs/nodejs.org#9223 Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
…thers Node.js 27 starts shipping vN.0.0-alpha.X.Y.Z releases before a line's first Current release. ranges now skips them everywhere except a new `alpha` range, which lists the alphas of a line in its Alpha phase, so `all.newest` stays the newest stable release. ranges also takes an optional second `options` argument that it passes to @nodevu/core, and depends on the 1.0.0 workspace versions of core and aliases.
the ranges tests fetched the live index.json and schedule.json and used today's clock, so they broke whenever the real schedule left a range empty. on 2026-10-20 no line is in Active LTS, which made lts/latest disappear and failed 5 tests. add test/fixtures.js, which serves core's checked-in snapshots filtered to 2025-09-01 and throws on any other URL. pass it to every ranges call, reuse it in alpha.test.js, add a test that pins each range's newest/oldest/security/lts values on that date, scope the test scripts to *.test.js, and widen the tests-ranges workflow path filter to ranges/** and core's snapshot data.
… "undefined" current, lts/latest and lts/maintenance built their security and LTS fields with template literals, so a line without a security release (or LTS data) got the string "undefined". assign core's values directly instead, and only fill the fields from the first line in each range by checking the versions count, since the old guards relied on the field never being undefined again.
botandbang
changed the base branch from
bnb/ranges-test-fixtures
to
bnb/ranges-alpha
October 20, 2026 22:09
…91) Co-authored-by: botandbang <337765928+botandbang@users.noreply.github.com>
…s-security-fields # Conflicts: # .github/workflows/tests-ranges.yml
… and versions in comments
…s-security-fields
… versions in comments
bnb
approved these changes
Oct 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #91.
current,lts/latestandlts/maintenance(andlts/active, which copies from them) builtoldestSecurity,newestSecurity,oldestLtsandnewestLtswith template literals like`${data[line].security.oldest}`. When a line hasn't had a security release yet, core leaves that value undefined, so ranges returned the string"undefined". With core's snapshot data at its snapshot time, for example,current.oldestSecuritywas"undefined".Changed: ranges assigns core's values directly, so a missing value is
undefinedand drops out of JSON, the same way core leaves out missing data. The fill-once guards now checkversions.length === 1. The old checks only worked because the fields always became strings, and without this a later line could fill them in (e.g.currentpicking up 0.12.15 on 2016-06-23). The README says empty fields areundefined.Added:
ranges/test/emptyFields.test.js, covering a Current line with no security releases, an LTS line with none, the first-line guard, missing LTS fields with made-up data, and a sweep checking that no field is ever"undefined". All five fail on the old code.Old and new output match for every day from 2015-09-08 to 2026-10-20 across seven filters, except where the old output had
"undefined".