|
|
| Ligne 67 : |
Ligne 67 : |
|
| |
|
| == Premier exemple == | | == Premier exemple == |
| Nom du projet : Navig2 | | Nom du projet : <code>Navig2</code> |
| | |
| | Fichiers {{fichier|C:\Prog\Navig2\src-tauri\tauri.conf.json}} |
| | |
| | Détails : |
| | * Nom de la fenêtre : <source inline>"title": "Navigation",</source> |
|
| |
|
| Fichiers {{fichier|C:\Prog\Navig2\package-lock.json}}
| |
| <source> | | <source> |
| { | | { |
| "name": "navig2", | | "$schema": "https://schema.tauri.app/config/2", |
| | "productName": "navig2x", |
| "version": "0.1.0", | | "version": "0.1.0", |
| "lockfileVersion": 3, | | "identifier": "com.phil.navig2", |
| "requires": true,
| | "build": { |
| "packages": {
| | "frontendDist": "../src" |
| "": {
| | }, |
| "name": "navig2",
| | "app": { |
| "version": "0.1.0",
| | "withGlobalTauri": true, |
| "devDependencies": {
| | "windows": [ |
| "@tauri-apps/cli": "^2"
| | { |
| }
| | "title": "Navigation", |
| },
| | "width": 800, |
| "node_modules/@tauri-apps/cli": {
| | "height": 600 |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli/-/cli-2.12.4.tgz",
| |
| "integrity": "sha512-JI9bHfudSRJikGOrjbXEm6RjzzvmKuLc+JixB1NE8hNzQkNlCCIC3pTES3uypkR9lxHrsbxzcnSwhI2IxBQphw==",
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "bin": {
| |
| "tauri": "tauri.js"
| |
| },
| |
| "engines": {
| |
| "node": ">= 10"
| |
| },
| |
| "funding": {
| |
| "type": "opencollective",
| |
| "url": "https://opencollective.com/tauri"
| |
| },
| |
| "optionalDependencies": {
| |
| "@tauri-apps/cli-darwin-arm64": "2.12.4",
| |
| "@tauri-apps/cli-darwin-x64": "2.12.4",
| |
| "@tauri-apps/cli-linux-arm-gnueabihf": "2.12.4",
| |
| "@tauri-apps/cli-linux-arm64-gnu": "2.12.4",
| |
| "@tauri-apps/cli-linux-arm64-musl": "2.12.4",
| |
| "@tauri-apps/cli-linux-riscv64-gnu": "2.12.4",
| |
| "@tauri-apps/cli-linux-x64-gnu": "2.12.4",
| |
| "@tauri-apps/cli-linux-x64-musl": "2.12.4",
| |
| "@tauri-apps/cli-win32-arm64-msvc": "2.12.4",
| |
| "@tauri-apps/cli-win32-ia32-msvc": "2.12.4",
| |
| "@tauri-apps/cli-win32-x64-msvc": "2.12.4"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-darwin-arm64": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-2.12.4.tgz",
| |
| "integrity": "sha512-OxqKSckIkoJ6vX2AjifIJpTasFC0Hbdoo7gEiCmAjauABO3U8m2MRsLWe+QTiBwDx1mIrvgA+rvI7tvDnbnHVg==",
| |
| "cpu": [
| |
| "arm64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "darwin"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-darwin-x64": { | |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-2.12.4.tgz",
| |
| "integrity": "sha512-fz76/77wMMJOaaUN6n3CybRG0P/MTEjjqYk81mGPyhi9m6Ue5T+LWBnJP/AkPooNatBPI2vtulGqomyMJ44lCQ==",
| |
| "cpu": [
| |
| "x64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "darwin"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-arm-gnueabihf": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-2.12.4.tgz",
| |
| "integrity": "sha512-K0w8Bof6Lt8QKLAYhRy0yy36ZH5iA/35VuSOvnxyjvCUZ+A3JKsUTlALviH/sVgAlisaPzzmeJSH8XOn4Q2HBA==",
| |
| "cpu": [
| |
| "arm"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-arm64-gnu": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-2.12.4.tgz",
| |
| "integrity": "sha512-j5rOnjmRUwWrm1oosf0zBYl4D+fqydgUROFCk0hvKZxvbTT8SOERes0QB7rBV/XWNy+kM6pCKzb3oSm2sRglzg==",
| |
| "cpu": [
| |
| "arm64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-arm64-musl": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.12.4.tgz",
| |
| "integrity": "sha512-aOue3Fy6Jb7+oWcfAVUsVHfeTybSCt2CZoU06aO4jv4d2Ks/KnaTPwMAK3CLEduGOvBLY1lbBBrIyomqLLH5Sg==",
| |
| "cpu": [
| |
| "arm64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-riscv64-gnu": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-riscv64-gnu/-/cli-linux-riscv64-gnu-2.12.4.tgz",
| |
| "integrity": "sha512-Fx6GShY/RvST+t6LMlTHAwd66+1tEaAAGrnU7cysVfaiRP1BKng5Vl6rVmO6rSLOA1Sp1dRzNYM4f0OWQGb7qA==",
| |
| "cpu": [
| |
| "riscv64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-x64-gnu": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-2.12.4.tgz",
| |
| "integrity": "sha512-tNzZSa79Z1nRpHxEpQ38lsAFpKlFlYvoXzjTV+lRRn/zSf3wrdUC3wnLcq2XEadchPu4ttK0zivhYzr+XGD19Q==",
| |
| "cpu": [
| |
| "x64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-linux-x64-musl": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-2.12.4.tgz",
| |
| "integrity": "sha512-jmZ1pr0xEqUhuEusWtt9Yt+GF6lCnGHUmIL+KIknpbjK/XQ2qkhDBhaxK/JMHM2A8dAacVXCxXJk2EXpwhQUfA==",
| |
| "cpu": [
| |
| "x64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "linux"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-win32-arm64-msvc": { | |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-arm64-msvc/-/cli-win32-arm64-msvc-2.12.4.tgz",
| |
| "integrity": "sha512-fGo8pgEHZxdSYgZ/J98m1usJ7NHKmKbq7k6uT0x1rpOq6Bg2YVzzpaAblWk710f5LHYBJIL5QIFS5IrD+4gmTg==",
| |
| "cpu": [
| |
| "arm64"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "win32"
| |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-win32-ia32-msvc": { | |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-2.12.4.tgz",
| |
| "integrity": "sha512-ezl8sQIcjYsye3TUnTH5VcWmWzccZASlQm7hlZt0dYyj1XD0qpVW47u2xYVrIKui0F8uQv/7QGZixdWiClBsbg==",
| |
| "cpu": [
| |
| "ia32"
| |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "win32"
| |
| ],
| |
| "engines": { | |
| "node": ">= 10" | |
| }
| |
| },
| |
| "node_modules/@tauri-apps/cli-win32-x64-msvc": {
| |
| "version": "2.12.4",
| |
| "resolved": "https://registry.npmjs.org/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-2.12.4.tgz",
| |
| "integrity": "sha512-DJhDeCqjLDNMWYFy7ZS8cfeAHX2RK0RbQMLiA3bMVVkXRDJ4NBYiHriGqsUhsr9iG41aTb+dJGkFPmPw1gWwVw==",
| |
| "cpu": [
| |
| "x64" | |
| ],
| |
| "dev": true,
| |
| "license": "Apache-2.0 OR MIT",
| |
| "optional": true,
| |
| "os": [
| |
| "win32" | |
| ],
| |
| "engines": {
| |
| "node": ">= 10"
| |
| } | | } |
| | ], |
| | "security": { |
| | "csp": null |
| } | | } |
| | }, |
| | "bundle": { |
| | "active": true, |
| | "targets": "all", |
| | "icon": [ |
| | "icons/32x32.png", |
| | "icons/128x128.png", |
| | "icons/128x128@2x.png", |
| | "icons/icon.icns", |
| | "icons/icon.ico" |
| | ] |
| } | | } |
| } | | } |
|
| |
| </source> | | </source> |
|
| |
|
| |
|
| == Voir aussi == | | == Voir aussi == |
Tauri est un cadriciel (framework) pour la création d'application web.
Généralité
Site officiel :
Tauri sur Wikipédia
Vidéo
Youtube,
Codynn, Tauri for Beginners: Build a Desktop App in Rust
Youtube,
NDC Conferences, Good Bye Electron, Hello Rust + Tauri! - Andreas Lillebø Holm - NDC TechTown 2025
Point de repère
Une fois que tous les outils sont installés :
- création d'un projet :
- se positionner dans le dossier des projet,
- en PowerShell :
irm https://create.tauri.app/ps | iex
- indiquer un nom de projet (project name) :
Fen2Bous
- indiquer un nom de paquet (package name) :
Fen2Bous
- choisir un identifiant (identifier) :
com.phil.fen2bous
- choisir un langage pour la forme (frontend) :
JavaScript
- choisir un gestionnaire de paquets (package manager) :
npm
- choisir un modèle d'interface (UI template) :
Vanilla
- choisir un langage d'interface (UI flavor) :
JavaScript
- se positionner dans le dossier du projet :
cd Fen2Bou
- installer les éléments du projet :
npm install
- lancer le développement :
npm run tauri dev ; environ 348 éléments à préparer
- les éléments suivants sont créés dans le dossier du projet :
.vscode
node_modules
src
src-tauri
.gitignore
package-lock.json
package.json
README.md
- les sous-dossiers suivants contiennent les principaux fichiers du projet :
src :
index.html
main.js
styles.css
src-tauri\src :
Note :
irm alias pour Invoke-RestMethod
iex alias pour Invoke-Expression
Premier exemple
Nom du projet : Navig2
Fichiers C:\Prog\Navig2\src-tauri\tauri.conf.json
Détails :
- Nom de la fenêtre :
"title": "Navigation",
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "navig2x",
"version": "0.1.0",
"identifier": "com.phil.navig2",
"build": {
"frontendDist": "../src"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"title": "Navigation",
"width": 800,
"height": 600
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}
Voir aussi