Skip to content

chore: Sync with upstream 3.1.0 and take time zone data from moment-timezone (3.2.0) - #14

Open
flavienbonvin wants to merge 22 commits into
mainfrom
chore/sync-upstream-3.2.0
Open

flavienbonvin wants to merge 22 commits into
mainfrom
chore/sync-upstream-3.2.0

Conversation

@flavienbonvin

@flavienbonvin flavienbonvin commented Nov 2, 2026 •

Copy link
Copy Markdown

What

Upstream (prantlf/timezone-support) is no longer updated with new tzdata releases, which is why we forked it. Our fork had drifted from upstream (17 commits ahead, 12 behind), and each tzdata update meant regenerating and committing about 670k lines of JSON.

This PR:

  • Rebases the fork's content on upstream 3.1.0. origin/main is recorded as merged with -s ours, so our history is kept and there are no conflicts.
  • Generates the time zone data from the moment-timezone dependency (^0.6.6, tzdata 2026f) instead of committed JSON. util/data-creator.js now reads moment-timezone/data/packed/latest.json, and util/data/*.json is deleted.
  • Publishes as @protontech/timezone-support 3.2.0.
  • Bumps @babel/core to ^7.22.0 so the tests run on a fresh install.

Why it is better for the future

  • Updating time zones is a dependency bump. When a new tzdata is out, moment-timezone releases it. We bump it, publish a new version, and nothing else changes.
  • No more giant data diffs. About 670k lines of generated JSON leave the repo, so reviews and clones are lighter.
  • We follow upstream again. The fork now sits on top of upstream 3.1.0, so later upstream fixes can be merged without conflicts.

Testing

pnpm build, compile:tests and check pass (17 suites, 76 tests). denolint and the browser tests were not run.

After merging

Publish 3.2.0 to npm.

superhawk610 and others added 22 commits July 14, 2020 15:27
Fix the example for `convertDateToTime` to match the expected signature.
* Upgrade dev dependencies
* Replace npm with pnpm (worked slower)
* Replace eslint with denolint (worked slower)
* Build ESM output to dist
* Announce ESM exports in package.json
* Add exports for lookup-convert, parse-format, data and limited data
* Replace `commander` with a hand-coded command-line parsing

* Upgrade dev dependencies
* Replace npm with pnpm (worked slower)
* Replace cpy-cli with cp.js (started to create wrong paths)
* Replace eslint with denolint (worked slower)
* Replace coveralls with codecov (they cancel accounts)
* Replace travis with github actions (more work to maintain)

BREAKING CHANGE: The initial ESM support exposed the sources at paths like `src/index.js` and worked only if you used a bundler. **The proper ESM support** has been provided by files built to paths like `dist/index.mjs`, which are mapped to export modules in `package.json`. For example, if you imported the main module like this:

    import { getZonedTime } from ./node_modules/timezone-support/src/index.js

Change it to this:

    import { getZonedTime } from timezone-support

See also sections "Loading" and "Modules" in `API.md`.

**Replacing `commander` in `create-timezone-data`** with a hand-coded command-line parsing should not affect anybody, because the command-line format did not change, but there might be some undetected difference.

Declaring export modules in `package.json` **works reliably since Node.js 14.8**, but the rest of the source code and loading the files from the `dist` directory directly should work since Node.js 6. The script `create-timezone-data` needs the `fs/promises` implementation, which was introduced in Node.js 14.
Generate the packed, unpacked and group leader data from
moment-timezone/data/packed/latest.json instead of committed JSON files.
Updating the time zone database now means bumping moment-timezone (2026f
with 0.6.6).

Publish as @protontech/timezone-support 3.2.0 and bump @babel/core so the
tests run on a fresh install.
…imezone

Keeps the tree of the upstream-based branch (@protontech/timezone-support 3.2.0)
and records origin/main as merged, so history is preserved without conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants