Skip to content

Commit

Permalink
chore: update date-fns to 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
paolostyle committed Jan 20, 2025
1 parent 94e2931 commit 9484932
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"dependencies": {
"@floating-ui/react": "^0.27.0",
"clsx": "^2.1.1",
"date-fns": "^3.6.0"
"date-fns": "^4.1.0"
},
"scripts": {
"eslint": "eslint --ext .js,.jsx,.ts,.tsx ./src",
Expand Down
20 changes: 0 additions & 20 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ const banner = `/*!
Released under the ${pkg.license} License.
*/`;

// it's important to mark all subpackages of data-fns as externals
// see https://github.com/Hacker0x01/react-datepicker/issues/1606
// We're relying on date-fn's package.json `exports` field to
// determine the list of directories to include.
const dateFnsPackageJson = JSON.parse(
fs
.readFileSync(
path.join(
path.dirname(fileURLToPath(import.meta.url)),
"node_modules/date-fns/package.json",
),
)
.toString(),
);
const dateFnsSubpackages = Object.keys(dateFnsPackageJson.exports)
.map((key) => key.replace("./", ""))
.filter((key) => key !== "." && key !== "package.json")
.map((key) => `date-fns/${key}`);

const globals = {
react: "React",
"prop-types": "PropTypes",
Expand Down Expand Up @@ -109,7 +90,6 @@ const config = {
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
...dateFnsSubpackages,
],
};

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4178,10 +4178,10 @@ __metadata:
languageName: node
linkType: hard

"date-fns@npm:^3.6.0":
version: 3.6.0
resolution: "date-fns@npm:3.6.0"
checksum: 10c0/0b5fb981590ef2f8e5a3ba6cd6d77faece0ea7f7158948f2eaae7bbb7c80a8f63ae30b01236c2923cf89bb3719c33aeb150c715ea4fe4e86e37dcf06bed42fb6
"date-fns@npm:^4.1.0":
version: 4.1.0
resolution: "date-fns@npm:4.1.0"
checksum: 10c0/b79ff32830e6b7faa009590af6ae0fb8c3fd9ffad46d930548fbb5acf473773b4712ae887e156ba91a7b3dc30591ce0f517d69fd83bd9c38650fdc03b4e0bac8
languageName: node
linkType: hard

Expand Down Expand Up @@ -8413,7 +8413,7 @@ __metadata:
babel-plugin-transform-react-remove-prop-types: "npm:^0.4.24"
clsx: "npm:^2.1.1"
core-js: "npm:^3.38.1"
date-fns: "npm:^3.6.0"
date-fns: "npm:^4.1.0"
eslint: "npm:^8.57.0"
eslint-config-prettier: "npm:^9.1.0"
eslint-plugin-import: "npm:^2.29.1"
Expand Down

0 comments on commit 9484932

Please sign in to comment.