| 1 |
From: |
| 2 |
Subject: Debian changes |
| 3 |
|
| 4 |
The Debian packaging of node-rollup-plugin-dts is maintained in git, using a workflow |
| 5 |
similar to the one described in dgit-maint-merge(7). |
| 6 |
The Debian delta is represented by this one combined patch; there isn't a |
| 7 |
patch queue that can be represented as a quilt series. |
| 8 |
|
| 9 |
A detailed breakdown of the changes is available from their canonical |
| 10 |
representation -- git commits in the packaging repository. |
| 11 |
For example, to see the changes made by the Debian maintainer in the first |
| 12 |
upload of upstream version 1.2.3, you could use: |
| 13 |
|
| 14 |
% git clone https://git.dgit.debian.org/node-rollup-plugin-dts |
| 15 |
% cd node-rollup-plugin-dts |
| 16 |
% git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian' |
| 17 |
|
| 18 |
(If you have dgit, use `dgit clone node-rollup-plugin-dts`, rather than plain `git clone`.) |
| 19 |
|
| 20 |
We don't use debian/source/options single-debian-patch because it has bugs. |
| 21 |
Therefore, NMUs etc. may nevertheless have made additional patches. |
| 22 |
|
| 23 |
--- |
| 24 |
|
| 25 |
diff --git a/package.json b/package.json |
| 26 |
index abca6e4..f5d3605 100644 |
| 27 |
--- a/package.json |
| 28 |
+++ b/package.json |
| 29 |
@@ -68,7 +68,7 @@ |
| 30 |
"@babel/code-frame": "^7.29.0" |
| 31 |
}, |
| 32 |
"dependencies": { |
| 33 |
- "@jridgewell/remapping": "^2.3.5", |
| 34 |
+ "@ampproject/remapping": "^2.2.0", |
| 35 |
"@jridgewell/sourcemap-codec": "^1.5.5", |
| 36 |
"convert-source-map": "^2.0.0", |
| 37 |
"magic-string": "^0.30.21" |
| 38 |
diff --git a/rollup.config.ts b/rollup.config.ts |
| 39 |
index 2ac1d20..b37fa04 100644 |
| 40 |
--- a/rollup.config.ts |
| 41 |
+++ b/rollup.config.ts |
| 42 |
@@ -3,7 +3,7 @@ import type { RollupWatchOptions } from "rollup"; |
| 43 |
import dts from "./src/index.js"; |
| 44 |
|
| 45 |
const pkg = JSON.parse(fs.readFileSync("./package.json", { encoding: "utf-8" })); |
| 46 |
-const external = ["node:module", "node:path", "node:fs", "node:fs/promises", "typescript", "rollup", "@babel/code-frame", "magic-string", "@jridgewell/remapping", "@jridgewell/sourcemap-codec", "convert-source-map"]; |
| 47 |
+const external = ["node:module", "node:path", "node:fs", "node:fs/promises", "typescript", "rollup", "@babel/code-frame", "magic-string", "@ampproject/remapping", "@jridgewell/sourcemap-codec", "convert-source-map"]; |
| 48 |
|
| 49 |
const config: Array<RollupWatchOptions> = [ |
| 50 |
{ |
| 51 |
diff --git a/src/transform/index.ts b/src/transform/index.ts |
| 52 |
index 0e6c06b..08a1e7e 100644 |
| 53 |
--- a/src/transform/index.ts |
| 54 |
+++ b/src/transform/index.ts |
| 55 |
@@ -1,7 +1,7 @@ |
| 56 |
import * as path from "node:path"; |
| 57 |
import type { Plugin, SourceMap } from "rollup"; |
| 58 |
-import remapping from "@jridgewell/remapping"; |
| 59 |
-import type { RawSourceMap } from "@jridgewell/remapping"; |
| 60 |
+import * as remapping from "@ampproject/remapping"; |
| 61 |
+import type { RawSourceMap } from "@ampproject/remapping"; |
| 62 |
import { NamespaceFixer } from "./NamespaceFixer.js"; |
| 63 |
import { preProcess } from "./preprocess.js"; |
| 64 |
import { convert } from "./Transformer.js"; |
| 65 |
@@ -11,6 +11,11 @@ import { ModuleDeclarationFixer } from "./ModuleDeclarationFixer.js"; |
| 66 |
import MagicString from "magic-string"; |
| 67 |
import { loadInputSourcemap, hydrateSourcemap, type InputSourceMap, type SourcemapInfo } from "./sourcemap.js"; |
| 68 |
|
| 69 |
+type RemappingFn = ( |
| 70 |
+ input: RawSourceMap, |
| 71 |
+ loader: (file: string) => RawSourceMap | null, |
| 72 |
+) => { sources: Array<string | null>; mappings: string | unknown; names?: string[] }; |
| 73 |
+ |
| 74 |
/** |
| 75 |
* This is the *transform* part of `rollup-plugin-dts`. |
| 76 |
* |
| 77 |
@@ -347,7 +352,8 @@ export const transform = (enableSourcemap: boolean) => { |
| 78 |
// point back to foo.ts. If we return the same map when resolving foo.ts, |
| 79 |
// @jridgewell/remapping will recursively try to resolve foo.ts again → infinite loop. |
| 80 |
const visitedFiles = new Set<string>(); |
| 81 |
- const remapped = remapping(chunk.map as unknown as RawSourceMap, (file) => { |
| 82 |
+ const remap = remapping.default as unknown as RemappingFn; |
| 83 |
+ const remapped = remap(chunk.map as unknown as RawSourceMap, (file: string) => { |
| 84 |
// File paths from remapping are relative to the chunk's output location |
| 85 |
const absolutePath = path.resolve(chunkDir, file); |
| 86 |
|
| 87 |
diff --git a/tests/testcases/include-external/meta.js b/tests/testcases/include-external/meta.js |
| 88 |
index 2cd3f55..a0d9335 100644 |
| 89 |
--- a/tests/testcases/include-external/meta.js |
| 90 |
+++ b/tests/testcases/include-external/meta.js |
| 91 |
@@ -2,6 +2,6 @@ |
| 92 |
/** @type {import('../../testcases').Meta} */ |
| 93 |
export default { |
| 94 |
options: { |
| 95 |
- includeExternal: ['@types/d3-drag'], |
| 96 |
+ includeExternal: ['@types/d3-drag', 'd3-drag'], |
| 97 |
}, |
| 98 |
}; |