Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Code launch configuration to debug the user's Indiekit installation #769

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jackdbd
Copy link
Contributor

@jackdbd jackdbd commented Oct 15, 2024

This PR adds a template for a VS Code launch configuration that will be will materialize at .vscode/launch.json in the user's Indiekit installation after they run the create-indiekit CLI.

This file will allow the user to just press F5 and start debugging their Indiekit installation.

debug-indiekit

Copy link
Collaborator

@paulrobertlloyd paulrobertlloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really interesting, and can see how it would help people onboard to the project! That said, I think it should be optional, much like adding Docker files to a project. We can do this by asking something like ‘Would you like to enable debugging in VS Code?’ as the final setup prompt.

"name": "Debug Indiekit",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/node_modules/@indiekit/indiekit/bin/cli.js",
// "args": ["--config", "path/to/your/indiekit.config.js"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented out code needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure which arguments were accepted by cli.js. Later I ended up using this:

"args": ["--config", "indiekit.config.js", "serve"]

@@ -19,7 +19,7 @@
"type": "module",
"main": "index.js",
"bin": {
"create-indiekit": "bin/create.js"
"create-indiekit": "bin/create.js delete-me"
Copy link
Collaborator

@paulrobertlloyd paulrobertlloyd Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does delete-me do here? I need to revisit this, but I think this script is called when you run npm init indiekit [directory name] or npm create indiekit [directory name]. Does this interfere with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was using delete-me as a placeholder for [directory name]

@jackdbd
Copy link
Contributor Author

jackdbd commented Oct 21, 2024

This is really interesting, and can see how it would help people onboard to the project! That said, I think it should be optional, much like adding Docker files to a project. We can do this by asking something like ‘Would you like to enable debugging in VS Code?’ as the final setup prompt.

I agree. Better to make it optional like Docker.

@paulrobertlloyd paulrobertlloyd force-pushed the main branch 2 times, most recently from 1b91b6e to 69936a4 Compare November 15, 2024 23:40
@paulrobertlloyd paulrobertlloyd force-pushed the main branch 4 times, most recently from 3225b55 to 7934b22 Compare November 26, 2024 01:06
@paulrobertlloyd paulrobertlloyd force-pushed the main branch 2 times, most recently from f8d0cc8 to f877637 Compare December 3, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants