docs(examples): add missing Readme and clarify existing (#3327)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
Jacob 2022-02-04 15:56:57 -05:00 committed by GitHub
parent 15358b1895
commit e57a303748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 117 additions and 12 deletions

5
examples/README.md Normal file
View File

@ -0,0 +1,5 @@
# Examples
Following directories contain examples of tauri app functionality.
There are different execution steps depending on the example. See each directory `README.md` for execution method.

View File

@ -5,17 +5,9 @@ In the future, this app will be used on Tauri's integration tests.
![App screenshot](./screenshot.png?raw=true)
## Running the example
- Install dependencies (Run inside of this folder tauri/examples/api/)
```bash
# with yarn
$ yarn
# with npm
$ npm install
```
- Compile tauri
go to root of the tauri repo and run
- Compile Tauri
go to root of the Tauri repo and run:
Linux / Mac:
```
# choose to install node cli (1)
@ -27,7 +19,15 @@ Windows:
./.scripts/setup.ps1
```
- Compile the app (Run inside of this folder tauri/examples/api/)
- Install dependencies (Run inside of this folder `examples/api/`)
```bash
# with yarn
$ yarn
# with npm
$ npm install
```
- Run the app in development mode (Run inside of this folder `examples/api/`)
```bash
# with yarn
$ yarn tauri dev
@ -35,7 +35,8 @@ $ yarn tauri dev
$ npm run tauri dev
```
- Run the app
- Build an run the release app (Run inside of this folder `examples/api/`)
```bash
$ yarn tauri build
$ ./src-tauri/target/release/app
```

View File

@ -0,0 +1,5 @@
# Commands Example
A simple Tauri Application showcasing the command API.
To execute run the following on the root directory of the repository: `cargo run --example commands`.

View File

@ -0,0 +1,3 @@
# Hello Wolrd Example
To execute run the following on the root directory of the repository: `cargo example --helloworld`.

View File

@ -0,0 +1,5 @@
# Multi-Window Example
An example Tauri Multi-Window Application.
To execute run the following on the root directory of the repository: `cargo run --example multiwindow`.

View File

@ -0,0 +1,5 @@
# Naviagtion Example
A very simple Tauri Appplication with frontend navigation.
To execute run the following on the root directory of the repository: `cargo run --example navigation`.

View File

@ -1,3 +1,5 @@
# Resource example
This example demonstrates the Tauri bundle resources functionality. The example adds `src-tauri/assets/index.js` as a resource (defined on `tauri.conf.json > tauri > bundle > resources`) and executes it using `Node.js`, locating the JavaScript file using the `tauri::api::path::resolve_path` API.
To execute run the following on the root directory of the repository: `cargo run --example resources`.

View File

@ -1,3 +1,43 @@
# Sidecar example
This example demonstrates how to use the Tauri sidecar feature. It uses [pkg](https://github.com/vercel/pkg) to compile a Node.js application and bundle it on the Tauri application.
## Running the example
- Compile Tauri
go to root of the Tauri repo and run:
Linux / Mac:
```
# choose to install node cli (1)
bash .scripts/setup.sh
```
Windows:
```
./.scripts/setup.ps1
```
- Install dependencies (Run inside of this folder `examples/sidecar/`)
```bash
# with yarn
$ yarn
# with npm
$ npm install
$ yarn tauri
$ yarn package
```
- Run the app in development mode (Run inside of this folder `examples/sidecar/`)
```bash
# with yarn
$ yarn tauri dev
# with npm
$ npm run tauri dev
```
- Build an run the release app (Run inside of this folder `examples/sidecar/`)
```bash
$ yarn tauri build
$ ./src-tauri/target/release/app
```

5
examples/state/README.md Normal file
View File

@ -0,0 +1,5 @@
# State example
A simple Tauri Appplication showcase the application State usage.
To execute run the following on the root directory of the repository: `cargo run --example state`

View File

@ -0,0 +1,5 @@
# Streaming example
A simple Tauri Appplication showcase the streaming functionality.
To execute run the following on the root directory of the repository: `cargo run --example streaming`.

View File

@ -0,0 +1,29 @@
# Updater Example
This example showcases the App Updater feature.
## Running the example
- Compile Tauri
go to root of the Tauri repo and run:
Linux / Mac:
```
# choose to install node cli (1)
bash .scripts/setup.sh
```
Windows:
```
./.scripts/setup.ps1
```
- Run the app in development mode (Run inside of this folder `examples/updater/`)
```bash
$ cargo tauri dev
```
- Build an run the release app (Run inside of this folder `examples/updater/`)
```bash
$ cargo tauri build
$ ./src-tauri/target/release/app
```