Skip to content

Commit 36eee37

Browse files
Restructure the repository (#10796)
* Restructure the repository * lock file * fmt * fix bench * fix cli template test * remove accidental file * fix mv command * clippy * upgrade paths-filter github action * fix cli migration tests * lockfile * license headers * clippy * scope test-core to tauri crate * license header * correct --manifest-path usage * lockfile * fix tauri-driver on macOS [skip ci] * build target ios * try downgrade env_logger * downgrade 0.1.7 * try to fix bench * bench overflow * revert overflow fix, fix tauri_root_path * revert env_logger downgrade * fmt * raise msrv to 1.71 * fmt * delete .cargo/config.toml [skip ci] --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent 22d2afa commit 36eee37

859 files changed

Lines changed: 11205 additions & 28397 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changes/config.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
},
129129
"packages": {
130130
"@tauri-apps/api": {
131-
"path": "./tooling/api",
131+
"path": "./packages/api",
132132
"manager": "javascript",
133133
"publish": [
134134
{
@@ -149,61 +149,61 @@
149149
]
150150
},
151151
"tauri-utils": {
152-
"path": "./core/tauri-utils",
152+
"path": "./crates/tauri-utils",
153153
"manager": "rust"
154154
},
155155
"tauri-macos-sign": {
156-
"path": "./tooling/macos-sign",
156+
"path": "./crates/tauri-macos-sign",
157157
"manager": "rust"
158158
},
159159
"tauri-bundler": {
160-
"path": "./tooling/bundler",
160+
"path": "./crates/tauri-bundler",
161161
"manager": "rust",
162162
"dependencies": ["tauri-utils", "tauri-macos-sign"]
163163
},
164164
"tauri-runtime": {
165-
"path": "./core/tauri-runtime",
165+
"path": "./crates/tauri-runtime",
166166
"manager": "rust",
167167
"dependencies": ["tauri-utils"]
168168
},
169169
"tauri-runtime-wry": {
170-
"path": "./core/tauri-runtime-wry",
170+
"path": "./crates/tauri-runtime-wry",
171171
"manager": "rust",
172172
"dependencies": ["tauri-utils", "tauri-runtime"]
173173
},
174174
"tauri-codegen": {
175-
"path": "./core/tauri-codegen",
175+
"path": "./crates/tauri-codegen",
176176
"manager": "rust",
177177
"dependencies": ["tauri-utils"]
178178
},
179179
"tauri-macros": {
180-
"path": "./core/tauri-macros",
180+
"path": "./crates/tauri-macros",
181181
"manager": "rust",
182182
"dependencies": ["tauri-codegen", "tauri-utils"]
183183
},
184184
"tauri-plugin": {
185-
"path": "./core/tauri-plugin",
185+
"path": "./crates/tauri-plugin",
186186
"manager": "rust",
187187
"dependencies": ["tauri-utils"],
188188
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
189189
},
190190
"tauri-build": {
191-
"path": "./core/tauri-build",
191+
"path": "./crates/tauri-build",
192192
"manager": "rust",
193193
"dependencies": ["tauri-codegen", "tauri-utils"],
194194
"postversion": [
195195
"node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
196-
"cargo build --manifest-path ../tauri-config-schema/Cargo.toml"
196+
"cargo build --manifest-path ../tauri-schema-generator/Cargo.toml"
197197
],
198198
"assets": [
199199
{
200-
"path": "./tooling/cli/schema.json",
201-
"name": "schema.json"
200+
"path": "./crates/tauri-schema-generator/schemas/config.schema.json",
201+
"name": "config.schema.json"
202202
}
203203
]
204204
},
205205
"tauri": {
206-
"path": "./core/tauri",
206+
"path": "./crates/tauri",
207207
"manager": "rust",
208208
"dependencies": [
209209
"tauri-macros",
@@ -215,28 +215,28 @@
215215
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
216216
},
217217
"@tauri-apps/cli": {
218-
"path": "./tooling/cli/node",
218+
"path": "./packages/cli",
219219
"manager": "javascript",
220220
"dependencies": ["tauri-cli"],
221221
"postversion": [
222222
"node ../../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
223-
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
223+
"cargo build --manifest-path ../../../crates/tauri-schema-generator/Cargo.toml"
224224
],
225225
"prepublish": [],
226226
"publish": [],
227227
"postpublish": []
228228
},
229229
"tauri-cli": {
230-
"path": "./tooling/cli",
230+
"path": "./crates/tauri-cli",
231231
"manager": "rust",
232232
"dependencies": ["tauri-bundler", "tauri-utils", "tauri-macos-sign"],
233233
"postversion": [
234234
"cargo check",
235-
"cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml"
235+
"cargo build --manifest-path ../../crates/tauri-schema-generator/Cargo.toml"
236236
]
237237
},
238238
"tauri-driver": {
239-
"path": "./tooling/webdriver",
239+
"path": "./crates/tauri-driver",
240240
"manager": "rust",
241241
"postversion": "cargo check"
242242
}

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
4848

4949
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
5050

51-
To set up your machine for development, follow the [Tauri setup guide](https://tauri.app/v1/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
51+
To set up your machine for development, follow the [Tauri setup guide](https://tauri.app/v1/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`packages/cli` and `packages/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
5252

5353
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the repository in order to run correctly.
5454

@@ -58,15 +58,15 @@ See [Architecture](../ARCHITECTURE.md#major-components) for an overview of the p
5858

5959
### Developing Tauri Bundler and Rust CLI
6060

61-
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
61+
The code for the bundler is located in `[Tauri repo root]/crates/tauri-bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/crates/tauri-cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
6262

6363
### Developing The Node.js CLI (`@tauri-apps/cli`)
6464

65-
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
65+
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/crates/tauri-cli` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
6666

6767
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
6868

69-
The code for the Rust crates, including the Core, Macros, Utils, WRY runtime, and a few more are located in `[Tauri repo root]/core/tauri-(macros/utils)`. The easiest way to test your changes is to use the `[Tauri repo root]/examples/helloworld` app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `cargo run --example helloworld` after making changes to test them out.
69+
The code for the Rust crates, including the Core, Macros, Utils, WRY runtime, and a few more are located in `[Tauri repo root]/crates/tauri-(macros/utils)`. The easiest way to test your changes is to use the `[Tauri repo root]/examples/helloworld` app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `cargo run --example helloworld` after making changes to test them out.
7070

7171
#### Building the documentation locally
7272

@@ -78,7 +78,7 @@ $ RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --open
7878

7979
### Developing the JS API
8080

81-
The JS API provides bindings between the developer's JS in the Webview and the builtin Tauri APIs, written in Rust. Its code is located in `[Tauri repo root]/tooling/api`. After making changes to the code, run `pnpm build` to build it. To test your changes, we recommend using the API example app, located in `[Tauri repo root]/examples/api`. It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
81+
The JS API provides bindings between the developer's JS in the Webview and the builtin Tauri APIs, written in Rust. Its code is located in `[Tauri repo root]/packages/api`. After making changes to the code, run `pnpm build` to build it. To test your changes, we recommend using the API example app, located in `[Tauri repo root]/examples/api`. It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
8282

8383
## Financial Contribution
8484

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name: 💡 Feature Request
66
title: '[feat] '
77
description: Suggest an idea
8-
labels: 'type: feature request'
8+
labels: ['type: feature request']
99

1010
body:
1111
- type: textarea

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Before submitting a PR, please read https://github.com/tauri-apps/tauri/blob/dev
55
66
Examples of good title:
77
- fix(windows): fix race condition in event loop
8-
- docs: update docstrings
8+
- docs: update example for `App::show`
99
- feat: add `Window::set_fullscreen`
1010
1111
Examples of bad title:

.github/workflows/audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ jobs:
3737
- run: corepack enable
3838
- uses: actions/setup-node@v4
3939
with:
40-
node-version: '18'
40+
node-version: 'lts/*'
4141
- run: pnpm audit

.github/workflows/bench.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
push:
99
branches:
1010
- dev
11-
- 1.x
1211
workflow_dispatch:
1312
pull_request:
1413
paths:
1514
- '.github/workflows/bench.yml'
15+
- 'bench/**'
1616

1717
env:
1818
RUST_BACKTRACE: 1
@@ -55,23 +55,21 @@ jobs:
5555
python -m pip install --upgrade pip
5656
sudo apt-get update
5757
sudo apt-get install -y --no-install-recommends \
58-
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev \
58+
webkit2gtk-4.1 libayatana-appindicator3-dev \
5959
xvfb \
6060
at-spi2-core
6161
wget https://github.com/sharkdp/hyperfine/releases/download/v1.18.0/hyperfine_1.18.0_amd64.deb
6262
sudo dpkg -i hyperfine_1.18.0_amd64.deb
6363
pip install memory_profiler
6464
6565
- uses: Swatinem/rust-cache@v2
66-
with:
67-
workspaces: |
68-
core -> ../target
69-
tooling/bench/tests
7066

7167
- name: run benchmarks
7268
run: |
73-
cargo build --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }} --manifest-path tooling/bench/tests/Cargo.toml
74-
xvfb-run --auto-servernum cargo run --manifest-path tooling/bench/Cargo.toml --bin run_benchmark
69+
cargo build --manifest-path bench/tests/cpu_intensive/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
70+
cargo build --manifest-path bench/tests/files_transfer/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
71+
cargo build --manifest-path bench/tests/helloworld/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
72+
xvfb-run --auto-servernum cargo run --manifest-path bench/Cargo.toml --bin run_benchmark
7573
7674
- name: clone benchmarks_results
7775
if: github.repository == 'tauri-apps/tauri' && github.ref == 'refs/heads/dev'
@@ -84,7 +82,7 @@ jobs:
8482
- name: push new benchmarks
8583
if: github.repository == 'tauri-apps/tauri' && github.ref == 'refs/heads/dev'
8684
run: |
87-
cargo run --manifest-path tooling/bench/Cargo.toml --bin build_benchmark_jsons
85+
cargo run --manifest-path bench/Cargo.toml --bin build_benchmark_jsons
8886
cd gh-pages
8987
git pull
9088
git config user.name "tauri-bench"

.github/workflows/check-change-tags.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121

22-
- uses: dorny/paths-filter@v2
22+
- name: check change files end with .md
23+
run: |
24+
for file in .changes
25+
do
26+
if [[ ! "$file" =~ \.(md|json)$ ]]; then
27+
echo ".changes directory should only contain files that end with .md"
28+
echo "found an invalid file in .changes directory:"
29+
echo "$file"
30+
exit 1
31+
fi
32+
end
33+
34+
- uses: dorny/paths-filter@v3
2335
id: filter
2436
with:
2537
list-files: shell

.github/workflows/check-generated-files.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
pull_request:
99
paths:
1010
- '.github/workflows/check-generated-files.yml'
11-
- 'tooling/api/src/**'
12-
- 'core/tauri/scripts/bundle.global.js'
13-
- 'core/tauri-utils/src/config.rs'
14-
- 'tooling/cli/schema.json'
15-
- 'core/tauri-config-schema/schema.json'
11+
- 'packages/api/src/**'
12+
- 'crates/tauri/scripts/bundle.global.js'
13+
- 'crates/tauri-utils/src/config.rs'
14+
- 'crates/tauri-cli/config.schema.json'
15+
- 'crates/tauri-schema-generator/schemas/*.json'
1616

1717
concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref }}
@@ -26,18 +26,17 @@ jobs:
2626
schema: ${{ steps.filter.outputs.schema }}
2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: dorny/paths-filter@v2
29+
- uses: dorny/paths-filter@v3
3030
id: filter
3131
with:
3232
filters: |
3333
api:
34-
- 'tooling/api/src/**'
35-
- 'core/tauri/scripts/bundle.global.js'
34+
- 'packages/api/src/**'
35+
- 'crates/tauri/scripts/bundle.global.js'
3636
schema:
37-
- 'core/tauri-utils/src/config.rs'
38-
- 'tooling/cli/schema.json'
39-
- 'core/tauri-config-schema/schema.json'
40-
- 'core/tauri-acl-schema/*.json'
37+
- 'crates/tauri-utils/src/config.rs'
38+
- 'crates/tauri-cli/config.schema.json'
39+
- 'crates/tauri-schema-generator/schemas/*.json'
4140
4241
api:
4342
runs-on: ubuntu-latest
@@ -51,9 +50,11 @@ jobs:
5150
node-version: 'lts/*'
5251
cache: 'pnpm'
5352

53+
- name: install deps
54+
run: pnpm i --frozen-lockfile
5455
- name: build api
55-
working-directory: tooling/api
56-
run: pnpm i --frozen-lockfile && pnpm build
56+
run: pnpm build
57+
working-directory: packages/api
5758
- name: check api
5859
run: ./.scripts/ci/has-diff.sh
5960

@@ -73,14 +74,9 @@ jobs:
7374
sudo apt-get install -y libgtk-3-dev
7475
7576
- uses: Swatinem/rust-cache@v2
76-
with:
77-
workspaces: core -> ../target
78-
79-
- name: generate config schema
80-
run: cargo build --manifest-path ./core/tauri-config-schema/Cargo.toml
8177

82-
- name: generate ACL schema
83-
run: cargo build --manifest-path ./core/tauri-acl-schema/Cargo.toml
78+
- name: generate schemas
79+
run: cargo build --manifest-path ./crates/tauri-schema-generator/Cargo.toml
8480

85-
- name: check schema
81+
- name: check schemas
8682
run: ./.scripts/ci/has-diff.sh

.github/workflows/check-license-header.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: dorny/paths-filter@v2
19+
- uses: dorny/paths-filter@v3
2020
id: filter
2121
with:
2222
list-files: shell

0 commit comments

Comments
 (0)