Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bump-rtti-compat-date.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/vitest-pool-workers": patch
---

Use today's date for the RTTI compat date query instead of a hardcoded `"2023-12-01"`, so newly added Node.js builtin modules are recognized by the module fallback service.
4 changes: 3 additions & 1 deletion packages/vitest-pool-workers/scripts/rtti/query.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Message } from "capnp-es";
import { Miniflare } from "miniflare";
import { StructureGroups } from "./rtti.js";

const compatibilityDate = new Date().toISOString().slice(0, 10);

export async function getBuiltinModules() {
// Extract RTTI from `workerd`
const mf = new Miniflare({
Expand All @@ -12,7 +14,7 @@ export async function getBuiltinModules() {
import rtti from "workerd:rtti";
export default {
fetch() {
return new Response(rtti.exportTypes("2023-12-01", ["nodejs_compat"]));
return new Response(rtti.exportTypes("${compatibilityDate}", ["nodejs_compat"]));
}
}
`,
Expand Down
Loading