Repository: redbadger/crux (language: rust)

Issue:
counter example installation fails due to missing pnpm
Following the steps here:
https://github.com/redbadger/crux/blob/master/examples/counter/README.md

Got an error at step 3:

     Blocking waiting for file lock on build directory
     Compiling getrandom v0.2.8
     Compiling rand_core v0.6.4
     Compiling uuid v1.3.0
     Compiling rand_chacha v0.3.1
     Compiling rand v0.8.5
     Compiling phf_generator v0.10.0
     Compiling phf_macros v0.10.0
     Compiling phf v0.10.1
     Compiling serde-generate v0.25.0
     Compiling crux_core v0.3.0 (/Users/guofoo/git/crux/crux/crux_core)
     Compiling crux_http v0.2.0 (/Users/guofoo/git/crux/crux/crux_http)
     Compiling crux_platform v0.1.1 (/Users/guofoo/git/crux/crux/crux_platform)
     Compiling crux_kv v0.1.1 (/Users/guofoo/git/crux/crux/crux_kv)
     Compiling crux_time v0.1.1 (/Users/guofoo/git/crux/crux/crux_time)
     Compiling shared v0.1.0 (/Users/guofoo/git/crux/crux/examples/counter/shared)
     Compiling shared_types v0.1.0 (/Users/guofoo/git/crux/crux/examples/counter/shared_types)
    error: failed to run custom build command for `shared_types v0.1.0 (/Users/guofoo/git/crux/crux/examples/counter/shared_types)`
    Caused by:
      process didn't exit successfully: `/Users/guofoo/git/crux/crux/examples/counter/target/debug/build/shared_types-07e3345a7cc49a79/build-script-build` (exit status: 101)
      --- stdout
      cargo:rerun-if-changed=../shared
      --- stderr
      thread 'main' panicked at 'Could not pnpm install: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /Users/guofoo/git/crux/crux/crux_core/src/typegen.rs:252:14
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    ➜ ~/git/crux/crux/examples/counter/shared_types :(master)
_
So I installed pnmp and ran cargo run again, and everything proceeded normally.



Discussion / hints:
Thanks @guofoo! Yeah, we should mention this in (at least) the Readme. I _think_ it's OK for an example to depend on pnpm, but we should deffo call that out. Feel free to submit a PR, or we'll get to it ourselves soon.
FWIW I hit this too. Calling it out would be good. 

Fix patch:
diff --git a/examples/cat_facts/README.md b/examples/cat_facts/README.md
index 490fdf04..8ef70974 100644
--- a/examples/cat_facts/README.md
+++ b/examples/cat_facts/README.md
@@ -2,9 +2,9 @@
 
 Note: Whilst this example _does_ work, the API that it uses is not under our control and can be flaky, so your mileage may vary. I would look at the [Counter](../counter/README.md) example first.
 
-### Rust
+### Notes:
 
-1. Make sure you have the following rust targets installed (e.g. `rustup target add <target-name>`). Note there is a `rust-toolchain.toml` in the root directory, so you should be able to just `rustup target list --installed` (in or below the root directory) and the targets should be installed if they are not already present.
+1. Please make sure you have the following rust targets installed (there is a [`rust-toolchain.toml`](../../rust-toolchain.toml) in the root directory of this repo, so you should be able to type `rustup target list --installed`, in or below the root directory, and these targets will be installed if they are not already present).
 
    ```txt
    aarch64-apple-darwin
@@ -15,19 +15,21 @@ Note: Whilst this example _does_ work, the API that it uses is not under our con
    x86_64-apple-ios
    ```
 
+2. This example currently depends on the `pnpm` package manager when generating types for TypeScript. We are currently revisiting the type generation for foreign types and so this requirement will probably go, but for now, please [install `pnpm`](https://pnpm.io/installation).
+
+### Rust
+
 1. Make sure the core builds
 
    ```sh
-   cd shared
-   cargo build
+   cargo build --package shared
    # => Finished dev [unoptimized + debuginfo] target(s) in 1.40s
    ```
 
-1. Generate the shared types for your client applications
+2. Generate the shared types for your client applications
 
    ```sh
-   cd shared_types
-   cargo build
+   cargo build --package shared_types
    ```
 
 ### Yew web app
diff --git a/examples/counter/README.md b/examples/counter/README.md
index b072054e..f6582a31 100644
--- a/examples/counter/README.md
+++ b/examples/counter/README.md
@@ -10,9 +10,9 @@ We have included an example of a [Server Sent Events capability](./shared/src/ca
 
 ![screenshots](./counter.webp)
 
-## Rust
+### Notes:
 
-1. Make sure you have the following rust targets installed (there is a [`rust-toolchain.toml`](../../rust-toolchain.toml) in the root directory of this repo, so you should be able to type `rustup target list --installed`, in or below the root directory, and these targets will be installed if they are not already present).
+1. Please make sure you have the following rust targets installed (there is a [`rust-toolchain.toml`](../../rust-toolchain.toml) in the root directory of this repo, so you should be able to type `rustup target list --installed`, in or below the root directory, and these targets will be installed if they are not already present).
 
    ```txt
    aarch64-apple-darwin
@@ -23,18 +23,20 @@ We have included an example of a [Server Sent Events capability](./shared/src/ca
    x86_64-apple-ios
    ```
 
+2. This example currently depends on the `pnpm` package manager when generating types for TypeScript. We are currently revisiting the type generation for foreign types and so this requirement will probably go, but for now, please [install `pnpm`](https://pnpm.io/installation).
+
+## Rust
+
 1. Make sure the core builds
 
    ```sh
-   cd shared
-   cargo build
+   cargo build --package shared
    ```
 
-1. Generate the shared types for your client applications
+2. Generate the shared types for your client applications
 
    ```sh
-   cd ../shared_types
-   cargo build
+   cargo build --package shared_types
    ```
 
 ## Yew Web app
diff --git a/examples/hello_world/README.md b/examples/hello_world/README.md
index 1add1e0b..68fd43a0 100644
--- a/examples/hello_world/README.md
+++ b/examples/hello_world/README.md
@@ -4,6 +4,10 @@ Simple "hello world" and counter examples, with tests.
 
 > Note: this is only a shared lib (and does not include any native shells).
 
+### Notes:
+
+1. This example currently depends on the `pnpm` package manager when generating types for TypeScript. We are currently revisiting the type generation for foreign types and so this requirement will probably go, but for now, please [install `pnpm`](https://pnpm.io/installation).
+
 ## 1. Hello World
 
 There is a single `None` event (enums with no variants cannot be instantiated).


Test patch: