Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 migration: guides/development to next #1670

Merged
merged 19 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default defineConfig({
items: [
{
label: 'Develop',
link: 'guides/develop',
link: 'guides/develop/',
},
{
label: 'Debug',
Expand Down Expand Up @@ -227,5 +227,23 @@ export default defineConfig({
'/blog/2023/06/14/tauri-1-4': '/blog/tauri-1-4',
'/blog/2023/06/15/tauri-board-elections-and-governance-updates':
'/blog/tauri-board-elections-and-governance-updates',
//
// v1 /guides/development -> /guides/develop
'/v1/guides/development/development-cycle': '/guides/develop/development-cycle',
'/v1/guides/development/updating-dependencies': '/guides/develop/updating-dependencies',
// i18n fr
'/fr/v1/guides/development/development-cycle/': '/fr/guides/develop/development-cycle/',
'/fr/v1/guides/development/updating-dependencies/': '/fr/guides/develop/updating-dependencies/',
// i18n ko
'/ko/v1/guides/development/development-cycle/': '/ko/guides/develop/development-cycle/',
'/ko/v1/guides/development/updating-dependencies/': '/ko/guides/develop/updating-dependencies/',
// i18n zh-cn
'/zh-cn/v1/guides/development/development-cycle/': '/zh-cn/guides/develop/development-cycle/',
'/zh-cn/v1/guides/development/updating-dependencies/': '/zh-cn/guides/develop/updating-dependencies/',
// i18n it
'/it/v1/guides/development/development-cycle/': '/it/guides/develop/development-cycle/',
'/it/v1/guides/development/updating-dependencies/': '/it/guides/develop/updating-dependencies/'
//
},
});

35 changes: 35 additions & 0 deletions src/content/docs/_ko/develop/development-cycle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: 개발 주기
---

import CommandTabs from '@components/CommandTabs.astro';

### 1. 개발 서버 시작

이제 모든 것이 설정되었으므로 UI 프레임워크 또는 번들러에서 제공하는 애플리케이션 개발 서버를 시작해야 합니다(물론, 둘 중 하나를 사용한다고 가정).

:::note

모든 프레임워크에는 자체 개발 도구가 있습니다. 모든 내용을 다루거나 최신 정보로 갱신하는 것은 이 문서의 범위를 밖입니다.

:::

### 2. Tauri 개발 윈도우 시작


<CommandTabs
npm="npm run tauri dev"
yarn="yarn tauri dev"
pnpm="pnpm tauri dev"
cargo="cargo tauri dev"
/>

이 명령을 처음 실행하면 Rust 패키지 관리자가 필요한 모든 패키지를 다운로드하고 빌드하는 데 몇 분이 소요됩니다. 이들은 캐시되기 때문에 코드만 재빌드하면 되므로 후속 빌드가 훨씬 더 빠릅니다.

Rust가 빌드를 완료하면 Webview가 열리고 웹 앱이 표시됩니다. 웹 앱을 변경할 수 있으며 도구에서 지원하는 경우, WebView는 브라우저처럼 자동으로 업데이트됩니다. Rust 파일을 변경하면 자동으로 다시 빌드되고 앱이 자동으로 다시 시작됩니다.

:::caution[Cargo.toml 및 소스 제어 정보]

프로젝트 저장소에서 `src-tauri/Cargo.toml`과 함께 `src-tauri/Cargo.lock`을 git에 커밋해야 합니다. 왜냐하면 Cargo는 결정된 빌드를 제공하기 위해 잠금 파일을 사용하기 때문입니다. 따라서, 모든 애플리케이션의 Cargo.lock을 체크인하는 것이 좋습니다. 단, `src-tauri/target` 폴더 또는 그 내용을 커밋하면 안 됩니다.

:::
11 changes: 11 additions & 0 deletions src/content/docs/_ko/develop/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: 개발
description: Tauri로 개발하기 위한 핵심 개념
---

import { LinkCard, CardGrid } from '@astrojs/starlight/components';

<CardGrid>
<LinkCard title="개발 주기" href="/ko/guides/develop/development-cycle/" />
<LinkCard title="종속성 업데이트하기" href="/ko/guides/develop/updating-dependencies" />
</CardGrid>
63 changes: 63 additions & 0 deletions src/content/docs/_ko/develop/updating-dependencies.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: 종속성 업데이트하기
---

import CommandTabs from '@components/CommandTabs.astro';

## Npm 패키지 업데이트

`tauri` 패키지를 사용할 경우:

<CommandTabs
npm="npm install @tauri-apps/cli@latest @tauri-apps/api@latest"
yarn="yarn up @tauri-apps/cli @tauri-apps/api"
pnpm="pnpm update @tauri-apps/cli @tauri-apps/api --latest"
/>

다음 항목을 사용하여 명령줄에서 최신 버전의 Tauri를 검색할 수 있습니다:


<CommandTabs
npm="npm outdated @tauri-apps/cli"
yarn="yarn outdated @tauri-apps/cli"
pnpm="pnpm outdated @tauri-apps/cli"
/>


대안으로 `vue-cli-plugin-tauri` 방식을 사용하는 경우:

<CommandTabs
npm="npm install vue-cli-plugin-tauri@latest"
yarn="yarn up vue-cli-plugin-tauri"
pnpm="pnpm update vue-cli-plugin-tauri --latest"
/>

## Cargo 패키지 업데이트

[`cargo outdated`][]나 crates.io 페이지에서 이전 패키지 내용을 확인할 수 있습니다: [tauri][] / [tauri-build][].

`src-tauri/Cargo.toml`에서 `tauri`와 `tauri-build` 를 아래와 같이 바꿔줍니다.

```toml
[build-dependencies]
tauri-build = "%version%"

[dependencies]
tauri = { version = "%version%" }
```

여기서 `%version%`는 위에 버전 번호입니다. {/* TODO: (You can just use the `MAJOR.MINOR`) version, like `0.9`. .*/}

그리고, 아래와 같이 실행합니다.

```shell
cd src-tauri
cargo update
```

또한, [cargo-edit][]에서 제공하는 `cargo upgrade` 명령을 실행하여 이 모든 작업을 자동으로 수행할 수 있습니다.

[`cargo outdated`]: https://github.com/kbknapp/cargo-outdated
[tauri]: https://crates.io/crates/tauri/versions
[tauri-build]: https://crates.io/crates/tauri-build/versions
[cargo-edit]: https://github.com/killercup/cargo-edit
34 changes: 34 additions & 0 deletions src/content/docs/fr/guides/develop/development-cycle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Development Cycle
---

import CommandTabs from '@components/CommandTabs.astro';

### 1. Démarrez votre serveur de développement

Maintenant que tout est configuré, vous devez démarrer votre serveur de développement d'applications fourni par votre framework ou bundler d'interface utilisateur (en supposant que vous en utilisiez un, bien sûr).

:::note

Chaque framework possède ses propres outils de développement. Il n'entre pas dans le cadre de ce document de les couvrir tous ou de rester à jour.

:::

### 2. Démarrer la fenêtre de développement de Tauri

<CommandTabs
npm="npm run tauri dev"
yarn="yarn tauri dev"
pnpm="pnpm tauri dev"
cargo="cargo tauri dev"
/>

La première fois que vous exécutez cette commande, le gestionnaire de packages Rust prend plusieurs minutes pour télécharger et créer tous les packages requis. Comme ils sont mis en cache, les builds suivants sont beaucoup plus rapides, car seul votre code a besoin d'être reconstruit.

Une fois que Rust a terminé la construction, la vue Web s'ouvre et affiche votre application Web. Vous pouvez apporter des modifications à votre application Web, et si vos outils le permettent, la vue Web devrait se mettre à jour automatiquement, tout comme un navigateur. Lorsque vous apportez des modifications à vos fichiers Rust, ils sont reconstruits automatiquement et votre application redémarre automatiquement.

:::caution[À propos de Cargo.toml et du contrôle de code source]

Dans votre référentiel de projet, vous **DEVEZ** valider le `src-tauri/Cargo.lock` avec le `src-tauri/Cargo.toml` sur git car Cargo utilise le fichier de verrouillage pour fournir des versions déterministes. Par conséquent, il est recommandé que toutes les applications enregistrent leur `Cargo.lock`. Vous **NE DEVEZ PAS** valider le dossier `src-tauri/target` ou l'un de ses contenus.

:::
11 changes: 11 additions & 0 deletions src/content/docs/fr/guides/develop/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Développement
description: Concepts de base pour le développement avec Tauri
---

import { LinkCard, CardGrid } from '@astrojs/starlight/components';

<CardGrid>
<LinkCard title="Development Cycle" href="/fr/guides/develop/development-cycle/" />
<LinkCard title="Mise à jour des dépendances" href="/fr/guides/develop/updating-dependencies" />
</CardGrid>
62 changes: 62 additions & 0 deletions src/content/docs/fr/guides/develop/updating-dependencies.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: Mise à jour des dépendances
---

import CommandTabs from '@components/CommandTabs.astro';

## Mettre à jour les packages npm

Si vous utilisez le package `tauri` :

<CommandTabs
npm="npm install @tauri-apps/cli@latest @tauri-apps/api@latest"
yarn="yarn up @tauri-apps/cli @tauri-apps/api"
pnpm="pnpm update @tauri-apps/cli @tauri-apps/api --latest"
/>

Vous pouvez également détecter la dernière version de Tauri sur la ligne de commande, en utilisant :


<CommandTabs
npm="npm outdated @tauri-apps/cli"
yarn="yarn outdated @tauri-apps/cli"
pnpm="pnpm outdated @tauri-apps/cli"
/>

Sinon, si vous utilisez l'approche `vue-cli-plugin-tauri` :

<CommandTabs
npm="npm install vue-cli-plugin-tauri@latest"
yarn="yarn up vue-cli-plugin-tauri"
pnpm="pnpm update vue-cli-plugin-tauri --latest"
/>

## Mettre à jour les packages Cargo

Vous pouvez vérifier les packages obsolètes avec [`cargo outdated`][] ou sur les pages crates.io : [tauri][] / [tauri-build][].

Accédez à `src-tauri/Cargo.toml` et remplacez `tauri` et `tauri-build` par

```toml
[build-dependencies]
tauri-build = "%version%"

[dependencies]
tauri = { version = "%version%" }
```

où `%version%` est le numéro de version correspondant ci-dessus.

Ensuite, procédez comme suit :

```shell
cd src-tauri
cargo update
```

Vous pouvez également exécuter la commande `cargo upgrade` fournie par [cargo-edit][] qui fait tout cela automatiquement.

[`cargo outdated`]: https://github.com/kbknapp/cargo-outdated
[tauri]: https://crates.io/crates/tauri/versions
[tauri-build]: https://crates.io/crates/tauri-build/versions
[cargo-edit]: https://github.com/killercup/cargo-edit
11 changes: 0 additions & 11 deletions src/content/docs/guides/develop.mdx

This file was deleted.

36 changes: 36 additions & 0 deletions src/content/docs/guides/develop/development-cycle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Development Cycle
---
{/*TODO: REVISE COPY TO V2 */}

import CommandTabs from '@components/CommandTabs.astro';

### 1. Start Your Dev server

Now that you have everything set up, you should start your application development server provided by your UI framework or bundler (assuming you're using one, of course).

:::note

Every framework has its own development tooling. It is outside of the scope of this document to cover them all or stay up to date.

:::

### 2. Start Tauri Development Window


<CommandTabs
npm="npm run tauri dev"
yarn="yarn tauri dev"
pnpm="pnpm tauri dev"
cargo="cargo tauri dev"
/>

The first time you run this command, the Rust package manager takes several minutes to download and build all the required packages. Since they are cached, subsequent builds are much faster, as only your code needs rebuilding.

Once Rust has finished building, the webview opens, displaying your web app. You can make changes to your web app, and if your tooling enables it, the webview should update automatically, just like a browser. When you make changes to your Rust files, they are rebuilt automatically, and your app automatically restarts.

:::caution[About Cargo.toml and Source Control]

In your project repository, you **SHOULD** commit the `src-tauri/Cargo.lock` along with the `src-tauri/Cargo.toml` to git because Cargo uses the lockfile to provide deterministic builds. As a result, it is recommended that all applications check in their `Cargo.lock`. You **SHOULD NOT** commit the `src-tauri/target` folder or any of its contents.

:::
11 changes: 11 additions & 0 deletions src/content/docs/guides/develop/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Develop
description: Core concepts for developing with Tauri.
---

import { LinkCard, CardGrid } from '@astrojs/starlight/components';

<CardGrid>
<LinkCard title="Development Cycle" href="/guides/develop/development-cycle/" />
<LinkCard title="Updating Dependencies" href="/guides/develop/updating-dependencies" />
</CardGrid>
64 changes: 64 additions & 0 deletions src/content/docs/guides/develop/updating-dependencies.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Updating Dependencies
---
{/*TODO: REVISE COPY TO V2 */}

import CommandTabs from '@components/CommandTabs.astro';

## Update npm Packages

If you are using the `tauri` package:

<CommandTabs
npm="npm install @tauri-apps/cli@latest @tauri-apps/api@latest"
yarn="yarn up @tauri-apps/cli @tauri-apps/api"
pnpm="pnpm update @tauri-apps/cli @tauri-apps/api --latest"
/>

You can also detect what the latest version of Tauri is on the command line, using:


<CommandTabs
npm="npm outdated @tauri-apps/cli"
yarn="yarn outdated @tauri-apps/cli"
pnpm="pnpm outdated @tauri-apps/cli"
/>


Alternatively, if you are using the `vue-cli-plugin-tauri` approach:

<CommandTabs
npm="npm install vue-cli-plugin-tauri@latest"
yarn="yarn up vue-cli-plugin-tauri"
pnpm="pnpm update vue-cli-plugin-tauri --latest"
/>

## Update Cargo Packages

You can check for outdated packages with [`cargo outdated`] or on the crates.io pages: [tauri] / [tauri-build].

Go to `src-tauri/Cargo.toml` and change `tauri` and `tauri-build` to

```toml
[build-dependencies]
tauri-build = "%version%"

[dependencies]
tauri = { version = "%version%" }
```
{/* _TODO MIGRATED FROM V1 ->*/}
where `%version%` is the corresponding version number from above. {/* TODO: (You can just use the `MAJOR.MINOR`) version, like `0.9`.*/}

Then do the following:

```shell
cd src-tauri
cargo update
```

Alternatively, you can run the `cargo upgrade` command provided by [cargo-edit] which does all of this automatically.

[`cargo outdated`]: https://github.com/kbknapp/cargo-outdated
[tauri]: https://crates.io/crates/tauri/versions
[tauri-build]: https://crates.io/crates/tauri-build/versions
[cargo-edit]: https://github.com/killercup/cargo-edit
Loading