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

Customize project-wide compile flags in wing.toml #6776

Open
Chriscbr opened this issue Jun 24, 2024 · 1 comment
Open

Customize project-wide compile flags in wing.toml #6776

Chriscbr opened this issue Jun 24, 2024 · 1 comment
Labels
⌨️ cli CLI ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl

Comments

@Chriscbr
Copy link
Contributor

Chriscbr commented Jun 24, 2024

Use Case

As a user I'd like to be able to be able to specify compile options in wing.toml in some way so that I don't have to type them or copy them every time I compile in my project.

Open questions:

  • What kinds of compile options need to be overridden? Is the only use case to add platform extensions, or are there other options?

Proposed Solution

Option 1

Allow defining custom target(s) in wing.toml, and then use that target with any overrides you've specified.

# wing.toml

[platforms.aws]
root_id = "myapp"
base_platform = "tf-aws"
platform_extensions = ["./s3-state.platform.js"]

Now, wing compile -t aws is a custom platform which extends tf-aws (a built-in platform) and applies the overrides described by s3-state.platform.js on top.

Option 2

Allow adding arbitrary compile flags for one or more targets/platforms that are always applied/added whenever you run wing compile -t TARGET.

For example:

# wing.toml

[platforms.tf-aws]
compile_flags = ["--platform", "~/.s3-state.platform.js", "--rootId", "myapp"]

Then wing compile -t tf-aws will automatically get run as wing compile -t tf-aws --platform ~/.s3-state.platform.js.

Implementation Notes

Related:

Component

CLI

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
@Chriscbr Chriscbr added ✨ enhancement New feature or request ⌨️ cli CLI needs-discussion Further discussion is needed prior to impl labels Jun 24, 2024
@Chriscbr
Copy link
Contributor Author

cc @MarkMcCulloh @ekeren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ cli CLI ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl
Projects
Status: 🤝 Backlog - handoff to owners
Development

No branches or pull requests

1 participant