chore: update TypeScript to 6.0.3#44
Merged
Merged
Conversation
TypeScript 6.0 ships lib types for Temporal (esnext.temporal), which lets sql-escaper type Temporal values natively instead of structurally. See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html#new-types-for-temporal The bump requires three behavior-preserving tsconfig adjustments that TS 6 now enforces: - ignoreDeprecations: "6.0" — moduleResolution=node10, esModuleInterop=false and allowSyntheticDefaultImports=false are deprecated in 6.0 (removed in 7.0); kept as-is to avoid a module-resolution behavior change in this PR. - rootDir: "src" — now required (TS5011) to keep the existing lib/ output layout. - types: ["node"] — TS 6 no longer auto-resolves @types/node under node10 resolution, so Buffer/node:* imports need it declared explicitly. Build, tests and lint all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 548 548
=========================================
Hits 548 548 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wellwelwel
approved these changes
Jul 12, 2026
Member
|
Thanks, @pdeveltere 🙋🏻♂️ |
pdeveltere
added a commit
to pdeveltere/sql-escaper
that referenced
this pull request
Jul 12, 2026
- type Temporal values via the esnext.temporal lib (unblocked by mysqljs#44) instead of the structural TemporalLike shape - add tests for the ISO-string fallback (Duration, PlainYearMonth, PlainMonthDay) - run Temporal tests on every runtime via @js-temporal/polyfill (dev-only) so coverage no longer depends on the CI Node version - trim comments to decision notes per review
wellwelwel
added a commit
that referenced
this pull request
Jul 12, 2026
* Add Temporal support to escape Escaping a Temporal value (e.g. Temporal.Instant) currently falls through to the generic object handling and produces broken SQL. Teach escape() about Temporal, mirroring the existing Date handling. - Instant / ZonedDateTime: absolute times, delegated to dateToString so the timezone argument behaves exactly as it does for Date (millisecond precision). - PlainDateTime / PlainDate / PlainTime: wall-clock values, emitted verbatim as DATETIME / DATE / TIME literals (timezone ignored). - Other Temporal types fall back to their ISO string. Temporal types are detected via Object.prototype.toString (Symbol.toStringTag), so the Temporal global is never referenced and no Temporal lib types are needed; the new TemporalLike type is declared structurally. Adds tests (skipped when Temporal is unavailable) and README docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor: use native Temporal types and cover the ISO fallback - type Temporal values via the esnext.temporal lib (unblocked by #44) instead of the structural TemporalLike shape - add tests for the ISO-string fallback (Duration, PlainYearMonth, PlainMonthDay) - run Temporal tests on every runtime via @js-temporal/polyfill (dev-only) so coverage no longer depends on the CI Node version - trim comments to decision notes per review * refactor: simplify temporalToString with structural narrowing * refactor: remove comments entirely, in line with codebase --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Weslley Araújo <46850407+wellwelwel@users.noreply.github.com>
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.
Why
TypeScript 6.0 ships lib types for Temporal (the
esnext.temporallib), which lets sql-escaper typeTemporalvalues natively rather than structurally — see the release note: New Types for Temporal. This bump is a prerequisite for that (discussed in #43 / #42).Changes
Just the compiler bump plus three behavior-preserving tsconfig adjustments that TS 6 now enforces:
ignoreDeprecations: "6.0"—moduleResolution=node10,esModuleInterop=falseandallowSyntheticDefaultImports=falseare deprecated in 6.0 (they stop functioning in 7.0). Kept as-is here so this PR does not change module-resolution behavior; migrating them is a separate TS 7 concern.rootDir: "src"— now required (TS5011) to preserve the existinglib/output layout.types: ["node"]— undernode10resolution TS 6 no longer auto-includes@types/node, soBuffer/node:*imports need it declared explicitly.Verification
tsc,npm run build,npm run test:nodeandnpm run lintall pass.