Skip to content
Open
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
7 changes: 7 additions & 0 deletions runtime/node/commonjs-wrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ declare global {
var require: (specifier: string) => any
var exports: any
var module: { exports: any }

// `@types/node` spells the callable `require` surface as `NodeRequire`.
// Generated projects set `types: []`, so the alias has to live here or
// tests that annotate `require` with that name fail as `TS2304`.
interface NodeRequire extends NodeJS.Require {}
var __filename: string
var __dirname: string
}
6 changes: 6 additions & 0 deletions runtime/node/node-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ declare global {

var process: NodeJS.Process

// Same alias `@types/node` publishes. A type only: a value binding here
// would claim a host cell the plugin does not define.
interface NodeRequire {
(specifier: string): any
}

// Node's own alias for the object `globalThis` already names -- kept
// because library code still spells it this way. `@hono/node-server`'s
// `listener.ts`/`request.ts`/`response.ts` read and
Expand Down
8 changes: 8 additions & 0 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,14 @@ if (process.env.GEA_FILE_MAP) {
message: row.message
})),
withheld: result.diagnostics.diagnostics.filter((row) => row.message.startsWith('withheld:')).map((row) => row.message),
// Certify-stage refusals are not diagnostics. Without this column a
// program can fail with certificate=null, missingPredicates=[], roots=[]
// and the corpus ladder reports `certify:unknown` with an empty reason.
refusals: result.refusals
.filter((row) => row.stage === 'certify')
.slice(0, 20)
.map((row) => `${row.key}: ${row.reason}`),
slotDrift: result.slotDrift.slice(0, 10).map((row) => row.reason ?? `${row.source} -> ${row.slot}`),
diagnostics: result.diagnostics.diagnostics.slice(0, 40).map((row) => `${row.severity} ${where(row)}: ${row.message}`),
sourcePreparations: result.sourcePreparations,
emittedLines: result.units.reduce((total, unit) => total + unit.source.split('\n').length, 0),
Expand Down
Loading