How to Debug a CLI application in VSCode

Опубликовано: 20 Апрель 2022
на канале: A shot of code
2,020
21

In this javascript tutorial we look at how to debug an open source CLI application. For our demo we use Astro which is a static site generation tool and which has a CLI for adding integrations such as Tailwind. We start by forking the Astro repo in gihub and then clone to our PC. Once in place we can look as the readme.txt or contributing.md to see how the project is built and also how to launch it so that it is ready to be attached to from VSCode. Once we have this (in our case pnpm run dev) we can open the Javascript Debug console window and run the CLI js file using node as below:

node astro.js add tailwind

Any breakpoints that we have in the source code will now be hit and we can make fixes enhancements to the code and the create a PR if looking all good!

If you are looking for help with making your first open source contribution then hopefully this can be of assistance


Смотрите видео How to Debug a CLI application in VSCode онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь A shot of code 20 Апрель 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,020 раз и оно понравилось 21 людям.