-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate each example in its own workspace. (#50)
It's time to make space for more than one example! This PR adds a skeleton of what will become the `realworld` API implementation for `pavex`. To make examples realistic, I restructured the `examples` folder in such a way that each example gets its own workspace. A new script (`ci.sh`) has been added to make it easy to check all examples for correctness.
- Loading branch information
1 parent
f2e772a
commit 33056e8
Showing
26 changed files
with
914 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/test-target | ||
/ui_test_envs | ||
/target | ||
/libs/ui_test_envs | ||
/libs/target | ||
/examples/**/target | ||
/vendor | ||
.DS_Store | ||
*.snap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Check that the first argument is not empty | ||
if [ -z "$1" ]; then | ||
echo "Usage: ./ci.sh <cargo command> [<cargo options>]" | ||
echo "Runs a 'cargo' command on all Rust workspaces in the current directory and its subdirectories." | ||
exit 1 | ||
fi | ||
|
||
# Get the cargo command and options from the arguments | ||
CARGO_CMD=$1 | ||
shift | ||
CARGO_OPTS=${*:-""} | ||
|
||
# Find all directories that contain a Cargo.toml file and have a [workspace] section in the file | ||
WORKSPACES=$(find . -type f -name Cargo.toml -exec grep -q "\[workspace\]" {} \; -print | xargs -n1 dirname | sort | uniq) | ||
|
||
# Exclude test directory | ||
TOP_WORKSPACES=() | ||
for workspace in $WORKSPACES; do | ||
if [[ ! "$workspace" =~ "/ui_test_envs/" ]]; then | ||
TOP_WORKSPACES+=("$workspace") | ||
fi | ||
done | ||
|
||
# Iterate over each workspace and run `cargo check` | ||
for workspace in "${TOP_WORKSPACES[@]}"; do | ||
echo "Running 'cargo $CARGO_CMD $CARGO_OPTS' in workspace: $workspace" | ||
(cd "$workspace" && cargo $CARGO_CMD $CARGO_OPTS) | ||
done |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[workspace] | ||
members = ["api_bp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "api_bp" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
Empty file.
Oops, something went wrong.