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

New simplified rewrite of the Vapor Toolbox #471

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

fpseverino
Copy link
Member

@fpseverino fpseverino commented Jan 19, 2025

New simplified rewrite of the Vapor Toolbox

  • Remove all commands except for new
  • Add support for nested variable conditions for file rendering in manifest.yml
  • Drop ConsoleKit dependency in favor of swift-argument-parser
  • Switch from vapor-community/mustache to hummingbird-project/swift-mustache for template rendering
  • Update to Swift 6
  • Add --verbose flag that defaults to false; the new default prints only key steps in template generation
  • Update CI and Dockerfile

Closes #369, closes #335, closes #403

@fpseverino fpseverino marked this pull request as draft January 19, 2025 21:38
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@fpseverino fpseverino marked this pull request as ready for review January 24, 2025 17:44
@fpseverino fpseverino requested a review from 0xTim January 24, 2025 17:44
@fpseverino
Copy link
Member Author

As it stands, two of the differences between this rewrite and the original are:

  • There is no support for asking for dynamic variables (e.g. fluent, leaf) via terminal input. All variables (which all appear in the --help menu) must be entered as arguments to the command
  • All variables that have a boolean value associated with them, including top-level nested variables (e.g. if --no-fluent is given its nested variable db is not required) are considered false by default. For this reason the -n flag, which in the original Toolbox set all boolean flags to false, has not been implemented

@0xTim
Copy link
Member

0xTim commented Jan 25, 2025

@fpseverino Does that mean there's no interactivity any more? So if I type vapor new MyProject it doesn't ask me questions anymore?

@fpseverino
Copy link
Member Author

fpseverino commented Jan 25, 2025

@fpseverino Does that mean there's no interactivity any more? So if I type vapor new MyProject it doesn't ask me questions anymore?

Yes, if required variables (in vapor/template there aren't any) are missing it will return an error.

If that functionality is required I can work on it, but it's not supported by swift-argument-parser

@0xTim
Copy link
Member

0xTim commented Jan 25, 2025

@fpseverino Does that mean there's no interactivity any more? So if I type vapor new MyProject it doesn't ask me questions anymore?

Yes, if required variables (in vapor/template there aren't any) are missing it will return an error.

If that functionality is required I can work on it, but it's not supported by swift-argument-parser

We should discuss this on discord. I think we should ensure this functionality is added as it makes for a much better experience for newcomers

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.

which fails on macOS Swift-argument-parser support Command line ordering too picky.
2 participants