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

cli: Interactive setup for code quality tools and test frameworks #33269

Open
1 of 2 tasks
ren-yamanashi opened this issue Feb 2, 2025 · 5 comments
Open
1 of 2 tasks
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@ren-yamanashi
Copy link
Contributor

ren-yamanashi commented Feb 2, 2025

Describe the feature

Add interactive CLI prompts for setting up code quality tools and test frameworks during project initialization for TypeScript / JavaScript.

⬇️ sample

sample-image

Similar issues: #32136

Use Case

Currently, the CLI automatically installs preset tools like Jest for testing. However, developers often have different preferences for their development tooling. An interactive setup would allow users to:

  • Choose their preferred package manager (e.g, npm, yarn, pnpm)
  • Choose their preferred code formatter (e.g., Prettier, biome)
  • Select linting tools (e.g., ESLint, biome)
  • Pick testing frameworks (e.g., Jest, Vitest)

Proposed Solution

Implement an interactive CLI setup similar to create-next-app or vue create:

1. Add prompts during cdk init for:

  • package manager selection (npm/yarn/pnpm)
  • Formatter selection (Prettier/Biome/none)
  • Linter configuration (ESLint/Biome/none)
  • Testing framework (Jest/Vitest/none)

2. Generate appropriate configuration files based on user selections

3. Add selected dependencies to package.json

4. install dependencies based on the selected package manager

Other Information

Reference implementations:

This would make the tool more flexible and suitable for different development preferences while maintaining the ease of setup.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.171.1

Environment details (OS name and version, etc.)

macOS Sonoma 14.0

@ren-yamanashi ren-yamanashi added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 2, 2025
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Feb 2, 2025
@pahud
Copy link
Contributor

pahud commented Feb 3, 2025

Wow! I love this feature! I am not sure if there's any concern from core team but I'll bring it up for there visibility and inputs here.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 3, 2025
@kaizencc
Copy link
Contributor

kaizencc commented Feb 4, 2025

@ren-yamanashi thanks for the feature request! while this is intriguing, this is quite a big increase in surface area for cdk init especially considering cdk init is supposed to be a lightweight way to get started with CDK. secondly, these features are mostly concerned with package management which falls under the umbrella of projen. and while cdk init today doesn't use projen, it could, in the future.

Maybe @mrgrain has more context on what belongs in projen.

@ren-yamanashi
Copy link
Contributor Author

@kaizencc

Thank you for your consideration!

Indeed, adding this request would make cdk init less lightweight.
And it is also true that this feature is not always necessary for all CDK users (especially when using projen).

However, I think that the JavaScript / TypeScript toolchain is complex and that this feature will allow many users to set up their preferred CDK project in a simpler way.

So, what about enabling interactive setup when certain actions (e.g. specified the --interactive-mode option) are performed when running cdk init?
(I think that languages other than TypeScript / JavaScript should be considered, but I don't have a good idea for that yet... 😅 )

@mrgrain
Copy link
Contributor

mrgrain commented Feb 5, 2025

Thanks @ren-yamanashi I think this is a great idea, but like @kaizencc said we currently don't want to start building yet another project-setup tool. I also think that in practice, this feature request will be less about "interactive setup" and much more about "support a larger variety and combination of dev tools and their respective default configs". We can bring this up with product in terms of priorities from our end.

For a projen implementation, I believe rougly the following would be needed:

  • Add interactive prompt setup to projen
  • Make the interactive prompts available to createProject function
  • Add missing desired features as projen components (e.g. Biome, Vitest)
  • Create a new "cdk init" like project type (or update the existing one) that matches the desired experience
  • Any tweaks required to allow projen to created projects in ejected mode (projen should be an option, but not forced upon users; this is already possible, but has some rough-edges)
  • Finally integrate the projen project creation into cdk init

The good news is that you can get started with the projen work right away!

@ren-yamanashi
Copy link
Contributor Author

@mrgrain

Thank you for your detailed explanation and for sharing your specific implementation policy on the projen side.
I will work on the projen side!

If I have any further questions or need confirmation as I proceed with the implementation, I would be happy to discuss this with you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

4 participants