NestJS DevTools is an open-source VS Code extension — contributions of all sizes are welcome. This guide walks you through cloning the repository, understanding the project layout, running the extension locally, and opening a pull request. The codebase is intentionally small and well-structured, so getting oriented takes only a few minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pouryazardosht/nestjs-devtools/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following installed:- Node.js (includes
npm) — used to install dependencies and run build scripts - VS Code — any recent version; the extension targets engine
^1.118.0 - Git — to clone the repository and manage branches
Local setup
Install dependencies
Project structure
src/extension.ts— theactivate()function is called by VS Code when the extension is first used. It iterates overLOGGER_METHODSto register logger commands dynamically, then registers the two module-searcher commands explicitly.src/constants.ts— the single source of truth for logger method names (with their emoji) and every recognised NestJS file type (with its suffix, label, shortcut, emoji, and category). Changing these values is all that is required to add new logger methods or file types.webpack.config.js— bundles the TypeScript source fromsrc/intodist/extension.js, which is the file VS Code actually loads. Thevscodemodule is declared as an external so webpack does not attempt to bundle it.
Build scripts
| Script | Command | What it does |
|---|---|---|
| Pre-publish | npm run vscode:prepublish | Runs package automatically before publishing to the VS Code Marketplace |
| Compile (dev) | npm run compile | Runs webpack in development mode — fast, with source maps |
| Watch | npm run watch | Watches src/ for changes and recompiles automatically |
| Package (prod) | npm run package | Production webpack build with hidden source maps, ready for publishing |
| Compile tests | npm run compile-tests | Compiles the test suite with tsc into the out/ directory |
| Watch tests | npm run watch-tests | Watches and recompiles the test suite on every change |
| Pre-test | npm run pretest | Runs compile-tests, compile, and lint automatically before each test run |
| Lint | npm run lint | Runs ESLint over src/ using the TypeScript-ESLint ruleset |
| Test | npm run test | Runs the VS Code extension test suite via vscode-test |
pretest hook automatically runs compile-tests, compile, and lint before every test run, so the suite always exercises up-to-date, lint-clean code.
Adding a new logger method
Logger commands are driven entirely by theLOGGER_METHODS map in src/constants.ts. No manual command registration is needed.
-
Add the method to
LOGGER_METHODSinsrc/constants.ts: -
Register the command and keybinding in
package.jsonundercontributes.commandsandcontributes.keybindings: -
No changes to
extension.tsare needed. Theactivate()function iterates overObject.keys(LOGGER_METHODS)and registersnestjs-log-helper.insert${Capitalize(method)}Logfor each key automatically.
Adding a new file type
File types are defined in theNEST_TYPES array in src/constants.ts. Each entry describes how the extension recognises, labels, and displays a NestJS file.
-
Add a new entry to
NEST_TYPESinsrc/constants.ts:The fields are:Field Purpose suffixFile name suffix used to recognise the type (e.g. .service.ts)typeLabelHuman-readable label shown in the quick-pick list shortcutLetter(s) the user types to open the file instantly emojiIcon displayed next to the file in the picker categoryGrouping header in the quick-pick ( "Core NestJS","Entities","DTOs", etc.) -
If the type name has a common plural form, add the suffix to the
pluralTypesarray insrc/commands/searchModuleFiles.tsso that directory scanning handles pluralised folder names correctly. -
Rebuild and test:
Then press F5 to reload the Extension Development Host and verify the new type appears in the file picker.
Submitting a pull request
- Fork the repository on GitHub.
-
Create a feature branch from
main: -
Make your changes, then verify everything is clean:
-
Push your branch and open a pull request against
main. Include a clear description of what the change does and why.
For significant changes — new features, architectural refactors, or anything that affects the extension manifest — please open an issue first to discuss the approach before investing time in a full implementation.