diff --git a/package-lock.json b/package-lock.json index 5d2f3b6371a..e78406aae44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "comment-json": "^5.0.0", "content-type": "^1.0.5", "cookie": "^2.0.0", - "cron-parser": "^4.9.0", + "cron-parser": "^5.0.0", "debug": "^4.4.3", "decache": "^4.6.2", "dot-prop": "^10.1.0", @@ -1788,6 +1788,9 @@ "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1804,6 +1807,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1820,6 +1826,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1836,6 +1845,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1852,6 +1864,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1868,6 +1883,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1884,6 +1902,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1900,6 +1921,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1916,6 +1940,9 @@ "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1938,6 +1965,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1960,6 +1990,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1982,6 +2015,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2004,6 +2040,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2026,6 +2065,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2048,6 +2090,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -2070,6 +2115,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "Apache-2.0", "optional": true, "os": [ @@ -3306,6 +3354,19 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/@netlify/config/node_modules/cron-parser": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", + "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", + "deprecated": "v4 is no longer maintained, upgrade to v5", + "license": "MIT", + "dependencies": { + "luxon": "^3.2.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@netlify/config/node_modules/dot-prop": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-9.0.0.tgz", @@ -4282,18 +4343,6 @@ "node": ">=22.12.0" } }, - "node_modules/@netlify/functions-dev/node_modules/cron-parser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.0.tgz", - "integrity": "sha512-izNAxJyRWUP8ljBoDSub5WyrVOUlT4SLGShswE7eoRBpp6QUsSycYxLBMJlbshgPBMcPT/nrfgjNY2918ayv2A==", - "license": "MIT", - "dependencies": { - "luxon": "^3.7.2" - }, - "engines": { - "node": ">=18" - } - }, "node_modules/@netlify/functions-utils": { "version": "7.1.8", "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-7.1.8.tgz", @@ -5992,6 +6041,9 @@ "arm64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6009,6 +6061,9 @@ "arm64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6026,6 +6081,9 @@ "ppc64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6043,6 +6101,9 @@ "riscv64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6060,6 +6121,9 @@ "riscv64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6077,6 +6141,9 @@ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6094,6 +6161,9 @@ "x64" ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6111,6 +6181,9 @@ "x64" ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6380,6 +6453,9 @@ "cpu": [ "arm" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6393,6 +6469,9 @@ "cpu": [ "arm" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6406,6 +6485,9 @@ "cpu": [ "arm64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6419,6 +6501,9 @@ "cpu": [ "arm64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6432,6 +6517,9 @@ "cpu": [ "loong64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6445,6 +6533,9 @@ "cpu": [ "loong64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6458,6 +6549,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6471,6 +6565,9 @@ "cpu": [ "ppc64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6484,6 +6581,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6497,6 +6597,9 @@ "cpu": [ "riscv64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -6510,6 +6613,9 @@ "cpu": [ "s390x" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6523,6 +6629,9 @@ "cpu": [ "x64" ], + "libc": [ + "glibc" + ], "license": "MIT", "optional": true, "os": [ @@ -6536,6 +6645,9 @@ "cpu": [ "x64" ], + "libc": [ + "musl" + ], "license": "MIT", "optional": true, "os": [ @@ -10859,13 +10971,15 @@ "license": "MIT" }, "node_modules/cron-parser": { - "version": "4.9.0", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.0.tgz", + "integrity": "sha512-izNAxJyRWUP8ljBoDSub5WyrVOUlT4SLGShswE7eoRBpp6QUsSycYxLBMJlbshgPBMcPT/nrfgjNY2918ayv2A==", "license": "MIT", "dependencies": { - "luxon": "^3.2.1" + "luxon": "^3.7.2" }, "engines": { - "node": ">=12.0.0" + "node": ">=18" } }, "node_modules/cross-spawn": { diff --git a/package.json b/package.json index ef4687aad5f..1b5b71d6246 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "comment-json": "^5.0.0", "content-type": "^1.0.5", "cookie": "^2.0.0", - "cron-parser": "^4.9.0", + "cron-parser": "^5.0.0", "debug": "^4.4.3", "decache": "^4.6.2", "dot-prop": "^10.1.0", diff --git a/src/lib/functions/netlify-function.ts b/src/lib/functions/netlify-function.ts index ef93339a12f..6f647131593 100644 --- a/src/lib/functions/netlify-function.ts +++ b/src/lib/functions/netlify-function.ts @@ -4,7 +4,7 @@ import { version as nodeVersion } from 'process' import type { ExtendedRoute, Route } from '@netlify/zip-it-and-ship-it' import type { MemoizeCache } from '@netlify/dev-utils' -import CronParser from 'cron-parser' +import { CronExpressionParser } from 'cron-parser' import semver from 'semver' import { logAndThrowError, type NormalizedCachedConfigConfig } from '../../utils/command-helpers.js' @@ -36,7 +36,7 @@ type MappedOmit = { [P in keyof T as P extends K ? never : const difference = (setA: Set, setB: Set) => new Set([...setA].filter((item) => !setB.has(item))) const getNextRun = function (schedule: string) { - const cron = CronParser.parseExpression(schedule, { + const cron = CronExpressionParser.parse(schedule, { tz: 'Etc/UTC', }) return cron.next().toDate()