Repository navigation
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
Open
flavienbonvin wants to merge 22 commits into
flavienbonvin wants to merge 22 commits into
Conversation
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.
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.
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:
origin/mainis recorded as merged with-s ours, so our history is kept and there are no conflicts.moment-timezonedependency (^0.6.6, tzdata 2026f) instead of committed JSON.util/data-creator.jsnow readsmoment-timezone/data/packed/latest.json, andutil/data/*.jsonis deleted.@protontech/timezone-support3.2.0.@babel/coreto^7.22.0so the tests run on a fresh install.Why it is better for the future
moment-timezonereleases it. We bump it, publish a new version, and nothing else changes.Testing
pnpm build,compile:testsandcheckpass (17 suites, 76 tests).denolintand the browser tests were not run.After merging
Publish 3.2.0 to npm.