winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.98k stars 196 forks source link

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

Open Chriscbr opened 3 months ago

Chriscbr commented 3 months ago

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:

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

Chriscbr commented 3 months ago

cc @MarkMcCulloh @ekeren

github-actions[bot] commented 1 week ago

Hi,

This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!