Skip to content

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.

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