Skip to content

Commit 059ede5

Browse files
committed
Set up a debugging config for plugin
1 parent 6c3265f commit 059ede5

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

.vscode/launch.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach",
6+
"port": 9229,
7+
"request": "attach",
8+
"internalConsoleOptions": "openOnSessionStart",
9+
"skipFiles": ["<node_internals>/**"],
10+
"type": "node",
11+
"sourceMaps": true,
12+
"resolveSourceMapLocations": [
13+
// "${workspaceFolder}/**",
14+
"!**/node_modules/**"
15+
],
16+
"sourceMapPathOverrides": {
17+
"typedoc-plugin-missing-exports://*": "${workspaceFolder}/*"
18+
}
19+
}
20+
]
21+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"scripts": {
3030
"test": "vitest run test/packages.test.ts",
31+
"test:doc": "typedoc --plugin ./index.js --tsconfig ./test/packages",
3132
"build": "tsc"
3233
}
3334
}

scripts/setup_links.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Expects to be run from within a package where you want to debug this plugin.
3+
# Will create a td-missing-exports folder which hardlinks the build of this plugin
4+
# so that imports of typedoc will use the debug target's version of TypeDoc,
5+
# while allowing changes to be made/debugged in this repo.
6+
7+
PLUGIN_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
8+
9+
rm -rf td-missing-exports
10+
mkdir td-missing-exports
11+
ln -T "$PLUGIN_DIR/../package.json" td-missing-exports/package.json
12+
ln -T "$PLUGIN_DIR/../index.js" td-missing-exports/index.js
13+
ln -T "$PLUGIN_DIR/../index.js.map" td-missing-exports/index.js.map
14+
15+
echo "Add ./td-missing-exports/index.js to your plugins configuration for debugging"

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"noUnusedParameters": true,
1010
"strict": true,
1111
"sourceMap": true,
12+
"sourceRoot": "typedoc-plugin-missing-exports://",
1213
"skipLibCheck": true
1314
},
1415
"include": ["."],

0 commit comments

Comments
 (0)