trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Can trunk serve examples?

Open gilescope opened this issue 1 year ago • 3 comments

I've hit this a few times now. I would like to trunk serve some bevy examples that ought to work using the web. I guess https://github.com/eliotbo/bevy_shadertoy_wgsl/tree/main/examples is a canonical example. Is there a nice way of pointing trunk at an example? While I can see there's a bin I can point to using an index.html, there's no specific Cargo.toml to point to with examples...

So I thought I'd ask here to see if anyone has a good solution / workaround other than moving the example and giving it its own Cargo.toml...

gilescope avatar Sep 03 '22 09:09 gilescope

I built https://github.com/kurbos/bevy-shell-template, which uses a Trunk.toml to point to a WASM launcher for Bevy. Use this as a gold standard. But Trunk (afaik) does not support --example currently.

simbleau avatar Sep 03 '22 12:09 simbleau

But doing that for each example seems overkill. We just need a way to tell trunk to use a certain example, ideally from the command line rather than altering an index.html

On Sat, 3 Sept 2022 at 13:06, simbleau @.***> wrote:

I built https://github.com/kurbos/bevy-shell-template, which uses a Trunk.toml to point to a WASM launcher for Bevy. Use this as a gold standard.

— Reply to this email directly, view it on GitHub https://github.com/thedodd/trunk/issues/423#issuecomment-1236106650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCBT6E7CC6YD57UDTFTV4M5MXANCNFSM6AAAAAAQD2RJ6M . You are receiving this because you authored the thread.Message ID: @.***>

gilescope avatar Sep 03 '22 12:09 gilescope

I totally agree. It should be a feature, but I don't have the bandwidth. If you want to add the --example (which would default check for an index.html in the example's folder) CLI syntax with a PR, I'd be happy to review it.

simbleau avatar Sep 03 '22 16:09 simbleau

Can we please get an --example flag? It would greatly simplify using inbuilt rust examples for WASM targets, rather than extracting the tests into there own seperate Cargo.toml project

ActuallyHappening avatar May 13 '23 06:05 ActuallyHappening

Personally I think we need a cargo-example tool that can do the same for any example in this project and all the others in rust. Would be really helpful if it’s possible. Worst case the created example project could contain too many dependencies.

On Sat, 13 May 2023 at 07:43, ActuallyHappening @.***> wrote:

Can we please get an --example flag? It would greatly simplify using inbuilt rust examples for WASM targets, rather than extracting the tests into there own seperate project

— Reply to this email directly, view it on GitHub https://github.com/thedodd/trunk/issues/423#issuecomment-1546545767, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGEJCGWO3B3RKJ62SHB77DXF4UQ7ANCNFSM6AAAAAAQD2RJ6M . You are receiving this because you authored the thread.Message ID: @.***>

gilescope avatar May 13 '23 10:05 gilescope

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Sep 22 '23 00:09 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 27 '23 00:09 github-actions[bot]