Schedules redesign 3/5: domain schema, types, and utilities#3550
Conversation
Adds date-name and list Intl formatters, ordinal plural support in the i18n replace types, new common locale strings, and a sortNumbers array utility. Removes the unused common.timezone key. Co-Authored-By: Claude Fable 5 <[email protected]>
Pure logic layer for the schedules redesign: zod form schemas, request/ response types, and utilities for summarizing specs, building request bodies, parsing cron strings, and mapping schedules into form state, with unit tests. Adds cronstrue. Legacy types and i18n keys consumed by the existing pages are retained; they are removed in the final PR of the stack. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -7425,16 +7414,16 @@ packages: | |||
| peerDependencies: | |||
| vitest: '*' | |||
|
|
|||
| [email protected]: | |||
| resolution: {integrity: sha512-xejya+bT/j/+R/AGa1XOfRxLmNUlLtlwjRsFUILF+xHfzElmGcmFydy2gqqIrd62ptIEfwVMofd19uNWD9L7Nw==} | |||
| [email protected]: | |||
There was a problem hiding this comment.
Risk: Affected versions of vitest are vulnerable to Missing Authorization. When the Vitest UI server is listening, the deprecated isFileServingAllowed check is applied without normalizing the URL before filesystem operations, allowing path traversal that lets an attacker read, write, and execute arbitrary files outside the project directory.
Manual Review Advice: A vulnerability from this advisory is reachable if you run the Vitest UI on Windows, or you expose the Vitest UI server to the network with the --api.host flag or api.host config option
Fix: Upgrade this library to at least version 3.2.6 at ui/pnpm-lock.yaml:7417.
Reference(s): GHSA-5xrq-8626-4rwp
🚀 Fixed in commit d5b610f 🚀
Description & motivation 💭
Third of five PRs splitting the schedules redesign, stacked on #3549 (the base will retarget to
feature/schedulesautomatically when #3549 merges).The pure logic layer — no UI changes:
schedule/schema/: zod form schemas (flat spec schema with akinddiscriminator field, duration-with-default preprocessing)schedule/utilities/: spec summarization engine (fragment-based, bounded-window phrasing like "Every 15 minutes 09:00-17:00 on weekdays"), request-body builder with round-trip preservation of fields the form doesn't model, cron validation (rejects#), schedule→form mapping, range/duration/date helpers — all with unit teststypes/schedule.ts: new HTTP request/response types (ScheduleRequestBodyfamily,DurationString)en/schedules.ts: new keys for the redesigned UIcronstrueSplit-specific notes for reviewers:
ScheduleParametersfamily,Unspecifiedoverlap, etc.) and legacy i18n keys are retained because the existing pages still consume them — PR 5 deletes them.DescribeFullSchedule.schedulestays the wideScheduletype for now (the narrowedScheduleResponseis exported but unwired) so the existing stores keep compiling; PR 4 adopts it with the stores rewrite.Testing 🧪
How was this tested 👻
pnpm check0 errors,pnpm lint0 errors, 2,155 unit tests passing (existing suite + ~120 new tests for the utilities/schema layer).Steps for others to test: 🚶🏽♂️🚶🏽♀️
pnpm test -- --run src/lib/components/scheduleexercises the new layer; nothing user-visible changes until PR 4.Checklists
Merge Checklist
feature/schedules(notmain)🤖 Generated with Claude Code