mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Fixes https://github.com/vercel/next.js/pull/96198#discussion_r3666434724. Bumps the pinned `@types/node` version to `20.17.7` to get an upstream fix for `findSourceMap` type. Also regenerates the pnpm patch due to a conflict. I upgraded by just a patch because I'm not sure if we rely on being on an old version here. ## Test Plan `findSourceMap` now shows correct types. <img width="694" height="335" alt="Screenshot 2026-07-29 at 01 02 48" src="https://github.com/user-attachments/assets/cfe740e0-b8bf-4edc-ac27-698f926feb32" />
40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
diff --git a/module.d.ts b/module.d.ts
|
|
index 73b88af8b53babda5843dc5d4bb3b2a9b14d053b..6ecfa95f38c81421a49bc055bfff87a4f9dcc51c 100644
|
|
--- a/module.d.ts
|
|
+++ b/module.d.ts
|
|
@@ -49,7 +49,25 @@ declare module "module" {
|
|
* @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise.
|
|
*/
|
|
function findSourceMap(path: string, error?: Error): SourceMap | undefined;
|
|
- interface SourceMapPayload {
|
|
+ /**
|
|
+ * https://tc39.es/source-map/#index-map
|
|
+ */
|
|
+ interface IndexSourceMapSection {
|
|
+ offset: {
|
|
+ line: number
|
|
+ column: number
|
|
+ }
|
|
+ map: BasicSourceMapPayload
|
|
+ }
|
|
+
|
|
+ // TODO(veil): Upstream types
|
|
+ /** https://tc39.es/ecma426/#sec-index-source-map */
|
|
+ interface IndexSourceMap {
|
|
+ version: number
|
|
+ file: string
|
|
+ sections: IndexSourceMapSection[]
|
|
+ }
|
|
+ interface BasicSourceMapPayload {
|
|
file: string;
|
|
version: number;
|
|
sources: string[];
|
|
@@ -58,6 +76,7 @@ declare module "module" {
|
|
mappings: string;
|
|
sourceRoot: string;
|
|
}
|
|
+ type SourceMapPayload = BasicSourceMapPayload | IndexSourceMap;
|
|
interface SourceMapping {
|
|
generatedLine: number;
|
|
generatedColumn: number;
|