Update dependency js-toml to v2 #36

Open
MarkerBot wants to merge 1 commit from renovate/js-toml-2.x into main
Member

This PR contains the following updates:

Package Change Age Confidence
js-toml ^1.0.2^2.0.0 age confidence

Release Notes

sunnyadn/js-toml (js-toml)

v2.0.1

Compare Source

Note on versioning: 2.0.1 is breaking relative to 2.0.0. TomlTime changed from a String subclass to a Date subclass. 2.0.0 was published two hours earlier, its serialization defect was found immediately, and npm does not allow unpublishing any version of a package that has dependents. 2.0.0 is deprecated with a pointer here. If you installed 2.0.0 during that window, t.split() and t.length no longer work; use String(t) or t.toISOString().

Three coordinated breaks, one migration. Before this release, js-toml added
timezone information that documents did not contain and lost the type of every
date and time on a round trip. A major is the consent mechanism: the date
reading changes silently rather than throwing, so it should not arrive through
npm update unannounced.

Changed
  • BREAKING: local date-times (an RFC 3339 date-time with no offset, such as 1979-05-27T07:32:00) now read their wall clock as UTC instead of as the host machine's local time. Previously the same document parsed to different instants on servers in different timezones, and the reading was ambiguous even on a single machine: a wall clock inside a daylight-saving gap does not exist, and one inside a fall-back hour occurs twice. The new value matches what smol-toml and @iarna/toml return, to the millisecond. Migration: read local date-times with the getUTC* accessors (start.getUTCHours()) rather than the local ones (start.getHours()). Hosts running in UTC, which includes most servers and CI, see no change. Offset date-times, local dates, and local times are unaffected.
  • Date/time semantics are documented in the README for the first time, including which JavaScript type each of the four TOML date/time types loads as.
  • BREAKING: dump() writes each TOML date/time type back in its own form. A local date-time was previously re-emitted as 1979-05-27T07:32:00.000Z and a local date as a full offset date-time, so a round trip through this library silently added a timezone claim the document never made. TOML defines a local date-time as carrying no relation to an offset or timezone at all. A local time was re-emitted as a quoted string, degrading it to a different TOML type. A plain Date supplied by a caller is still written as an offset date-time, since one instant is all it carries. Note that a time written without seconds still normalizes on load, so 07:32 round-trips as 07:32:00: valid TOML, different bytes.
Added
  • CI runs the suite under three timezones rather than only the runner's UTC. The local date-time reading above had been there since 2022 because a UTC-only suite cannot observe it.
  • TomlTime, exported, is what load() now returns for a local time, replacing a bare string. It extends Date, which is what the ecosystem's parsers do and what generic value walkers expect: such code dispatches on typeof for primitives and instanceof Date for everything time-shaped, and has no branch for anything else. toISOString() and toString() return the time of day (07:32:00.123456789), not the anchor day, so the sentinel never leaks and the source precision is kept exactly, which a millisecond-based encoding rounds away. Read the fields with getUTCHours() or the added hour, minute, second and fraction. Its constructor validates: new TomlTime(x) throws SyntaxParseError unless x is a TOML local time, and fills omitted seconds so the stored form is always HH:MM:SS[.frac]. Migration: typeof t === 'string' is now false and t === '07:32:00' is false; use instanceof Date or compare String(t). Note the anchor day is fiction: read the time with toISOString(), String(t) or the added accessors, not with getHours() or the toLocale* family, and a parsed local time retains about 72 bytes more than the bare string it replaces.
  • TomlDate, exported, is what load() now returns for every TOML date/time value. It extends Date and adds kind, one of 'offset-date-time', 'local-date-time' or 'local-date'. toISOString() returns the form the document wrote, so a local date-time no longer serializes as ...Z through JSON.stringify or any consumer that reads a Date, not only through this library's dump(). kind is an accessor rather than an own property, so deep-equality, Object.keys and object spread treat an instance exactly like the Date it extends; existing assertions comparing against a plain Date keep passing. constructor === Date is false, so test with instanceof, and structuredClone returns a plain Date, keeping the instant but dropping the type.
  • The toml-test round trip now compares which date/time type each value came from, not only the instant. Deep-equality compares Dates by instant alone, which is why a local date-time re-emitted as ...Z went unnoticed: the implementation and the test oracle shared the same blind spot.
Fixed
  • Time-of-day validation round-tripped its fields through a Date built from local components. The check is an hour/minute/second range test and now says so directly, which removes the clock, and with it the timezone surface, from a function that had no use for either. Behaviour is unchanged: the two forms agree on every input the grammar can produce, and leap seconds stay rejected.

v2.0.0

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [js-toml](https://github.com/sunnyadn/js-toml) | [`^1.0.2` → `^2.0.0`](https://renovatebot.com/diffs/npm/js-toml/1.2.2/2.0.1) | ![age](https://developer.mend.io/api/mc/badges/age/npm/js-toml/2.0.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/js-toml/1.2.2/2.0.1?slim=true) | --- ### Release Notes <details> <summary>sunnyadn/js-toml (js-toml)</summary> ### [`v2.0.1`](https://github.com/sunnyadn/js-toml/blob/HEAD/CHANGELOG.md#201---2026-08-04) [Compare Source](https://github.com/sunnyadn/js-toml/compare/v2.0.0...v2.0.1) **Note on versioning**: 2.0.1 is breaking relative to 2.0.0. `TomlTime` changed from a `String` subclass to a `Date` subclass. 2.0.0 was published two hours earlier, its serialization defect was found immediately, and npm does not allow unpublishing any version of a package that has dependents. 2.0.0 is deprecated with a pointer here. If you installed 2.0.0 during that window, `t.split()` and `t.length` no longer work; use `String(t)` or `t.toISOString()`. Three coordinated breaks, one migration. Before this release, js-toml added timezone information that documents did not contain and lost the type of every date and time on a round trip. A major is the consent mechanism: the date reading changes silently rather than throwing, so it should not arrive through `npm update` unannounced. ##### Changed - **BREAKING**: local date-times (an RFC 3339 date-time with no offset, such as `1979-05-27T07:32:00`) now read their wall clock as UTC instead of as the host machine's local time. Previously the same document parsed to different instants on servers in different timezones, and the reading was ambiguous even on a single machine: a wall clock inside a daylight-saving gap does not exist, and one inside a fall-back hour occurs twice. The new value matches what `smol-toml` and `@iarna/toml` return, to the millisecond. **Migration**: read local date-times with the `getUTC*` accessors (`start.getUTCHours()`) rather than the local ones (`start.getHours()`). Hosts running in UTC, which includes most servers and CI, see no change. Offset date-times, local dates, and local times are unaffected. - Date/time semantics are documented in the README for the first time, including which JavaScript type each of the four TOML date/time types loads as. - **BREAKING**: `dump()` writes each TOML date/time type back in its own form. A local date-time was previously re-emitted as `1979-05-27T07:32:00.000Z` and a local date as a full offset date-time, so a round trip through this library silently added a timezone claim the document never made. TOML defines a local date-time as carrying no relation to an offset or timezone at all. A local time was re-emitted as a quoted string, degrading it to a different TOML type. A plain `Date` supplied by a caller is still written as an offset date-time, since one instant is all it carries. Note that a time written without seconds still normalizes on load, so `07:32` round-trips as `07:32:00`: valid TOML, different bytes. ##### Added - CI runs the suite under three timezones rather than only the runner's UTC. The local date-time reading above had been there since 2022 because a UTC-only suite cannot observe it. - `TomlTime`, exported, is what `load()` now returns for a local time, replacing a bare `string`. It extends `Date`, which is what the ecosystem's parsers do and what generic value walkers expect: such code dispatches on `typeof` for primitives and `instanceof Date` for everything time-shaped, and has no branch for anything else. `toISOString()` and `toString()` return the time of day (`07:32:00.123456789`), not the anchor day, so the sentinel never leaks and the source precision is kept exactly, which a millisecond-based encoding rounds away. Read the fields with `getUTCHours()` or the added `hour`, `minute`, `second` and `fraction`. Its constructor validates: `new TomlTime(x)` throws `SyntaxParseError` unless `x` is a TOML local time, and fills omitted seconds so the stored form is always `HH:MM:SS[.frac]`. **Migration**: `typeof t === 'string'` is now false and `t === '07:32:00'` is false; use `instanceof Date` or compare `String(t)`. Note the anchor day is fiction: read the time with `toISOString()`, `String(t)` or the added accessors, not with `getHours()` or the `toLocale*` family, and a parsed local time retains about 72 bytes more than the bare string it replaces. - `TomlDate`, exported, is what `load()` now returns for every TOML date/time value. It extends `Date` and adds `kind`, one of `'offset-date-time'`, `'local-date-time'` or `'local-date'`. `toISOString()` returns the form the document wrote, so a local date-time no longer serializes as `...Z` through `JSON.stringify` or any consumer that reads a `Date`, not only through this library's `dump()`. `kind` is an accessor rather than an own property, so deep-equality, `Object.keys` and object spread treat an instance exactly like the `Date` it extends; existing assertions comparing against a plain `Date` keep passing. `constructor === Date` is false, so test with `instanceof`, and `structuredClone` returns a plain `Date`, keeping the instant but dropping the type. - The toml-test round trip now compares which date/time type each value came from, not only the instant. Deep-equality compares `Date`s by instant alone, which is why a local date-time re-emitted as `...Z` went unnoticed: the implementation and the test oracle shared the same blind spot. ##### Fixed - Time-of-day validation round-tripped its fields through a `Date` built from local components. The check is an hour/minute/second range test and now says so directly, which removes the clock, and with it the timezone surface, from a function that had no use for either. Behaviour is unchanged: the two forms agree on every input the grammar can produce, and leap seconds stay rejected. ### [`v2.0.0`](https://github.com/sunnyadn/js-toml/compare/v1.2.2...v2.0.0) [Compare Source](https://github.com/sunnyadn/js-toml/compare/v1.2.2...v2.0.0) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDkuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIwOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->
Update dependency js-toml to v2
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline was canceled
ci/woodpecker/pull_request_metadata/build Pipeline was successful
b5f7ec098a
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/pr/build Pipeline was canceled
Required
Details
ci/woodpecker/pull_request_metadata/build Pipeline was successful
Some required checks were not successful.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/js-toml-2.x:renovate/js-toml-2.x
git switch renovate/js-toml-2.x
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MarkerMatic/site!36
No description provided.