Skip to content

Commit

Permalink
Set up a debugging config for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jan 14, 2024
1 parent 6c3265f commit 059ede5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"port": 9229,
"request": "attach",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": ["<node_internals>/**"],
"type": "node",
"sourceMaps": true,
"resolveSourceMapLocations": [
// "${workspaceFolder}/**",
"!**/node_modules/**"
],
"sourceMapPathOverrides": {
"typedoc-plugin-missing-exports://*": "${workspaceFolder}/*"
}
}
]
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"scripts": {
"test": "vitest run test/packages.test.ts",
"test:doc": "typedoc --plugin ./index.js --tsconfig ./test/packages",
"build": "tsc"
}
}
15 changes: 15 additions & 0 deletions scripts/setup_links.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# Expects to be run from within a package where you want to debug this plugin.
# Will create a td-missing-exports folder which hardlinks the build of this plugin
# so that imports of typedoc will use the debug target's version of TypeDoc,
# while allowing changes to be made/debugged in this repo.

PLUGIN_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

rm -rf td-missing-exports
mkdir td-missing-exports
ln -T "$PLUGIN_DIR/../package.json" td-missing-exports/package.json
ln -T "$PLUGIN_DIR/../index.js" td-missing-exports/index.js
ln -T "$PLUGIN_DIR/../index.js.map" td-missing-exports/index.js.map

echo "Add ./td-missing-exports/index.js to your plugins configuration for debugging"
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"noUnusedParameters": true,
"strict": true,
"sourceMap": true,
"sourceRoot": "typedoc-plugin-missing-exports://",
"skipLibCheck": true
},
"include": ["."],
Expand Down

0 comments on commit 059ede5

Please sign in to comment.