Fix defaultDate/12-24-hour parsing bug, harden CI, and misc chores - #136
Merged
Conversation
Update @astrojs/starlight, @types/node, @vitest/coverage-v8, astro, eslint, prettier, rollup, rollup-plugin-dts, tsx, typescript-eslint, and vitest to latest patch/minor versions.
Add timeout-minutes to all jobs, add explicit permissions, and add a concurrency group to test.yml to cancel superseded runs. Bump actions/checkout, actions/setup-node, actions/configure-pages, actions/upload-pages-artifact, actions/deploy-pages, actions/upload-artifact, and emibcn/badge-action to their latest major versions.
…ted 12/24-hour fields The hour resolution mixed pr and defaultDate fields before deciding whether to use 24-hour (H) or 12-hour (h/A) semantics, so an unrelated field left over in defaultDate could silently override an explicitly parsed value (e.g. defaultDate.H clobbering a parsed "h a" time, or defaultDate.A/h clobbering a parsed H, including the H=0/H=24 boundary values which the previous truthiness-based check treated as absent). The mode is now decided from the parsed result alone; defaultDate only fills in fields the parsed string didn't provide.
Vite's native configLoader warns that __dirname support will be removed in a future major version. rollup.config.ts already resolved paths the ESM-native way, so vitest.config.ts is brought in line.
Coverage was measured and reported (via the badge) but never gated, so a regression in coverage wouldn't fail CI. Current measured coverage is lines/statements/functions 100% and branches 98.14%; thresholds are set at 100% for the former and 95% for branches to leave some room while still catching real regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parse()incorrectly let unrelateddefaultDatefields (HvsA/h) override an explicitly parsed hour, including theH=0/H=24boundary values that a truthiness-based check treated as absent. The hour mode (24-hour vs 12-hour) is now decided from the parsed string alone;defaultDateonly fills in fields the parsed string didn't provide.__dirnamewithimport.meta.dirnameinvitest.config.ts(Vite native configLoader deprecation warning);rollup.config.tsalready used the ESM-native pattern.thresholdstovitest.config.ts(lines/statements/functions 100%, branches 95%) so a coverage regression fails CI instead of only affecting the badge.Antarctica/McMurdo.