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

Support workspaces and -p #719

Open
ctron opened this issue Feb 19, 2024 · 5 comments
Open

Support workspaces and -p #719

ctron opened this issue Feb 19, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@ctron
Copy link
Collaborator

ctron commented Feb 19, 2024

Coming out of a discussion on #670 … it might make more sense to support workspace projects and the ability to run trunk build -p frontend, which would:

  • Lookup the frontend crate inside the workspace
  • Then run trunk build/watch/serve --config <frontend>/Trunk.toml
@ctron ctron added enhancement New feature or request help wanted Extra attention is needed labels Feb 19, 2024
@ctron ctron added this to the 0.19.0 milestone Feb 19, 2024
@ctron ctron removed this from the 0.19.0 milestone Mar 12, 2024
@Xu-Mj
Copy link
Contributor

Xu-Mj commented Mar 17, 2024

is this meaning that we can use workspace with multiple crates to reduce the compilation time?

@ctron
Copy link
Collaborator Author

ctron commented Mar 17, 2024

is this meaning that we can use workspace with multiple crates to reduce the compilation time?

You can already do that, assuming that workspace is an "all WASM" workspace. But you can split up your code like that already.

Even adding the ability to use -p when calling trunk would still mean that the workspaces needs to be compiled a second time for the "wasm" target. I guess this somehow also ties in #605. As it would make sense to a have different build profile for that part of the build.

@simbleau
Copy link
Member

@ctron Do you have recommendations for the implementation?

This is now a high priority item for me, since most of the repos I work will workspace examples or demos.

Thanks!

@ctron
Copy link
Collaborator Author

ctron commented Apr 19, 2024

I would add a new --package argument to the CLI. There will be another discrepancy, as that's a clap only field, should be skipped from serde I guess.

And then, during the initialization of the configuration, perform the lookup, and change the base directory. Not actually change, but start processing with a different path.

@simbleau
Copy link
Member

simbleau commented May 3, 2024

Something else that should come with this is that Trunk should detect changes in the workspace by default.

No need for a Trunk.toml or watch list addition to the parent and member packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants