mirror of
https://github.com/tauri-apps/tauri-docs.git
synced 2026-01-31 00:35:16 +01:00
feat: adding pre-commit and formatting stuff (#2196)
This commit is contained in:
1
.github/labeler.yml
vendored
1
.github/labeler.yml
vendored
@@ -4,4 +4,3 @@ i18n:
|
|||||||
- src/content/docs/es/**/*
|
- src/content/docs/es/**/*
|
||||||
- src/content/docs/fr/**/*
|
- src/content/docs/fr/**/*
|
||||||
- src/content/docs/zh-cn/**/*
|
- src/content/docs/zh-cn/**/*
|
||||||
|
|
||||||
|
|||||||
1
.github/workflows/congrats.yml
vendored
1
.github/workflows/congrats.yml
vendored
@@ -9,4 +9,3 @@ jobs:
|
|||||||
uses: tauri-apps/automation/.github/workflows/congrats.yml@main
|
uses: tauri-apps/automation/.github/workflows/congrats.yml@main
|
||||||
secrets:
|
secrets:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|
||||||
|
|||||||
1
.github/workflows/labeler.yml
vendored
1
.github/workflows/labeler.yml
vendored
@@ -19,4 +19,3 @@ jobs:
|
|||||||
- name: Rebuild i18n Dashboard
|
- name: Rebuild i18n Dashboard
|
||||||
if: contains(steps.label-pr.outputs.all-labels, 'i18n')
|
if: contains(steps.label-pr.outputs.all-labels, 'i18n')
|
||||||
run: curl -X POST -d {} https://api.netlify.com/build_hooks/$NETLIFY_BUILD_KEY
|
run: curl -X POST -d {} https://api.netlify.com/build_hooks/$NETLIFY_BUILD_KEY
|
||||||
|
|
||||||
|
|||||||
9
.pre-commit-config.yaml
Normal file
9
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.6.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-json
|
||||||
|
- id: check-added-large-files
|
||||||
@@ -15,3 +15,6 @@ pnpm-lock.yaml
|
|||||||
# Configs
|
# Configs
|
||||||
.github
|
.github
|
||||||
!.github/**.md
|
!.github/**.md
|
||||||
|
|
||||||
|
# TODO: Figure out why this format isn't acceptable
|
||||||
|
src/components/overrides/Header.astro
|
||||||
|
|||||||
48
.prettierrc
48
.prettierrc
@@ -1,23 +1,29 @@
|
|||||||
{
|
{
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"plugins": ["prettier-plugin-astro"],
|
"plugins": ["prettier-plugin-astro"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": [".*", "*.json", "*.md", "*.toml", "*.yml"],
|
"files": "*.astro",
|
||||||
"options": {
|
"options": {
|
||||||
"useTabs": false
|
"parser": "astro"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.md", "*.mdx"],
|
"files": ["*.json", "*.md", "*.toml", "*.yml"],
|
||||||
"options": {
|
"options": {
|
||||||
"printWidth": 80
|
"useTabs": false
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
"files": ["*.md", "*.mdx"],
|
||||||
|
"options": {
|
||||||
|
"printWidth": 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
7
.vscode/settings.json
vendored
Normal file
7
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"files.encoding": "utf8",
|
||||||
|
"prettier.documentSelectors": ["**/*.astro"],
|
||||||
|
"[astro]": {
|
||||||
|
"editor.defaultFormatter": "astro-build.astro-vscode"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
|||||||
import locales from './locales.json';
|
import locales from './locales.json';
|
||||||
import starlightLinksValidator from 'starlight-links-validator';
|
import starlightLinksValidator from 'starlight-links-validator';
|
||||||
import starlightBlog from 'starlight-blog';
|
import starlightBlog from 'starlight-blog';
|
||||||
import serviceWorker from "astrojs-service-worker";
|
import serviceWorker from 'astrojs-service-worker';
|
||||||
|
|
||||||
const authors = {
|
const authors = {
|
||||||
nothingismagick: {
|
nothingismagick: {
|
||||||
@@ -81,8 +81,8 @@ export default defineConfig({
|
|||||||
rss: `${site}/rss`,
|
rss: `${site}/rss`,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Sidebar: "./src/components/overrides/Sidebar.astro",
|
Sidebar: './src/components/overrides/Sidebar.astro',
|
||||||
Header: "./src/components/overrides/Header.astro",
|
Header: './src/components/overrides/Header.astro',
|
||||||
Footer: 'src/components/overrides/Footer.astro',
|
Footer: 'src/components/overrides/Footer.astro',
|
||||||
ThemeSelect: 'src/components/overrides/ThemeSelect.astro',
|
ThemeSelect: 'src/components/overrides/ThemeSelect.astro',
|
||||||
PageFrame: 'src/components/overrides/PageFrame.astro',
|
PageFrame: 'src/components/overrides/PageFrame.astro',
|
||||||
@@ -106,7 +106,7 @@ export default defineConfig({
|
|||||||
tag: 'link',
|
tag: 'link',
|
||||||
attrs: {
|
attrs: {
|
||||||
rel: 'manifest',
|
rel: 'manifest',
|
||||||
href: '/manifest.json'
|
href: '/manifest.json',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -129,19 +129,19 @@ export default defineConfig({
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'What is Tauri?',
|
label: 'What is Tauri?',
|
||||||
link: '/start/'
|
link: '/start/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Prerequisites',
|
label: 'Prerequisites',
|
||||||
link: '/start/prerequisites/'
|
link: '/start/prerequisites/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Create a Project',
|
label: 'Create a Project',
|
||||||
link: '/start/create-project/',
|
link: '/start/create-project/',
|
||||||
badge: {
|
badge: {
|
||||||
text: 'WIP',
|
text: 'WIP',
|
||||||
variant: 'caution'
|
variant: 'caution',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Frontend Configuration',
|
label: 'Frontend Configuration',
|
||||||
@@ -153,7 +153,7 @@ export default defineConfig({
|
|||||||
collapsed: true,
|
collapsed: true,
|
||||||
autogenerate: { directory: 'start/migrate' },
|
autogenerate: { directory: 'start/migrate' },
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Core Concepts',
|
label: 'Core Concepts',
|
||||||
@@ -190,7 +190,7 @@ export default defineConfig({
|
|||||||
collapsed: true,
|
collapsed: true,
|
||||||
autogenerate: { directory: 'about' },
|
autogenerate: { directory: 'about' },
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'References',
|
label: 'References',
|
||||||
@@ -198,23 +198,23 @@ export default defineConfig({
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'Access Control List',
|
label: 'Access Control List',
|
||||||
link: '/reference/acl/'
|
link: '/reference/acl/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Command Line Interface (CLI)',
|
label: 'Command Line Interface (CLI)',
|
||||||
link: '/reference/cli/'
|
link: '/reference/cli/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Configuration',
|
label: 'Configuration',
|
||||||
link: '/reference/config/'
|
link: '/reference/config/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Environment Variables',
|
label: 'Environment Variables',
|
||||||
link: '/reference/environment-variables/'
|
link: '/reference/environment-variables/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Webview Versions',
|
label: 'Webview Versions',
|
||||||
link: '/reference/webview-versions/'
|
link: '/reference/webview-versions/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Releases',
|
label: 'Releases',
|
||||||
@@ -228,9 +228,9 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Rust (docs.rs)',
|
label: 'Rust (docs.rs)',
|
||||||
link: 'https://docs.rs/tauri/2.0.0-beta.19/tauri/index.html'
|
link: 'https://docs.rs/tauri/2.0.0-beta.19/tauri/index.html',
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Blog',
|
label: 'Blog',
|
||||||
@@ -238,14 +238,14 @@ export default defineConfig({
|
|||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'All posts',
|
label: 'All posts',
|
||||||
link: '/blog/'
|
link: '/blog/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Recent posts',
|
label: 'Recent posts',
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
autogenerate: { directory: 'blog' }, // TODO: Manually construct `items` to sort by dates
|
autogenerate: { directory: 'blog' }, // TODO: Manually construct `items` to sort by dates
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
locales,
|
locales,
|
||||||
@@ -257,19 +257,21 @@ export default defineConfig({
|
|||||||
clientsClaim: true,
|
clientsClaim: true,
|
||||||
inlineWorkboxRuntime: true,
|
inlineWorkboxRuntime: true,
|
||||||
skipWaiting: true,
|
skipWaiting: true,
|
||||||
globIgnores: ["**_redirects**", "**_headers**"],
|
globIgnores: ['**_redirects**', '**_headers**'],
|
||||||
globPatterns: ["**/*.js", "**/*.css"],
|
globPatterns: ['**/*.js', '**/*.css'],
|
||||||
runtimeCaching: [{
|
runtimeCaching: [
|
||||||
urlPattern: new RegExp('.*'),
|
{
|
||||||
handler: 'CacheFirst',
|
urlPattern: new RegExp('.*'),
|
||||||
options: {
|
handler: 'CacheFirst',
|
||||||
cacheName: 'tauri-runtime',
|
options: {
|
||||||
expiration: {
|
cacheName: 'tauri-runtime',
|
||||||
maxAgeSeconds: 30 * 60 // 30 minutes
|
expiration: {
|
||||||
|
maxAgeSeconds: 30 * 60, // 30 minutes
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}]
|
],
|
||||||
}
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
markdown: {
|
markdown: {
|
||||||
@@ -376,9 +378,9 @@ function i18nRedirect(from, to) {
|
|||||||
locale === 'root'
|
locale === 'root'
|
||||||
? (routes[from] = to)
|
? (routes[from] = to)
|
||||||
: (routes[`/${locale}/${from.replaceAll(/^\/*/g, '')}`] = `/${locale}/${to.replaceAll(
|
: (routes[`/${locale}/${from.replaceAll(/^\/*/g, '')}`] = `/${locale}/${to.replaceAll(
|
||||||
/^\/*/g,
|
/^\/*/g,
|
||||||
''
|
''
|
||||||
)}`)
|
)}`)
|
||||||
);
|
);
|
||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,9 +249,9 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
If you're interested in helping us translate
|
If you're interested in helping us translate
|
||||||
<a href="https://v2.tauri.app/">v2.tauri.app</a> into one of the languages listed
|
<a href="https://v2.tauri.app/">v2.tauri.app</a> into one of the languages listed below,
|
||||||
below, you've come to the right place! This auto-updating page always lists all the
|
you've come to the right place! This auto-updating page always lists all the content that
|
||||||
content that could use your help right now.
|
could use your help right now.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "Tauri",
|
"name": "Tauri",
|
||||||
"short_name": "Tauri",
|
"short_name": "Tauri",
|
||||||
"description": "The cross-platform app building toolkit",
|
"description": "The cross-platform app building toolkit",
|
||||||
"start_url": "/index.html",
|
"start_url": "/index.html",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"background_color": "#181818",
|
"background_color": "#181818",
|
||||||
"theme_color": "#181818",
|
"theme_color": "#181818",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/logo.png",
|
"src": "/logo.png",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "/logo.png",
|
"src": "/logo.png",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lang": "en-US",
|
"lang": "en-US",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"scope": "/"
|
"scope": "/"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ body[data-mobile-menu-expanded] header {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
{Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ?
|
{
|
||||||
|
Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ?
|
||||||
<style>
|
<style>
|
||||||
.header {
|
.header {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
---
|
---
|
||||||
import MobileMenuToggle from 'virtual:starlight/components/MobileMenuToggle';
|
import MobileMenuToggle from 'virtual:starlight/components/MobileMenuToggle';
|
||||||
import type { Props } from '@astrojs/starlight/props';
|
import type { Props } from '@astrojs/starlight/props';
|
||||||
import Sidebar from './Sidebar.astro'
|
import Sidebar from './Sidebar.astro';
|
||||||
const { labels } = Astro.props;
|
const { labels } = Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="page sl-flex">
|
<div class="page sl-flex">
|
||||||
<header class="header"><slot name="header" /></header>
|
<header class="header"><slot name="header" /></header>
|
||||||
<nav class="sidebar" aria-label={labels['sidebarNav.accessibleLabel']}>
|
<nav class="sidebar" aria-label={labels['sidebarNav.accessibleLabel']}>
|
||||||
<MobileMenuToggle {...Astro.props} />
|
<MobileMenuToggle {...Astro.props} />
|
||||||
<div id="starlight__sidebar" class={Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug ? "sidebar-pane lp-hide" : 'sidebar-pane'}>
|
<div
|
||||||
<div class="sidebar-content sl-flex">
|
id="starlight__sidebar"
|
||||||
<Sidebar {...Astro.props} />
|
class={Astro.props.entry.slug === '' || Astro.props.locale === Astro.props.entry.slug
|
||||||
</div>
|
? 'sidebar-pane lp-hide'
|
||||||
|
: 'sidebar-pane'}
|
||||||
|
>
|
||||||
|
<div class="sidebar-content sl-flex">
|
||||||
|
<Sidebar {...Astro.props} />
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</div>
|
||||||
|
</nav>
|
||||||
<div class="main-frame"><slot /></div>
|
<div class="main-frame"><slot /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
import type { Props } from "@astrojs/starlight/props";
|
import type { Props } from '@astrojs/starlight/props';
|
||||||
import Default from "@astrojs/starlight/components/Sidebar.astro";
|
import Default from '@astrojs/starlight/components/Sidebar.astro';
|
||||||
import { AstroError } from "astro/errors";
|
import { AstroError } from 'astro/errors';
|
||||||
|
|
||||||
// Styles and CSS logic derived from https://daisyui.com/components/collapse/
|
// Styles and CSS logic derived from https://daisyui.com/components/collapse/
|
||||||
|
|
||||||
@@ -11,124 +11,108 @@ import { AstroError } from "astro/errors";
|
|||||||
// 1. Validate the config is set up correctly
|
// 1. Validate the config is set up correctly
|
||||||
// 2. Create a new derived set of `Astro.props` that only contains one set of sidebar entries
|
// 2. Create a new derived set of `Astro.props` that only contains one set of sidebar entries
|
||||||
// 3. Check if the current page being rendered is current page to determine if this sidebar group should be selected
|
// 3. Check if the current page being rendered is current page to determine if this sidebar group should be selected
|
||||||
const multiSidebarConfig: [string, boolean, Props][] = Astro.props.sidebar.map(
|
const multiSidebarConfig: [string, boolean, Props][] = Astro.props.sidebar.map((entry) => {
|
||||||
(entry) => {
|
if (entry.type !== 'group') {
|
||||||
if (entry.type !== "group") {
|
throw new AstroError(
|
||||||
throw new AstroError(
|
`\`${entry.label}\` cannot be used with multiple Starlight sidebars.
|
||||||
`\`${entry.label}\` cannot be used with multiple Starlight sidebars.
|
|
||||||
|
|
||||||
Each top-level \`sidebar\` item in the Starlight config must be either a group or autogenerated.
|
Each top-level \`sidebar\` item in the Starlight config must be either a group or autogenerated.
|
||||||
|
|
||||||
See https://starlight.astro.build/guides/sidebar/#groups and https://starlight.astro.build/guides/sidebar/#autogenerated-groups`
|
See https://starlight.astro.build/guides/sidebar/#groups and https://starlight.astro.build/guides/sidebar/#autogenerated-groups`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively check if a group of sidebar entries contains the current page
|
// Recursively check if a group of sidebar entries contains the current page
|
||||||
const findIfIsCurrent = (
|
const findIfIsCurrent = (entry: (typeof Astro.props.sidebar)[number]): boolean => {
|
||||||
entry: (typeof Astro.props.sidebar)[number]
|
if (entry.type === 'link') {
|
||||||
): boolean => {
|
return entry.isCurrent;
|
||||||
if (entry.type === "link") {
|
}
|
||||||
return entry.isCurrent;
|
return entry.entries.some((item) => findIfIsCurrent(item));
|
||||||
}
|
};
|
||||||
return entry.entries.some((item) => findIfIsCurrent(item));
|
|
||||||
};
|
|
||||||
|
|
||||||
const isCurrentPage = findIfIsCurrent(entry);
|
const isCurrentPage = findIfIsCurrent(entry);
|
||||||
|
|
||||||
return [
|
return [entry.label, isCurrentPage, { ...Astro.props, sidebar: [...entry.entries] }];
|
||||||
entry.label,
|
});
|
||||||
isCurrentPage,
|
|
||||||
{ ...Astro.props, sidebar: [...entry.entries] },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
);
|
|
||||||
let foundCurrentPage = false;
|
let foundCurrentPage = false;
|
||||||
for (const page of multiSidebarConfig) {
|
for (const page of multiSidebarConfig) {
|
||||||
if (page[1]) {
|
if (page[1]) {
|
||||||
foundCurrentPage = true;
|
foundCurrentPage = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!foundCurrentPage && multiSidebarConfig.length > 0) {
|
if (!foundCurrentPage && multiSidebarConfig.length > 0) {
|
||||||
multiSidebarConfig[0][1] = true;
|
multiSidebarConfig[0][1] = true;
|
||||||
}
|
}
|
||||||
if (
|
if (!multiSidebarConfig.some(([_label, isCurrentPage, _config]) => isCurrentPage)) {
|
||||||
!multiSidebarConfig.some(([_label, isCurrentPage, _config]) => isCurrentPage)
|
multiSidebarConfig[0][1] = true;
|
||||||
) {
|
|
||||||
multiSidebarConfig[0][1] = true;
|
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="__collapse">
|
<div class="__collapse">
|
||||||
{
|
{
|
||||||
multiSidebarConfig.map(([label, isCurrentPage, config]) => (
|
multiSidebarConfig.map(([label, isCurrentPage, config]) => (
|
||||||
<>
|
<>
|
||||||
<input
|
<input type="radio" name="sidebar" role="tab" aria-label={label} checked={isCurrentPage} />
|
||||||
type="radio"
|
<div class="__collapse-content">
|
||||||
name="sidebar"
|
<Default {...config}>
|
||||||
role="tab"
|
<slot />
|
||||||
aria-label={label}
|
</Default>
|
||||||
checked={isCurrentPage}
|
</div>
|
||||||
/>
|
</>
|
||||||
<div class="__collapse-content">
|
))
|
||||||
<Default {...config}>
|
}
|
||||||
<slot />
|
|
||||||
</Default>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<style>
|
<style>
|
||||||
.__collapse {
|
.__collapse {
|
||||||
display: grid;
|
display: grid;
|
||||||
}
|
}
|
||||||
.__collapse > input {
|
.__collapse > input {
|
||||||
/* Layout */
|
/* Layout */
|
||||||
position: relative;
|
position: relative;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
grid-row-start: 1;
|
grid-row-start: 1;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
|
|
||||||
/* Styles */
|
/* Styles */
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
padding: 0.2em 0.5rem;
|
padding: 0.2em 0.5rem;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
font-size: var(--sl-text-lg);
|
font-size: var(--sl-text-lg);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
margin-bottom: var(--sl-nav-pad-y);
|
margin-bottom: var(--sl-nav-pad-y);
|
||||||
}
|
}
|
||||||
|
|
||||||
.__collapse > input::after {
|
.__collapse > input::after {
|
||||||
content: attr(aria-label);
|
content: attr(aria-label);
|
||||||
}
|
}
|
||||||
|
|
||||||
.__collapse > input:checked {
|
.__collapse > input:checked {
|
||||||
color: var(--sl-color-text-invert);
|
color: var(--sl-color-text-invert);
|
||||||
background-color: var(--sl-color-text-accent);
|
background-color: var(--sl-color-text-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.__collapse > .__collapse-content {
|
.__collapse > .__collapse-content {
|
||||||
display: none;
|
display: none;
|
||||||
grid-column-start: 1;
|
grid-column-start: 1;
|
||||||
grid-column-end: span 999;
|
grid-column-end: span 999;
|
||||||
grid-row-start: 2;
|
grid-row-start: 2;
|
||||||
border-top: 1px solid var(--sl-color-gray-5);
|
border-top: 1px solid var(--sl-color-gray-5);
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
}
|
}
|
||||||
.__collapse > input:checked + .__collapse-content {
|
.__collapse > input:checked + .__collapse-content {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style is:global>
|
<style is:global>
|
||||||
.top-level {
|
.top-level {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
.sidebar-pane {
|
.sidebar-pane {
|
||||||
overflow-y:scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
---
|
|
||||||
title: Bridge
|
|
||||||
draft: true
|
|
||||||
---
|
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
|
||||||
|
|
||||||
<div className="row">
|
|
||||||
<div className="col col--4">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Ease of Use</td>
|
|
||||||
<td><Rater value="3"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensibility</td>
|
|
||||||
<td><Rater value="5"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Performance</td>
|
|
||||||
<td><Rater value="4"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Security</td>
|
|
||||||
<td><Rater value="4"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div className="col col--4 pattern-logo">
|
|
||||||
<img src={useBaseUrl('img/recipes/Bridge.svg')} alt="Bridge" />
|
|
||||||
</div>
|
|
||||||
<div className="col col--4">
|
|
||||||
Pros:
|
|
||||||
<ul>
|
|
||||||
<li>Highly configurable</li>
|
|
||||||
<li>No Rust skills required</li>
|
|
||||||
</ul>
|
|
||||||
Cons:
|
|
||||||
<ul>
|
|
||||||
<li>Some WebAPIs unavailable</li>
|
|
||||||
<li>Challenge to implement</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
The Bridge recipe is a secure pattern where messages are passed between brokers via an implicit bridge using the API. It isolates functionality to the specific scope and passes messages instead of functionality.
|
|
||||||
|
|
||||||
## Diagram
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph TD
|
|
||||||
H==>F
|
|
||||||
subgraph WEBVIEW
|
|
||||||
F-.-E
|
|
||||||
end
|
|
||||||
D-->E
|
|
||||||
E-->D
|
|
||||||
B-->D
|
|
||||||
D-->B
|
|
||||||
subgraph RUST
|
|
||||||
A==>H
|
|
||||||
A-->B
|
|
||||||
B-.-C
|
|
||||||
B-.-G
|
|
||||||
end
|
|
||||||
A[Binary]
|
|
||||||
B{Rust Broker}
|
|
||||||
C[Subprocess 2]
|
|
||||||
G[Subprocess 1]
|
|
||||||
D(( API BRIDGE ))
|
|
||||||
E{JS Broker}
|
|
||||||
F[Window]
|
|
||||||
H{Bootstrap}
|
|
||||||
class D apibridge
|
|
||||||
class RUST rust
|
|
||||||
class WEBVIEW webview
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Here's what you need to add to your tauri.conf.json file:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"tauri": {
|
|
||||||
"allowlist": {
|
|
||||||
"all": false,
|
|
||||||
"clipboard": {
|
|
||||||
"all": false,
|
|
||||||
"readText": false,
|
|
||||||
"writeText": false
|
|
||||||
},
|
|
||||||
"dialog": {
|
|
||||||
"all": false,
|
|
||||||
"ask": false,
|
|
||||||
"confirm": false,
|
|
||||||
"message": false,
|
|
||||||
"open": false,
|
|
||||||
"save": false
|
|
||||||
},
|
|
||||||
"fs": {
|
|
||||||
"all": false,
|
|
||||||
"copyFile": false,
|
|
||||||
"createDir": false,
|
|
||||||
"readDir": false,
|
|
||||||
"readFile": false,
|
|
||||||
"removeDir": false,
|
|
||||||
"removeFile": false,
|
|
||||||
"renameFile": false,
|
|
||||||
"scope": [],
|
|
||||||
"writeFile": false
|
|
||||||
},
|
|
||||||
"globalShortcut": {
|
|
||||||
"all": false
|
|
||||||
},
|
|
||||||
"http": {
|
|
||||||
"all": false,
|
|
||||||
"request": false,
|
|
||||||
"scope": []
|
|
||||||
},
|
|
||||||
"notification": {
|
|
||||||
"all": false
|
|
||||||
},
|
|
||||||
"os": {
|
|
||||||
"all": false
|
|
||||||
},
|
|
||||||
"path": {
|
|
||||||
"all": false
|
|
||||||
},
|
|
||||||
"process": {
|
|
||||||
"all": false,
|
|
||||||
"exit": false,
|
|
||||||
"relaunch": false,
|
|
||||||
"relaunchDangerousAllowSymlinkMacos": false
|
|
||||||
},
|
|
||||||
"protocol": {
|
|
||||||
"all": false,
|
|
||||||
"asset": false,
|
|
||||||
"assetScope": []
|
|
||||||
},
|
|
||||||
"shell": {
|
|
||||||
"all": false,
|
|
||||||
"execute": false,
|
|
||||||
"open": false,
|
|
||||||
"scope": [],
|
|
||||||
"sidecar": false
|
|
||||||
},
|
|
||||||
"window": {
|
|
||||||
"all": false,
|
|
||||||
"center": false,
|
|
||||||
"close": false,
|
|
||||||
"create": false,
|
|
||||||
"hide": false,
|
|
||||||
"maximize": false,
|
|
||||||
"minimize": false,
|
|
||||||
"print": false,
|
|
||||||
"requestUserAttention": false,
|
|
||||||
"setAlwaysOnTop": false,
|
|
||||||
"setDecorations": false,
|
|
||||||
"setFocus": false,
|
|
||||||
"setFullscreen": false,
|
|
||||||
"setIcon": false,
|
|
||||||
"setMaxSize": false,
|
|
||||||
"setMinSize": false,
|
|
||||||
"setPosition": false,
|
|
||||||
"setResizable": false,
|
|
||||||
"setSize": false,
|
|
||||||
"setSkipTaskbar": false,
|
|
||||||
"setTitle": false,
|
|
||||||
"show": false,
|
|
||||||
"startDragging": false,
|
|
||||||
"unmaximize": false,
|
|
||||||
"unminimize": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
189
src/content/docs/concept/_recipes/bridge.mdx
Normal file
189
src/content/docs/concept/_recipes/bridge.mdx
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
---
|
||||||
|
title: Bridge
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
||||||
|
import Rater from '@theme/Rater';
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col col--4">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Ease of Use</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="3" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Extensibility</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="5" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Performance</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="4" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Security</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="4" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div className="col col--4 pattern-logo">
|
||||||
|
<img src={useBaseUrl('img/recipes/Bridge.svg')} alt="Bridge" />
|
||||||
|
</div>
|
||||||
|
<div className="col col--4">
|
||||||
|
Pros:
|
||||||
|
<ul>
|
||||||
|
<li>Highly configurable</li>
|
||||||
|
<li>No Rust skills required</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>Some WebAPIs unavailable</li>
|
||||||
|
<li>Challenge to implement</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
The Bridge recipe is a secure pattern where messages are passed between brokers via an implicit bridge using the API. It isolates functionality to the specific scope and passes messages instead of functionality.
|
||||||
|
|
||||||
|
## Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
H==>F
|
||||||
|
subgraph WEBVIEW
|
||||||
|
F-.-E
|
||||||
|
end
|
||||||
|
D-->E
|
||||||
|
E-->D
|
||||||
|
B-->D
|
||||||
|
D-->B
|
||||||
|
subgraph RUST
|
||||||
|
A==>H
|
||||||
|
A-->B
|
||||||
|
B-.-C
|
||||||
|
B-.-G
|
||||||
|
end
|
||||||
|
A[Binary]
|
||||||
|
B{Rust Broker}
|
||||||
|
C[Subprocess 2]
|
||||||
|
G[Subprocess 1]
|
||||||
|
D(( API BRIDGE ))
|
||||||
|
E{JS Broker}
|
||||||
|
F[Window]
|
||||||
|
H{Bootstrap}
|
||||||
|
class D apibridge
|
||||||
|
class RUST rust
|
||||||
|
class WEBVIEW webview
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Here's what you need to add to your tauri.conf.json file:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"tauri": {
|
||||||
|
"allowlist": {
|
||||||
|
"all": false,
|
||||||
|
"clipboard": {
|
||||||
|
"all": false,
|
||||||
|
"readText": false,
|
||||||
|
"writeText": false
|
||||||
|
},
|
||||||
|
"dialog": {
|
||||||
|
"all": false,
|
||||||
|
"ask": false,
|
||||||
|
"confirm": false,
|
||||||
|
"message": false,
|
||||||
|
"open": false,
|
||||||
|
"save": false
|
||||||
|
},
|
||||||
|
"fs": {
|
||||||
|
"all": false,
|
||||||
|
"copyFile": false,
|
||||||
|
"createDir": false,
|
||||||
|
"readDir": false,
|
||||||
|
"readFile": false,
|
||||||
|
"removeDir": false,
|
||||||
|
"removeFile": false,
|
||||||
|
"renameFile": false,
|
||||||
|
"scope": [],
|
||||||
|
"writeFile": false
|
||||||
|
},
|
||||||
|
"globalShortcut": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"all": false,
|
||||||
|
"request": false,
|
||||||
|
"scope": []
|
||||||
|
},
|
||||||
|
"notification": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"os": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"all": false
|
||||||
|
},
|
||||||
|
"process": {
|
||||||
|
"all": false,
|
||||||
|
"exit": false,
|
||||||
|
"relaunch": false,
|
||||||
|
"relaunchDangerousAllowSymlinkMacos": false
|
||||||
|
},
|
||||||
|
"protocol": {
|
||||||
|
"all": false,
|
||||||
|
"asset": false,
|
||||||
|
"assetScope": []
|
||||||
|
},
|
||||||
|
"shell": {
|
||||||
|
"all": false,
|
||||||
|
"execute": false,
|
||||||
|
"open": false,
|
||||||
|
"scope": [],
|
||||||
|
"sidecar": false
|
||||||
|
},
|
||||||
|
"window": {
|
||||||
|
"all": false,
|
||||||
|
"center": false,
|
||||||
|
"close": false,
|
||||||
|
"create": false,
|
||||||
|
"hide": false,
|
||||||
|
"maximize": false,
|
||||||
|
"minimize": false,
|
||||||
|
"print": false,
|
||||||
|
"requestUserAttention": false,
|
||||||
|
"setAlwaysOnTop": false,
|
||||||
|
"setDecorations": false,
|
||||||
|
"setFocus": false,
|
||||||
|
"setFullscreen": false,
|
||||||
|
"setIcon": false,
|
||||||
|
"setMaxSize": false,
|
||||||
|
"setMinSize": false,
|
||||||
|
"setPosition": false,
|
||||||
|
"setResizable": false,
|
||||||
|
"setSize": false,
|
||||||
|
"setSkipTaskbar": false,
|
||||||
|
"setTitle": false,
|
||||||
|
"show": false,
|
||||||
|
"startDragging": false,
|
||||||
|
"unmaximize": false,
|
||||||
|
"unminimize": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -3,45 +3,53 @@ title: Cloudbridge
|
|||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
import Rater from '@theme/Rater';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--4">
|
<div className="col col--4">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ease of Use</td>
|
<td>Ease of Use</td>
|
||||||
<td><Rater value="1"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="1" />
|
||||||
<tr>
|
</td>
|
||||||
<td>Extensibility</td>
|
</tr>
|
||||||
<td><Rater value="5"/></td>
|
<tr>
|
||||||
</tr>
|
<td>Extensibility</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>Performance</td>
|
<Rater value="5" />
|
||||||
<td><Rater value="3"/></td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Security</td>
|
<td>Performance</td>
|
||||||
<td><Rater value="2"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="3" />
|
||||||
</table>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div className="col col--4 pattern-logo">
|
<tr>
|
||||||
<img src={useBaseUrl('img/recipes/Cloudbridge.svg')} alt="Cloudbridge" />
|
<td>Security</td>
|
||||||
</div>
|
<td>
|
||||||
<div className="col col--4">
|
<Rater value="2" />
|
||||||
Pros:
|
</td>
|
||||||
<ul>
|
</tr>
|
||||||
<li>All available features</li>
|
</table>
|
||||||
<li>No Rust skills required</li>
|
</div>
|
||||||
</ul>
|
<div className="col col--4 pattern-logo">
|
||||||
Cons:
|
<img src={useBaseUrl('img/recipes/Cloudbridge.svg')} alt="Cloudbridge" />
|
||||||
<ul>
|
</div>
|
||||||
<li>Largest bundle size</li>
|
<div className="col col--4">
|
||||||
<li>Hard to separate concerns</li>
|
Pros:
|
||||||
</ul>
|
<ul>
|
||||||
</div>
|
<li>All available features</li>
|
||||||
|
<li>No Rust skills required</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>Largest bundle size</li>
|
||||||
|
<li>Hard to separate concerns</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
@@ -3,45 +3,53 @@ title: Cloudish
|
|||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
import Rater from '@theme/Rater';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--4">
|
<div className="col col--4">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ease of Use</td>
|
<td>Ease of Use</td>
|
||||||
<td><Rater value="5"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="5" />
|
||||||
<tr>
|
</td>
|
||||||
<td>Extensibility</td>
|
</tr>
|
||||||
<td><Rater value="3"/></td>
|
<tr>
|
||||||
</tr>
|
<td>Extensibility</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>Performance</td>
|
<Rater value="3" />
|
||||||
<td><Rater value="3"/></td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Security</td>
|
<td>Performance</td>
|
||||||
<td><Rater value="2"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="3" />
|
||||||
</table>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div className="col col--4 pattern-logo">
|
<tr>
|
||||||
<img src={useBaseUrl('img/recipes/Cloudish.svg')} alt="Cloudish" />
|
<td>Security</td>
|
||||||
</div>
|
<td>
|
||||||
<div className="col col--4">
|
<Rater value="2" />
|
||||||
Pros:
|
</td>
|
||||||
<ul>
|
</tr>
|
||||||
<li>Similar to a SPA web-app</li>
|
</table>
|
||||||
<li>No Rust skills required</li>
|
</div>
|
||||||
</ul>
|
<div className="col col--4 pattern-logo">
|
||||||
Cons:
|
<img src={useBaseUrl('img/recipes/Cloudish.svg')} alt="Cloudish" />
|
||||||
<ul>
|
</div>
|
||||||
<li>No access to Rust API</li>
|
<div className="col col--4">
|
||||||
<li>Uses a localhost server</li>
|
Pros:
|
||||||
</ul>
|
<ul>
|
||||||
</div>
|
<li>Similar to a SPA web-app</li>
|
||||||
|
<li>No Rust skills required</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>No access to Rust API</li>
|
||||||
|
<li>Uses a localhost server</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
@@ -3,49 +3,57 @@ title: GLUI
|
|||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
:::warning
|
:::warning
|
||||||
This pattern is not available for now.
|
This pattern is not available for now.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
import Rater from '@theme/Rater';
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--4">
|
<div className="col col--4">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ease of Use</td>
|
<td>Ease of Use</td>
|
||||||
<td><Rater value="0"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="0" />
|
||||||
<tr>
|
</td>
|
||||||
<td>Extensibility</td>
|
</tr>
|
||||||
<td><Rater value="0"/></td>
|
<tr>
|
||||||
</tr>
|
<td>Extensibility</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>Performance</td>
|
<Rater value="0" />
|
||||||
<td><Rater value="5"/></td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Security</td>
|
<td>Performance</td>
|
||||||
<td><Rater value="0"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="5" />
|
||||||
</table>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div className="col col--4 pattern-logo">
|
<tr>
|
||||||
<img src={useBaseUrl('img/recipes/GLUI.svg')} alt="GLUI" />
|
<td>Security</td>
|
||||||
</div>
|
<td>
|
||||||
<div className="col col--4">
|
<Rater value="0" />
|
||||||
Pros:
|
</td>
|
||||||
<ul>
|
</tr>
|
||||||
<li>Framebuffer FTW</li>
|
</table>
|
||||||
<li>Window events rigged</li>
|
</div>
|
||||||
</ul>
|
<div className="col col--4 pattern-logo">
|
||||||
Cons:
|
<img src={useBaseUrl('img/recipes/GLUI.svg')} alt="GLUI" />
|
||||||
<ul>
|
</div>
|
||||||
<li>Broken on your machine</li>
|
<div className="col col--4">
|
||||||
</ul>
|
Pros:
|
||||||
</div>
|
<ul>
|
||||||
|
<li>Framebuffer FTW</li>
|
||||||
|
<li>Window events rigged</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>Broken on your machine</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
@@ -3,45 +3,53 @@ title: Hermit
|
|||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
import Rater from '@theme/Rater';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col col--4">
|
<div className="col col--4">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Ease of Use</td>
|
<td>Ease of Use</td>
|
||||||
<td><Rater value="5"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="5" />
|
||||||
<tr>
|
</td>
|
||||||
<td>Extensibility</td>
|
</tr>
|
||||||
<td><Rater value="0"/></td>
|
<tr>
|
||||||
</tr>
|
<td>Extensibility</td>
|
||||||
<tr>
|
<td>
|
||||||
<td>Performance</td>
|
<Rater value="0" />
|
||||||
<td><Rater value="5"/></td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Security</td>
|
<td>Performance</td>
|
||||||
<td><Rater value="5"/></td>
|
<td>
|
||||||
</tr>
|
<Rater value="5" />
|
||||||
</table>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
<div className="col col--4 pattern-logo">
|
<tr>
|
||||||
<img src={useBaseUrl('img/recipes/Hermit.svg')} alt="Hermit" />
|
<td>Security</td>
|
||||||
</div>
|
<td>
|
||||||
<div className="col col--4">
|
<Rater value="5" />
|
||||||
Pros:
|
</td>
|
||||||
<ul>
|
</tr>
|
||||||
<li>Quick to make</li>
|
</table>
|
||||||
<li>Smallest size</li>
|
</div>
|
||||||
</ul>
|
<div className="col col--4 pattern-logo">
|
||||||
Cons:
|
<img src={useBaseUrl('img/recipes/Hermit.svg')} alt="Hermit" />
|
||||||
<ul>
|
</div>
|
||||||
<li>No remote resources</li>
|
<div className="col col--4">
|
||||||
<li>No access to API</li>
|
Pros:
|
||||||
</ul>
|
<ul>
|
||||||
</div>
|
<li>Quick to make</li>
|
||||||
|
<li>Smallest size</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>No remote resources</li>
|
||||||
|
<li>No access to API</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
---
|
|
||||||
title: Lockdown
|
|
||||||
draft: true
|
|
||||||
---
|
|
||||||
|
|
||||||
import Rater from '@theme/Rater'
|
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
|
||||||
|
|
||||||
<div className="row">
|
|
||||||
<div className="col col--4">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Ease of Use</td>
|
|
||||||
<td><Rater value="2"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensibility</td>
|
|
||||||
<td><Rater value="4"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Performance</td>
|
|
||||||
<td><Rater value="5"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Security</td>
|
|
||||||
<td><Rater value="5" /></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div className="col col--4 pattern-logo">
|
|
||||||
<img src={useBaseUrl('img/recipes/Lockdown.svg')} alt="Lockdown" />
|
|
||||||
</div>
|
|
||||||
<div className="col col--4">
|
|
||||||
Pros:
|
|
||||||
<ul>
|
|
||||||
<li>Highest security rating</li>
|
|
||||||
<li>Elegant and powerful</li>
|
|
||||||
</ul>
|
|
||||||
Cons:
|
|
||||||
<ul>
|
|
||||||
<li>Rust skills required</li>
|
|
||||||
<li>No remote resources</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
The Lockdown recipe is a minimal usage of the [Bridge pattern](./bridge), which only allows interaction between Rust and the Window via expiring JS Promise Closures that are injected into the Window by Rust and nulled as part of the callback.
|
|
||||||
|
|
||||||
## Diagram
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph TD
|
|
||||||
H==>F
|
|
||||||
G-.->B
|
|
||||||
B-->G
|
|
||||||
subgraph WEBVIEW
|
|
||||||
G-->F
|
|
||||||
end
|
|
||||||
subgraph RUST
|
|
||||||
A-->B
|
|
||||||
A==>H
|
|
||||||
end
|
|
||||||
A[Binary]
|
|
||||||
B[API:Event]
|
|
||||||
F[Window]
|
|
||||||
G((Promise Closure))
|
|
||||||
H{Bootstrap}
|
|
||||||
class RUST rust
|
|
||||||
class WEBVIEW webview
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Here's what you need to add to your tauri.conf.json file:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"tauri": {
|
|
||||||
"allowlist": {} // all API endpoints are default false
|
|
||||||
}
|
|
||||||
```
|
|
||||||
90
src/content/docs/concept/_recipes/lockdown.mdx
Normal file
90
src/content/docs/concept/_recipes/lockdown.mdx
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
---
|
||||||
|
title: Lockdown
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
||||||
|
import Rater from '@theme/Rater';
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col col--4">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Ease of Use</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="2" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Extensibility</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="4" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Performance</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="5" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Security</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="5" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div className="col col--4 pattern-logo">
|
||||||
|
<img src={useBaseUrl('img/recipes/Lockdown.svg')} alt="Lockdown" />
|
||||||
|
</div>
|
||||||
|
<div className="col col--4">
|
||||||
|
Pros:
|
||||||
|
<ul>
|
||||||
|
<li>Highest security rating</li>
|
||||||
|
<li>Elegant and powerful</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>Rust skills required</li>
|
||||||
|
<li>No remote resources</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
The Lockdown recipe is a minimal usage of the [Bridge pattern](./bridge), which only allows interaction between Rust and the Window via expiring JS Promise Closures that are injected into the Window by Rust and nulled as part of the callback.
|
||||||
|
|
||||||
|
## Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph TD
|
||||||
|
H==>F
|
||||||
|
G-.->B
|
||||||
|
B-->G
|
||||||
|
subgraph WEBVIEW
|
||||||
|
G-->F
|
||||||
|
end
|
||||||
|
subgraph RUST
|
||||||
|
A-->B
|
||||||
|
A==>H
|
||||||
|
end
|
||||||
|
A[Binary]
|
||||||
|
B[API:Event]
|
||||||
|
F[Window]
|
||||||
|
G((Promise Closure))
|
||||||
|
H{Bootstrap}
|
||||||
|
class RUST rust
|
||||||
|
class WEBVIEW webview
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Here's what you need to add to your tauri.conf.json file:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"tauri": {
|
||||||
|
"allowlist": {} // all API endpoints are default false
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
---
|
|
||||||
title: Multiwin
|
|
||||||
draft: true
|
|
||||||
---
|
|
||||||
|
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl'
|
|
||||||
import Rater from '@theme/Rater'
|
|
||||||
|
|
||||||
<div className="row">
|
|
||||||
<div className="col col--4">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Ease of Use</td>
|
|
||||||
<td><Rater value="4"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Extensibility</td>
|
|
||||||
<td><Rater value="4"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Performance</td>
|
|
||||||
<td><Rater value="3"/></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Security</td>
|
|
||||||
<td><Rater value="5"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div className="col col--4 pattern-logo">
|
|
||||||
<img src={useBaseUrl('img/recipes/Multiwin.svg')} alt="Multiwin" />
|
|
||||||
</div>
|
|
||||||
<div className="col col--4">
|
|
||||||
Pros:
|
|
||||||
<ul>
|
|
||||||
<li>Windows can be spawned or destroyed at runtime</li>
|
|
||||||
<li>Separation of concerns</li>
|
|
||||||
</ul>
|
|
||||||
Cons:
|
|
||||||
<ul>
|
|
||||||
<li>Somewhat complex</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
The Multiwin recipe will allow you to have multiple windows.
|
|
||||||
|
|
||||||
## Diagram
|
|
||||||
|
|
||||||
```mermaid
|
|
||||||
graph LR
|
|
||||||
A==>H
|
|
||||||
H==>F
|
|
||||||
H==>G
|
|
||||||
subgraph WEBVIEW
|
|
||||||
F
|
|
||||||
end
|
|
||||||
subgraph WINIT
|
|
||||||
G
|
|
||||||
end
|
|
||||||
subgraph RUST
|
|
||||||
A
|
|
||||||
end
|
|
||||||
A[Binary]
|
|
||||||
F[Window]
|
|
||||||
G[Window]
|
|
||||||
H{Bootstrap}
|
|
||||||
class WINIT other
|
|
||||||
class RUST rust
|
|
||||||
class WEBVIEW webview
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
Here's what you need to add to your tauri.conf.json file:
|
|
||||||
|
|
||||||
```json
|
|
||||||
"tauri": {
|
|
||||||
"allowlist": {}, // all API endpoints are default false
|
|
||||||
"windows": [{
|
|
||||||
"title": "Window1",
|
|
||||||
"label": "main",
|
|
||||||
}, {
|
|
||||||
"title": "Splash",
|
|
||||||
"label": "splashscreen"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
99
src/content/docs/concept/_recipes/multiwin.mdx
Normal file
99
src/content/docs/concept/_recipes/multiwin.mdx
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
---
|
||||||
|
title: Multiwin
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
||||||
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
import Rater from '@theme/Rater';
|
||||||
|
|
||||||
|
<div className="row">
|
||||||
|
<div className="col col--4">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Ease of Use</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="4" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Extensibility</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="4" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Performance</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="3" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Security</td>
|
||||||
|
<td>
|
||||||
|
<Rater value="5" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div className="col col--4 pattern-logo">
|
||||||
|
<img src={useBaseUrl('img/recipes/Multiwin.svg')} alt="Multiwin" />
|
||||||
|
</div>
|
||||||
|
<div className="col col--4">
|
||||||
|
Pros:
|
||||||
|
<ul>
|
||||||
|
<li>Windows can be spawned or destroyed at runtime</li>
|
||||||
|
<li>Separation of concerns</li>
|
||||||
|
</ul>
|
||||||
|
Cons:
|
||||||
|
<ul>
|
||||||
|
<li>Somewhat complex</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
The Multiwin recipe will allow you to have multiple windows.
|
||||||
|
|
||||||
|
## Diagram
|
||||||
|
|
||||||
|
```mermaid
|
||||||
|
graph LR
|
||||||
|
A==>H
|
||||||
|
H==>F
|
||||||
|
H==>G
|
||||||
|
subgraph WEBVIEW
|
||||||
|
F
|
||||||
|
end
|
||||||
|
subgraph WINIT
|
||||||
|
G
|
||||||
|
end
|
||||||
|
subgraph RUST
|
||||||
|
A
|
||||||
|
end
|
||||||
|
A[Binary]
|
||||||
|
F[Window]
|
||||||
|
G[Window]
|
||||||
|
H{Bootstrap}
|
||||||
|
class WINIT other
|
||||||
|
class RUST rust
|
||||||
|
class WEBVIEW webview
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Here's what you need to add to your tauri.conf.json file:
|
||||||
|
|
||||||
|
```json
|
||||||
|
"tauri": {
|
||||||
|
"allowlist": {}, // all API endpoints are default false
|
||||||
|
"windows": [{
|
||||||
|
"title": "Window1",
|
||||||
|
"label": "main",
|
||||||
|
}, {
|
||||||
|
"title": "Splash",
|
||||||
|
"label": "splashscreen"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
@@ -32,7 +32,7 @@ Tauri has a variety of topics that are considered to be core concepts, things an
|
|||||||
title="Process Model"
|
title="Process Model"
|
||||||
href="/concept/process-model/"
|
href="/concept/process-model/"
|
||||||
description="Which processes Tauri manages and why."
|
description="Which processes Tauri manages and why."
|
||||||
/>
|
/>
|
||||||
<LinkCard
|
<LinkCard
|
||||||
title="App Size"
|
title="App Size"
|
||||||
href="/concept/size/"
|
href="/concept/size/"
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ lto = true # Enables link-time-optimizations.
|
|||||||
opt-level = "s" # Prioritizes small binary size. Use `3` if you prefer speed.
|
opt-level = "s" # Prioritizes small binary size. Use `3` if you prefer speed.
|
||||||
panic = "abort" # Higher performance by disabling panic handlers.
|
panic = "abort" # Higher performance by disabling panic handlers.
|
||||||
strip = true # Ensures debug symbols are removed.
|
strip = true # Ensures debug symbols are removed.
|
||||||
```
|
|
||||||
|
````
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
<TabItem label="Nightly">
|
<TabItem label="Nightly">
|
||||||
@@ -48,7 +49,8 @@ panic = "abort" # Higher performance by disabling panic handlers.
|
|||||||
strip = true # Ensures debug symbols are removed.
|
strip = true # Ensures debug symbols are removed.
|
||||||
trim-paths = "all" # Removes potentially privileged information from your binaries.
|
trim-paths = "all" # Removes potentially privileged information from your binaries.
|
||||||
rustflags = ["-Cdebuginfo=0", "-Zthreads=8"] # Better compile performance.
|
rustflags = ["-Cdebuginfo=0", "-Zthreads=8"] # Better compile performance.
|
||||||
```
|
````
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ sidebar:
|
|||||||
variant: caution
|
variant: caution
|
||||||
---
|
---
|
||||||
|
|
||||||
{ /* TODO: REVISE COPY TO V2 */}
|
{/* TODO: REVISE COPY TO V2 */}
|
||||||
{ /* TODO: Update links and internal navigation */}
|
{/* TODO: Update links and internal navigation */}
|
||||||
{ /* TODO: Add support to light/dark mode images */}
|
{/* TODO: Add support to light/dark mode images */}
|
||||||
{ /* TODO: Revise this change: Debugging in CLion > Debug in CLion */}
|
{/* TODO: Revise this change: Debugging in CLion > Debug in CLion */}
|
||||||
|
|
||||||
In this guide, we'll be setting up IntelliJ CLion for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
|
In this guide, we'll be setting up IntelliJ CLion for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
|
||||||
|
|
||||||
@@ -33,17 +33,17 @@ Before you proceed, make sure that your project is fully loaded. If the indexing
|
|||||||
We will set up a Run/Debug configuration that we can use to launch our Tauri app in debugging mode. To create a configuration, go to Edit Configurations, click **+**, and then select Cargo Command.
|
We will set up a Run/Debug configuration that we can use to launch our Tauri app in debugging mode. To create a configuration, go to Edit Configurations, click **+**, and then select Cargo Command.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
With that created we need to configure CLion so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.
|
With that created we need to configure CLion so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.
|
Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
:::caution
|
:::caution
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ sidebar:
|
|||||||
variant: caution
|
variant: caution
|
||||||
---
|
---
|
||||||
|
|
||||||
{ /* TODO: Update links and internal navigation */}
|
{/* TODO: Update links and internal navigation */}
|
||||||
{ /* TODO: Add support to light/dark mode images */}
|
{/* TODO: Add support to light/dark mode images */}
|
||||||
|
|
||||||
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
|
In this guide, we'll be setting up JetBrains RustRover for debugging the [Core Process of your Tauri app](/concept/process-model/#the-core-process).
|
||||||
|
|
||||||
@@ -29,27 +29,29 @@ Before you proceed, make sure that your project is fully loaded. If the Cargo to
|
|||||||
## Setting up Run Configurations
|
## Setting up Run Configurations
|
||||||
|
|
||||||
You will need to set up two separate Run/Debug configurations:
|
You will need to set up two separate Run/Debug configurations:
|
||||||
* one for launching the Tauri app in debugging mode,
|
|
||||||
* another one for running your frontend development server of choice.
|
- one for launching the Tauri app in debugging mode,
|
||||||
|
- another one for running your frontend development server of choice.
|
||||||
|
|
||||||
### Tauri App
|
### Tauri App
|
||||||
|
|
||||||
1. In the main menu, go to **Run | Edit Configurations**.
|
1. In the main menu, go to **Run | Edit Configurations**.
|
||||||
2. In the **Run/Debug Configurations** dialog:
|
2. In the **Run/Debug Configurations** dialog:
|
||||||
* To create a new configuration, click **+** on the toolbar and select **Cargo**.
|
|
||||||
|
- To create a new configuration, click **+** on the toolbar and select **Cargo**.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
With that created, we need to configure RustRover, so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from the disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.
|
With that created, we need to configure RustRover, so it instructs Cargo to build our app without any default features. This will tell Tauri to use your development server instead of reading assets from the disk. Normally this flag is passed by the Tauri CLI, but since we're completely sidestepping that here, we need to pass the flag manually.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.
|
Now we can optionally rename the Run/Debug Configuration to something more memorable, in this example we called it "Run Tauri App", but you can name it whatever you want.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
### Development Server
|
### Development Server
|
||||||
|
|
||||||
@@ -64,22 +66,21 @@ To create the corresponding Run configuration, you need to check the actual deve
|
|||||||
For `npm`, `pnpm`, or `yarn`, you could use the **npm** Run Configuration, for example:
|
For `npm`, `pnpm`, or `yarn`, you could use the **npm** Run Configuration, for example:
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
Make sure you have the correct values in the **Command**, **Scripts**, and **Package Manager** fields.
|
Make sure you have the correct values in the **Command**, **Scripts**, and **Package Manager** fields.
|
||||||
|
|
||||||
If your development server is `trunk` for Rust-based WebAssembly frontend frameworks, you could use the generic **Shell Script** Run Configuration:
|
If your development server is `trunk` for Rust-based WebAssembly frontend frameworks, you could use the generic **Shell Script** Run Configuration:
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
|
|
||||||
## Launching a Debugging Session
|
## Launching a Debugging Session
|
||||||
|
|
||||||
To launch a debugging session, you first need to run your development server, and then start debugging the Tauri App by clicking the **Debug** button next to the Run Configurations Switcher. RustRover will automatically recognize breakpoints placed in any Rust file in your project and stop on the first one hit.
|
To launch a debugging session, you first need to run your development server, and then start debugging the Tauri App by clicking the **Debug** button next to the Run Configurations Switcher. RustRover will automatically recognize breakpoints placed in any Rust file in your project and stop on the first one hit.
|
||||||
|
|
||||||

|

|
||||||
{ /*  */}
|
{/*  */}
|
||||||
|
|
||||||
From this point, you can explore the values of your variables, step further into the code, and check what's going at runtime in detail.
|
From this point, you can explore the values of your variables, step further into the code, and check what's going at runtime in detail.
|
||||||
|
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ class ExamplePlugin: Plugin {
|
|||||||
|
|
||||||
Tauri automatically implements two commands for the plugin: `checkPermissions` and `requestPermissions`. Those commands can be directly called from JavaScript or Rust:
|
Tauri automatically implements two commands for the plugin: `checkPermissions` and `requestPermissions`. Those commands can be directly called from JavaScript or Rust:
|
||||||
|
|
||||||
{ /* TODO: PermissionState type should be exported in Tauri */}
|
{/* TODO: PermissionState type should be exported in Tauri */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="JavaScript">
|
<TabItem label="JavaScript">
|
||||||
@@ -405,7 +405,7 @@ impl<R: Runtime> Notification<R> {
|
|||||||
|
|
||||||
## Plugin Events
|
## Plugin Events
|
||||||
|
|
||||||
{ /* TODO: Is this section a duplicate of Lifecycle Events above? */}
|
{/* TODO: Is this section a duplicate of Lifecycle Events above? */}
|
||||||
|
|
||||||
Plugins can emit events at any point of time using the `trigger` function:
|
Plugins can emit events at any point of time using the `trigger` function:
|
||||||
|
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ sidebar:
|
|||||||
order: 10
|
order: 10
|
||||||
---
|
---
|
||||||
|
|
||||||
{ /* TODO: Add a CLI section */}
|
{/* TODO: Add a CLI section */}
|
||||||
|
|
||||||
import CommandTabs from '@components/CommandTabs.astro';
|
import CommandTabs from '@components/CommandTabs.astro';
|
||||||
|
|
||||||
{ /* TODO: Link to windowing system, commands for sending messages, and event system */}
|
{/* TODO: Link to windowing system, commands for sending messages, and event system */}
|
||||||
|
|
||||||
:::tip[Plugin Development]
|
:::tip[Plugin Development]
|
||||||
|
|
||||||
@@ -24,11 +24,11 @@ Tauri offers a windowing system with web view functionality, a way to send messa
|
|||||||
|
|
||||||
A Tauri plugin is composed of a Cargo crate and an optional NPM package that provides API bindings for its commands and events. Additionally, a plugin project can include an Android library project and a Swift package for iOS. You can learn more about developing plugins for Android and iOS in the [Mobile Plugin Development guide](/develop/plugins/develop-mobile/).
|
A Tauri plugin is composed of a Cargo crate and an optional NPM package that provides API bindings for its commands and events. Additionally, a plugin project can include an Android library project and a Swift package for iOS. You can learn more about developing plugins for Android and iOS in the [Mobile Plugin Development guide](/develop/plugins/develop-mobile/).
|
||||||
|
|
||||||
{ /* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
{/* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
||||||
|
|
||||||
## Naming Convention
|
## Naming Convention
|
||||||
|
|
||||||
{ /* TODO: Add link to allowlist */}
|
{/* TODO: Add link to allowlist */}
|
||||||
|
|
||||||
Tauri plugins have a prefix (`tauri-plugin-` prefix for the Rust crate name and `@tauri-apps/plugin-` for the NPM package) followed by the plugin name. The plugin name is specified on the plugin configuration under [`tauri.conf.json > plugin`](/reference/config/#pluginconfig) and on the allowlist configuration.
|
Tauri plugins have a prefix (`tauri-plugin-` prefix for the Rust crate name and `@tauri-apps/plugin-` for the NPM package) followed by the plugin name. The plugin name is specified on the plugin configuration under [`tauri.conf.json > plugin`](/reference/config/#pluginconfig) and on the allowlist configuration.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sidebar:
|
|||||||
variant: caution
|
variant: caution
|
||||||
---
|
---
|
||||||
|
|
||||||
{ /* TODO: REVISE COPY TO V2 */}
|
{/* TODO: REVISE COPY TO V2 */}
|
||||||
|
|
||||||
:::caution[Currently in pre-alpha]
|
:::caution[Currently in pre-alpha]
|
||||||
|
|
||||||
@@ -61,18 +61,24 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components';
|
|||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
<LinkCard title="Setup" href="/start/develop/tests/webdriver/example/" />
|
<LinkCard title="Setup" href="/start/develop/tests/webdriver/example/" />
|
||||||
<LinkCard title="Selenium" href="/start/develop/tests/webdriver/example/selenium" />
|
|
||||||
<LinkCard
|
<LinkCard
|
||||||
title="WebdriverIO"
|
title="Selenium"
|
||||||
href="/start/develop/tests/webdriver/example/webdriverio"
|
href="/start/develop/tests/webdriver/example/selenium"
|
||||||
/>
|
/>
|
||||||
|
<LinkCard
|
||||||
|
title="WebdriverIO"
|
||||||
|
href="/start/develop/tests/webdriver/example/webdriverio"
|
||||||
|
/>
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|
||||||
## Continuous Integration (CI)
|
## Continuous Integration (CI)
|
||||||
|
|
||||||
The above examples also comes with a CI script to test with GitHub actions, but you may still be interested in the below WebDriver CI guide as it explains the concept a bit more.
|
The above examples also comes with a CI script to test with GitHub actions, but you may still be interested in the below WebDriver CI guide as it explains the concept a bit more.
|
||||||
|
|
||||||
<LinkCard title="Continuous Integration (CI)" href="/start/develop/tests/webdriver/ci" />
|
<LinkCard
|
||||||
|
title="Continuous Integration (CI)"
|
||||||
|
href="/start/develop/tests/webdriver/ci"
|
||||||
|
/>
|
||||||
|
|
||||||
[webdriver]: https://www.w3.org/TR/webdriver/
|
[webdriver]: https://www.w3.org/TR/webdriver/
|
||||||
[`tauri-driver`]: https://crates.io/crates/tauri-driver
|
[`tauri-driver`]: https://crates.io/crates/tauri-driver
|
||||||
|
|||||||
@@ -17,15 +17,15 @@ Here is a sample to illustrate the configuration. This is not a complete `tauri.
|
|||||||
|
|
||||||
```json title="src-tauri/tauri.conf.json"
|
```json title="src-tauri/tauri.conf.json"
|
||||||
{
|
{
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"externalBin": [
|
"externalBin": [
|
||||||
"/absolute/path/to/sidecar",
|
"/absolute/path/to/sidecar",
|
||||||
"relative/path/to/binary",
|
"relative/path/to/binary",
|
||||||
"binaries/my-sidecar"
|
"binaries/my-sidecar"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -54,29 +54,29 @@ rustc -Vv | Select-String "host:" | ForEach-Object {$_.Line.split(" ")[1]}
|
|||||||
Here's a Node.js script to append the target triple to a binary:
|
Here's a Node.js script to append the target triple to a binary:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const execa = require('execa')
|
const execa = require('execa');
|
||||||
const fs = require('fs')
|
const fs = require('fs');
|
||||||
|
|
||||||
let extension = ''
|
let extension = '';
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
extension = '.exe'
|
extension = '.exe';
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const rustInfo = (await execa('rustc', ['-vV'])).stdout
|
const rustInfo = (await execa('rustc', ['-vV'])).stdout;
|
||||||
const targetTriple = /host: (\S+)/g.exec(rustInfo)[1]
|
const targetTriple = /host: (\S+)/g.exec(rustInfo)[1];
|
||||||
if (!targetTriple) {
|
if (!targetTriple) {
|
||||||
console.error('Failed to determine platform target triple')
|
console.error('Failed to determine platform target triple');
|
||||||
}
|
}
|
||||||
fs.renameSync(
|
fs.renameSync(
|
||||||
`src-tauri/binaries/sidecar${extension}`,
|
`src-tauri/binaries/sidecar${extension}`,
|
||||||
`src-tauri/binaries/sidecar-${targetTriple}${extension}`
|
`src-tauri/binaries/sidecar-${targetTriple}${extension}`
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch((e) => {
|
main().catch((e) => {
|
||||||
throw e
|
throw e;
|
||||||
})
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running it from Rust
|
## Running it from Rust
|
||||||
@@ -116,8 +116,8 @@ In the JavaScript code, import the `Command` class from the `@tauri-apps/plugin-
|
|||||||
```javascript
|
```javascript
|
||||||
import { Command } from '@tauri-apps/plugin-shell';
|
import { Command } from '@tauri-apps/plugin-shell';
|
||||||
// `binaries/my-sidecar` is the EXACT value specified on `tauri.conf.json > tauri > bundle > externalBin`
|
// `binaries/my-sidecar` is the EXACT value specified on `tauri.conf.json > tauri > bundle > externalBin`
|
||||||
const sidecar_command = Command.sidecar('binaries/my-sidecar')
|
const sidecar_command = Command.sidecar('binaries/my-sidecar');
|
||||||
const output = await sidecar_command.execute()
|
const output = await sidecar_command.execute();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Passing arguments
|
## Passing arguments
|
||||||
@@ -130,38 +130,38 @@ First, define the arguments that need to be passed to the sidecar command in `sr
|
|||||||
|
|
||||||
```json title="src-tauri/capabilities/main.json" ins={14-31}
|
```json title="src-tauri/capabilities/main.json" ins={14-31}
|
||||||
{
|
{
|
||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "default",
|
"identifier": "default",
|
||||||
"description": "Capability for the main window",
|
"description": "Capability for the main window",
|
||||||
"windows": ["main"],
|
"windows": ["main"],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"path:default",
|
"path:default",
|
||||||
"event:default",
|
"event:default",
|
||||||
"window:default",
|
"window:default",
|
||||||
"app:default",
|
"app:default",
|
||||||
"resources:default",
|
"resources:default",
|
||||||
"menu:default",
|
"menu:default",
|
||||||
"tray:default",
|
"tray:default",
|
||||||
{
|
{
|
||||||
"identifier": "shell:allow-execute",
|
"identifier": "shell:allow-execute",
|
||||||
"allow": [
|
"allow": [
|
||||||
{
|
{
|
||||||
"args": [
|
"args": [
|
||||||
"arg1",
|
"arg1",
|
||||||
"-a",
|
"-a",
|
||||||
"--arg2",
|
"--arg2",
|
||||||
{
|
{
|
||||||
"validator": "\\S+"
|
"validator": "\\S+"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
"cmd": "",
|
"cmd": "",
|
||||||
"name": "binaries/my-sidecar",
|
"name": "binaries/my-sidecar",
|
||||||
"sidecar": true
|
"sidecar": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"shell:allow-open"
|
"shell:allow-open"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -192,25 +192,20 @@ import { Command } from '@tauri-apps/plugin-shell';
|
|||||||
// `binaries/my-sidecar` is the EXACT value specified on `tauri.conf.json > tauri > bundle > externalBin`
|
// `binaries/my-sidecar` is the EXACT value specified on `tauri.conf.json > tauri > bundle > externalBin`
|
||||||
// notice that the args array matches EXACTLY what is specified on `tauri.conf.json`.
|
// notice that the args array matches EXACTLY what is specified on `tauri.conf.json`.
|
||||||
const command = Command.sidecar('binaries/my-sidecar', [
|
const command = Command.sidecar('binaries/my-sidecar', [
|
||||||
'arg1',
|
'arg1',
|
||||||
'-a',
|
'-a',
|
||||||
'--arg2',
|
'--arg2',
|
||||||
'any-string-that-matches-the-validator',
|
'any-string-that-matches-the-validator',
|
||||||
])
|
]);
|
||||||
const output = await command.execute()
|
const output = await command.execute();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
Example: For a set of arguments like: `-i /path/to/input.png -o /path/to/output.txt`, the arguments array would look like –
|
Example: For a set of arguments like: `-i /path/to/input.png -o /path/to/output.txt`, the arguments array would look like –
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
["-i", { "validator": "\\S+" }, "-o", { "validator": "\\S+" }]
|
||||||
"-i",
|
|
||||||
{"validator": "\\S+"},
|
|
||||||
"-o",
|
|
||||||
{"validator": "\\S+"}
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Here, the first and third arguments are static (`-i` and `-o`), but the second and fourth are dynamic and match the regex pattern described (`\\S+` means anything except space).
|
Here, the first and third arguments are static (`-i` and `-o`), but the second and fourth are dynamic and match the regex pattern described (`\\S+` means anything except space).
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ en Rust:
|
|||||||
|
|
||||||
Consulta todas las [Opciones de diálogo](/reference/javascript/dialog/) en la referencia de la API de JavaScript.
|
Consulta todas las [Opciones de diálogo](/reference/javascript/dialog/) en la referencia de la API de JavaScript.
|
||||||
|
|
||||||
{ /* ASK */}
|
{/* ASK */}
|
||||||
|
|
||||||
#### Crear un diálogo de Si/No
|
#### Crear un diálogo de Si/No
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ console.log(answer);
|
|||||||
// Imprime un booleano en la consola
|
// Imprime un booleano en la consola
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* CONFIRM */}
|
{/* CONFIRM */}
|
||||||
|
|
||||||
#### Crear un diálogo de Ok/Cancelar
|
#### Crear un diálogo de Ok/Cancelar
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ console.log(confirmation);
|
|||||||
// Imprime un booleano en la consola
|
// Imprime un booleano en la consola
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* MESSAGE */}
|
{/* MESSAGE */}
|
||||||
|
|
||||||
#### Crear un diálogo de mensaje
|
#### Crear un diálogo de mensaje
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ import { message } from '@tauri-apps/plugin-dialog';
|
|||||||
await message('File not found', { title: 'Tauri', type: 'error' });
|
await message('File not found', { title: 'Tauri', type: 'error' });
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* OPEN */}
|
{/* OPEN */}
|
||||||
|
|
||||||
#### Abrir un diálogo de selección de archivos
|
#### Abrir un diálogo de selección de archivos
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ console.log(file);
|
|||||||
// Imprime la ruta y el nombre del archivo en la consola
|
// Imprime la ruta y el nombre del archivo en la consola
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* SAVE */}
|
{/* SAVE */}
|
||||||
|
|
||||||
#### Diálogo de guardar en archivo
|
#### Diálogo de guardar en archivo
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ Conceptualmente Tauri desempeña el rol de un servidor web estático. Necesitas
|
|||||||
|
|
||||||
Debajo puedes consultar una checklist de escenarios comunes al integrar un frontend con Tauri:
|
Debajo puedes consultar una checklist de escenarios comunes al integrar un frontend con Tauri:
|
||||||
|
|
||||||
{ /* TODO: Link to core concept of SSG/SSR, etc. */}
|
{/* TODO: Link to core concept of SSG/SSR, etc. */}
|
||||||
{ /* TODO: Link to mobile development server guide */}
|
{/* TODO: Link to mobile development server guide */}
|
||||||
{ /* TODO: Concept of how to do a client-server relationship? */}
|
{/* TODO: Concept of how to do a client-server relationship? */}
|
||||||
|
|
||||||
- Usa la generación de sitios estáticos (SSG). Tauri no soporta alternativas basadas en servidores de manera oficial (como SSR).
|
- Usa la generación de sitios estáticos (SSG). Tauri no soporta alternativas basadas en servidores de manera oficial (como SSR).
|
||||||
- Para el desarrollo de apps móviles, es necesario un servidor de desarrollo de algun tipo para servir el frontend desde tu IP interna.
|
- Para el desarrollo de apps móviles, es necesario un servidor de desarrollo de algun tipo para servir el frontend desde tu IP interna.
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ Aprende más sobre Nuxt en https://nuxt.com. Esta guía es precisa a partir de N
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="yarn">
|
<TabItem label="yarn">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -49,8 +49,8 @@ Aprende más sobre Nuxt en https://nuxt.com. Esta guía es precisa a partir de N
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="pnpm">
|
<TabItem label="pnpm">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -64,7 +64,8 @@ Aprende más sobre Nuxt en https://nuxt.com. Esta guía es precisa a partir de N
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
2. Actualiza la configuración de Nuxt:
|
2. Actualiza la configuración de Nuxt:
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ Sigue el enlace para comenzar según tu sistema operativo:
|
|||||||
|
|
||||||
Tauri requiere varias dependencias del sistema para el desarrollo en Linux. Estas pueden ser diferentes dependiendo de su distribución, pero hemos incluido algunas distribuciones populares a continuación para ayudarlo a configurar.
|
Tauri requiere varias dependencias del sistema para el desarrollo en Linux. Estas pueden ser diferentes dependiendo de su distribución, pero hemos incluido algunas distribuciones populares a continuación para ayudarlo a configurar.
|
||||||
|
|
||||||
{ /* Note: These are the officially supported linux distributions. */}
|
{/* Note: These are the officially supported linux distributions. */}
|
||||||
{ /* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
{/* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Debian">
|
<TabItem label="Debian">
|
||||||
@@ -184,7 +184,7 @@ Aquí está el archivo como un script plano: [rustup.sh](https://sh.rustup.rs/)
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
Visita https://www.rust-lang.org/tools/install para instalar `rustup`.
|
Visita https://www.rust-lang.org/tools/install para instalar `rustup`.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
@@ -205,7 +205,7 @@ Si deseas compilar tu aplicación para Android o iOS, entonces hay algunas depen
|
|||||||
1. Descarga e instala [Android Studio desde el sitio web de Android Developers](https://developer.android.com/studio)
|
1. Descarga e instala [Android Studio desde el sitio web de Android Developers](https://developer.android.com/studio)
|
||||||
2. Establece la variable de entorno `JAVA_HOME`:
|
2. Establece la variable de entorno `JAVA_HOME`:
|
||||||
|
|
||||||
{ /* TODO: Can this be done in the 4th step? */}
|
{/* TODO: Can this be done in the 4th step? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux">
|
<TabItem label="Linux">
|
||||||
@@ -240,7 +240,7 @@ export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
|
|||||||
|
|
||||||
4. Establece las variables de entorno `ANDROID_HOME` y `NDK_HOME`. Reemplaza los números de versión para que coincidan con la versión instalada.
|
4. Establece las variables de entorno `ANDROID_HOME` y `NDK_HOME`. Reemplaza los números de versión para que coincidan con la versión instalada.
|
||||||
|
|
||||||
{ /* TODO: Does the version number change below? */}
|
{/* TODO: Does the version number change below? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux">
|
<TabItem label="Linux">
|
||||||
@@ -261,7 +261,7 @@ export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105"
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
{ /* TODO: Do we need a note about this version? */}
|
{/* TODO: Do we need a note about this version? */}
|
||||||
|
|
||||||
```ps
|
```ps
|
||||||
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
||||||
@@ -284,9 +284,9 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
```ps
|
```ps
|
||||||
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -11,5 +11,8 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components';
|
|||||||
href="/fr/develop/Debug/application//"
|
href="/fr/develop/Debug/application//"
|
||||||
/>
|
/>
|
||||||
<LinkCard title="Débogage dans VS Code" href="/fr/develop/Debug/vscode" />
|
<LinkCard title="Débogage dans VS Code" href="/fr/develop/Debug/vscode" />
|
||||||
<LinkCard title="Débogage dans RustRover" href="/fr/develop/Debug/rustrover" />
|
<LinkCard
|
||||||
|
title="Débogage dans RustRover"
|
||||||
|
href="/fr/develop/Debug/rustrover"
|
||||||
|
/>
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ Théoriquement, Tauri agit comme un hôte web statique. Vous avez besoin de four
|
|||||||
|
|
||||||
Ci-dessous se trouve une liste des scénarios communs nécessaires pour intégrer un frontend avec Tauri :
|
Ci-dessous se trouve une liste des scénarios communs nécessaires pour intégrer un frontend avec Tauri :
|
||||||
|
|
||||||
{ /* TODO: Link to core concept of SSG/SSR, etc. */}
|
{/* TODO: Link to core concept of SSG/SSR, etc. */}
|
||||||
{ /* TODO: Link to mobile development server guide */}
|
{/* TODO: Link to mobile development server guide */}
|
||||||
{ /* TODO: Concept of how to do a client-server relationship? */}
|
{/* TODO: Concept of how to do a client-server relationship? */}
|
||||||
|
|
||||||
- Utilisez la génération statique de site (SSG). Tauri ne supporte pas officiellent les solutions basées sur serveur (par exemple SSR).
|
- Utilisez la génération statique de site (SSG). Tauri ne supporte pas officiellent les solutions basées sur serveur (par exemple SSR).
|
||||||
- Pour le développement mobile, un serveur de développement d'un certain type est nécessaire pour héberger le frontend sur votre IP locale.
|
- Pour le développement mobile, un serveur de développement d'un certain type est nécessaire pour héberger le frontend sur votre IP locale.
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ Apprenez-en plus au sujet de Nuxt sur https://nuxt.com. Ce guide est valable à
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="yarn">
|
<TabItem label="yarn">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -49,8 +49,8 @@ Apprenez-en plus au sujet de Nuxt sur https://nuxt.com. Ce guide est valable à
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="pnpm">
|
<TabItem label="pnpm">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -64,7 +64,8 @@ Apprenez-en plus au sujet de Nuxt sur https://nuxt.com. Ce guide est valable à
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
2. Mettez à jour la configuration de Nuxt :
|
2. Mettez à jour la configuration de Nuxt :
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ Suivez les liens pour votre système d'exploitation:
|
|||||||
|
|
||||||
Tauri exige un système varié de dépendances pour le développement sur Linux. Celles-ci peuvent être différentes selon votre distribution, mais nous avons inclus quelques distributions populaires ci-dessous pour vous aider durant l'installation.
|
Tauri exige un système varié de dépendances pour le développement sur Linux. Celles-ci peuvent être différentes selon votre distribution, mais nous avons inclus quelques distributions populaires ci-dessous pour vous aider durant l'installation.
|
||||||
|
|
||||||
{ /* Note: These are the officially supported linux distributions. */}
|
{/* Note: These are the officially supported linux distributions. */}
|
||||||
{ /* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
{/* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Debian">
|
<TabItem label="Debian">
|
||||||
@@ -187,7 +187,7 @@ Voici le fichier contenant le script: [rustup.sh](https://sh.rustup.rs/)
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
Visitez https://www.rust-lang.org/tools/install pour installer `rustup`.
|
Visitez https://www.rust-lang.org/tools/install pour installer `rustup`.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
@@ -208,7 +208,7 @@ Si vous vouler que votre application soit utilisable sur Android et iOS, il faut
|
|||||||
1. Téléchargez et installez [Android Studio à partir du site Android Developers](https://developer.android.com/studio)
|
1. Téléchargez et installez [Android Studio à partir du site Android Developers](https://developer.android.com/studio)
|
||||||
2. Configurez la variable d'environement `JAVA_HOME`:
|
2. Configurez la variable d'environement `JAVA_HOME`:
|
||||||
|
|
||||||
{ /* TODO: Can this be done in the 4th step? */}
|
{/* TODO: Can this be done in the 4th step? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux">
|
<TabItem label="Linux">
|
||||||
@@ -243,7 +243,7 @@ export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
|
|||||||
|
|
||||||
4. Configurez les variables d'environemment `ANDROID_HOME` et `NDK_HOME`
|
4. Configurez les variables d'environemment `ANDROID_HOME` et `NDK_HOME`
|
||||||
|
|
||||||
{ /* TODO: Does the version number change below? */}
|
{/* TODO: Does the version number change below? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux and macOS">
|
<TabItem label="Linux and macOS">
|
||||||
@@ -256,7 +256,7 @@ export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105"
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
{ /* TODO: Do we need a note about this version? */}
|
{/* TODO: Do we need a note about this version? */}
|
||||||
|
|
||||||
```ps
|
```ps
|
||||||
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
||||||
@@ -279,9 +279,9 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
```ps
|
```ps
|
||||||
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ import Cta from '@fragments/cta.mdx';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="lp-cta-card">
|
<div class="lp-cta-card">
|
||||||
<Card title="Create a Project" icon="rocket">
|
<Card title="Create a Project" icon="rocket">
|
||||||
<Cta/>
|
<Cta />
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ Install the CLI plugin to get started.
|
|||||||
{' '}
|
{' '}
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="npm run tauri add cli"
|
npm="npm run tauri add cli"
|
||||||
yarn="yarn run tauri add cli"
|
yarn="yarn run tauri add cli"
|
||||||
pnpm="pnpm tauri add cli"
|
pnpm="pnpm tauri add cli"
|
||||||
cargo="cargo tauri add cli"
|
cargo="cargo tauri add cli"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Manual">
|
<TabItem label="Manual">
|
||||||
@@ -70,10 +70,10 @@ Install the CLI plugin to get started.
|
|||||||
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
3. Install the JavaScript Guest bindings using your preferred JavaScript package manager:
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="npm install @tauri-apps/plugin-cli"
|
npm="npm install @tauri-apps/plugin-cli"
|
||||||
yarn="yarn add @tauri-apps/plugin-cli"
|
yarn="yarn add @tauri-apps/plugin-cli"
|
||||||
pnpm="pnpm add @tauri-apps/plugin-cli"
|
pnpm="pnpm add @tauri-apps/plugin-cli"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Steps>
|
</Steps>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
@@ -126,7 +126,7 @@ All JSON configurations here are just samples, many other fields have been omitt
|
|||||||
|
|
||||||
The `args` array represents the list of arguments accepted by its command or subcommand.
|
The `args` array represents the list of arguments accepted by its command or subcommand.
|
||||||
|
|
||||||
{ /* TODO: List available configuration */}
|
{/* TODO: List available configuration */}
|
||||||
|
|
||||||
### Positional Arguments
|
### Positional Arguments
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ in Rust:
|
|||||||
|
|
||||||
See all [Dialog Options](/reference/javascript/dialog/) at the JavaScript API reference.
|
See all [Dialog Options](/reference/javascript/dialog/) at the JavaScript API reference.
|
||||||
|
|
||||||
{ /* ASK */}
|
{/* ASK */}
|
||||||
|
|
||||||
#### Create Yes/No Dialog
|
#### Create Yes/No Dialog
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ console.log(answer);
|
|||||||
// Prints boolean to the console
|
// Prints boolean to the console
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* CONFIRM */}
|
{/* CONFIRM */}
|
||||||
|
|
||||||
#### Create Ok/Cancel Dialog
|
#### Create Ok/Cancel Dialog
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ console.log(confirmation);
|
|||||||
// Prints boolean to the console
|
// Prints boolean to the console
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* MESSAGE */}
|
{/* MESSAGE */}
|
||||||
|
|
||||||
#### Create Message Dialog
|
#### Create Message Dialog
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ import { message } from '@tauri-apps/plugin-dialog';
|
|||||||
await message('File not found', { title: 'Tauri', kind: 'error' });
|
await message('File not found', { title: 'Tauri', kind: 'error' });
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* OPEN */}
|
{/* OPEN */}
|
||||||
|
|
||||||
#### Open a File Selector Dialog
|
#### Open a File Selector Dialog
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ console.log(file);
|
|||||||
// Prints file path and name to the console
|
// Prints file path and name to the console
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* SAVE */}
|
{/* SAVE */}
|
||||||
|
|
||||||
#### Save to File Dialog
|
#### Save to File Dialog
|
||||||
|
|
||||||
|
|||||||
@@ -84,27 +84,27 @@ Install the log plugin to get started.
|
|||||||
|
|
||||||
<Steps>
|
<Steps>
|
||||||
|
|
||||||
1. First, you need to register the plugin with Tauri.
|
1. First, you need to register the plugin with Tauri.
|
||||||
|
|
||||||
```rust title="src-tauri/src/lib.rs" {1} {6-14}
|
```rust title="src-tauri/src/lib.rs" {1} {6-14}
|
||||||
use tauri_plugin_log::{Target, TargetKind};
|
use tauri_plugin_log::{Target, TargetKind};
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
pub fn run() {
|
pub fn run() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(
|
.plugin(
|
||||||
tauri_plugin_log::Builder::new()
|
tauri_plugin_log::Builder::new()
|
||||||
.targets([
|
.targets([
|
||||||
Target::new(TargetKind::Stdout),
|
Target::new(TargetKind::Stdout),
|
||||||
Target::new(TargetKind::LogDir { file_name: None }),
|
Target::new(TargetKind::LogDir { file_name: None }),
|
||||||
Target::new(TargetKind::Webview),
|
Target::new(TargetKind::Webview),
|
||||||
])
|
])
|
||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Afterwards, all the plugin's APIs are available through the JavaScript guest bindings:
|
2. Afterwards, all the plugin's APIs are available through the JavaScript guest bindings:
|
||||||
|
|
||||||
|
|||||||
@@ -90,24 +90,25 @@ Additional setup is required to get tray-relative positions to work.
|
|||||||
tauri-plugin-positioner = { version = "2.0.0-beta", features = ["tray-icon"] }
|
tauri-plugin-positioner = { version = "2.0.0-beta", features = ["tray-icon"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Setup `on_tray_event` for positioner plugin:
|
2. Setup `on_tray_event` for positioner plugin:
|
||||||
```rust title="src-tauri/src/lib.rs" ins={4-12}
|
```rust title="src-tauri/src/lib.rs" ins={4-12}
|
||||||
fn run() {
|
fn run() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_positioner::init())
|
.plugin(tauri_plugin_positioner::init())
|
||||||
// This is required to get tray-relative positions to work
|
// This is required to get tray-relative positions to work
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
TrayIconBuilder::new()
|
TrayIconBuilder::new()
|
||||||
.on_tray_icon_event(|app, event| {
|
.on_tray_icon_event(|app, event| {
|
||||||
tauri_plugin_positioner::on_tray_event(app.app_handle(), &event);
|
tauri_plugin_positioner::on_tray_event(app.app_handle(), &event);
|
||||||
})
|
})
|
||||||
.build(app)?;
|
.build(app)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</Steps>
|
</Steps>
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ The closure has three arguments:
|
|||||||
|
|
||||||
<Steps>
|
<Steps>
|
||||||
|
|
||||||
1. **`app` :** The [AppHandle](https://docs.rs/tauri/latest/tauri/struct.AppHandle.html) of the application.
|
1. **`app` :** The [AppHandle](https://docs.rs/tauri/latest/tauri/struct.AppHandle.html) of the application.
|
||||||
2. **`args` :** The list of arguments, that was passed by the user to initiate this new instance.
|
2. **`args` :** The list of arguments, that was passed by the user to initiate this new instance.
|
||||||
3. **`cwd` :** The Current Working Directory denotes the directory from which the new application instance was launched.
|
3. **`cwd` :** The Current Working Directory denotes the directory from which the new application instance was launched.
|
||||||
|
|
||||||
</Steps>
|
</Steps>
|
||||||
|
|
||||||
|
|||||||
@@ -230,24 +230,21 @@ See [Access Control List](/reference/acl/) for more information.
|
|||||||
|
|
||||||
```json title="src-tauri/capabilities/main.json" ins={7-8}
|
```json title="src-tauri/capabilities/main.json" ins={7-8}
|
||||||
{
|
{
|
||||||
"$schema": "../gen/schemas/desktop-schema.json",
|
"$schema": "../gen/schemas/desktop-schema.json",
|
||||||
"identifier": "main-capability",
|
"identifier": "main-capability",
|
||||||
"description": "Capability for the main window",
|
"description": "Capability for the main window",
|
||||||
"windows": ["main"],
|
"windows": ["main"],
|
||||||
"permissions": [
|
"permissions": ["sql:allow-load", "sql:allow-execute"]
|
||||||
"sql:allow-load",
|
|
||||||
"sql:allow-execute",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Permission | Description |
|
| Permission | Description |
|
||||||
|------|-----|
|
| ------------------- | ------------------------------------------------------------- |
|
||||||
|`sql:allow-close`|Enables the close command without any pre-configured scope.|
|
| `sql:allow-close` | Enables the close command without any pre-configured scope. |
|
||||||
|`sql:deny-close`|Denies the close command without any pre-configured scope.|
|
| `sql:deny-close` | Denies the close command without any pre-configured scope. |
|
||||||
|`sql:allow-execute`|Enables the execute command without any pre-configured scope.|
|
| `sql:allow-execute` | Enables the execute command without any pre-configured scope. |
|
||||||
|`sql:deny-execute`|Denies the execute command without any pre-configured scope.|
|
| `sql:deny-execute` | Denies the execute command without any pre-configured scope. |
|
||||||
|`sql:allow-load`|Enables the load command without any pre-configured scope.|
|
| `sql:allow-load` | Enables the load command without any pre-configured scope. |
|
||||||
|`sql:deny-load`|Denies the load command without any pre-configured scope.|
|
| `sql:deny-load` | Denies the load command without any pre-configured scope. |
|
||||||
|`sql:allow-select`|Enables the select command without any pre-configured scope.|
|
| `sql:allow-select` | Enables the select command without any pre-configured scope. |
|
||||||
|`sql:deny-select`|Denies the select command without any pre-configured scope.|
|
| `sql:deny-select` | Denies the select command without any pre-configured scope. |
|
||||||
|
|||||||
@@ -142,9 +142,9 @@ See [Access Control List](/reference/acl/) for more information.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Permission | Description |
|
| Permission | Description |
|
||||||
| ----------------------------------------- | -------------------------------------------------------------------------- |
|
| -------------------------------------- | ----------------------------------------------------------------------- |
|
||||||
| `window-state:allow-restore-state` | Enables the restore_state command without any pre-configured scope. |
|
| `window-state:allow-restore-state` | Enables the restore_state command without any pre-configured scope. |
|
||||||
| `window-state:deny-restore-state` | Denies the restore_state command without any pre-configured scope. |
|
| `window-state:deny-restore-state` | Denies the restore_state command without any pre-configured scope. |
|
||||||
| `window-state:allow-save-window-state` | Enables the save_window_state command without any pre-configured scope. |
|
| `window-state:allow-save-window-state` | Enables the save_window_state command without any pre-configured scope. |
|
||||||
| `window-state:deny-save-window-state` | Denies the save_window_state command without any pre-configured scope. |
|
| `window-state:deny-save-window-state` | Denies the save_window_state command without any pre-configured scope. |
|
||||||
|
|||||||
@@ -588,7 +588,6 @@ Options:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## `capability`
|
## `capability`
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
|
|||||||
@@ -35,23 +35,23 @@ We recommend starting with the vanilla template (HTML, CSS, and JavaScript witho
|
|||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
||||||
{ /* TODO: Can CTA offer to install the deps? */}
|
{/* TODO: Can CTA offer to install the deps? */}
|
||||||
|
|
||||||
After `create-tauri-app` has complete you can navigate into your project's folder, install dependencies, then use the [Tauri CLI](/reference/cli) to start the development server:
|
After `create-tauri-app` has complete you can navigate into your project's folder, install dependencies, then use the [Tauri CLI](/reference/cli) to start the development server:
|
||||||
|
|
||||||
import CommandTabs from '@components/CommandTabs.astro';
|
import CommandTabs from '@components/CommandTabs.astro';
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="cd tauri-app
|
npm="cd tauri-app
|
||||||
npm install
|
npm install
|
||||||
npm run tauri dev"
|
npm run tauri dev"
|
||||||
yarn="cd tauri-app
|
yarn="cd tauri-app
|
||||||
yarn install
|
yarn install
|
||||||
yarn tauri dev"
|
yarn tauri dev"
|
||||||
pnpm="cd tauri-app
|
pnpm="cd tauri-app
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm tauri dev"
|
pnpm tauri dev"
|
||||||
cargo="cd tauri-app
|
cargo="cd tauri-app
|
||||||
cargo tauri dev"
|
cargo tauri dev"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ Conceptually Tauri acts as a static web host. You need to provide Tauri with a f
|
|||||||
|
|
||||||
Below is a checklist of common scenarios needed to integrate a frontend with Tauri:
|
Below is a checklist of common scenarios needed to integrate a frontend with Tauri:
|
||||||
|
|
||||||
{ /* TODO: Link to core concept of SSG/SSR, etc. */}
|
{/* TODO: Link to core concept of SSG/SSR, etc. */}
|
||||||
{ /* TODO: Link to mobile development server guide */}
|
{/* TODO: Link to mobile development server guide */}
|
||||||
{ /* TODO: Concept of how to do a client-server relationship? */}
|
{/* TODO: Concept of how to do a client-server relationship? */}
|
||||||
|
|
||||||
- Use static site generation (SSG), single-page applications (SPA), or classic multi-page apps (MPA). Tauri does not natively support server based alternatives (such as SSR).
|
- Use static site generation (SSG), single-page applications (SPA), or classic multi-page apps (MPA). Tauri does not natively support server based alternatives (such as SSR).
|
||||||
- For mobile development, a development server of some kind is necessary that can host the frontend on your internal IP.
|
- For mobile development, a development server of some kind is necessary that can host the frontend on your internal IP.
|
||||||
@@ -28,7 +28,7 @@ Below is a checklist of common scenarios needed to integrate a frontend with Tau
|
|||||||
|
|
||||||
## JavaScript
|
## JavaScript
|
||||||
|
|
||||||
{ /* TODO: Help me with the wording here lol */}
|
{/* TODO: Help me with the wording here lol */}
|
||||||
For most projects we recommend [Vite](https://vitejs.dev/) for SPA frameworks such as React, Vue, Svelte, and Solid, but also for plain JavaScript or TypeScript projects. Most other guides listed here show how to use Meta-Frameworks as they are typically designed for SSR and therefore require special configuration.
|
For most projects we recommend [Vite](https://vitejs.dev/) for SPA frameworks such as React, Vue, Svelte, and Solid, but also for plain JavaScript or TypeScript projects. Most other guides listed here show how to use Meta-Frameworks as they are typically designed for SSR and therefore require special configuration.
|
||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
@@ -36,10 +36,7 @@ For most projects we recommend [Vite](https://vitejs.dev/) for SPA frameworks su
|
|||||||
<LinkCard title="Nuxt" href="/start/frontend/nuxt/" />
|
<LinkCard title="Nuxt" href="/start/frontend/nuxt/" />
|
||||||
<LinkCard title="Qwik" href="/start/frontend/qwik/" />
|
<LinkCard title="Qwik" href="/start/frontend/qwik/" />
|
||||||
<LinkCard title="SvelteKit" href="/start/frontend/sveltekit/" />
|
<LinkCard title="SvelteKit" href="/start/frontend/sveltekit/" />
|
||||||
<LinkCard
|
<LinkCard title="Vite (recommended)" href="/start/frontend/vite/" />
|
||||||
title="Vite (recommended)"
|
|
||||||
href="/start/frontend/vite/"
|
|
||||||
/>
|
|
||||||
<LinkCard title="Webpack" href="/start/frontend/webpack/" />
|
<LinkCard title="Webpack" href="/start/frontend/webpack/" />
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ Learn more about Nuxt at https://nuxt.com. This guide is accurate as of Nuxt 3.7
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="yarn">
|
<TabItem label="yarn">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -49,8 +49,8 @@ Learn more about Nuxt at https://nuxt.com. This guide is accurate as of Nuxt 3.7
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="pnpm">
|
<TabItem label="pnpm">
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// tauri.conf.json
|
// tauri.conf.json
|
||||||
@@ -64,7 +64,8 @@ Learn more about Nuxt at https://nuxt.com. This guide is accurate as of Nuxt 3.7
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
2. Update Nuxt configuration:
|
2. Update Nuxt configuration:
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ fn main() {
|
|||||||
The Tauri v2 CLI includes a `migrate` command that automates most of the process and helps you finish the migration:
|
The Tauri v2 CLI includes a `migrate` command that automates most of the process and helps you finish the migration:
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="npm install @tauri-apps/cli@next
|
npm="npm install @tauri-apps/cli@next
|
||||||
npm run tauri migrate"
|
npm run tauri migrate"
|
||||||
yarn="yarn upgrade @tauri-apps/cli --next
|
yarn="yarn upgrade @tauri-apps/cli --next
|
||||||
yarn tauri migrate"
|
yarn tauri migrate"
|
||||||
pnpm="pnpm update @tauri-apps/cli@next
|
pnpm="pnpm update @tauri-apps/cli@next
|
||||||
pnpm tauri migrate"
|
pnpm tauri migrate"
|
||||||
cargo='cargo install tauri-cli --version "^2.0.0-beta"
|
cargo='cargo install tauri-cli --version "^2.0.0-beta"
|
||||||
cargo tauri migrate'
|
cargo tauri migrate'
|
||||||
@@ -1159,7 +1159,6 @@ On the JavaScript side, the `WebviewWindow` class is now exported in the `@tauri
|
|||||||
|
|
||||||
The `onMenuClicked` function was removed, you can intercept menu events when creating a menu in JavaScript instead.
|
The `onMenuClicked` function was removed, you can intercept menu events when creating a menu in JavaScript instead.
|
||||||
|
|
||||||
|
|
||||||
### Migrate Embedded External Binaries (Sidecar)
|
### Migrate Embedded External Binaries (Sidecar)
|
||||||
|
|
||||||
In Tauri v1, the external binaries and their arguments were defined in the allowlist. In v2, use the new permissions system. Read [Migrate Permissions](#migrate-permissions) for more information.
|
In Tauri v1, the external binaries and their arguments were defined in the allowlist. In v2, use the new permissions system. Read [Migrate Permissions](#migrate-permissions) for more information.
|
||||||
|
|||||||
@@ -13,16 +13,7 @@ Learn about common scenarios and steps to upgrade from Tauri 1.0 or migrate from
|
|||||||
import { LinkCard, CardGrid } from '@astrojs/starlight/components';
|
import { LinkCard, CardGrid } from '@astrojs/starlight/components';
|
||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
<LinkCard
|
<LinkCard title="Upgrade from Tauri 1.0" href="/start/migrate/from-tauri-1" />
|
||||||
title="Upgrade from Tauri 1.0"
|
<LinkCard title="Migrate from Electron" href="/start/migrate/from-electron" />
|
||||||
href="/start/migrate/from-tauri-1"
|
<LinkCard title="Migrate from Flutter" href="/start/migrate/from-flutter" />
|
||||||
/>
|
|
||||||
<LinkCard
|
|
||||||
title="Migrate from Electron"
|
|
||||||
href="/start/migrate/from-electron"
|
|
||||||
/>
|
|
||||||
<LinkCard
|
|
||||||
title="Migrate from Flutter"
|
|
||||||
href="/start/migrate/from-flutter"
|
|
||||||
/>
|
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ Follow the link to get started for your respective operating system:
|
|||||||
|
|
||||||
Tauri requires various system dependencies for development on Linux. These may be different depending on your distribution but we've included some popular distributions below to help you get setup.
|
Tauri requires various system dependencies for development on Linux. These may be different depending on your distribution but we've included some popular distributions below to help you get setup.
|
||||||
|
|
||||||
{ /* Note: These are the officially supported linux distributions. */}
|
{/* Note: These are the officially supported linux distributions. */}
|
||||||
{ /* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
{/* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Debian">
|
<TabItem label="Debian">
|
||||||
@@ -186,7 +186,7 @@ Here is the file as a plain script: [rustup.sh](https://sh.rustup.rs/)
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
Visit https://www.rust-lang.org/tools/install to install `rustup`.
|
Visit https://www.rust-lang.org/tools/install to install `rustup`.
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
@@ -230,7 +230,7 @@ If you'd like to target your app for Android or iOS then there are a few additio
|
|||||||
1. Download and install [Android Studio from the Android Developers website](https://developer.android.com/studio)
|
1. Download and install [Android Studio from the Android Developers website](https://developer.android.com/studio)
|
||||||
2. Set the `JAVA_HOME` environment variable:
|
2. Set the `JAVA_HOME` environment variable:
|
||||||
|
|
||||||
{ /* TODO: Can this be done in the 4th step? */}
|
{/* TODO: Can this be done in the 4th step? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux">
|
<TabItem label="Linux">
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ class ExamplePlugin: Plugin {
|
|||||||
|
|
||||||
Tauri 自动为插件实现了两个命令:`checkPermissions` 和 `requestPermissions`。这些命令可以从 JavaScript 或 Rust 中直接调用。
|
Tauri 自动为插件实现了两个命令:`checkPermissions` 和 `requestPermissions`。这些命令可以从 JavaScript 或 Rust 中直接调用。
|
||||||
|
|
||||||
{ /* TODO: PermissionState type should be exported in Tauri */}
|
{/* TODO: PermissionState type should be exported in Tauri */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="JavaScript">
|
<TabItem label="JavaScript">
|
||||||
@@ -317,7 +317,7 @@ impl<R: Runtime> Notification<R> {
|
|||||||
|
|
||||||
## 插件事件
|
## 插件事件
|
||||||
|
|
||||||
{ /* TODO: Is this section a duplicate of Lifecycle Events above? */}
|
{/* TODO: Is this section a duplicate of Lifecycle Events above? */}
|
||||||
|
|
||||||
插件可以使用 `trigger` 函数在任何时候触发事件:
|
插件可以使用 `trigger` 函数在任何时候触发事件:
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ title: 插件开发
|
|||||||
i18nReady: true
|
i18nReady: true
|
||||||
---
|
---
|
||||||
|
|
||||||
{ /* TODO: Add a CLI section */}
|
{/* TODO: Add a CLI section */}
|
||||||
|
|
||||||
import CommandTabs from '@components/CommandTabs.astro';
|
import CommandTabs from '@components/CommandTabs.astro';
|
||||||
|
|
||||||
{ /* TODO: Link to windowing system, commands for sending messages, and event system */}
|
{/* TODO: Link to windowing system, commands for sending messages, and event system */}
|
||||||
|
|
||||||
:::tip[插件开发]
|
:::tip[插件开发]
|
||||||
|
|
||||||
@@ -24,11 +24,11 @@ Tauri 提供了一个基于 webview 功能的视窗系统,一个在 Rust 进
|
|||||||
同时,一个插件项目可以包含一个 Android 库项目和/或一个用于 iOS 的 Swift 包。
|
同时,一个插件项目可以包含一个 Android 库项目和/或一个用于 iOS 的 Swift 包。
|
||||||
你可以查阅[移动端插件开发指南](/zh-cn/develop/plugins/develop-mobile)以获取更多关于开发安卓或 iOS 插件的信息。
|
你可以查阅[移动端插件开发指南](/zh-cn/develop/plugins/develop-mobile)以获取更多关于开发安卓或 iOS 插件的信息。
|
||||||
|
|
||||||
{ /* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
{/* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
||||||
|
|
||||||
## 命名规范
|
## 命名规范
|
||||||
|
|
||||||
{ /* TODO: Add link to allowlist */}
|
{/* TODO: Add link to allowlist */}
|
||||||
|
|
||||||
Tauri 插件具有一个前缀(Rust 包使用 `tauri-plugin-` 前缀,NPM 包使用 `@tauri-apps/plugin-` 前缀),随后是插件名称。
|
Tauri 插件具有一个前缀(Rust 包使用 `tauri-plugin-` 前缀,NPM 包使用 `@tauri-apps/plugin-` 前缀),随后是插件名称。
|
||||||
插件名称由插件配置中的 [`tauri.conf.json > plugin`](/reference/config/#pluginconfig) 和许可列表中的配置确定。
|
插件名称由插件配置中的 [`tauri.conf.json > plugin`](/reference/config/#pluginconfig) 和许可列表中的配置确定。
|
||||||
@@ -40,11 +40,11 @@ Tauri 插件具有一个前缀(Rust 包使用 `tauri-plugin-` 前缀,NPM 包
|
|||||||
要引导创建一个新的插件项目,请运行 `plugin init`。如果不需要相应的 NPM 程序包,请使用 `--no-api` 命令行标志。
|
要引导创建一个新的插件项目,请运行 `plugin init`。如果不需要相应的 NPM 程序包,请使用 `--no-api` 命令行标志。
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="npm run tauri plugin init"
|
npm="npm run tauri plugin init"
|
||||||
yarn="yarn tauri plugin init"
|
yarn="yarn tauri plugin init"
|
||||||
pnpm="pnpm tauri plugin init"
|
pnpm="pnpm tauri plugin init"
|
||||||
cargo="cargo tauri plugin init"
|
cargo="cargo tauri plugin init"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
这会初始化插件,并且生成如下所示的代码:
|
这会初始化插件,并且生成如下所示的代码:
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ Tauri 插件具有一个前缀(Rust 包使用 `tauri-plugin-` 前缀,NPM 包
|
|||||||
└── package.json - NPM 包元数据
|
└── package.json - NPM 包元数据
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
{/* TODO: https://github.com/tauri-apps/tauri/issues/7749 */}
|
||||||
|
|
||||||
如果你有一个现有的插件,并且想添加 Android 或 iOS 功能,你可以使用 `plugin android add` 和 `plugin ios add` 来引导移动端库项目,并指导你完成所需的更改。
|
如果你有一个现有的插件,并且想添加 Android 或 iOS 功能,你可以使用 `plugin android add` 和 `plugin ios add` 来引导移动端库项目,并指导你完成所需的更改。
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,11 @@ _这个插件要求 Rust 版本至少是 **1.75**_
|
|||||||
{' '}
|
{' '}
|
||||||
|
|
||||||
<CommandTabs
|
<CommandTabs
|
||||||
npm="npm run tauri add cli"
|
npm="npm run tauri add cli"
|
||||||
yarn="yarn run tauri add cli"
|
yarn="yarn run tauri add cli"
|
||||||
pnpm="pnpm tauri add cli"
|
pnpm="pnpm tauri add cli"
|
||||||
cargo="cargo tauri add cli"
|
cargo="cargo tauri add cli"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="手动">
|
<TabItem label="手动">
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ import CommandTabs from '@components/CommandTabs.astro';
|
|||||||
|
|
||||||
可以在 JavaScript API 参考中查看所有 [Dialog 选项](/reference/javascript/dialog/)。
|
可以在 JavaScript API 参考中查看所有 [Dialog 选项](/reference/javascript/dialog/)。
|
||||||
|
|
||||||
{ /* ASK */}
|
{/* ASK */}
|
||||||
|
|
||||||
#### 创建 Yes/No 对话框
|
#### 创建 Yes/No 对话框
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ console.log(answer);
|
|||||||
// Prints boolean to the console
|
// Prints boolean to the console
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* CONFIRM */}
|
{/* CONFIRM */}
|
||||||
|
|
||||||
#### 创建 Ok/Cancel 对话框
|
#### 创建 Ok/Cancel 对话框
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ console.log(confirmation);
|
|||||||
// Prints boolean to the console
|
// Prints boolean to the console
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* MESSAGE */}
|
{/* MESSAGE */}
|
||||||
|
|
||||||
#### 创建 Message 对话框
|
#### 创建 Message 对话框
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ import { message } from '@tauri-apps/plugin-dialog';
|
|||||||
await message('File not found', { title: 'Tauri', type: 'error' });
|
await message('File not found', { title: 'Tauri', type: 'error' });
|
||||||
```
|
```
|
||||||
|
|
||||||
{ /* OPEN */}
|
{/* OPEN */}
|
||||||
|
|
||||||
#### 打开一个文件选择对话框
|
#### 打开一个文件选择对话框
|
||||||
|
|
||||||
|
|||||||
@@ -23,20 +23,14 @@ Tauri 与前端无关,支持大多数开箱即用的前端框架。但是,
|
|||||||
<LinkCard title="Qwik" href="/zh-cn/start/frontend/qwik" />
|
<LinkCard title="Qwik" href="/zh-cn/start/frontend/qwik" />
|
||||||
<LinkCard title="Svelte" href="/zh-cn/start/frontend/svelte" />
|
<LinkCard title="Svelte" href="/zh-cn/start/frontend/svelte" />
|
||||||
<LinkCard title="Vite" href="/zh-cn/start/frontend/vite" />
|
<LinkCard title="Vite" href="/zh-cn/start/frontend/vite" />
|
||||||
<LinkCard
|
<LinkCard title="Webpack" href="/zh-cn/start/frontend/webpack" />
|
||||||
title="Webpack"
|
|
||||||
href="/zh-cn/start/frontend/webpack"
|
|
||||||
/>
|
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|
||||||
## Rust
|
## Rust
|
||||||
|
|
||||||
<CardGrid>
|
<CardGrid>
|
||||||
<LinkCard title="Leptos" href="/zh-cn/start/frontend/leptos" />
|
<LinkCard title="Leptos" href="/zh-cn/start/frontend/leptos" />
|
||||||
<LinkCard
|
<LinkCard title="Sycamore" href="/zh-cn/start/frontend/sycamore" />
|
||||||
title="Sycamore"
|
|
||||||
href="/zh-cn/start/frontend/sycamore"
|
|
||||||
/>
|
|
||||||
<LinkCard title="Trunk" href="/zh-cn/start/frontend/trunk" />
|
<LinkCard title="Trunk" href="/zh-cn/start/frontend/trunk" />
|
||||||
<LinkCard title="Yew" href="/zh-cn/start/frontend/yew" />
|
<LinkCard title="Yew" href="/zh-cn/start/frontend/yew" />
|
||||||
</CardGrid>
|
</CardGrid>
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ import { Tabs, TabItem, Card } from '@astrojs/starlight/components';
|
|||||||
|
|
||||||
Tauri 在 Linux 上进行开发需要各种系统依赖项。这些可能会有所不同,具体取决于你的发行版,但我们在下面提供了一些流行的发行版来帮助你进行设置。
|
Tauri 在 Linux 上进行开发需要各种系统依赖项。这些可能会有所不同,具体取决于你的发行版,但我们在下面提供了一些流行的发行版来帮助你进行设置。
|
||||||
|
|
||||||
{ /* Note: These are the officially supported linux distributions. */}
|
{/* Note: These are the officially supported linux distributions. */}
|
||||||
{ /* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
{/* If you wish to add another please open an issue to discuss prior to opening a PR */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Debian">
|
<TabItem label="Debian">
|
||||||
@@ -207,7 +207,7 @@ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
|
|||||||
1. 从 Android Developers 网站下载并安装 [Android Studio](https://developer.android.com/studio)。
|
1. 从 Android Developers 网站下载并安装 [Android Studio](https://developer.android.com/studio)。
|
||||||
2. 设置 `JAVA_HOME` 环境变量:
|
2. 设置 `JAVA_HOME` 环境变量:
|
||||||
|
|
||||||
{ /* TODO: Can this be done in the 4th step? */}
|
{/* TODO: Can this be done in the 4th step? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux">
|
<TabItem label="Linux">
|
||||||
@@ -242,7 +242,7 @@ export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
|
|||||||
|
|
||||||
4. 配置 `ANDROID_HOME` 和 `NDK_HOME` 环境变量:
|
4. 配置 `ANDROID_HOME` 和 `NDK_HOME` 环境变量:
|
||||||
|
|
||||||
{ /* TODO: Does the version number change below? */}
|
{/* TODO: Does the version number change below? */}
|
||||||
|
|
||||||
<Tabs>
|
<Tabs>
|
||||||
<TabItem label="Linux and macOS">
|
<TabItem label="Linux and macOS">
|
||||||
@@ -255,7 +255,7 @@ export NDK_HOME="$ANDROID_HOME/ndk/25.0.8775105"
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem label="Windows">
|
<TabItem label="Windows">
|
||||||
|
|
||||||
{ /* TODO: Do we need a note about this version? */}
|
{/* TODO: Do we need a note about this version? */}
|
||||||
|
|
||||||
```ps
|
```ps
|
||||||
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
[System.Environment]::SetEnvironmentVariable("ANDROID_HOME", "$env:LocalAppData\Android\Sdk", "User")
|
||||||
|
|||||||
Reference in New Issue
Block a user