Skip to content

Commit

Permalink
Major refactor of code layout and structure.
Browse files Browse the repository at this point in the history
This should allow for a much easier process of adding new pipelines and
assets to the mix. Functionality has been preserved. A few small bug
fixes have been factored in.

Add a Trunk, Yew, YBC (Bulma) example. This includes a minimal
Trunk.toml.

Add snapshot tests over the yew example app.

Added a pull request template, just to help folks remember to knock out
a few of the small tasks associated with getting PRs to land.

Broke apart the config.rs module into a directory of a few separate
modules under src/config. The file was getting fairly large and had
three distinct families of types.

Simplified the handling of errors in main. This handles returning proper
status codes and also prints out the chain of errors associated with the
error being logged.

The processing of Trunk.toml files has been updated to ensure that all
paths declared in the file will be treated as relative to the config
file itself (if the paths are indeed relative).

closes #58
  • Loading branch information
thedodd committed Sep 30, 2020
1 parent 6142ab3 commit c1e5b50
Show file tree
Hide file tree
Showing 41 changed files with 2,670 additions and 1,022 deletions.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Thank you for taking the time to open a pull request!
Please review the checklist below and perform each of
the applicable tasks. Cheers!
-->
**Checklist**
- [ ] Updated CHANGELOG.md describing pertinent changes.
- [ ] Updated README.md with pertinent info (may not always apply).
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
binPath: target/debug/trunk
exPath: examples/yew/
- os: macos-latest
binPath: target/debug/trunk
exPath: examples/yew/
- os: windows-latest
binPath: target\debug\trunk.exe
exPath: examples\yew\
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: build
Expand All @@ -39,3 +50,12 @@ jobs:
with:
command: run
args: -- -h
# build examples via our newly built debug artifact
- run: wget -qO- https://github.com/rustwasm/wasm-bindgen/releases/download/0.2.68/wasm-bindgen-0.2.68-x86_64-unknown-linux-musl.tar.gz | tar -xzf - && \
mv wasm-bindgen-0.2.68-x86_64-unknown-linux-musl/wasm-bindgen /usr/bin && \
chmod +x /usr/bin/wasm-bindgen
- run: ${{ matrix.binPath }} --config=${{ matrix.exPath }}Trunk.toml build
# execute tests, including snapshot tests for the examples
- uses: actions-rs/cargo@v1
with:
command: test
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ changelog
This changelog follows the patterns described here: https://keepachangelog.com/en/1.0.0/.

## Unreleased
- Closes [#58](https://github.com/thedodd/trunk/issues/58): the output WASM file generated from the cargo build is now determined purely based on a JSON build plan provided from cargo itself. This will help to provide a more stable pattern for finding build artifacts.
- The default location of the `dist` dir has been slightly modified. The `dist` dir will now default to being generated in the parent dir of cargo's `target` dir. This helps to make behavior a bit more consistent when executing trunk for locations other than the CWD.

### added
- Support for writing the public URL (`--public-url`) to the HTML output. ([#59](https://github.com/thedodd/trunk/issues/55))
Expand Down
Loading

0 comments on commit c1e5b50

Please # to comment.