Skip to content

Commit 40a9374

Browse files
committed
fix: developer instruction README overriden by template README
1 parent a1b4c61 commit 40a9374

File tree

4 files changed

+81
-73
lines changed

4 files changed

+81
-73
lines changed

cargo-generate/README.md

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,8 @@
1-
# Yew Trunk Template
1+
If you are a developer of this template repository
22

3-
This is a fairly minimal template for a Yew app that's built with [Trunk].
4-
5-
## Usage
6-
7-
For a more thorough explanation of Trunk and its features, please head over to the [repository][trunk].
8-
9-
### Installation
10-
11-
If you don't already have it installed, it's time to install Rust: <https://www.rust-lang.org/tools/install>.
12-
The rest of this guide assumes a typical Rust installation which contains both `rustup` and Cargo.
13-
14-
To compile Rust to WASM, we need to have the `wasm32-unknown-unknown` target installed.
15-
If you don't already have it, install it with the following command:
16-
17-
```bash
18-
rustup target add wasm32-unknown-unknown
193
```
20-
21-
Now that we have our basics covered, it's time to install the star of the show: [Trunk].
22-
Simply run the following command to install it:
23-
24-
```bash
25-
cargo install trunk wasm-bindgen-cli
26-
```
27-
28-
That's it, we're done!
29-
30-
### Running
31-
32-
```bash
33-
trunk serve
34-
```
35-
36-
Rebuilds the app whenever a change is detected and runs a local server to host it.
37-
38-
There's also the `trunk watch` command which does the same thing but without hosting it.
39-
40-
### Release
41-
42-
```bash
43-
trunk build --release
4+
cd cargo-gen-gen
5+
cargo run
446
```
457

46-
This builds the app in release mode similar to `cargo build --release`.
47-
You can also pass the `--release` flag to `trunk serve` if you need to get every last drop of performance.
48-
49-
Unless overwritten, the output will be located in the `dist` directory.
50-
51-
## Using this template
52-
53-
There are a few things you have to adjust when adopting this template.
54-
55-
### Remove example code
56-
57-
The code in [src/main.rs](src/main.rs) specific to the example is limited to only the `view` method.
58-
There is, however, a fair bit of Sass in [index.scss](index.scss) you can remove.
59-
60-
### Update metadata
61-
62-
Update the `version`, `description` and `repository` fields in the [Cargo.toml](Cargo.toml) file.
63-
The [index.html](index.html) file also contains a `<title>` tag that needs updating.
64-
65-
66-
Finally, you should update this very `README` file to be about your app.
67-
68-
### License
69-
70-
The template ships with both the Apache and MIT license.
71-
If you don't want to have your app dual licensed, just remove one (or both) of the files and update the `license` field in `Cargo.toml`.
72-
73-
There are two empty spaces in the MIT license you need to fill out: `{{year}}` and `{{authors}}`.
74-
75-
[trunk]: https://github.com/thedodd/trunk
8+
will generate you new file templates for cargo-generate to use.

cargo-generate/_README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Yew Trunk Template
2+
3+
This is a fairly minimal template for a Yew app that's built with [Trunk].
4+
5+
## Usage
6+
7+
For a more thorough explanation of Trunk and its features, please head over to the [repository][trunk].
8+
9+
### Installation
10+
11+
If you don't already have it installed, it's time to install Rust: <https://www.rust-lang.org/tools/install>.
12+
The rest of this guide assumes a typical Rust installation which contains both `rustup` and Cargo.
13+
14+
To compile Rust to WASM, we need to have the `wasm32-unknown-unknown` target installed.
15+
If you don't already have it, install it with the following command:
16+
17+
```bash
18+
rustup target add wasm32-unknown-unknown
19+
```
20+
21+
Now that we have our basics covered, it's time to install the star of the show: [Trunk].
22+
Simply run the following command to install it:
23+
24+
```bash
25+
cargo install trunk wasm-bindgen-cli
26+
```
27+
28+
That's it, we're done!
29+
30+
### Running
31+
32+
```bash
33+
trunk serve
34+
```
35+
36+
Rebuilds the app whenever a change is detected and runs a local server to host it.
37+
38+
There's also the `trunk watch` command which does the same thing but without hosting it.
39+
40+
### Release
41+
42+
```bash
43+
trunk build --release
44+
```
45+
46+
This builds the app in release mode similar to `cargo build --release`.
47+
You can also pass the `--release` flag to `trunk serve` if you need to get every last drop of performance.
48+
49+
Unless overwritten, the output will be located in the `dist` directory.
50+
51+
## Using this template
52+
53+
There are a few things you have to adjust when adopting this template.
54+
55+
### Remove example code
56+
57+
The code in [src/main.rs](src/main.rs) specific to the example is limited to only the `view` method.
58+
There is, however, a fair bit of Sass in [index.scss](index.scss) you can remove.
59+
60+
### Update metadata
61+
62+
Update the `version`, `description` and `repository` fields in the [Cargo.toml](Cargo.toml) file.
63+
The [index.html](index.html) file also contains a `<title>` tag that needs updating.
64+
65+
66+
Finally, you should update this very `README` file to be about your app.
67+
68+
### License
69+
70+
The template ships with both the Apache and MIT license.
71+
If you don't want to have your app dual licensed, just remove one (or both) of the files and update the `license` field in `Cargo.toml`.
72+
73+
There are two empty spaces in the MIT license you need to fill out: `{{year}}` and `{{authors}}`.
74+
75+
[trunk]: https://github.com/thedodd/trunk

cargo-generate/cargo-gen-gen/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ fn main() {
136136
.collect::<Vec<&str>>()
137137
.join("\n");
138138

139-
std::fs::write(cargo_gen_dir.join("README.md"), new_md).unwrap();
139+
std::fs::write(cargo_gen_dir.join("_README.md"), new_md).unwrap();
140140
}

cargo-generate/configure_files.rhai

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ switch variable::get("yew_version"){
88
file::rename("cargo-generate/Cargo.toml.next", "Cargo.toml");
99
}
1010
}
11-
file::rename("cargo-generate/README.md", "README.md");
11+
file::rename("cargo-generate/_README.md", "README.md");
1212

1313
file::delete("cargo-generate");
1414
file::delete(".github");

0 commit comments

Comments
 (0)