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

feat: allow language plugins to expose flags for module creation #2924

Merged
merged 4 commits into from
Oct 1, 2024

Conversation

matt2e
Copy link
Collaborator

@matt2e matt2e commented Oct 1, 2024

Each language plug in can expose flags for ftl new.

  • Users can see these by using ftl new <language> --help
  • FTL uses kong to set defaults, validate values, fill in envars, show help text, etc
    • This is done by adding kong.Flag items to kong's graph at start up based on the selected language.
  • All flags are string values. It is up to each plugin to parse the values further (like go's replace flag being transformed into a map)

eg: this is appended at the bottom of ftl new go --help

Flags for Go modules
  -r, --replace=OLD=NEW,...    Replace a module import path with a
                               local path in the initialised FTL module
                               ($FTL_INIT_GO_REPLACE).

@matt2e matt2e requested review from a team and alecthomas as code owners October 1, 2024 05:49
@matt2e matt2e requested review from a team and wesbillman and removed request for a team October 1, 2024 05:49
@ftl-robot ftl-robot mentioned this pull request Oct 1, 2024
@matt2e
Copy link
Collaborator Author

matt2e commented Oct 1, 2024

@alecthomas is this a complete misuse of kong? 🤔 I figured this was nicer than kong's passthrough:"" as it makes it more discoverable

@matt2e matt2e added the run-all A PR with this label will run the full set of CI jobs in the PR rather than in the merge queue label Oct 1, 2024
@matt2e matt2e mentioned this pull request Oct 1, 2024
38 tasks
Copy link
Collaborator

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Very cool! I wondered how you were going to make that work.

@alecthomas
Copy link
Collaborator

@alecthomas is this a complete misuse of kong? 🤔 I figured this was nicer than kong's passthrough:"" as it makes it more discoverable

No way, this is super cool. I love how it's integrated seamlessly.

@matt2e matt2e force-pushed the matt2e/new-module-flags branch from 876fd90 to 38c53e8 Compare October 1, 2024 22:34
@matt2e matt2e merged commit ca26e99 into main Oct 1, 2024
93 checks passed
@matt2e matt2e deleted the matt2e/new-module-flags branch October 1, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-all A PR with this label will run the full set of CI jobs in the PR rather than in the merge queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants