Add launch.json to the project
Description
This PR adds automatic generation of a .vscode/launch.json file when creating new Booster projects. This provides developers with a pre-configured VS Code debug setup for running unit tests, improving the development experience.
Changes
- Added
launch-json.tstemplate - Created a new template file with VS Code launch configuration for unit tests - Updated project initializer - Modified
project-initializer.tsto:- Import the launch.json template
- Create
.vscodedirectory during project initialization - Generate
.vscode/launch.jsonfile with the template content
- Added comprehensive tests - Updated test files to verify:
.vscodedirectory creation ingenerateRootDirectory()function.vscode/launch.jsonfile generation ingenerateConfigFiles()function- Integration tests ensure the new functionality works with all project creation scenarios
Checks
- [x] Project Builds
- [x] Project passes tests and checks
- [x] Updated documentation accordingly
Additional information
This enhancement improves the developer experience by automatically providing a VS Code debug configuration when creating new Booster projects. The generated .vscode/launch.json file includes:
- A "Unit Tests" configuration that runs
rushx test - Proper workspace folder variable usage (
${workspaceFolder}) - Node terminal type for better integration with VS Code
The implementation follows the existing codebase patterns and maintains backward compatibility. All existing functionality continues to work as expected, and the new feature is thoroughly tested.
PR Summary
-
Launch Configuration for Unit Tests
- A new file named
launch-json.tswas created that serves as a guide/template for setting up unit tests in the Visual Studio Code environment.
- A new file named
-
Improved Directory Creation for New Projects
- Modifications were made to the code in
project-initializer.tsto include the creation of a.vscodedirectory when setting up a new project, enhancing project structure.
- Modifications were made to the code in
-
Integration of
launch.jsonin Initial Project Setup- The
filesToGeneratelist inproject-initializer.tsnow includes thelaunch.jsonfile, assuring that this important file is created whenever a new project is initialized.
- The
-
Enhanced Test Cases for Project Initialization
- The testing files (
project.test.tsandproject-initializer.test.ts) have been adjusted to anticipate the creation of both the.vscodedirectory andlaunch.jsonfile. This ensures our new initial setup process is correctly validated through our tests.
- The testing files (
Hello. You need to create a changeset file and commit it to let this change be approved. Could you run rush change and commit the generated file? This is the pipeline error:
ERROR: The following projects have been changed and require change descriptions,
but change descriptions were not detected for them:
- @boostercloud/framework-core
To resolve this error, run "rush change". This will generate change description
files that must be committed to source control.
@davidverdu Now it's fine sir, I have generated the changeset and its seems to fine.
/integration sha=6126df160824fe5d0b7bfebb7a66205c51989f4b
:white_check_mark: Integration tests have finished successfully!
@davidverdu sir , Can u check it out as if it's ok to merge. Closes #1437