├── .all-contributorsrc ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── ci.yml │ ├── close-old-needs-reply.yml │ └── needs-reply-remove.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── .gitignore ├── CHANGELOG.md ├── README.md ├── babel.config.js ├── blog │ ├── 2019-05-28-hola.md │ ├── 2019-05-29-hello-world.md │ └── 2019-05-30-welcome.md ├── docs │ ├── intro.md │ ├── tutorial-basics │ │ ├── _category_.json │ │ ├── congratulations.md │ │ ├── create-a-blog-post.md │ │ ├── create-a-document.md │ │ ├── create-a-page.md │ │ ├── deploy-your-site.md │ │ └── markdown-features.mdx │ └── tutorial-extras │ │ ├── _category_.json │ │ ├── manage-docs-versions.md │ │ └── translate-your-site.md ├── docusaurus.config.js ├── package-lock.json ├── package.json ├── sidebars.js ├── src │ ├── components │ │ ├── HomepageFeatures.js │ │ └── HomepageFeatures.module.css │ ├── css │ │ └── custom.css │ └── pages │ │ ├── index.js │ │ ├── index.module.css │ │ └── markdown-page.md ├── static │ ├── .nojekyll │ └── img │ │ ├── docusaurus.png │ │ ├── favicon.ico │ │ ├── logo.svg │ │ ├── tutorial │ │ ├── docsVersionDropdown.png │ │ └── localeDropdown.png │ │ ├── undraw_docusaurus_mountain.svg │ │ ├── undraw_docusaurus_react.svg │ │ └── undraw_docusaurus_tree.svg └── yarn.lock ├── lerna.json ├── package-lock.json ├── package.json └── platform ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc.js ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build-platform.js ├── changelog.config.js ├── deployChangeLog.sh ├── package-lock.json ├── package.json ├── src └── cli-scripts │ ├── add.ts │ ├── common.ts │ ├── copy.ts │ ├── index.ts │ ├── open.ts │ └── update.ts └── template ├── .gitignore ├── package.json └── src-tauri ├── Cargo.lock ├── Cargo.toml ├── icons ├── 128x128.png ├── 128x128@2x.png ├── 32x32.png ├── Square107x107Logo.png ├── Square142x142Logo.png ├── Square150x150Logo.png ├── Square284x284Logo.png ├── Square30x30Logo.png ├── Square310x310Logo.png ├── Square44x44Logo.png ├── Square71x71Logo.png ├── Square89x89Logo.png ├── StoreLogo.png ├── icon.icns ├── icon.ico └── icon.png ├── rustfmt.toml ├── src ├── build.rs └── main.rs ├── tauri-capacitor-plugin ├── Cargo.lock ├── Cargo.toml └── src │ └── lib.rs └── tauri.conf.json /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "tauri", 3 | "projectOwner": "capacitor-community", 4 | "repoType": "github", 5 | "badgeTemplate": "-orange?style=flat-square\" />", 6 | "repoHost": "https://github.com", 7 | "files": [ 8 | "README.md" 9 | ], 10 | "imageSize": 75, 11 | "commit": true, 12 | "commitConvention": "none", 13 | "contributors": [ 14 | { 15 | "login": "IT-MikeS", 16 | "name": "Mike S", 17 | "avatar_url": "https://avatars0.githubusercontent.com/u/20338451?v=4", 18 | "profile": "https://github.com/IT-MikeS", 19 | "contributions": [ 20 | "code", 21 | "doc" 22 | ] 23 | } 24 | ], 25 | "contributorsPerLine": 7, 26 | "skipCi": true 27 | } -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | 28 | - OS: [e.g. iOS] 29 | - Browser [e.g. chrome, safari] 30 | - Version [e.g. 22] 31 | 32 | **Smartphone (please complete the following information):** 33 | 34 | - Device: [e.g. iPhone6] 35 | - OS: [e.g. iOS8.1] 36 | - Browser [e.g. stock browser, safari] 37 | - Version [e.g. 22] 38 | 39 | **Additional context** 40 | Add any other context about the problem here. 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | pull_request: 8 | branches: 9 | - "main" 10 | 11 | jobs: 12 | lint-platform: 13 | runs-on: ubuntu-latest 14 | timeout-minutes: 30 15 | defaults: 16 | run: 17 | working-directory: ./platform 18 | steps: 19 | - uses: actions/setup-node@v1 20 | with: 21 | node-version: 14.x 22 | - uses: actions/checkout@v2 23 | - run: npm install 24 | - run: npm run lint 25 | 26 | build-platform: 27 | runs-on: ubuntu-latest 28 | timeout-minutes: 30 29 | defaults: 30 | run: 31 | working-directory: ./platform 32 | steps: 33 | - uses: actions/setup-node@v1 34 | with: 35 | node-version: 14.x 36 | - uses: actions/checkout@v2 37 | - run: npm install 38 | - run: npm run build 39 | -------------------------------------------------------------------------------- /.github/workflows/close-old-needs-reply.yml: -------------------------------------------------------------------------------- 1 | name: Close old issues that need reply 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * *" 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Close old issues that need reply 12 | uses: dwieeb/needs-reply@v2 13 | with: 14 | repo-token: ${{ secrets.BOT_TOKEN }} 15 | issue-label: needs-reply 16 | close-message: | 17 | It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot. 18 | 19 | Have a great day! 20 | Capacitor Community Bot 💙 21 | -------------------------------------------------------------------------------- /.github/workflows/needs-reply-remove.yml: -------------------------------------------------------------------------------- 1 | name: Remove needs-reply label 2 | 3 | on: 4 | issue_comment: 5 | types: 6 | - created 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Remove needs-reply label 13 | uses: octokit/request-action@v2.x 14 | continue-on-error: true 15 | with: 16 | route: DELETE /repos/:repository/issues/:issue/labels/:label 17 | repository: ${{ github.repository }} 18 | issue: ${{ github.event.issue.number }} 19 | label: needs-reply 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | lerna-debug.log 3 | node_modules -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [1.0.0-alpha.12](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2021-08-19) 7 | 8 | **Note:** Version bump only for package capacitor-tauri-platform 9 | 10 | 11 | 12 | 13 | 14 | # [1.0.0-alpha.11](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2021-08-19) 15 | 16 | 17 | ### Features 18 | 19 | * cli hooks more clear for better DX ([2b69add](https://github.com/capacitor-community/tauri/commit/2b69add17349a089e57cca0cec2f8a9c51534090)) 20 | * more cli improvements ([99866fe](https://github.com/capacitor-community/tauri/commit/99866fe0f9925c64a9b25693e754ed7d2b72291c)) 21 | * no need for copy cli script, use web app build dir ([891f9ec](https://github.com/capacitor-community/tauri/commit/891f9ec6beb34b194632d2edbf4e4a49547b1cb4)) 22 | 23 | 24 | 25 | 26 | 27 | 28 | # [1.0.0-alpha.10](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2021-08-11) 29 | 30 | 31 | ### Bug Fixes 32 | 33 | * more lean npm dist package ([647ea65](https://github.com/capacitor-community/tauri/commit/647ea6555ee7c7507fd728b97da71ae2dd0f628d)) 34 | * open command function on macos ([5407d42](https://github.com/capacitor-community/tauri/commit/5407d425c494be526d76b3c9ba1059403b15b5f1)) 35 | 36 | 37 | 38 | 39 | 40 | # [1.0.0-alpha.9](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2021-08-10) 41 | 42 | **Note:** Version bump only for package capacitor-tauri-platform 43 | 44 | 45 | 46 | 47 | 48 | # [1.0.0-alpha.8](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2021-08-10) 49 | 50 | 51 | ### Features 52 | 53 | * template as tarball in releases ([ce3ba64](https://github.com/capacitor-community/tauri/commit/ce3ba64f7feba7f4f3f08d43242ae805aa353b94)) 54 | 55 | 56 | 57 | 58 | 59 | # [1.0.0-alpha.7](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2021-08-10) 60 | 61 | **Note:** Version bump only for package capacitor-tauri-platform 62 | 63 | 64 | 65 | 66 | 67 | # [1.0.0-alpha.6](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-08-10) 68 | 69 | **Note:** Version bump only for package capacitor-tauri-platform 70 | 71 | 72 | 73 | 74 | 75 | 76 | # [1.0.0-alpha.5](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-08-10) 77 | 78 | **Note:** Version bump only for package capacitor-tauri-platform 79 | 80 | 81 | 82 | 83 | 84 | # [1.0.0-alpha.4](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-08-10) 85 | 86 | **Note:** Version bump only for package capacitor-tauri-platform 87 | 88 | 89 | 90 | 91 | 92 | # [1.0.0-alpha.3](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-08-10) 93 | 94 | 95 | ### Bug Fixes 96 | 97 | * run/open scripts not running ([f985162](https://github.com/capacitor-community/tauri/commit/f98516210c697d3d5b165647f8487e96acdd0ed1)) 98 | 99 | 100 | 101 | 102 | 103 | # [1.0.0-alpha.2](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-08-10) 104 | 105 | **Note:** Version bump only for package capacitor-tauri-platform 106 | 107 | 108 | 109 | 110 | 111 | # 1.0.0-alpha.1 (2021-08-10) 112 | 113 | **Note:** Version bump only for package capacitor-tauri-platform 114 | 115 | 116 | 117 | 118 | 119 | # Change Log 120 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Please see [`CODE_OF_CONDUCT.md`](https://github.com/capacitor-community/welcome/blob/main/CODE_OF_CONDUCT.md) in the Capacitor Community Welcome repository. 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this project 2 | 3 | Describe the steps a developer should go through in order to contribute to this project 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Mike S. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 🚨 This platform is in alpha, expect broken parts. 🚨 3 |

4 | 5 |

6 |
7 |

8 | 9 |

10 | Bring your Capacitor ⚡ apps to the desktop with Tauri! 🖥 11 |

12 |

13 | 14 | 15 | 16 | 17 | 18 |

19 |

20 | 21 | npm 22 | 23 | GitHub Workflow Status 24 |

25 | 26 | ## ⚠ Important Info 27 | - Please follow your operating systems guide to setup your environment for Tauri development [here](https://tauri.studio/en/docs/getting-started/intro#setting-up-your-environment) 28 | - You will need `@capacitor/core` version `>= 3.2.0`. 29 | 30 | ## ⏳ Quickstart (Functioning on: ✅ Windows, ✅ MacOS, ⬜ Linux) 31 | 0. Create or open a Capacitor initialized web app project. [CAPACITOR DOCS](https://capacitorjs.com/docs) 32 | 1. Build your web app (`npm run build` for example) 33 | 2. `npm i @capacitor-community/tauri@alpha` 34 | 3. `npx cap add @capacitor-community/tauri` 35 | 4. `npx cap open @capacitor-community/tauri` - _This can take several minutes the first time you run it._ 36 | 5. You now have your web app running in tauri, right click and select `inspect` to bring up dev tools. 37 | 38 | ## 🎉 More Info 39 | - Check out Tauri on its [website](https://tauri.studio/) or on [github](https://github.com/tauri-apps/tauri) 40 | 41 | ## 🛠 Maintainers 42 | 43 | | Maintainer | GitHub | Social | Sponsoring Company | Primary | 44 | | ---------------- | --------------------------------------- | ----------------------------------------- | ------------------ | ------- | 45 | | Mike Summerfeldt | [IT-MikeS](https://github.com/IT-MikeS) | [@IT_MikeS](https://twitter.com/IT_MikeS) | Volunteer | Yes | 46 | 47 | 48 | ## ✨ Contributors 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |

Mike Summerfeldt

💻 📖
58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [1.0.0-alpha.12](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2021-08-19) 7 | 8 | **Note:** Version bump only for package docs 9 | 10 | 11 | 12 | 13 | 14 | # [1.0.0-alpha.11](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2021-08-19) 15 | 16 | **Note:** Version bump only for package docs 17 | 18 | 19 | 20 | 21 | 22 | 23 | # [1.0.0-alpha.10](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2021-08-11) 24 | 25 | **Note:** Version bump only for package docs 26 | 27 | 28 | 29 | 30 | 31 | # [1.0.0-alpha.9](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2021-08-10) 32 | 33 | **Note:** Version bump only for package docs 34 | 35 | 36 | 37 | 38 | 39 | # [1.0.0-alpha.8](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2021-08-10) 40 | 41 | **Note:** Version bump only for package docs 42 | 43 | 44 | 45 | 46 | 47 | # [1.0.0-alpha.7](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2021-08-10) 48 | 49 | **Note:** Version bump only for package docs 50 | 51 | 52 | 53 | 54 | 55 | # [1.0.0-alpha.6](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-08-10) 56 | 57 | **Note:** Version bump only for package docs 58 | 59 | 60 | 61 | 62 | 63 | 64 | # [1.0.0-alpha.5](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-08-10) 65 | 66 | **Note:** Version bump only for package docs 67 | 68 | 69 | 70 | 71 | 72 | # [1.0.0-alpha.4](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-08-10) 73 | 74 | **Note:** Version bump only for package docs 75 | 76 | 77 | 78 | 79 | 80 | # [1.0.0-alpha.3](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-08-10) 81 | 82 | **Note:** Version bump only for package docs 83 | 84 | 85 | 86 | 87 | 88 | # [1.0.0-alpha.2](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-08-10) 89 | 90 | **Note:** Version bump only for package docs 91 | 92 | 93 | 94 | 95 | 96 | # 1.0.0-alpha.1 (2021-08-10) 97 | 98 | **Note:** Version bump only for package docs 99 | 100 | 101 | 102 | 103 | 104 | 105 | # [4.0.0-next.8](https://github.com/capacitor-community/electron/compare/v4.0.0-next.7...v4.0.0-next.8) (2021-07-23) 106 | 107 | **Note:** Version bump only for package docs 108 | 109 | 110 | 111 | 112 | 113 | # [4.0.0-next.7](https://github.com/capacitor-community/electron/compare/v4.0.0-next.6...v4.0.0-next.7) (2021-07-23) 114 | 115 | **Note:** Version bump only for package docs 116 | 117 | 118 | 119 | 120 | 121 | # [4.0.0-next.4](https://github.com/capacitor-community/electron/compare/v4.0.0-next.3...v4.0.0-next.4) (2021-07-23) 122 | 123 | **Note:** Version bump only for package docs 124 | 125 | 126 | 127 | 128 | 129 | # [4.0.0-next.3](https://github.com/capacitor-community/electron/compare/v4.0.0-next.2...v4.0.0-next.3) (2021-07-23) 130 | 131 | **Note:** Version bump only for package docs 132 | 133 | 134 | 135 | 136 | 137 | # [4.0.0-next.2](https://github.com/capacitor-community/electron/compare/v4.0.0-next.1...v4.0.0-next.2) (2021-07-23) 138 | 139 | **Note:** Version bump only for package docs 140 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ## Installation 6 | 7 | ```console 8 | yarn install 9 | ``` 10 | 11 | ## Local Development 12 | 13 | ```console 14 | yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ## Build 20 | 21 | ```console 22 | yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ## Deployment 28 | 29 | ```console 30 | GIT_USER= USE_SSH=true yarn deploy 31 | ``` 32 | 33 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 34 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/blog/2019-05-28-hola.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: hola 3 | title: Hola 4 | author: Gao Wei 5 | author_title: Docusaurus Core Team 6 | author_url: https://github.com/wgao19 7 | author_image_url: https://avatars1.githubusercontent.com/u/2055384?v=4 8 | tags: [hola, docusaurus] 9 | --- 10 | 11 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet 12 | -------------------------------------------------------------------------------- /docs/blog/2019-05-29-hello-world.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: hello-world 3 | title: Hello 4 | author: Endilie Yacop Sucipto 5 | author_title: Maintainer of Docusaurus 6 | author_url: https://github.com/endiliey 7 | author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4 8 | tags: [hello, docusaurus] 9 | --- 10 | 11 | Welcome to this blog. This blog is created with [**Docusaurus 2**](https://docusaurus.io/). 12 | 13 | 14 | 15 | This is a test post. 16 | 17 | A whole bunch of other information. 18 | -------------------------------------------------------------------------------- /docs/blog/2019-05-30-welcome.md: -------------------------------------------------------------------------------- 1 | --- 2 | slug: welcome 3 | title: Welcome 4 | author: Yangshun Tay 5 | author_title: Front End Engineer @ Facebook 6 | author_url: https://github.com/yangshun 7 | author_image_url: https://avatars0.githubusercontent.com/u/1315101?s=400&v=4 8 | tags: [facebook, hello, docusaurus] 9 | --- 10 | 11 | Blog features are powered by the blog plugin. Simply add files to the `blog` directory. It supports tags as well! 12 | 13 | Delete the whole directory if you don't want the blog features. As simple as that! 14 | -------------------------------------------------------------------------------- /docs/docs/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Tutorial Intro 6 | 7 | Let's discover **Docusaurus in less than 5 minutes**! 8 | 9 | ## Getting Started 10 | 11 | Get started by **creating a new site**. 12 | 13 | Or **try Docusaurus immediately** with **[new.docusaurus.io](https://new.docusaurus.io)**. 14 | 15 | ## Generate a new site 16 | 17 | Generate a new Docusaurus site using the **classic template**: 18 | 19 | ```shell 20 | npx @docusaurus/init@latest init my-website classic 21 | ``` 22 | 23 | ## Start your site 24 | 25 | Run the development server: 26 | 27 | ```shell 28 | cd my-website 29 | 30 | npx docusaurus start 31 | ``` 32 | 33 | Your site starts at `http://localhost:3000`. 34 | 35 | Open `docs/intro.md` and edit some lines: the site **reloads automatically** and display your changes. 36 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Basics", 3 | "position": 2 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/congratulations.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # Congratulations! 6 | 7 | You have just learned the **basics of Docusaurus** and made some changes to the **initial template**. 8 | 9 | Docusaurus has **much more to offer**! 10 | 11 | Have **5 more minutes**? Take a look at **[versioning](../tutorial-extras/manage-docs-versions.md)** and **[i18n](../tutorial-extras/translate-your-site.md)**. 12 | 13 | Anything **unclear** or **buggy** in this tutorial? [Please report it!](https://github.com/facebook/docusaurus/discussions/4610) 14 | 15 | ## What's next? 16 | 17 | - Read the [official documentation](https://docusaurus.io/). 18 | - Add a custom [Design and Layout](https://docusaurus.io/docs/styling-layout) 19 | - Add a [search bar](https://docusaurus.io/docs/search) 20 | - Find inspirations in the [Docusaurus showcase](https://docusaurus.io/showcase) 21 | - Get involved in the [Docusaurus Community](https://docusaurus.io/community/support) 22 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/create-a-blog-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | 5 | # Create a Blog Post 6 | 7 | Docusaurus creates a **page for each blog post**, but also a **blog index page**, a **tag system**, an **RSS** feed... 8 | 9 | ## Create your first Post 10 | 11 | Create a file at `blog/2021-02-28-greetings.md`: 12 | 13 | ```md title="blog/2021-02-28-greetings.md" 14 | --- 15 | slug: greetings 16 | title: Greetings! 17 | author: Steven Hansel 18 | author_title: Docusaurus Contributor 19 | author_url: https://github.com/ShinteiMai 20 | author_image_url: https://github.com/ShinteiMai.png 21 | tags: [greetings] 22 | --- 23 | 24 | Congratulations, you have made your first post! 25 | 26 | Feel free to play around and edit this post as much you like. 27 | ``` 28 | 29 | A new blog post is now available at `http://localhost:3000/blog/greetings`. 30 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/create-a-document.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Create a Document 6 | 7 | Documents are **groups of pages** connected through: 8 | 9 | - a **sidebar** 10 | - **previous/next navigation** 11 | - **versioning** 12 | 13 | ## Create your first Doc 14 | 15 | Create a markdown file at `docs/hello.md`: 16 | 17 | ```md title="docs/hello.md" 18 | # Hello 19 | 20 | This is my **first Docusaurus document**! 21 | ``` 22 | 23 | A new document is now available at `http://localhost:3000/docs/hello`. 24 | 25 | ## Configure the Sidebar 26 | 27 | Docusaurus automatically **creates a sidebar** from the `docs` folder. 28 | 29 | Add metadatas to customize the sidebar label and position: 30 | 31 | ```md title="docs/hello.md" {1-4} 32 | --- 33 | sidebar_label: 'Hi!' 34 | sidebar_position: 3 35 | --- 36 | 37 | # Hello 38 | 39 | This is my **first Docusaurus document**! 40 | ``` 41 | 42 | It is also possible to create your sidebar explicitly in `sidebars.js`: 43 | 44 | ```diff title="sidebars.js" 45 | module.exports = { 46 | tutorialSidebar: [ 47 | { 48 | type: 'category', 49 | label: 'Tutorial', 50 | - items: [...], 51 | + items: ['hello'], 52 | }, 53 | ], 54 | }; 55 | ``` 56 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/create-a-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Create a Page 6 | 7 | Add **Markdown or React** files to `src/pages` to create a **standalone page**: 8 | 9 | - `src/pages/index.js` -> `localhost:3000/` 10 | - `src/pages/foo.md` -> `localhost:3000/foo` 11 | - `src/pages/foo/bar.js` -> `localhost:3000/foo/bar` 12 | 13 | ## Create your first React Page 14 | 15 | Create a file at `src/pages/my-react-page.js`: 16 | 17 | ```jsx title="src/pages/my-react-page.js" 18 | import React from 'react'; 19 | import Layout from '@theme/Layout'; 20 | 21 | export default function MyReactPage() { 22 | return ( 23 | 24 |

My React page

25 |

This is a React page

26 |
27 | ); 28 | } 29 | ``` 30 | 31 | A new page is now available at `http://localhost:3000/my-react-page`. 32 | 33 | ## Create your first Markdown Page 34 | 35 | Create a file at `src/pages/my-markdown-page.md`: 36 | 37 | ```mdx title="src/pages/my-markdown-page.md" 38 | # My Markdown page 39 | 40 | This is a Markdown page 41 | ``` 42 | 43 | A new page is now available at `http://localhost:3000/my-markdown-page`. 44 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/deploy-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Deploy your site 6 | 7 | Docusaurus is a **static-site-generator** (also called **[Jamstack](https://jamstack.org/)**). 8 | 9 | It builds your site as simple **static HTML, JavaScript and CSS files**. 10 | 11 | ## Build your site 12 | 13 | Build your site **for production**: 14 | 15 | ```bash 16 | npm run build 17 | ``` 18 | 19 | The static files are generated in the `build` folder. 20 | 21 | ## Deploy your site 22 | 23 | Test your production build locally: 24 | 25 | ```bash 26 | npm run serve 27 | ``` 28 | 29 | The `build` folder is now served at `http://localhost:3000/`. 30 | 31 | You can now deploy the `build` folder **almost anywhere** easily, **for free** or very small cost (read the **[Deployment Guide](https://docusaurus.io/docs/deployment)**). 32 | -------------------------------------------------------------------------------- /docs/docs/tutorial-basics/markdown-features.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Markdown Features 6 | 7 | Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. 8 | 9 | ## Front Matter 10 | 11 | Markdown documents have metadata at the top called [Front Matter](https://jekyllrb.com/docs/front-matter/): 12 | 13 | ```text title="my-doc.md" 14 | // highlight-start 15 | --- 16 | id: my-doc-id 17 | title: My document title 18 | description: My document description 19 | slug: /my-custom-url 20 | --- 21 | // highlight-end 22 | 23 | ## Markdown heading 24 | 25 | Markdown text with [links](./hello.md) 26 | ``` 27 | 28 | ## Links 29 | 30 | Regular Markdown links are supported, using url paths or relative file paths. 31 | 32 | ```md 33 | Let's see how to [Create a page](/create-a-page). 34 | ``` 35 | 36 | ```md 37 | Let's see how to [Create a page](./create-a-page.md). 38 | ``` 39 | 40 | **Result:** Let's see how to [Create a page](./create-a-page.md). 41 | 42 | ## Images 43 | 44 | Regular Markdown images are supported. 45 | 46 | Add an image at `static/img/docusaurus.png` and display it in Markdown: 47 | 48 | ```md 49 | ![Docusaurus logo](/img/docusaurus.png) 50 | ``` 51 | 52 | ![Docusaurus logo](/img/docusaurus.png) 53 | 54 | ## Code Blocks 55 | 56 | Markdown code blocks are supported with Syntax highlighting. 57 | 58 | ```jsx title="src/components/HelloDocusaurus.js" 59 | function HelloDocusaurus() { 60 | return ( 61 |

Hello, Docusaurus!

62 | ) 63 | } 64 | ``` 65 | 66 | ```jsx title="src/components/HelloDocusaurus.js" 67 | function HelloDocusaurus() { 68 | return

Hello, Docusaurus!

; 69 | } 70 | ``` 71 | 72 | ## Admonitions 73 | 74 | Docusaurus has a special syntax to create admonitions and callouts: 75 | 76 | :::tip My tip 77 | 78 | Use this awesome feature option 79 | 80 | ::: 81 | 82 | :::danger Take care 83 | 84 | This action is dangerous 85 | 86 | ::: 87 | 88 | :::tip My tip 89 | 90 | Use this awesome feature option 91 | 92 | ::: 93 | 94 | :::danger Take care 95 | 96 | This action is dangerous 97 | 98 | ::: 99 | 100 | ## MDX and React Components 101 | 102 | [MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: 103 | 104 | ```jsx 105 | export const Highlight = ({children, color}) => ( 106 | { 115 | alert(`You clicked the color ${color} with label ${children}`) 116 | }}> 117 | {children} 118 | 119 | ); 120 | 121 | This is Docusaurus green ! 122 | 123 | This is Facebook blue ! 124 | ``` 125 | 126 | export const Highlight = ({children, color}) => ( 127 | { 136 | alert(`You clicked the color ${color} with label ${children}`); 137 | }}> 138 | {children} 139 | 140 | ); 141 | 142 | This is Docusaurus green ! 143 | 144 | This is Facebook blue ! 145 | -------------------------------------------------------------------------------- /docs/docs/tutorial-extras/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Tutorial - Extras", 3 | "position": 3 4 | } 5 | -------------------------------------------------------------------------------- /docs/docs/tutorial-extras/manage-docs-versions.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | 5 | # Manage Docs Versions 6 | 7 | Docusaurus can manage multiple versions of your docs. 8 | 9 | ## Create a docs version 10 | 11 | Release a version 1.0 of your project: 12 | 13 | ```bash 14 | npm run docusaurus docs:version 1.0 15 | ``` 16 | 17 | The `docs` folder is copied into `versioned_docs/version-1.0` and `versions.json` is created. 18 | 19 | Your docs now have 2 versions: 20 | 21 | - `1.0` at `http://localhost:3000/docs/` for the version 1.0 docs 22 | - `current` at `http://localhost:3000/docs/next/` for the **upcoming, unreleased docs** 23 | 24 | ## Add a Version Dropdown 25 | 26 | To navigate seamlessly across versions, add a version dropdown. 27 | 28 | Modify the `docusaurus.config.js` file: 29 | 30 | ```js title="docusaurus.config.js" 31 | module.exports = { 32 | themeConfig: { 33 | navbar: { 34 | items: [ 35 | // highlight-start 36 | { 37 | type: 'docsVersionDropdown', 38 | }, 39 | // highlight-end 40 | ], 41 | }, 42 | }, 43 | }; 44 | ``` 45 | 46 | The docs version dropdown appears in your navbar: 47 | 48 | ![Docs Version Dropdown](/img/tutorial/docsVersionDropdown.png) 49 | 50 | ## Update an existing version 51 | 52 | It is possible to edit versioned docs in their respective folder: 53 | 54 | - `versioned_docs/version-1.0/hello.md` updates `http://localhost:3000/docs/hello` 55 | - `docs/hello.md` updates `http://localhost:3000/docs/next/hello` 56 | -------------------------------------------------------------------------------- /docs/docs/tutorial-extras/translate-your-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # Translate your site 6 | 7 | Let's translate `docs/intro.md` to French. 8 | 9 | ## Configure i18n 10 | 11 | Modify `docusaurus.config.js` to add support for the `fr` locale: 12 | 13 | ```js title="docusaurus.config.js" 14 | module.exports = { 15 | i18n: { 16 | defaultLocale: 'en', 17 | locales: ['en', 'fr'], 18 | }, 19 | }; 20 | ``` 21 | 22 | ## Translate a doc 23 | 24 | Copy the `docs/intro.md` file to the `i18n/fr` folder: 25 | 26 | ```bash 27 | mkdir -p i18n/fr/docusaurus-plugin-content-docs/current/ 28 | 29 | cp docs/intro.md i18n/fr/docusaurus-plugin-content-docs/current/intro.md 30 | ``` 31 | 32 | Translate `i18n/fr/docusaurus-plugin-content-docs/current/intro.md` in French. 33 | 34 | ## Start your localized site 35 | 36 | Start your site on the French locale: 37 | 38 | ```bash 39 | npm run start -- --locale fr 40 | ``` 41 | 42 | Your localized site is accessible at `http://localhost:3000/fr/` and the `Getting Started` page is translated. 43 | 44 | :::caution 45 | 46 | In development, you can only use one locale at a same time. 47 | 48 | ::: 49 | 50 | ## Add a Locale Dropdown 51 | 52 | To navigate seamlessly across languages, add a locale dropdown. 53 | 54 | Modify the `docusaurus.config.js` file: 55 | 56 | ```js title="docusaurus.config.js" 57 | module.exports = { 58 | themeConfig: { 59 | navbar: { 60 | items: [ 61 | // highlight-start 62 | { 63 | type: 'localeDropdown', 64 | }, 65 | // highlight-end 66 | ], 67 | }, 68 | }, 69 | }; 70 | ``` 71 | 72 | The locale dropdown now appears in your navbar: 73 | 74 | ![Locale Dropdown](/img/tutorial/localeDropdown.png) 75 | 76 | ## Build your localized site 77 | 78 | Build your site for a specific locale: 79 | 80 | ```bash 81 | npm run build -- --locale fr 82 | ``` 83 | 84 | Or build your site to include all the locales at once: 85 | 86 | ```bash 87 | npm run build 88 | ``` 89 | -------------------------------------------------------------------------------- /docs/docusaurus.config.js: -------------------------------------------------------------------------------- 1 | const lightCodeTheme = require('prism-react-renderer/themes/github'); 2 | const darkCodeTheme = require('prism-react-renderer/themes/dracula'); 3 | 4 | /** @type {import('@docusaurus/types').DocusaurusConfig} */ 5 | module.exports = { 6 | title: 'My Site', 7 | tagline: 'Dinosaurs are cool', 8 | url: 'https://your-docusaurus-test-site.com', 9 | baseUrl: '/', 10 | onBrokenLinks: 'throw', 11 | onBrokenMarkdownLinks: 'warn', 12 | favicon: 'img/favicon.ico', 13 | organizationName: 'facebook', // Usually your GitHub org/user name. 14 | projectName: 'docusaurus', // Usually your repo name. 15 | themeConfig: { 16 | navbar: { 17 | title: 'My Site', 18 | logo: { 19 | alt: 'My Site Logo', 20 | src: 'img/logo.svg', 21 | }, 22 | items: [ 23 | { 24 | type: 'doc', 25 | docId: 'intro', 26 | position: 'left', 27 | label: 'Tutorial', 28 | }, 29 | {to: '/blog', label: 'Blog', position: 'left'}, 30 | { 31 | href: 'https://github.com/facebook/docusaurus', 32 | label: 'GitHub', 33 | position: 'right', 34 | }, 35 | ], 36 | }, 37 | footer: { 38 | style: 'dark', 39 | links: [ 40 | { 41 | title: 'Docs', 42 | items: [ 43 | { 44 | label: 'Tutorial', 45 | to: '/docs/intro', 46 | }, 47 | ], 48 | }, 49 | { 50 | title: 'Community', 51 | items: [ 52 | { 53 | label: 'Stack Overflow', 54 | href: 'https://stackoverflow.com/questions/tagged/docusaurus', 55 | }, 56 | { 57 | label: 'Discord', 58 | href: 'https://discordapp.com/invite/docusaurus', 59 | }, 60 | { 61 | label: 'Twitter', 62 | href: 'https://twitter.com/docusaurus', 63 | }, 64 | ], 65 | }, 66 | { 67 | title: 'More', 68 | items: [ 69 | { 70 | label: 'Blog', 71 | to: '/blog', 72 | }, 73 | { 74 | label: 'GitHub', 75 | href: 'https://github.com/facebook/docusaurus', 76 | }, 77 | ], 78 | }, 79 | ], 80 | copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, 81 | }, 82 | prism: { 83 | theme: lightCodeTheme, 84 | darkTheme: darkCodeTheme, 85 | }, 86 | }, 87 | presets: [ 88 | [ 89 | '@docusaurus/preset-classic', 90 | { 91 | docs: { 92 | sidebarPath: require.resolve('./sidebars.js'), 93 | // Please change this to your repo. 94 | editUrl: 95 | 'https://github.com/facebook/docusaurus/edit/master/website/', 96 | }, 97 | blog: { 98 | showReadingTime: true, 99 | // Please change this to your repo. 100 | editUrl: 101 | 'https://github.com/facebook/docusaurus/edit/master/website/blog/', 102 | }, 103 | theme: { 104 | customCss: require.resolve('./src/css/custom.css'), 105 | }, 106 | }, 107 | ], 108 | ], 109 | }; 110 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "version": "1.0.0-alpha.12", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@docusaurus/core": "2.0.0-beta.3", 18 | "@docusaurus/preset-classic": "2.0.0-beta.3", 19 | "@mdx-js/react": "^1.6.21", 20 | "@svgr/webpack": "^5.5.0", 21 | "clsx": "^1.1.1", 22 | "file-loader": "^6.2.0", 23 | "prism-react-renderer": "^1.2.1", 24 | "react": "^17.0.1", 25 | "react-dom": "^17.0.1", 26 | "url-loader": "^4.1.1" 27 | }, 28 | "browserslist": { 29 | "production": [ 30 | ">0.5%", 31 | "not dead", 32 | "not op_mini all" 33 | ], 34 | "development": [ 35 | "last 1 chrome version", 36 | "last 1 firefox version", 37 | "last 1 safari version" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | module.exports = { 13 | // By default, Docusaurus generates a sidebar from the docs folder structure 14 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 15 | 16 | // But you can create a sidebar manually 17 | /* 18 | tutorialSidebar: [ 19 | { 20 | type: 'category', 21 | label: 'Tutorial', 22 | items: ['hello'], 23 | }, 24 | ], 25 | */ 26 | }; 27 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import styles from './HomepageFeatures.module.css'; 4 | 5 | const FeatureList = [ 6 | { 7 | title: 'Easy to Use', 8 | Svg: require('../../static/img/undraw_docusaurus_mountain.svg').default, 9 | description: ( 10 | <> 11 | Docusaurus was designed from the ground up to be easily installed and 12 | used to get your website up and running quickly. 13 | 14 | ), 15 | }, 16 | { 17 | title: 'Focus on What Matters', 18 | Svg: require('../../static/img/undraw_docusaurus_tree.svg').default, 19 | description: ( 20 | <> 21 | Docusaurus lets you focus on your docs, and we'll do the chores. Go 22 | ahead and move your docs into the docs directory. 23 | 24 | ), 25 | }, 26 | { 27 | title: 'Powered by React', 28 | Svg: require('../../static/img/undraw_docusaurus_react.svg').default, 29 | description: ( 30 | <> 31 | Extend or customize your website layout by reusing React. Docusaurus can 32 | be extended while reusing the same header and footer. 33 | 34 | ), 35 | }, 36 | ]; 37 | 38 | function Feature({Svg, title, description}) { 39 | return ( 40 |
41 |
42 | 43 |
44 |
45 |

{title}

46 |

{description}

47 |
48 |
49 | ); 50 | } 51 | 52 | export default function HomepageFeatures() { 53 | return ( 54 |
55 |
56 |
57 | {FeatureList.map((props, idx) => ( 58 | 59 | ))} 60 |
61 |
62 |
63 | ); 64 | } 65 | -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | .features { 4 | display: flex; 5 | align-items: center; 6 | padding: 2rem 0; 7 | width: 100%; 8 | } 9 | 10 | .featureSvg { 11 | height: 200px; 12 | width: 200px; 13 | } 14 | -------------------------------------------------------------------------------- /docs/src/css/custom.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | /** 3 | * Any CSS included here will be global. The classic template 4 | * bundles Infima by default. Infima is a CSS framework designed to 5 | * work well for content-centric websites. 6 | */ 7 | 8 | /* You can override the default Infima variables here. */ 9 | :root { 10 | --ifm-color-primary: #25c2a0; 11 | --ifm-color-primary-dark: rgb(33, 175, 144); 12 | --ifm-color-primary-darker: rgb(31, 165, 136); 13 | --ifm-color-primary-darkest: rgb(26, 136, 112); 14 | --ifm-color-primary-light: rgb(70, 203, 174); 15 | --ifm-color-primary-lighter: rgb(102, 212, 189); 16 | --ifm-color-primary-lightest: rgb(146, 224, 208); 17 | --ifm-code-font-size: 95%; 18 | } 19 | 20 | .docusaurus-highlight-code-line { 21 | background-color: rgba(0, 0, 0, 0.1); 22 | display: block; 23 | margin: 0 calc(-1 * var(--ifm-pre-padding)); 24 | padding: 0 var(--ifm-pre-padding); 25 | } 26 | 27 | html[data-theme='dark'] .docusaurus-highlight-code-line { 28 | background-color: rgba(0, 0, 0, 0.3); 29 | } 30 | -------------------------------------------------------------------------------- /docs/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import Layout from '@theme/Layout'; 4 | import Link from '@docusaurus/Link'; 5 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 6 | import styles from './index.module.css'; 7 | import HomepageFeatures from '../components/HomepageFeatures'; 8 | 9 | function HomepageHeader() { 10 | const {siteConfig} = useDocusaurusContext(); 11 | return ( 12 |
13 |
14 |

{siteConfig.title}

15 |

{siteConfig.tagline}

16 |
17 | 20 | Docusaurus Tutorial - 5min ⏱️ 21 | 22 |
23 |
24 |
25 | ); 26 | } 27 | 28 | export default function Home() { 29 | const {siteConfig} = useDocusaurusContext(); 30 | return ( 31 | 34 | 35 |
36 | 37 |
38 |
39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | /** 4 | * CSS files with the .module.css suffix will be treated as CSS modules 5 | * and scoped locally. 6 | */ 7 | 8 | .heroBanner { 9 | padding: 4rem 0; 10 | text-align: center; 11 | position: relative; 12 | overflow: hidden; 13 | } 14 | 15 | @media screen and (max-width: 966px) { 16 | .heroBanner { 17 | padding: 2rem; 18 | } 19 | } 20 | 21 | .buttons { 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } 26 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /docs/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/docs/static/.nojekyll -------------------------------------------------------------------------------- /docs/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/docs/static/img/docusaurus.png -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/static/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/docs/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /docs/static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/docs/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /docs/static/img/undraw_docusaurus_mountain.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /docs/static/img/undraw_docusaurus_react.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | -------------------------------------------------------------------------------- /docs/static/img/undraw_docusaurus_tree.svg: -------------------------------------------------------------------------------- 1 | docu_tree -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "./platform/", 4 | "./docs/" 5 | ], 6 | "version": "1.0.0-alpha.12" 7 | } 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capacitor-tauri-platform", 3 | "private": true, 4 | "scripts": { 5 | "prepublishOnly": "npm run build-all && shx cp -f ./README.md ./platform/README.md && git add --all && git commit -m \"chore: build and update readme in package\" && git push", 6 | "publish:latest": "env-cmd lerna publish --conventional-commits -create-release github --force-publish", 7 | "publish:next-prerelease": "env-cmd lerna publish prerelease --preid alpha --dist-tag alpha --pre-dist-tag alpha --conventional-commits --create-release github --force-publish", 8 | "publish:next": "env-cmd lerna publish --preid next --dist-tag next --pre-dist-tag next --conventional-commits --create-release github --force-publish", 9 | "build-all": "lerna run build --stream", 10 | "fmt": "lerna run fmt --stream", 11 | "postinstall": "lerna bootstrap", 12 | "env-cmd": "env-cmd", 13 | "shx": "shx" 14 | }, 15 | "devDependencies": { 16 | "env-cmd": "^10.1.0", 17 | "lerna": "^4.0.0", 18 | "shx": "^0.3.3" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /platform/.eslintignore: -------------------------------------------------------------------------------- 1 | plugin-examples 2 | dist 3 | docs 4 | node_modules -------------------------------------------------------------------------------- /platform/.eslintrc.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-undef 2 | module.exports = { 3 | extends: '@ionic/eslint-config/recommended', 4 | }; 5 | -------------------------------------------------------------------------------- /platform/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .cache/ 3 | build/ 4 | dist/ 5 | node_modules/ 6 | .DS_Store 7 | .vscode/ 8 | npm-debug.log 9 | template/package-lock.json 10 | template.tar.gz -------------------------------------------------------------------------------- /platform/.npmignore: -------------------------------------------------------------------------------- 1 | .cache/ 2 | .github/ 3 | node_modules/ 4 | plugin-examples/ 5 | .husky/ 6 | src/ 7 | docs/ 8 | .all-contributorsrc 9 | .gitignore 10 | CODE_OF_CONDUCT.md 11 | CONTRIBUTING.md 12 | rollup.config.plugins.js 13 | /tsconfig.json 14 | /tsconfig.electron.json 15 | /tsconfig.plugins.json 16 | deployChangeLog.sh 17 | CHANGELOG.md 18 | tsconfig.cli-scripts.json 19 | tsconfig.runtime.json 20 | changelog.config.js 21 | template/ 22 | .eslintignore 23 | .prettierignore 24 | .prettierrc.js 25 | .eslintrc.js 26 | build-platform.js -------------------------------------------------------------------------------- /platform/.prettierignore: -------------------------------------------------------------------------------- 1 | plugin-examples/** 2 | docs/** 3 | .github/** 4 | .husky/** 5 | dist/** 6 | node_modules/** 7 | *.md 8 | *.sh 9 | package.json 10 | package-lock.json -------------------------------------------------------------------------------- /platform/.prettierrc.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-undef 2 | module.exports = { 3 | ...require('@ionic/prettier-config'), 4 | }; 5 | -------------------------------------------------------------------------------- /platform/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. 5 | 6 | # [1.0.0-alpha.12](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2021-08-19) 7 | 8 | **Note:** Version bump only for package @capacitor-community/tauri 9 | 10 | 11 | 12 | 13 | 14 | # [1.0.0-alpha.11](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2021-08-19) 15 | 16 | 17 | ### Features 18 | 19 | * cli hooks more clear for better DX ([2b69add](https://github.com/capacitor-community/tauri/commit/2b69add17349a089e57cca0cec2f8a9c51534090)) 20 | * more cli improvements ([99866fe](https://github.com/capacitor-community/tauri/commit/99866fe0f9925c64a9b25693e754ed7d2b72291c)) 21 | * no need for copy cli script, use web app build dir ([891f9ec](https://github.com/capacitor-community/tauri/commit/891f9ec6beb34b194632d2edbf4e4a49547b1cb4)) 22 | 23 | 24 | 25 | 26 | 27 | 28 | # [1.0.0-alpha.10](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2021-08-11) 29 | 30 | 31 | ### Bug Fixes 32 | 33 | * more lean npm dist package ([647ea65](https://github.com/capacitor-community/tauri/commit/647ea6555ee7c7507fd728b97da71ae2dd0f628d)) 34 | * open command function on macos ([5407d42](https://github.com/capacitor-community/tauri/commit/5407d425c494be526d76b3c9ba1059403b15b5f1)) 35 | 36 | 37 | 38 | 39 | 40 | # [1.0.0-alpha.9](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2021-08-10) 41 | 42 | **Note:** Version bump only for package @capacitor-community/tauri 43 | 44 | 45 | 46 | 47 | 48 | # [1.0.0-alpha.8](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2021-08-10) 49 | 50 | 51 | ### Features 52 | 53 | * template as tarball in releases ([ce3ba64](https://github.com/capacitor-community/tauri/commit/ce3ba64f7feba7f4f3f08d43242ae805aa353b94)) 54 | 55 | 56 | 57 | 58 | 59 | # [1.0.0-alpha.7](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2021-08-10) 60 | 61 | **Note:** Version bump only for package @capacitor-community/tauri 62 | 63 | 64 | 65 | 66 | 67 | # [1.0.0-alpha.6](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2021-08-10) 68 | 69 | **Note:** Version bump only for package @capacitor-community/tauri 70 | 71 | 72 | 73 | 74 | 75 | 76 | # [1.0.0-alpha.5](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-08-10) 77 | 78 | **Note:** Version bump only for package @capacitor-community/tauri 79 | 80 | 81 | 82 | 83 | 84 | # [1.0.0-alpha.4](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-08-10) 85 | 86 | **Note:** Version bump only for package @capacitor-community/tauri 87 | 88 | 89 | 90 | 91 | 92 | # [1.0.0-alpha.3](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-08-10) 93 | 94 | 95 | ### Bug Fixes 96 | 97 | * run/open scripts not running ([f985162](https://github.com/capacitor-community/tauri/commit/f98516210c697d3d5b165647f8487e96acdd0ed1)) 98 | 99 | 100 | 101 | 102 | 103 | # [1.0.0-alpha.2](https://github.com/capacitor-community/tauri/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-08-10) 104 | 105 | **Note:** Version bump only for package @capacitor-community/tauri 106 | 107 | 108 | 109 | 110 | 111 | # 1.0.0-alpha.1 (2021-08-10) 112 | 113 | **Note:** Version bump only for package @capacitor-community/tauri 114 | 115 | 116 | 117 | 118 | 119 | # Change Log 120 | -------------------------------------------------------------------------------- /platform/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Mike S. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /platform/README.md: -------------------------------------------------------------------------------- 1 |

2 | 🚨 This platform is in alpha, expect broken parts. 🚨 3 |

4 | 5 |

6 |
7 |

8 | 9 |

10 | Bring your Capacitor ⚡ apps to the desktop with Tauri! 🖥 11 |

12 |

13 | 14 | 15 | 16 | 17 | 18 |

19 |

20 | 21 | npm 22 | 23 | GitHub Workflow Status 24 |

25 | 26 | ## ⚠ Important Info 27 | - Please follow your operating systems guide to setup your environment for Tauri development [here](https://tauri.studio/en/docs/getting-started/intro#setting-up-your-environment) 28 | - You will need `@capacitor/core` version `>= 3.2.0`. 29 | 30 | ## ⏳ Quickstart (Functioning on: ✅ Windows, ✅ MacOS, ⬜ Linux) 31 | 0. Create or open a Capacitor initialized web app project. [CAPACITOR DOCS](https://capacitorjs.com/docs) 32 | 1. Build your web app (`npm run build` for example) 33 | 2. `npm i @capacitor-community/tauri@alpha` 34 | 3. `npx cap add @capacitor-community/tauri` 35 | 4. `npx cap open @capacitor-community/tauri` - _This can take several minutes the first time you run it._ 36 | 5. You now have your web app running in tauri, right click and select `inspect` to bring up dev tools. 37 | 38 | ## 🎉 More Info 39 | - Check out Tauri on its [website](https://tauri.studio/) or on [github](https://github.com/tauri-apps/tauri) 40 | 41 | ## 🛠 Maintainers 42 | 43 | | Maintainer | GitHub | Social | Sponsoring Company | Primary | 44 | | ---------------- | --------------------------------------- | ----------------------------------------- | ------------------ | ------- | 45 | | Mike Summerfeldt | [IT-MikeS](https://github.com/IT-MikeS) | [@IT_MikeS](https://twitter.com/IT_MikeS) | Volunteer | Yes | 46 | 47 | 48 | ## ✨ Contributors 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |

Mike Summerfeldt

💻 📖
58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /platform/build-platform.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | const esbuild = require('esbuild'); 4 | const { readdirSync } = require('fs'); 5 | const { join } = require('path'); 6 | const tar = require('tar'); 7 | 8 | async function packTemplate() { 9 | const templateSrc = join('./', 'template'); 10 | const destTemplateFilePath = join('./', 'template.tar.gz'); 11 | const files = []; 12 | readdirSync(templateSrc).forEach(file => { 13 | files.push(file); 14 | }); 15 | await tar.create( 16 | { gzip: true, file: destTemplateFilePath, cwd: templateSrc }, 17 | files, 18 | ); 19 | console.log(`Packed ${destTemplateFilePath}!`); 20 | } 21 | 22 | async function buildCliScrpts() { 23 | await esbuild.build({ 24 | entryPoints: ['src/cli-scripts/index.ts'], 25 | bundle: true, 26 | outfile: 'dist/cli-scripts/cap-scripts.js', 27 | platform: 'node', 28 | target: 'node14', 29 | minify: true, 30 | external: [ 31 | 'child_process', 32 | 'fs', 33 | 'path', 34 | 'fs-extra', 35 | 'crypto', 36 | 'chalk', 37 | 'ora', 38 | ], 39 | }); 40 | } 41 | 42 | (async () => { 43 | try { 44 | await buildCliScrpts(); 45 | await packTemplate(); 46 | console.log('\nPlatform Build Complete.\n'); 47 | } catch (e) { 48 | console.error(e); 49 | process.exit(1); 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /platform/changelog.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /* eslint-disable @typescript-eslint/no-var-requires */ 3 | 'use strict'; 4 | const config = require('conventional-changelog-conventionalcommits'); 5 | 6 | module.exports = config({ 7 | types: [ 8 | { type: 'feat', section: 'Features' }, 9 | { type: 'fix', section: 'Bug Fixes' }, 10 | { type: 'chore', section: 'Chores' }, 11 | { type: 'docs', section: 'Documentation' }, 12 | { type: 'style', hidden: true }, 13 | { type: 'refactor', hidden: true }, 14 | { type: 'perf', hidden: true }, 15 | { type: 'test', hidden: true }, 16 | { type: 'changelog', hidden: true }, 17 | ], 18 | }); 19 | -------------------------------------------------------------------------------- /platform/deployChangeLog.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | PACKAGE_JSON=`cat package.json`; 4 | export PACKAGE_VERSION="$(node -pe "JSON.parse(\`$PACKAGE_JSON\`)['version']")" 5 | 6 | echo "Deploying Capacitor-Community/tauri v$PACKAGE_VERSION changelog" 7 | 8 | # This is what we do instead of letting lerna git commit for us 9 | git add CHANGELOG.md 10 | git commit -m "changelog: update changelog for $PACKAGE_VERSION" 11 | git push origin main -------------------------------------------------------------------------------- /platform/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@capacitor-community/tauri", 3 | "version": "1.0.0-alpha.12", 4 | "description": "Capacitor community support for the Tauri platform.", 5 | "main": "dist/core/index.js", 6 | "typings": "dist/core/index.d.ts", 7 | "scripts": { 8 | "lint": "npm run eslint && npm run prettier -- --check", 9 | "fmt": "npm run eslint -- --fix && npm run prettier -- --write", 10 | "clean": "rimraf ./dist", 11 | "build": "npm run clean && npm run build-cli-scripts", 12 | "capacitor:add": "node dist/cli-scripts/cap-scripts.js add", 13 | "capacitor:copy": "node dist/cli-scripts/cap-scripts.js copy", 14 | "capacitor:update": "node dist/cli-scripts/cap-scripts.js update", 15 | "capacitor:sync": "node dist/cli-scripts/cap-scripts.js sync", 16 | "capacitor:open": "node dist/cli-scripts/cap-scripts.js open", 17 | "capacitor:run": "node dist/cli-scripts/cap-scripts.js run", 18 | "build-cli-scripts": "node ./build-platform.js", 19 | "generate-changelog": "conventional-changelog -o ../../CHANGELOG.md -r 0 --config ./changelog.config.js", 20 | "deploy-changelog": "bash ./deployChangeLog.sh", 21 | "prettier": "prettier \"**/*.{css,html,js,mjs,ts}\"", 22 | "eslint": "eslint . --ext ts" 23 | }, 24 | "license": "MIT", 25 | "author": "IT-MikeS", 26 | "devDependencies": { 27 | "@ionic/eslint-config": "^0.3.0", 28 | "@ionic/prettier-config": "^1.0.1", 29 | "@types/events": "~3.0.0", 30 | "@types/fs-extra": "~9.0.11", 31 | "@types/node": "~14.17.4", 32 | "conventional-changelog-cli": "~2.1.1", 33 | "conventional-changelog-conventionalcommits": "~4.6.0", 34 | "esbuild": "~0.12.15", 35 | "eslint": "~7.27.0", 36 | "np": "~7.5.0", 37 | "prettier": "2.3.2", 38 | "rimraf": "~3.0.2", 39 | "shx": "^0.3.3", 40 | "tar": "^6.1.7", 41 | "tslib": "~2.3.0", 42 | "typescript": "~4.3.5" 43 | }, 44 | "dependencies": { 45 | "@capacitor/cli": "^3.1.1", 46 | "@capacitor/core": "^3.1.1", 47 | "@ionic/utils-fs": "~3.1.5", 48 | "chalk": "~4.1.1", 49 | "electron-is-dev": "~2.0.0", 50 | "events": "~3.3.0", 51 | "execa": "^5.1.1", 52 | "fs-extra": "~9.1.0", 53 | "mime-types": "~2.1.31", 54 | "ora": "~5.4.1" 55 | }, 56 | "repository": { 57 | "type": "git", 58 | "url": "https://github.com/capacitor-community/tauri" 59 | }, 60 | "bugs": { 61 | "url": "https://github.com/capacitor-community/tauri/issues" 62 | }, 63 | "gitHead": "c5268a33dce9718fa8acbc3211411c5907c60359" 64 | } 65 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/add.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import { existsSync, mkdirSync } from 'fs'; 3 | import { copySync } from 'fs-extra'; 4 | import path from 'path'; 5 | import { extract } from 'tar'; 6 | 7 | import { 8 | log, 9 | runExecWithInput, 10 | readJSON, 11 | writePrettyJSON, 12 | formatHrTime, 13 | } from './common'; 14 | 15 | const relative = path.relative; 16 | const join = path.join; 17 | const sep = path.sep; 18 | const posixSep = path.posix.sep; 19 | 20 | export async function doAdd(): Promise { 21 | const start = process.hrtime(); 22 | log(`\n${chalk.bold('Tauri Platform:')} Starting add task 🚀`); 23 | const usersProjectDir = process.env.CAPACITOR_ROOT_DIR; 24 | const builtWebAppDir = process.env.CAPACITOR_WEB_DIR; 25 | const platformNodeModuleTemplateTar = join( 26 | usersProjectDir, 27 | 'node_modules', 28 | '@capacitor-community', 29 | 'tauri', 30 | 'template.tar.gz', 31 | ); 32 | const destDir = join(usersProjectDir, 'tauri'); 33 | let usersProjectCapConfigFile: string | undefined = undefined; 34 | let configFileName: string | undefined = undefined; 35 | 36 | const configFileOptions = { 37 | ts: join(usersProjectDir, 'capacitor.config.ts'), 38 | js: join(usersProjectDir, 'capacitor.config.js'), 39 | json: join(usersProjectDir, 'capacitor.config.json'), 40 | }; 41 | if (existsSync(configFileOptions.ts)) { 42 | usersProjectCapConfigFile = configFileOptions.ts; 43 | configFileName = 'capacitor.config.ts'; 44 | } else if (existsSync(configFileOptions.js)) { 45 | usersProjectCapConfigFile = configFileOptions.js; 46 | configFileName = 'capacitor.config.js'; 47 | } else { 48 | usersProjectCapConfigFile = configFileOptions.json; 49 | configFileName = 'capacitor.config.json'; 50 | } 51 | 52 | const configData = JSON.parse(process.env.CAPACITOR_CONFIG); 53 | 54 | if (!existsSync(destDir)) { 55 | mkdirSync(destDir); 56 | log(`\n${chalk.bold('Tauri Platform:')} Unpacking template files 📦`); 57 | await extract({ file: platformNodeModuleTemplateTar, cwd: destDir }); 58 | log(`\n${chalk.bold('Tauri Platform:')} Copying Capacitor config file ⚙`); 59 | copySync(usersProjectCapConfigFile, join(destDir, configFileName)); 60 | 61 | const appName: string = configData.appName; 62 | const platformPackageJson = readJSON(join(destDir, 'package.json')); 63 | const rootPackageJson = readJSON(join(usersProjectDir, 'package.json')); 64 | platformPackageJson.name = appName; 65 | if (rootPackageJson.repository) { 66 | platformPackageJson.repository = rootPackageJson.repository; 67 | } 68 | log(`\n${chalk.bold('Tauri Platform:')} Setting up Tauri project files 📋`); 69 | writePrettyJSON(join(destDir, 'package.json'), platformPackageJson); 70 | 71 | const srcTauriPath = join(destDir, 'src-tauri'); 72 | const platformTauriConfigJson = readJSON( 73 | join(srcTauriPath, 'tauri.conf.json'), 74 | ); 75 | platformTauriConfigJson.package.productName = appName; 76 | platformTauriConfigJson.tauri.windows[0].title = appName; 77 | platformTauriConfigJson.build.distDir = relative( 78 | srcTauriPath, 79 | builtWebAppDir, 80 | ) 81 | .split(sep) 82 | .join(posixSep); 83 | writePrettyJSON( 84 | join(destDir, 'src-tauri', 'tauri.conf.json'), 85 | platformTauriConfigJson, 86 | ); 87 | 88 | log(`\n${chalk.bold('Tauri Platform:')} Installing npm modules ⏳`); 89 | await runExecWithInput(`cd ${destDir} && npm i`); 90 | log(`\n${chalk.bold('Tauri Platform:')} Updating Tauri CLI 🌟`); 91 | await runExecWithInput(`cd ${destDir} && npm i @tauri-apps/cli@latest`); 92 | log(`\n${chalk.bold('Tauri Platform:')} Updating Tauri dependancies 🛠`); 93 | await runExecWithInput(`cd ${destDir} && npm run update-deps`); 94 | const elapsed = process.hrtime(start); 95 | log( 96 | `\n${chalk.bold('Tauri Platform:')} Add task complete ✅ - ${formatHrTime( 97 | elapsed, 98 | )}\n`, 99 | ); 100 | } else { 101 | throw new Error('Tauri platform already exists.'); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/common.ts: -------------------------------------------------------------------------------- 1 | import execa from 'execa'; 2 | import { readFileSync, writeFileSync } from 'fs'; 3 | 4 | export function readJSON(pathToUse: string): { [key: string]: any } { 5 | const data = readFileSync(pathToUse, 'utf8'); 6 | return JSON.parse(data); 7 | } 8 | 9 | export function writePrettyJSON(path: string, data: any): void { 10 | return writeFileSync(path, JSON.stringify(data, null, ' ') + '\n'); 11 | } 12 | 13 | export async function runExecWithInput(command: string): Promise { 14 | const { stdout, stderr } = await execa.command(command, { 15 | stdio: 'inherit', 16 | shell: true, 17 | }); 18 | if (stderr) { 19 | return stdout + stderr; 20 | } else { 21 | return stdout; 22 | } 23 | } 24 | 25 | export const log = console.log; 26 | 27 | const TIME_UNITS = ['s', 'ms', 'μp']; 28 | 29 | export function formatHrTime(hrtime: any): string { 30 | let time = hrtime[0] + hrtime[1] / 1e9; 31 | let index = 0; 32 | for (; index < TIME_UNITS.length - 1; index++, time *= 1000) { 33 | if (time >= 1) { 34 | break; 35 | } 36 | } 37 | return time.toFixed(2) + TIME_UNITS[index]; 38 | } 39 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/copy.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import { existsSync } from 'fs'; 3 | import { copySync, removeSync } from 'fs-extra'; 4 | import { join } from 'path'; 5 | 6 | import { formatHrTime, log } from './common'; 7 | 8 | export async function doCopy(): Promise { 9 | const start = process.hrtime(); 10 | log(`\n${chalk.bold('Tauri Platform:')} Starting copy task 🚀`); 11 | const usersProjectDir = process.env.CAPACITOR_ROOT_DIR; 12 | const builtWebAppDir = process.env.CAPACITOR_WEB_DIR; 13 | const destDir = join(usersProjectDir, 'tauri', 'app'); 14 | 15 | log( 16 | `\n${chalk.bold( 17 | 'Tauri Platform:', 18 | )} Copying ${builtWebAppDir} into ${destDir} ✨`, 19 | ); 20 | if (existsSync(destDir)) removeSync(destDir); 21 | copySync(builtWebAppDir, destDir); 22 | const elapsed = process.hrtime(start); 23 | log( 24 | `\n${chalk.bold('Tauri Platform:')} Copy task complete ✅ - ${formatHrTime( 25 | elapsed, 26 | )}\n`, 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/index.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | 3 | import { doAdd } from './add'; 4 | import { log } from './common'; 5 | import { doOpen } from './open'; 6 | // import { doCopy } from './copy'; 7 | // import { doUpdate } from './update'; 8 | 9 | /* 10 | async function doUpdateTask() { 11 | return await doUpdate(); 12 | } 13 | */ 14 | 15 | async function doAddTask() { 16 | return await doAdd(); 17 | } 18 | 19 | /* 20 | async function doCopyTask() { 21 | return await doCopy(); 22 | } 23 | */ 24 | 25 | async function doOpenTask() { 26 | return await doOpen(); 27 | } 28 | 29 | (async () => { 30 | const scriptToRun = process.argv[2] ? process.argv[2] : null; 31 | if (scriptToRun !== null) { 32 | switch (scriptToRun) { 33 | case 'add': 34 | await doAddTask(); 35 | // await doCopyTask(); 36 | // await doUpdateTask(); 37 | break; 38 | case 'copy': 39 | log( 40 | `\n${chalk.bold( 41 | 'Tauri Platform:', 42 | )} Copy isn't necessary on the Tauri platform, as it uses your build folder from the web app directly 👍\n`, 43 | ); 44 | // await doCopyTask(); 45 | break; 46 | case 'run': 47 | case 'open': 48 | await doOpenTask(); 49 | break; 50 | case 'update': 51 | throw new Error(`Invalid script chosen: ${scriptToRun}`); 52 | // await doUpdateTask(); 53 | // break; 54 | case 'sync': 55 | throw new Error(`Invalid script chosen: ${scriptToRun}`); 56 | // await doSyncTask(); 57 | // await doUpdateTask(); 58 | // break; 59 | default: 60 | throw new Error(`Invalid script chosen: ${scriptToRun}`); 61 | } 62 | } else { 63 | throw new Error(`Invalid script chosen: ${scriptToRun}`); 64 | } 65 | })(); 66 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/open.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import { platform } from 'os'; 3 | import { join } from 'path'; 4 | 5 | import { runExecWithInput, log, formatHrTime } from './common'; 6 | 7 | export async function doOpen(): Promise { 8 | const start = process.hrtime(); 9 | log(`\n${chalk.bold('Tauri Platform:')} Starting open/run task 🚀`); 10 | log( 11 | `\n${chalk.bold( 12 | 'Tauri Platform:', 13 | )} 🚨 Note: The first run of this command can take several minutes to show the app. 🚨`, 14 | ); 15 | const configData = JSON.parse(process.env.CAPACITOR_CONFIG); 16 | const usersProjectDir = process.env.CAPACITOR_ROOT_DIR; 17 | const destDir = join(usersProjectDir, 'tauri'); 18 | log(`\n${chalk.bold('Tauri Platform:')} Building Tauri app 🚧`); 19 | await runExecWithInput(`cd ${destDir} && npm run build`); 20 | const elapsed = process.hrtime(start); 21 | log( 22 | `\n${chalk.bold( 23 | 'Tauri Platform:', 24 | )} Tauri app build complete ✅ - ${formatHrTime(elapsed)}\n`, 25 | ); 26 | const osPlatform = platform(); 27 | if (osPlatform === 'win32') { 28 | log(`\n${chalk.bold('Tauri Platform:')} Running windows app ⚡\n`); 29 | await runExecWithInput( 30 | `cd ${destDir} && cd src-tauri/target/debug && ${configData.appName}.exe`, 31 | ); 32 | } else if (osPlatform === 'darwin') { 33 | log(`\n${chalk.bold('Tauri Platform:')} Running macOS app ⚡\n`); 34 | await runExecWithInput( 35 | `cd ${destDir} && src-tauri/target/debug/${configData.appName}`, 36 | ); 37 | } else { 38 | throw new Error( 39 | 'Sorry but your OS is not supported by the open/run command at this time.', 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /platform/src/cli-scripts/update.ts: -------------------------------------------------------------------------------- 1 | import { existsSync, writeFileSync } from 'fs'; 2 | import { copySync } from 'fs-extra'; 3 | import { join, isAbsolute, resolve, relative } from 'path'; 4 | 5 | import { 6 | readJSON, 7 | resolvePlugin, 8 | resolveElectronPlugin, 9 | runExec, 10 | } from './common'; 11 | 12 | export async function doUpdate(): Promise { 13 | const usersProjectDir = process.env.CAPACITOR_ROOT_DIR; 14 | 15 | const webAppPackageJson = await readJSON( 16 | join(usersProjectDir, 'package.json'), 17 | ); 18 | const dependencies = webAppPackageJson.dependencies 19 | ? webAppPackageJson.dependencies 20 | : {}; 21 | const devDependencies = webAppPackageJson.devDependencies 22 | ? webAppPackageJson.devDependencies 23 | : {}; 24 | const deps = { 25 | ...dependencies, 26 | ...devDependencies, 27 | }; 28 | // get all cap plugins installed 29 | let plugins = await Promise.all( 30 | Object.keys(deps).map(async p => resolvePlugin(p)), 31 | ); 32 | // Filter out null returns 33 | plugins = plugins.filter(p => !!p); 34 | // Get only the ones with electron "native" plugins 35 | const pluginMap: { 36 | name: string; 37 | path: string | null; 38 | installStr: string; 39 | id: string; 40 | }[] = plugins 41 | .map(plugin => { 42 | let installStr = ''; 43 | // consider cases when package is not installed via npm 44 | // TODO: add support for packages installed via git etc... 45 | if (deps[plugin?.id] && deps[plugin?.id].startsWith('file:')) { 46 | const pkgPath = deps[plugin?.id].replace(/^file:/, ''); 47 | const pkgAbsPath = isAbsolute(pkgPath) 48 | ? pkgPath 49 | : resolve(usersProjectDir, pkgPath); 50 | installStr = relative(join(usersProjectDir, 'electron'), pkgAbsPath); // try to use relative path as much as possible 51 | } else installStr = `${plugin?.id}@${plugin?.version}`; 52 | const path = resolveElectronPlugin(plugin); 53 | const name = plugin?.name; 54 | const id = plugin?.id; 55 | return { name, path, installStr, id }; 56 | }) 57 | .filter(plugin => plugin.path !== null); 58 | 59 | let npmIStr = ''; 60 | 61 | let outStr = `/* eslint-disable @typescript-eslint/no-var-requires */\n`; 62 | for (const electronPlugin of pluginMap) { 63 | npmIStr += ` ${electronPlugin.installStr}`; 64 | const tmpPath = join( 65 | usersProjectDir, 66 | 'electron', 67 | 'node_modules', 68 | electronPlugin.id, 69 | 'electron', 70 | 'dist/plugin.js', 71 | ); 72 | outStr += `const ${electronPlugin.name} = require('${tmpPath.replace( 73 | /\\/g, 74 | '\\\\', 75 | )}')\n`; 76 | } 77 | outStr += '\nmodule.exports = {\n'; 78 | for (const electronPlugin of pluginMap) { 79 | outStr += ` ${electronPlugin.name},\n`; 80 | } 81 | outStr += '}'; 82 | 83 | const capacitorElectronRuntimeFilePath = join( 84 | usersProjectDir, 85 | 'electron', 86 | 'src', 87 | 'rt', 88 | ); 89 | 90 | writeFileSync( 91 | join(capacitorElectronRuntimeFilePath, 'electron-plugins.js'), 92 | outStr, 93 | { encoding: 'utf-8' }, 94 | ); 95 | 96 | let usersProjectCapConfigFile: string | undefined = undefined; 97 | let configFileName: string | undefined = undefined; 98 | const configFileOptions = { 99 | ts: join(usersProjectDir, 'capacitor.config.ts'), 100 | js: join(usersProjectDir, 'capacitor.config.js'), 101 | json: join(usersProjectDir, 'capacitor.config.json'), 102 | }; 103 | if (existsSync(configFileOptions.ts)) { 104 | usersProjectCapConfigFile = configFileOptions.ts; 105 | configFileName = 'capacitor.config.ts'; 106 | } else if (existsSync(configFileOptions.js)) { 107 | usersProjectCapConfigFile = configFileOptions.js; 108 | configFileName = 'capacitor.config.js'; 109 | } else { 110 | usersProjectCapConfigFile = configFileOptions.json; 111 | configFileName = 'capacitor.config.json'; 112 | } 113 | copySync( 114 | usersProjectCapConfigFile, 115 | join(usersProjectDir, 'electron', configFileName), 116 | { overwrite: true }, 117 | ); 118 | 119 | if (npmIStr.length > 0) { 120 | console.log(`\n\nWill install:${npmIStr}\n\n`); 121 | await runExec(`cd ${join(usersProjectDir, 'electron')} && npm i${npmIStr}`); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /platform/template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | src-tauri/target 3 | src-tauri/tauri-capacitor-plugin/target 4 | src-tauri/WixTools -------------------------------------------------------------------------------- /platform/template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-tauri-app", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "npm run tauri dev", 8 | "build": "npm run tauri build -- --debug", 9 | "update-deps": "npm run tauri deps update", 10 | "tauri": "tauri" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "MIT", 15 | "devDependencies": { 16 | "@tauri-apps/cli": "^1.0.0-beta.6" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /platform/template/src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "app" 3 | version = "0.1.0" 4 | description = "A Tauri App" 5 | authors = ["you"] 6 | license = "" 7 | repository = "" 8 | default-run = "app" 9 | edition = "2018" 10 | build = "src/build.rs" 11 | 12 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 13 | 14 | [build-dependencies] 15 | tauri-build = { version = "1.0.0-beta.3" } 16 | 17 | [dependencies] 18 | serde_json = "1.0" 19 | serde = { version = "1.0", features = ["derive"] } 20 | tauri = { version = "1.0.0-beta.5", features = ["api-all"] } 21 | tauri-capacitor-plugin = { path = "./tauri-capacitor-plugin" } 22 | 23 | [features] 24 | default = [ "custom-protocol" ] 25 | custom-protocol = [ "tauri/custom-protocol" ] 26 | -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /platform/template/src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capacitor-community/tauri/d3ac3a84176093e0b6024f07141381bca26de672/platform/template/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /platform/template/src-tauri/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 100 2 | hard_tabs = false 3 | tab_spaces = 2 4 | newline_style = "Auto" 5 | use_small_heuristics = "Default" 6 | reorder_imports = true 7 | reorder_modules = true 8 | remove_nested_parens = true 9 | edition = "2018" 10 | merge_derives = true 11 | use_try_shorthand = false 12 | use_field_init_shorthand = false 13 | force_explicit_abi = true 14 | imports_granularity = "Crate" 15 | -------------------------------------------------------------------------------- /platform/template/src-tauri/src/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /platform/template/src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | #![cfg_attr( 2 | all(not(debug_assertions), target_os = "windows"), 3 | windows_subsystem = "windows" 4 | )] 5 | 6 | use tauri_capacitor_plugin::Capacitor; 7 | 8 | fn main() { 9 | tauri::Builder::default() 10 | .plugin(Capacitor::default()) 11 | .run(tauri::generate_context!()) 12 | .expect("error while running tauri application"); 13 | } 14 | -------------------------------------------------------------------------------- /platform/template/src-tauri/tauri-capacitor-plugin/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tauri-capacitor-plugin" 3 | version = "0.0.1" 4 | authors = ["Mike Summerfeldt "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | tauri = "1.0.0-beta.5" -------------------------------------------------------------------------------- /platform/template/src-tauri/tauri-capacitor-plugin/src/lib.rs: -------------------------------------------------------------------------------- 1 | use tauri::{plugin::Plugin, Invoke, Runtime}; 2 | 3 | // the plugin custom command handlers if you choose to extend the API. 4 | #[tauri::command] 5 | // this will be accessible with `invoke('plugin:awesome|initialize')`. 6 | // where `awesome` is the plugin name. 7 | fn initialize() {} 8 | 9 | #[tauri::command] 10 | // this will be accessible with `invoke('plugin:awesome|do_something')`. 11 | fn do_something() {} 12 | 13 | 14 | pub struct Capacitor { 15 | invoke_handler: Box) + Send + Sync>, 16 | // plugin state, configuration fields 17 | } 18 | 19 | impl Default for Capacitor { 20 | fn default() -> Self { 21 | Self { 22 | invoke_handler: Box::new(tauri::generate_handler![initialize, do_something]), 23 | } 24 | } 25 | } 26 | 27 | impl Plugin for Capacitor { 28 | /// The plugin name. Must be defined and used on the `invoke` calls. 29 | fn name(&self) -> &'static str { 30 | "capacitor" 31 | } 32 | 33 | /// The JS script to evaluate on initialization. 34 | /// Useful when your plugin is accessible through `window` 35 | /// or needs to perform a JS task on app initialization 36 | /// e.g. "window.awesomePlugin = { ... the plugin interface }" 37 | fn initialization_script(&self) -> Option { 38 | let opt: Option = Some(String::from("window.CapacitorCustomPlatform = {name: 'tauri', plugins: {}}")); 39 | opt 40 | } 41 | 42 | /// Extend the invoke handler. 43 | fn extend_api(&mut self, invoke: Invoke) { 44 | (self.invoke_handler)(invoke) 45 | } 46 | } -------------------------------------------------------------------------------- /platform/template/src-tauri/tauri.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": { 3 | "productName": "capacitor-tauri-app", 4 | "version": "0.1.0" 5 | }, 6 | "build": { 7 | "distDir": "../app", 8 | "devPath": "http://localhost:3000", 9 | "beforeDevCommand": "", 10 | "beforeBuildCommand": "", 11 | "withGlobalTauri": true 12 | }, 13 | "tauri": { 14 | "bundle": { 15 | "active": true, 16 | "targets": "all", 17 | "identifier": "com.tauri.dev", 18 | "icon": [ 19 | "icons/32x32.png", 20 | "icons/128x128.png", 21 | "icons/128x128@2x.png", 22 | "icons/icon.icns", 23 | "icons/icon.ico" 24 | ], 25 | "resources": [], 26 | "externalBin": [], 27 | "copyright": "", 28 | "category": "DeveloperTool", 29 | "shortDescription": "", 30 | "longDescription": "", 31 | "deb": { 32 | "depends": [], 33 | "useBootstrapper": false 34 | }, 35 | "macOS": { 36 | "frameworks": [], 37 | "minimumSystemVersion": "", 38 | "useBootstrapper": false, 39 | "exceptionDomain": "", 40 | "signingIdentity": null, 41 | "entitlements": null 42 | }, 43 | "windows": { 44 | "certificateThumbprint": null, 45 | "digestAlgorithm": "sha256", 46 | "timestampUrl": "" 47 | } 48 | }, 49 | "updater": { 50 | "active": false 51 | }, 52 | "allowlist": { 53 | "all": true 54 | }, 55 | "windows": [ 56 | { 57 | "title": "capacitor-tauri-app", 58 | "width": 800, 59 | "height": 600, 60 | "resizable": true, 61 | "fullscreen": false 62 | } 63 | ], 64 | "security": { 65 | "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" 66 | } 67 | } 68 | } 69 | --------------------------------------------------------------------------------