Skip to content

Commit 6505c56

Browse files
committed
Extend the Temporal banner fix to @fedify/mysql
`@fedify/mysql` was added on the `2.1-maintenance` branch after PR issue carried into this package. Its `pollInterval` and `handlerTimeout` options take a `Temporal.Duration` or `Temporal.DurationLike`, and the generated `.d.ts` imported `Temporal` from `@js-temporal/polyfill`, binding the parameter types to the polyfill's nominal classes. Users on Node.js 26+ would hit the same nominal mismatch when passing native `Temporal.Duration` values that PR #768 fixed for the sibling adapters. Apply the same `banner.js`/`banner.dts` split as the sibling adapters: keep the runtime polyfill import in the JS output so Node.js 22-25 keeps working, and emit `/// <reference lib="esnext.temporal" />` in the `.d.ts` so the ambient `Temporal` namespace from `lib.esnext.temporal` resolves the declared types. Add a matching `@fedify/mysql` entry to the `Version 2.1.13` section of the changelog. `@fedify/astro`, the other new 2.1-only package, doesn't reference `Temporal` in its source, so no change is needed there. #767 #768 Assisted-by: Claude Code:claude-opus-4-7
1 parent 3e07b80 commit 6505c56

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

.hongdown.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include = ["*.md", "**/*.md"]
33
exclude = [
44
"**/node_modules/**",
55
"**/dist/**",
6+
".agents/skills/**",
67
".claude/skills/**",
78
".github/copilot-instructions.md",
89
"AGENT.md",

CHANGES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ To be released.
6868
mismatch. TypeScript 6.0 or later is required to consume the type
6969
declarations. [[#767], [#768]]
7070

71+
### @fedify/mysql
72+
73+
- Generated _\*.d.ts_ declarations no longer import from
74+
`@js-temporal/polyfill`; they reference the ambient `Temporal` namespace
75+
through the `esnext.temporal` lib instead, so `pollInterval` and
76+
`handlerTimeout` accept native `Temporal.Duration` values from Node.js
77+
26+ without a nominal type mismatch. TypeScript 6.0 or later is
78+
required to consume the type declarations. [[#767]]
79+
7180

7281
Version 2.1.12
7382
--------------

packages/mysql/tsdown.config.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ export default defineConfig({
1010
if (format === "cjs") return { js: ".cjs", dts: ".d.cts" };
1111
return { js: ".js", dts: ".d.ts" };
1212
},
13-
outputOptions(outputOptions, format) {
14-
if (format === "cjs") {
15-
outputOptions.intro = `
16-
const { Temporal } = require("@js-temporal/polyfill");
17-
`;
18-
} else {
19-
outputOptions.intro = `
20-
import { Temporal } from "@js-temporal/polyfill";
21-
`;
22-
}
23-
return outputOptions;
13+
banner({ format }) {
14+
const js = format === "cjs"
15+
? `const { Temporal } = require("@js-temporal/polyfill");`
16+
: `import { Temporal } from "@js-temporal/polyfill";`;
17+
return {
18+
js,
19+
dts: `/// <reference lib="esnext.temporal" />`,
20+
};
2421
},
2522
});

0 commit comments

Comments
 (0)