From 204c84a58c2f04d2ec6e4b9a20e920a466010804 Mon Sep 17 00:00:00 2001 From: renovate <29139614+renovate@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:08:13 +0000 Subject: [PATCH] chore: bump up date-fns version to v4 (#8405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [date-fns](https://redirect.github.com/date-fns/date-fns) | [`^3.6.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/date-fns/3.6.0/4.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/date-fns/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/date-fns/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/date-fns/3.6.0/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/date-fns/3.6.0/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
date-fns/date-fns (date-fns) ### [`v4.1.0`](https://redirect.github.com/date-fns/date-fns/blob/HEAD/CHANGELOG.md#v410---2024-09-17) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v4.0.0...v4.1.0) This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs. Make sure also upgrade `TZDate` to v1.0.2 as it [includes a bunch of critical bug fixes](https://redirect.github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14). ##### Fixed - Fixed internal `constructFrom` throwing an exception on `null` arguments. While `null` isn't allowed, the functions should rather return `Invalid Date` or `NaN` in such cases. See [#​3885](https://redirect.github.com/date-fns/date-fns/issues/3885). ##### Added - Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#​3886](https://redirect.github.com/date-fns/date-fns/issues/3886). ### [`v4.0.0`](https://redirect.github.com/date-fns/date-fns/blob/HEAD/CHANGELOG.md#v400---2024-09-16) [Compare Source](https://redirect.github.com/date-fns/date-fns/compare/v3.6.0...v4.0.0) I have great news! First, ten years after its release, date-fns finally gets first-class time zone support. Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward. [Read more about the release in the announcement blog post](https://blog.date-fns.org/v40-with-time-zone-support/). \- [Sasha @​kossnocorp](https://twitter.com/kossnocorp) ##### Added - Added time zones support via [`@date-fns/tz`](https://redirect.github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://redirect.github.com/date-fns/tz) for the details about the API. - All relevant functions now accept the context `in` option, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone: ```ts import { addDays, startOfDay } from "date-fns"; import { tz } from "@​date-fns/tz"; startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") })); //=> "2024-09-16T00:00:00.000+08:00" ``` In the example, `addDays` will get the current date and time in Singapore and add 5 days to it. `startOfDay` will inherit the date type and return the start of the day in Singapore. ##### Changed - The function arguments, as well as `Interval`'s `start` and `end`, now can be of different types, allowing you to mix `UTCDate`, `TZDate`, `Date`, and other extensions, as well as primitives (strings and numbers). The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context `in` option or the first encountered argument object type. The `Interval`'s `start` and `end` will be considered separately, starting from `start`. In the given example, the result will be in the `TZDate` as the first argument is a number, and the `start` takes precedence over the `end`. ```ts clamp(Date.now(), { start: new TZDate(start, "Asia/Singapore"), end: new UTCDate(), }); //=> TZDate ``` - **BREAKING**: This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you running the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://redirect.github.com/date-fns/date-fns/issues/new). - **BREAKING**: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please [report them](https://redirect.github.com/date-fns/date-fns/issues/new). ##### Fixed - Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE.
--- ### Configuration 📅 **Schedule**: 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 is behind base branch, 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 was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/blocksuite). --- packages/affine/components/package.json | 2 +- packages/affine/data-view/package.json | 2 +- packages/blocks/package.json | 2 +- packages/docs/package.json | 2 +- yarn.lock | 16 ++++++++-------- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/affine/components/package.json b/packages/affine/components/package.json index b6ca7105e9ce..d201359cce06 100644 --- a/packages/affine/components/package.json +++ b/packages/affine/components/package.json @@ -31,7 +31,7 @@ "@lottiefiles/dotlottie-wc": "^0.2.16", "@preact/signals-core": "^1.8.0", "@toeverything/theme": "^1.0.8", - "date-fns": "^3.6.0", + "date-fns": "^4.0.0", "katex": "^0.16.11", "lit": "^3.2.0", "shiki": "^1.12.0", diff --git a/packages/affine/data-view/package.json b/packages/affine/data-view/package.json index 6aafea8de645..f9559dbbb52c 100644 --- a/packages/affine/data-view/package.json +++ b/packages/affine/data-view/package.json @@ -29,7 +29,7 @@ "@lit/context": "^1.1.2", "@preact/signals-core": "^1.8.0", "@toeverything/theme": "^1.0.8", - "date-fns": "^3.6.0", + "date-fns": "^4.0.0", "lit": "^3.2.0", "sortablejs": "^1.15.2", "zod": "^3.23.8" diff --git a/packages/blocks/package.json b/packages/blocks/package.json index 5c7ce2d3838a..a19744a36aae 100644 --- a/packages/blocks/package.json +++ b/packages/blocks/package.json @@ -42,7 +42,7 @@ "@types/mdast": "^4.0.4", "@types/sortablejs": "^1.15.8", "collapse-white-space": "^2.1.0", - "date-fns": "^3.6.0", + "date-fns": "^4.0.0", "dompurify": "^3.1.6", "fflate": "^0.8.2", "file-type": "^19.4.1", diff --git a/packages/docs/package.json b/packages/docs/package.json index 4d698a10dec1..f4376f4586cd 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -27,7 +27,7 @@ "@blocksuite/blocks": "workspace:*", "@blocksuite/presets": "workspace:*", "@blocksuite/store": "workspace:*", - "date-fns": "^3.6.0", + "date-fns": "^4.0.0", "markdown-it-container": "^4.0.0", "vitepress-plugin-sandpack": "^1.1.4" } diff --git a/yarn.lock b/yarn.lock index 6748c5148801..350ce1e04d7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1761,7 +1761,7 @@ __metadata: "@preact/signals-core": "npm:^1.8.0" "@toeverything/theme": "npm:^1.0.8" "@types/katex": "npm:^0.16.7" - date-fns: "npm:^3.6.0" + date-fns: "npm:^4.0.0" katex: "npm:^0.16.11" lit: "npm:^3.2.0" shiki: "npm:^1.12.0" @@ -1868,7 +1868,7 @@ __metadata: "@types/mdast": "npm:^4.0.4" "@types/sortablejs": "npm:^1.15.8" collapse-white-space: "npm:^2.1.0" - date-fns: "npm:^3.6.0" + date-fns: "npm:^4.0.0" dompurify: "npm:^3.1.6" fflate: "npm:^0.8.2" file-type: "npm:^19.4.1" @@ -1915,7 +1915,7 @@ __metadata: "@preact/signals-core": "npm:^1.8.0" "@toeverything/theme": "npm:^1.0.8" "@types/sortablejs": "npm:^1.15.8" - date-fns: "npm:^3.6.0" + date-fns: "npm:^4.0.0" lit: "npm:^3.2.0" sortablejs: "npm:^1.15.2" zod: "npm:^3.23.8" @@ -1929,7 +1929,7 @@ __metadata: "@blocksuite/blocks": "workspace:*" "@blocksuite/presets": "workspace:*" "@blocksuite/store": "workspace:*" - date-fns: "npm:^3.6.0" + date-fns: "npm:^4.0.0" markdown-it-container: "npm:^4.0.0" typedoc: "npm:^0.26.6" typedoc-plugin-markdown: "npm:4.2.7" @@ -7096,10 +7096,10 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^3.6.0": - version: 3.6.0 - resolution: "date-fns@npm:3.6.0" - checksum: 10/cac35c58926a3b5d577082ff2b253612ec1c79eb6754fddef46b6a8e826501ea2cb346ecbd211205f1ba382ddd1f9d8c3f00bf433ad63cc3063454d294e3a6b8 +"date-fns@npm:^4.0.0": + version: 4.1.0 + resolution: "date-fns@npm:4.1.0" + checksum: 10/d5f6e9de5bbc52310f786099e18609289ed5e30af60a71e0646784c8185ddd1d0eebcf7c96b7faaaefc4a8366f3a3a4244d099b6d0866ee2bec80d1361e64342 languageName: node linkType: hard