Skip to content

Commit

Permalink
Add quiz game (cncf#641)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
Co-authored-by: Sergio Castaño Arteaga <[email protected]>
Co-authored-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
tegioz and cynthia-sg authored Jun 3, 2024
1 parent 431fb90 commit a7a5069
Show file tree
Hide file tree
Showing 49 changed files with 2,181 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
crates/wasm/overlay/data
crates/wasm/overlay/dist
crates/wasm/overlay/sources
crates/wasm/quiz/data
crates/wasm/quiz/dist
lcov.info
npm-debug.log*
target
Expand Down
164 changes: 151 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ resolver = "2"
members = [
"crates/cli",
"crates/core",
"crates/wasm/overlay"
"crates/wasm/overlay",
"crates/wasm/quiz"
]

[workspace.package]
Expand All @@ -23,12 +24,15 @@ aws-config = "1.4.0"
aws-sdk-s3 = "1.29.0"
axum = "0.7.5"
base64 = "0.22.1"
cached = { version = "0.51.3", default-features = false, features = ["async", "proc_macro"] }
chrono = { version = "0.4.38", features = ["serde"] }
clap = { version = "4.5.4", features = ["derive"] }
csv = "1.3.0"
deadpool = "0.11.2"
dirs = "5.0.1"
futures = "0.3.30"
gloo-console = "0.3.0"
gloo-net = { version = "0.5.0", default-features = false, features = ["http", "json"] }
headless_chrome = { git = "https://github.com/rust-headless-chrome/rust-headless-chrome", rev = "973ebea" }
hex = "0.4.3"
imagesize = "0.12.0"
Expand All @@ -45,6 +49,7 @@ octorust = "0.7.0"
parse_link_header = "0.3.3"
pretty_assertions = "1.4.0"
qrcode = "0.14.0"
rand = "0.8.5"
regex = "1.10.4"
reqwest = { version = "0.12.4", features = ["json", "native-tls-vendored"] }
reqwest_octorust = { package = "reqwest", version = "0.11.14", default-features = false, features = ["json", "multipart"] }
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ You can check out how the generated landscapes look like by visiting the [CNCF l

- **Landscape guide**. The guide file is a YAML file that defines the content of the guide that will be displayed on the landscape website. For more information, please see the [reference documentation](https://github.com/cncf/landscape2/blob/main/docs/config/guide.yml).

- **Landscape games**. The games data file is a YAML file that defines the content of the games that will be displayed on the landscape website. For more information, please see the [reference documentation](https://github.com/cncf/landscape2/blob/main/docs/config/games.yml).

- **Logos location**. Each landscape item *must* provide a valid relative reference to a logo image in SVG format in the landscape data file (item's `logo` field). The logos data source defines the location of those logos (base *url* or *local path*), so that the tool can get them as needed when processing the landscape items.

### Data collection from external services
Expand Down Expand Up @@ -224,6 +226,7 @@ The overlay can be enabled by providing any of the following query parameters to
- `overlay-data`: *data file url*
- `overlay-settings`: *settings file url*
- `overlay-guide`: *guide file url*
- `overlay-games`: *games data file url*
- `overlay-logos`: *logos base url*

> [!WARNING]
Expand Down
17 changes: 17 additions & 0 deletions crates/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use which::which;
fn main() -> Result<()> {
// Tell Cargo to rerun this build script if the source changes
println!("cargo:rerun-if-changed=../wasm/overlay");
println!("cargo:rerun-if-changed=../wasm/quiz");
println!("cargo:rerun-if-changed=../../ui/embed/src");
println!("cargo:rerun-if-changed=../../ui/embed/embed.html");
println!("cargo:rerun-if-changed=../../ui/webapp/src");
Expand Down Expand Up @@ -48,6 +49,22 @@ fn main() -> Result<()> {
],
)?;

// Build quiz game wasm module
run(
"wasm-pack",
&[
"build",
"--target",
"web",
"--out-dir",
"../../../ui/webapp/wasm/quiz",
wasm_profile,
"../wasm/quiz",
"--target-dir",
&wasm_target_dir,
],
)?;

// Build embed
run("yarn", &["--cwd", "../../ui/embed", "install"])?;
run("yarn", &["--cwd", "../../ui/embed", "build"])?;
Expand Down
Loading

0 comments on commit a7a5069

Please sign in to comment.