From f1ef797c922e423a805b5de109a0242541e50e85 Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 12 Jul 2020 08:43:56 -0300 Subject: [PATCH] refactor(examples) cleanup, add READMEs (#331) --- .github/workflows/build-node-examples.yml | 2 +- README.md | 32 ++--- node/README.md | 3 + node/react/create-react-app/README.md | 101 +++------------ node/react/create-react-app/package.json | 9 +- .../src-tauri/tauri.conf.json | 4 +- node/react/gatsby-themed-site/README.md | 19 +++ node/react/gatsby-themed-site/package.json | 9 +- .../src-tauri/tauri.conf.json | 4 +- node/react/next.js/README.md | 22 ++-- node/react/next.js/package.json | 9 +- node/react/next.js/src-tauri/tauri.conf.json | 4 +- node/svelte/svelte-app/README.md | 118 ++---------------- node/svelte/svelte-app/package.json | 9 +- .../svelte-app/src-tauri/tauri.conf.json | 4 +- node/vanillajs/monolith/README.md | 22 ++++ node/vanillajs/monolith/package.json | 9 +- node/vue/nuxt-app/README.md | 34 ++--- node/vue/nuxt-app/package.json | 9 +- node/vue/nuxt-app/src-tauri/tauri.conf.json | 6 +- node/vue/quasar-app/README.md | 32 +++-- node/vue/quasar-app/package.json | 9 +- node/vue/quasar-app/src-tauri/tauri.conf.json | 12 +- node/vue/vue-cli-app/README.md | 26 ++-- node/vue/vue-cli-app/package.json | 2 +- rust/README.md | 3 + rust/yew/todomvc/Makefile.toml | 5 +- tauri/README.md | 3 + tauri/communication/README.md | 22 ++++ transpiled/reason-react/package.json | 11 +- 30 files changed, 211 insertions(+), 343 deletions(-) create mode 100644 node/README.md create mode 100644 node/vanillajs/monolith/README.md create mode 100644 rust/README.md create mode 100644 tauri/README.md create mode 100644 tauri/communication/README.md diff --git a/.github/workflows/build-node-examples.yml b/.github/workflows/build-node-examples.yml index f813542b..ce8a5fa5 100644 --- a/.github/workflows/build-node-examples.yml +++ b/.github/workflows/build-node-examples.yml @@ -100,7 +100,7 @@ jobs: run: yarn build - name: yarn tauri build working-directory: ./examples/node/${{ matrix.example.folder }} - run: yarn tauri:source:build + run: yarn tauri:build - uses: actions/upload-artifact@v1 if: success() with: diff --git a/README.md b/README.md index 142221ae..57349042 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,31 @@ # Examples -A collection of frameworks used as a suite of smoke-tests for tauri + +A collection of examples of Tauri apps using frontends written in Rust or JavaScript. These examples are a great way to see how Tauri works with a variety of frameworks. -## How to run -Ensure that you have read the readme of the example to check that your first-time setup is done. +Uses the template project of each framework. -The examples assume by default that the main Tauri repo is in the root of your drive ( on windows c:/tauri/) +## How to run -To change an example to be self-contained: -Go to `/%example_path%/src-tauri/cargo.toml`: -and change the dependency -```toml -tauri = { path = "../../../../../tauri", features = [ "edge" ] } +Ensure that you have read the README of the example to check that your first-time setup is done. + +The examples assume that this git repository was cloned in the root of the [tauri repo](https://github.com/tauri-apps/tauri) clone on your machine. +The recommended way of running the examples is using [mask](https://github.com/jakedeichert/mask): + +```bash +$ cargo install mask +$ git clone https://github.com/tauri-apps/tauri +$ cd tauri +$ mask prepare +$ mask list examples # this will show all the examples names +$ mask run example some-example-name # run an example listed on the previous command ``` -to -```toml -tauri = { version = "*", features = [ "edge" ] } -``` - ## Error reporting + Please report all library errors at https://github.com/tauri-apps/tauri ## License + Everything in this repo is MIT License unless otherwise specified. diff --git a/node/README.md b/node/README.md new file mode 100644 index 00000000..4e18d9cf --- /dev/null +++ b/node/README.md @@ -0,0 +1,3 @@ +# Node.js examples + +This is a list of examples of Tauri apps with frontend related to the Node.js ecosystem (NPM usage or Node.js CLIs). diff --git a/node/react/create-react-app/README.md b/node/react/create-react-app/README.md index 5f63db40..028689fe 100644 --- a/node/react/create-react-app/README.md +++ b/node/react/create-react-app/README.md @@ -1,95 +1,22 @@ -## Running Example - -Ensure you have setup and installed all the project dependencies. - -``` -npm install -g tauri -git clone https://github.com/tauri-apps/tauri -cd examples/react/create-react-app -yarn -cargo install tauri-bundler -``` - -### Development - -``` -yarn start & tauri dev -``` - -### Production - -``` -yarn build -tauri build -``` - -# Original ReadMe +# React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). -## Available Scripts +## Installation -In the project directory, you can run: +``` +$ cargo install tauri-bundler +$ yarn +``` -### `yarn start` +## Dev -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. +``` +$ yarn tauri dev +``` -The page will reload if you make edits.
-You will also see any lint errors in the console. +## Build -### `yarn test` - -Launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting - -### Analyzing the Bundle Size - -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size - -### Making a Progressive Web App - -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app - -### Advanced Configuration - -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration - -### Deployment - -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment - -### `yarn build` fails to minify - -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify +``` +$ yarn tauri build +``` diff --git a/node/react/create-react-app/package.json b/node/react/create-react-app/package.json index 6e2cbf0f..7af703f4 100644 --- a/node/react/create-react-app/package.json +++ b/node/react/create-react-app/package.json @@ -14,14 +14,9 @@ "start": "craco start", "build": "craco build", "test": "craco test", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "eslintConfig": { "extends": "react-app" diff --git a/node/react/create-react-app/src-tauri/tauri.conf.json b/node/react/create-react-app/src-tauri/tauri.conf.json index 8b43d484..46a16f44 100644 --- a/node/react/create-react-app/src-tauri/tauri.conf.json +++ b/node/react/create-react-app/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../build", - "devPath": "http://localhost:3000" + "devPath": "http://localhost:3000", + "beforeDevCommand": "yarn start", + "beforeBuildCommand": "yarn build" }, "ctx": {}, "tauri": { diff --git a/node/react/gatsby-themed-site/README.md b/node/react/gatsby-themed-site/README.md index fff1f7a0..20c89162 100644 --- a/node/react/gatsby-themed-site/README.md +++ b/node/react/gatsby-themed-site/README.md @@ -2,3 +2,22 @@ This is a minimal config required gatsby site created using themes. The intention is to smoke test gatsby and provide an assortment of pages to test tauri response. This _does_ use an API key to Airtable, but we have made it optional. (Although currently gatsby is rather aggressive in compiling things out of node_modules so `gatsby-config.js` has a hack to rename files so gatsby will ignore them. [insert heavy sigh here]) + +## Installation + +``` +$ cargo install tauri-bundler +$ yarn +``` + +## Dev + +``` +$ yarn tauri dev +``` + +## Build + +``` +$ yarn tauri build +``` diff --git a/node/react/gatsby-themed-site/package.json b/node/react/gatsby-themed-site/package.json index 94a34226..b83ff806 100644 --- a/node/react/gatsby-themed-site/package.json +++ b/node/react/gatsby-themed-site/package.json @@ -13,14 +13,9 @@ "develop": "gatsby develop", "dev:hard": "gatsby clean && gatsby develop", "format": "prettier --write \"**/*.{js,jsx,json,md}\"", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build", + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build", "test": "echo \"Error: run tests from root\" && exit 1" }, "dependencies": { diff --git a/node/react/gatsby-themed-site/src-tauri/tauri.conf.json b/node/react/gatsby-themed-site/src-tauri/tauri.conf.json index 4318b5a2..7800a0bd 100644 --- a/node/react/gatsby-themed-site/src-tauri/tauri.conf.json +++ b/node/react/gatsby-themed-site/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../public", - "devPath": "http://localhost:8000" + "devPath": "http://localhost:8000", + "beforeDevCommand": "yarn develop", + "beforeBuildCommand": "yarn build" }, "ctx": {}, "tauri": { diff --git a/node/react/next.js/README.md b/node/react/next.js/README.md index b4c2a4d5..0392eaa8 100644 --- a/node/react/next.js/README.md +++ b/node/react/next.js/README.md @@ -1,24 +1,22 @@ -## Running Example +# Next.js App -Ensure you have setup and installed all the project dependencies. +This project was bootstrapped with [Create Next App](https://github.com/vercel/create-next-app). + +## Installation ``` -npm install -g tauri -git clone https://github.com/tauri-apps/tauri -cd examples/react/next.js -yarn -cargo install tauri-bundler +$ cargo install tauri-bundler +$ yarn ``` -### Development +## Dev ``` -yarn dev & tauri dev +$ yarn tauri dev ``` -### Production +## Build ``` -yarn build -tauri build +$ yarn tauri build ``` diff --git a/node/react/next.js/package.json b/node/react/next.js/package.json index 5bce9096..569bd97b 100644 --- a/node/react/next.js/package.json +++ b/node/react/next.js/package.json @@ -6,14 +6,9 @@ "dev": "next dev", "build": "next build && next export", "start": "next start", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "dependencies": { "next": "9.4.4", diff --git a/node/react/next.js/src-tauri/tauri.conf.json b/node/react/next.js/src-tauri/tauri.conf.json index f9ed9efe..3186bbe6 100644 --- a/node/react/next.js/src-tauri/tauri.conf.json +++ b/node/react/next.js/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../out", - "devPath": "http://localhost:3000" + "devPath": "http://localhost:3000", + "beforeDevCommand": "yarn dev", + "beforeBuildCommand": "yarn build" }, "ctx": {}, "tauri": { diff --git a/node/svelte/svelte-app/README.md b/node/svelte/svelte-app/README.md index 5203cfcf..fef845c7 100644 --- a/node/svelte/svelte-app/README.md +++ b/node/svelte/svelte-app/README.md @@ -1,120 +1,22 @@ -## Running Example +# Svelte App -Ensure you have setup and installed all the project dependencies. +This is the default Svelte template. + +## Installation ``` -npm install -g tauri -git clone https://github.com/tauri-apps/tauri -cd examples/svelte/svelte-app -yarn -cargo install tauri-bundler +$ cargo install tauri-bundler +$ yarn ``` -### Development +## Dev ``` -yarn start & tauri dev +$ yarn tauri dev ``` -### Production +## Build ``` -yarn build -tauri build -``` - -# Original ReadMe - -*Psst — looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)* - ---- - -# svelte app - -This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template. - -To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit): - -```bash -npx degit sveltejs/template svelte-app -cd svelte-app -``` - -*Note that you will need to have [Node.js](https://nodejs.org) installed.* - - -## Get started - -Install the dependencies... - -```bash -cd svelte-app -npm install -``` - -...then start [Rollup](https://rollupjs.org): - -```bash -npm run dev -``` - -Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes. - -By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`. - - -## Building and running in production mode - -To create an optimised version of the app: - -```bash -npm run build -``` - -You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com). - - -## Single-page app mode - -By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere. - -If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json: - -```js -"start": "sirv public --single" -``` - - -## Deploying to the web - -### With [now](https://zeit.co/now) - -Install `now` if you haven't already: - -```bash -npm install -g now -``` - -Then, from within your project folder: - -```bash -cd public -now deploy --name my-project -``` - -As an alternative, use the [Now desktop client](https://zeit.co/download) and simply drag the unzipped project folder to the taskbar icon. - -### With [surge](https://surge.sh/) - -Install `surge` if you haven't already: - -```bash -npm install -g surge -``` - -Then, from within your project folder: - -```bash -npm run build -surge public my-project.surge.sh +$ yarn tauri build ``` diff --git a/node/svelte/svelte-app/package.json b/node/svelte/svelte-app/package.json index c0e109f2..febf3b09 100644 --- a/node/svelte/svelte-app/package.json +++ b/node/svelte/svelte-app/package.json @@ -7,14 +7,9 @@ "dev": "rollup -c -w", "build": "rollup -c", "test": "echo \"No test specified\" && exit 0", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "devDependencies": { "@babel/core": "7.10.4", diff --git a/node/svelte/svelte-app/src-tauri/tauri.conf.json b/node/svelte/svelte-app/src-tauri/tauri.conf.json index 1847707e..710c7711 100644 --- a/node/svelte/svelte-app/src-tauri/tauri.conf.json +++ b/node/svelte/svelte-app/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../public", - "devPath": "http://localhost:5000" + "devPath": "http://localhost:5000", + "beforeDevCommand": "yarn dev", + "beforeBuildCommand": "yarn build" }, "ctx": {}, "tauri": { diff --git a/node/vanillajs/monolith/README.md b/node/vanillajs/monolith/README.md new file mode 100644 index 00000000..fed1965e --- /dev/null +++ b/node/vanillajs/monolith/README.md @@ -0,0 +1,22 @@ +# Monolith Vanilla JavaScript App + +A Tauri app that uses Vanilla JavaScript with a monolith index.html. + +## Installation + +``` +$ cargo install tauri-bundler +$ yarn +``` + +## Dev + +``` +$ yarn tauri dev +``` + +## Build + +``` +$ yarn tauri build +``` diff --git a/node/vanillajs/monolith/package.json b/node/vanillajs/monolith/package.json index 6b1bec0f..073ab6f9 100644 --- a/node/vanillajs/monolith/package.json +++ b/node/vanillajs/monolith/package.json @@ -7,14 +7,9 @@ "test": "echo \"Error: no test specified\" && exit 1", "build": "echo \"No build is necessary for Vanillajs, skipping.\"", "html:dev": "quasar serve ./dist", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "author": "", "license": "MIT", diff --git a/node/vue/nuxt-app/README.md b/node/vue/nuxt-app/README.md index 382cb570..7be14e2d 100644 --- a/node/vue/nuxt-app/README.md +++ b/node/vue/nuxt-app/README.md @@ -1,22 +1,22 @@ -# nuxt-app +# Nuxt App -> My good Nuxt.js project +This project was bootstrapped with [create-nuxt-app](https://github.com/nuxt/create-nuxt-app/). -## Build Setup +## Installation -``` bash -# install dependencies -$ yarn install - -# serve with hot reload at localhost:3000 -$ yarn dev - -# build for production and launch server -$ yarn build -$ yarn start - -# generate static project -$ yarn generate +``` +$ cargo install tauri-bundler +$ yarn ``` -For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). +## Dev + +``` +$ yarn tauri dev +``` + +## Build + +``` +$ yarn tauri build +``` diff --git a/node/vue/nuxt-app/package.json b/node/vue/nuxt-app/package.json index c4793c01..7d0135f7 100644 --- a/node/vue/nuxt-app/package.json +++ b/node/vue/nuxt-app/package.json @@ -9,14 +9,9 @@ "build": "nuxt build", "start": "nuxt start", "generate": "nuxt generate", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "dependencies": { "nuxt": "2.13.3" diff --git a/node/vue/nuxt-app/src-tauri/tauri.conf.json b/node/vue/nuxt-app/src-tauri/tauri.conf.json index 02be3fe5..b5663ede 100644 --- a/node/vue/nuxt-app/src-tauri/tauri.conf.json +++ b/node/vue/nuxt-app/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../dist", - "devPath": "http://localhost:4000" + "devPath": "http://localhost:4000", + "beforeDevCommand": "yarn start", + "beforeBuildCommand": "yarn build" }, "ctx": {}, "tauri": { @@ -30,4 +32,4 @@ "active": false } } -} \ No newline at end of file +} diff --git a/node/vue/quasar-app/README.md b/node/vue/quasar-app/README.md index 0c3c4c3d..1b7a0f62 100644 --- a/node/vue/quasar-app/README.md +++ b/node/vue/quasar-app/README.md @@ -1,26 +1,22 @@ -# Quasar App (quasar-app) +# Quasar App -A Quasar Framework app +This project was bootstrapped with [Quasar CLI](https://github.com/quasarframework/quasar/). -## Install the dependencies -```bash -yarn +## Installation + +``` +$ cargo install tauri-bundler +$ yarn ``` -### Start the app in development mode (hot-code reloading, error reporting, etc.) -```bash -quasar dev +## Dev + +``` +$ yarn tauri dev ``` -### Lint the files -```bash -yarn run lint -``` +## Build -### Build the app for production -```bash -quasar build ``` - -### Customize the configuration -See [Configuring quasar.conf.js](https://quasar.dev/quasar-cli/quasar-conf-js). +$ yarn tauri build +``` diff --git a/node/vue/quasar-app/package.json b/node/vue/quasar-app/package.json index 39a0987f..c5fd9474 100644 --- a/node/vue/quasar-app/package.json +++ b/node/vue/quasar-app/package.json @@ -9,14 +9,9 @@ "lint": "eslint --ext .js,.vue src", "test": "echo \"No test specified\" && exit 0", "build": "quasar build", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "dependencies": { "@quasar/extras": "1.8.2", diff --git a/node/vue/quasar-app/src-tauri/tauri.conf.json b/node/vue/quasar-app/src-tauri/tauri.conf.json index 9332b9f4..46846f05 100644 --- a/node/vue/quasar-app/src-tauri/tauri.conf.json +++ b/node/vue/quasar-app/src-tauri/tauri.conf.json @@ -1,7 +1,9 @@ { "build": { "distDir": "../dist/spa", - "devPath": "http://localhost:7334" + "devPath": "http://localhost:7334", + "beforeDevCommand": "quasar dev", + "beforeBuildCommand": "quasar build" }, "ctx": {}, "tauri": { @@ -10,10 +12,10 @@ }, "bundle": { "active": true, - "identifier": "com.tauri.dev", - "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"], - "resources": ["resources"], - "targets": ["deb", "osx", "msi", "appimage"] + "identifier": "com.tauri.dev", + "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"], + "resources": ["resources"], + "targets": ["deb", "osx", "msi", "appimage"] }, "whitelist": { "all": true diff --git a/node/vue/vue-cli-app/README.md b/node/vue/vue-cli-app/README.md index 79a947db..66c33244 100644 --- a/node/vue/vue-cli-app/README.md +++ b/node/vue/vue-cli-app/README.md @@ -1,24 +1,22 @@ -# vue-cli-app +# Vue CLI App + +This project was bootstrapped with [Vue CLI](https://cli.vuejs.org/). + +## Installation -## Project setup ``` -yarn install +$ cargo install tauri-bundler +$ yarn ``` -### Compiles and hot-reloads for development +## Dev + ``` -yarn serve +$ yarn tauri:serve ``` -### Compiles and minifies for production -``` -yarn build -``` +## Build -### Lints and fixes files ``` -yarn lint +$ yarn tauri:build ``` - -### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/node/vue/vue-cli-app/package.json b/node/vue/vue-cli-app/package.json index 5289c99c..ef46e3da 100644 --- a/node/vue/vue-cli-app/package.json +++ b/node/vue/vue-cli-app/package.json @@ -7,7 +7,7 @@ "build": "vue-cli-service build", "lint": "vue-cli-service lint", "tauri:build": "vue-cli-service tauri:build", - "tauri:serve": "vue-cli-service tauri:serve" + "tauri:dev": "vue-cli-service tauri:serve" }, "dependencies": { "core-js": "3.6.5", diff --git a/rust/README.md b/rust/README.md new file mode 100644 index 00000000..192d40c7 --- /dev/null +++ b/rust/README.md @@ -0,0 +1,3 @@ +# Rust examples + +This is a list of examples of Tauri apps with frontend written in Rust. diff --git a/rust/yew/todomvc/Makefile.toml b/rust/yew/todomvc/Makefile.toml index 9f3d3dc7..6e7d6174 100644 --- a/rust/yew/todomvc/Makefile.toml +++ b/rust/yew/todomvc/Makefile.toml @@ -1,9 +1,8 @@ [tasks.install] script = [ - "cargo install cargo-web", + "cargo install cargo-web --force", "yarn install", - "yarn add tauri", - "cargo install tauri-bundler" + "cargo install tauri-bundler --force" ] [tasks.build-todomvc] diff --git a/tauri/README.md b/tauri/README.md new file mode 100644 index 00000000..9828d196 --- /dev/null +++ b/tauri/README.md @@ -0,0 +1,3 @@ +# Tauri examples + +This is a list of examples of the Tauri API usage. diff --git a/tauri/communication/README.md b/tauri/communication/README.md new file mode 100644 index 00000000..563ad757 --- /dev/null +++ b/tauri/communication/README.md @@ -0,0 +1,22 @@ +# Communication example + +Demonstrates how to communicate between the backend and the frontend. + +## Installation + +``` +$ cargo install tauri-bundler +$ yarn +``` + +## Dev + +``` +$ yarn tauri dev +``` + +## Build + +``` +$ yarn tauri build +``` diff --git a/transpiled/reason-react/package.json b/transpiled/reason-react/package.json index 6bcfa781..5009063a 100644 --- a/transpiled/reason-react/package.json +++ b/transpiled/reason-react/package.json @@ -7,14 +7,9 @@ "clean": "bsb -clean-world", "server": "moduleserve ./ --port 8000", "bundle": "webpack --config webpack.config.js", - "tauri:prod": "tauri", "tauri:source": "node ../../../../cli/tauri.js/bin/tauri", - "tauri:source:init": "yarn tauri:source init --tauriPath ../../../../tauri", - "tauri:prod:init": "yarn tauri:prod init", - "tauri:source:dev": "yarn tauri:source dev", - "tauri:prod:dev": "yarn tauri:prod dev", - "tauri:source:build": "yarn tauri:source build", - "tauri:prod:build": "yarn tauri:prod build" + "tauri:dev": "yarn tauri:source dev", + "tauri:build": "yarn tauri:source build" }, "keywords": [ "BuckleScript", @@ -36,4 +31,4 @@ "webpack": "^4.42.0", "webpack-cli": "^3.3.11" } -} \ No newline at end of file +}