From d39255ac2024ea3643b675984b7b7b71ed895fab Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 16 Aug 2026 17:26:26 +0200 Subject: [PATCH] fix(deps): move the two remaining deprecated direct dependencies onto supported versions (#559) * fix(deps): move @xmldom/xmldom off the versions upstream flagged as critical Upstream deprecated 0.8.13 and 0.9.10 with 'this version has critical issues, please update to the latest version'. 0.8.14 and 0.9.11 are the patched releases of those same lines. The direct dependency moves to ^0.8.14, which also lifts xml-crypto and xml-encryption since both accept the whole 0.8 line. @boxyhq/saml20 pins 0.9.10 exactly, so a version scoped override takes it to 0.9.11. epubjs asks for ^0.7.5 and the 0.7 line has no release that is not deprecated, so 0.7.13 stays until epubjs moves; overriding it across two minors of an xml parser is not something to do blind. Also refreshes the stale minimumReleaseAgeExclude entry, which still named 0.8.12 and 0.8.13. The policy is not currently switched on, but 0.8.14 was published three days ago and the list is where this repo records that. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq * test(crontab-generator): pin the cron dialect detection and the execution times getLastExecutionTimes was only asserted to return five items, and getCronType only covered four expressions. Neither is enough to move a cron library under. Adds a classification table spanning the standard and aws dialects, including the six field expressions where they overlap, and freezes the clock so the returned execution times can be pinned exactly, timezone offsets included. No behaviour change: this is the reference the cron-parser v5 upgrade has to reproduce. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq * fix(deps): upgrade cron-parser to v5, keeping the aws dialect detected Upstream deprecated v4 with 'v4 is no longer maintained, upgrade to v5'. The rename is mechanical (parseExpression -> CronExpressionParser.parse) but the upgrade is not, because v5 accepts the six field aws dialect that v4 rejected. getCronType relied on that rejection: it tried the standard parser first and treated a throw as the signal to fall through to event-cron-parser. Under v5 '0 11-22 ? * MON-FRI *' parses as standard, so aws expressions would have been classified as standard, given the wrong next execution times and reported as invalid whenever the aws dialect was requested. Detection now keys off the '?' marker, which AWS EventBridge requires in one of the two day fields and which standard cron gives no meaning to. Checked against v4 over a 32 expression corpus spanning both dialects: identical classification everywhere, including '* * * * * *', which is valid in both and stays standard. getLastExecutionTimes keeps returning string[]: v5 types toJSON() as nullable and the caller joins the array, so a hole would have silently rendered as a blank line. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq * fix(build): stub bare fs/promises, which cron-parser v5 reaches for cron-parser v5 adds CronFileParser, exported from the package entry, and it does require('fs/promises') to read crontab files. The browser build has no business loading that, and the alias list only stubbed 'node:fs/promises'. Vite matches aliases by prefix, so the bare 'fs' entry rewrote 'fs/promises' into '_empty.ts/promises' and the build failed with UNLOADABLE_DEPENDENCY: 'Not a directory'. The new entry has to sit before 'fs' for that reason. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq * refactor(crontab-generator): run each cron parser at most once per classification From review feedback. getCronType could evaluate the standard branch twice for an expression that is neither dialect, and getLastExecutionTimes asked for the type twice, which repeated the whole classification. The '?' marker now selects which dialect to try first and each parser runs once; the caller keeps the type in a local. Behaviour is unchanged, the 30 assertions of the untouched test file still pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Mf5V2jMpFFXxGVXZU5rHBq --------- Co-authored-by: Claude --- package.json | 4 +- pnpm-lock.yaml | 38 ++++----- pnpm-workspace.yaml | 5 +- src/tools/cron-alarm/cron-alarm.vue | 4 +- .../crontab-generator.service.test.ts | 85 ++++++++++++++++++- .../crontab-generator.service.ts | 62 ++++++++++---- vite.config.ts | 3 + 7 files changed, 161 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 8f1dad62..cf344e7d 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@vueuse/head": "^1.3.1", "@vueuse/integrations": "^14.3.0", "@vueuse/router": "^10.11.1", - "@xmldom/xmldom": "^0.8.13", + "@xmldom/xmldom": "^0.8.14", "@xterm/xterm": "^5.5.0", "@younestouati/playing-cards-standard-deck": "^6.0.1", "@zxcvbn-ts/core": "^3.0.4", @@ -155,7 +155,7 @@ "crc": "^4.3.2", "creditcard": "^0.1.3", "creditcard-generator": "^0.0.7", - "cron-parser": "4.9.0", + "cron-parser": "5.10.0", "cron-validator": "^1.4.0", "cronstrue": "^3.24.0", "cross-spawn": "^7.0.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3cbcc3b8..eb963a66 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,7 @@ overrides: isolated-vm: file:./stubs/empty-stub onnxruntime-node: file:./stubs/empty-stub elliptic: ^6.6.1 + '@xmldom/xmldom@0.9.10': 0.9.11 js-sha256: ^0.11.1 xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz @@ -232,8 +233,8 @@ importers: specifier: ^10.11.1 version: 10.11.1(vue-router@5.1.0(@vue/compiler-sfc@3.5.39)(pinia@3.0.4(typescript@6.0.3)(vue@3.5.39(typescript@6.0.3)))(rolldown@1.1.4)(rollup@4.62.2)(vite@8.1.3(@types/node@24.13.3)(jiti@2.7.0)(less@4.6.7)(terser@5.48.0)(yaml@2.9.0))(vue@3.5.39(typescript@6.0.3))(webpack@5.108.3(postcss@8.5.16)))(vue@3.5.39(typescript@6.0.3)) '@xmldom/xmldom': - specifier: ^0.8.13 - version: 0.8.13 + specifier: ^0.8.14 + version: 0.8.14 '@xterm/xterm': specifier: ^5.5.0 version: 5.5.0 @@ -355,8 +356,8 @@ importers: specifier: ^0.0.7 version: 0.0.7 cron-parser: - specifier: 4.9.0 - version: 4.9.0 + specifier: 5.10.0 + version: 5.10.0 cron-validator: specifier: ^1.4.0 version: 1.4.0 @@ -5108,13 +5109,13 @@ packages: engines: {node: '>=10.0.0'} deprecated: this version has critical issues, please update to the latest version - '@xmldom/xmldom@0.8.13': - resolution: {integrity: sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==} + '@xmldom/xmldom@0.8.14': + resolution: {integrity: sha512-T4EDRUBVZYRldYApjEJiU0e1stYWaRAX7CuSnKzrpwdZKo53zGV8/pqfzV6FfwNl9YThD2OumQYvqtvjvgG7aQ==} engines: {node: '>=10.0.0'} deprecated: this version has critical issues, please update to the latest version - '@xmldom/xmldom@0.9.10': - resolution: {integrity: sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw==} + '@xmldom/xmldom@0.9.11': + resolution: {integrity: sha512-tW8bcK3hsG0/uqSnNz6TK4BkcuZSezoU7DlnYssILmZDktPnSHHuDJJFM0AJv+13gz2r0iGdrj6qqKeUnxXEDg==} engines: {node: '>=14.6'} deprecated: this version has critical issues, please update to the latest version @@ -6014,10 +6015,9 @@ packages: croact@1.0.4: resolution: {integrity: sha512-9GhvyzTY/IVUrMQ2iz/mzgZ8+NcjczmIo/t4FkC1CU0CEcau6v6VsEih4jkTa4ZmRgYTF0qXEZLObCzdDFplpw==} - cron-parser@4.9.0: - resolution: {integrity: sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==} - engines: {node: '>=12.0.0'} - deprecated: v4 is no longer maintained, upgrade to v5 + cron-parser@5.10.0: + resolution: {integrity: sha512-izNAxJyRWUP8ljBoDSub5WyrVOUlT4SLGShswE7eoRBpp6QUsSycYxLBMJlbshgPBMcPT/nrfgjNY2918ayv2A==} + engines: {node: '>=18'} cron-validator@1.4.0: resolution: {integrity: sha512-wGcJ9FCy65iaU6egSH8b5dZYJF7GU/3Jh06wzaT9lsa5dbqExjljmu+0cJ8cpKn+vUyZa/EM4WAxeLR6SypJXw==} @@ -12314,7 +12314,7 @@ snapshots: '@boxyhq/saml20@1.16.0': dependencies: - '@xmldom/xmldom': 0.9.10 + '@xmldom/xmldom': 0.9.11 xml-crypto: 6.1.2 xml-encryption: 4.0.1 xml2js: 0.6.2 @@ -15636,9 +15636,9 @@ snapshots: '@xmldom/xmldom@0.7.13': {} - '@xmldom/xmldom@0.8.13': {} + '@xmldom/xmldom@0.8.14': {} - '@xmldom/xmldom@0.9.10': {} + '@xmldom/xmldom@0.9.11': {} '@xterm/xterm@5.5.0': {} @@ -16539,7 +16539,7 @@ snapshots: '@daybrush/utils': 1.13.0 '@egjs/list-differ': 1.0.1 - cron-parser@4.9.0: + cron-parser@5.10.0: dependencies: luxon: 3.7.2 @@ -17593,7 +17593,7 @@ snapshots: exifreader@4.41.0: optionalDependencies: - '@xmldom/xmldom': 0.9.10 + '@xmldom/xmldom': 0.9.11 expand-tilde@2.0.2: dependencies: @@ -22703,12 +22703,12 @@ snapshots: xml-crypto@6.1.2: dependencies: '@xmldom/is-dom-node': 1.0.1 - '@xmldom/xmldom': 0.8.13 + '@xmldom/xmldom': 0.8.14 xpath: 0.0.33 xml-encryption@4.0.1: dependencies: - '@xmldom/xmldom': 0.8.13 + '@xmldom/xmldom': 0.8.14 escape-html: 1.0.3 xpath: 0.0.32 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index bf8844e0..c990fc6d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -11,6 +11,9 @@ overrides: isolated-vm: file:./stubs/empty-stub onnxruntime-node: file:./stubs/empty-stub elliptic: ^6.6.1 + # @boxyhq/saml20 pins 0.9.10 exactly, which upstream deprecated for "critical + # issues"; 0.9.11 is the patched release of that same line. + '@xmldom/xmldom@0.9.10': 0.9.11 # @it-tools/bip39 pins ^0.9.0, whose Node fallback uses eval("require('crypto')") # and triggers rolldown EVAL build warnings; 0.11.x dropped the eval. js-sha256: ^0.11.1 @@ -46,7 +49,7 @@ minimumReleaseAgeExclude: - unhead@2.1.11 || 2.1.13 - dompurify@3.3.2 || 3.3.4 || 3.4.0 || 3.4.6 || 3.4.7 || 3.4.8 || 3.4.9 || 3.4.11 - protocol-buffers-schema@3.6.1 - - '@xmldom/xmldom@0.8.12 || 0.8.13' + - '@xmldom/xmldom@0.8.14 || 0.9.11' - mathjs@15.2.0 - protobufjs@7.5.5 || 7.5.6 || 7.5.8 || 7.6.1 || 7.6.3 - underscore@1.13.8 diff --git a/src/tools/cron-alarm/cron-alarm.vue b/src/tools/cron-alarm/cron-alarm.vue index 25801747..169ea29a 100644 --- a/src/tools/cron-alarm/cron-alarm.vue +++ b/src/tools/cron-alarm/cron-alarm.vue @@ -1,7 +1,7 @@