Skip to content

Commit

Permalink
refactor(cli): rename tooling/cli.rs folder to tooling/cli (#3388)
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
  • Loading branch information
lucasfernog and amrbashir authored Feb 10, 2022
1 parent 62c7a8a commit 4334865
Show file tree
Hide file tree
Showing 209 changed files with 268 additions and 216 deletions.
42 changes: 31 additions & 11 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@
"tauri-bundler": {
"path": "./tooling/bundler",
"manager": "rust",
"dependencies": ["tauri-utils"]
"dependencies": [
"tauri-utils"
]
},
"tauri-utils": {
"path": "./core/tauri-utils",
Expand All @@ -218,29 +220,42 @@
"tauri-runtime": {
"path": "./core/tauri-runtime",
"manager": "rust",
"dependencies": ["tauri-utils"],
"dependencies": [
"tauri-utils"
],
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
},
"tauri-runtime-wry": {
"path": "./core/tauri-runtime-wry",
"manager": "rust",
"dependencies": ["tauri-utils", "tauri-runtime"],
"dependencies": [
"tauri-utils",
"tauri-runtime"
],
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
},
"tauri-codegen": {
"path": "./core/tauri-codegen",
"manager": "rust",
"dependencies": ["tauri-utils"]
"dependencies": [
"tauri-utils"
]
},
"tauri-macros": {
"path": "./core/tauri-macros",
"manager": "rust",
"dependencies": ["tauri-codegen", "tauri-utils"]
"dependencies": [
"tauri-codegen",
"tauri-utils"
]
},
"tauri-build": {
"path": "./core/tauri-build",
"manager": "rust",
"dependencies": ["tauri-codegen", "tauri-utils"],
"dependencies": [
"tauri-codegen",
"tauri-utils"
],
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
},
"tauri": {
Expand All @@ -255,18 +270,23 @@
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
},
"cli.js": {
"path": "./tooling/cli.rs/node",
"path": "./tooling/cli/node",
"manager": "javascript",
"dependencies": ["cli.rs"],
"dependencies": [
"cli.rs"
],
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"prepublish": [],
"publish": [],
"postpublish": []
},
"cli.rs": {
"path": "./tooling/cli.rs",
"path": "./tooling/cli",
"manager": "rust",
"dependencies": ["tauri-bundler", "tauri-utils"],
"dependencies": [
"tauri-bundler",
"tauri-utils"
],
"postversion": "cargo check"
},
"create-tauri-app": {
Expand All @@ -279,4 +299,4 @@
"postversion": "node ../../.scripts/covector/sync-prerelease.js ${ pkg.pkg } ${ release.type }"
}
}
}
}
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

/tooling/bundler/ @tauri-apps/bundler

/tooling/cli.rs/ @tauri-apps/core
/tooling/cli/ @tauri-apps/core

/tooling/cli.rs/node/ @tauri-apps/js-cli
/tooling/cli/node/ @tauri-apps/js-cli

/core/** @tauri-apps/core
10 changes: 5 additions & 5 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ Hi! We, the maintainers, are really excited that you are interested in contribut

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.

To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/en/docs/get-started/intro#setting-up-your-environment) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli.rs/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.
To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/en/docs/get-started/intro#setting-up-your-environment) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), 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.

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 respository in order to run correctly.

### Packages Overview

- The JS API (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
- The Rust CLI (`/tooling/cli.rs`) is the primary CLI for creating and developing Tauri apps.
- cli.js (`/tooling/cli.rs/node`) is a Node.js CLI wrapper for `cli.rs`.
- cli.rs (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
- cli.js (`/tooling/cli/node`) is a Node.js CLI wrapper for `cli.rs`.
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
- Tauri Core (`/core/tauri`) is the heart of Tauri. It contains the code that starts the app, configures communication between Rust and the Webview, and ties all the other packages together.
- The Macros (`/core/tauri-macros`) are used by Tauri Core for various functions.

### Developing The Node.js CLI (cli.js)

`cli.js` is a wrapper to `cli.rs` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli.rs/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
`cli.js` is a wrapper to `cli.rs` 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.

### Developing Tauri Bundler and Rust CLI

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.rs`. If you are using your local copy of cli.js (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.
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 cli.js (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.

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

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/artifacts-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
paths:
- '.github/workflows/artifacts-updater.yml'
- 'core/tauri/**'
- 'tooling/cli.rs/**'
- 'tooling/cli/**'
- 'tooling/bundler/**'
- 'examples/updater/**'

Expand All @@ -37,7 +37,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
Expand Down Expand Up @@ -78,27 +78,27 @@ jobs:
restore-keys: |
${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('core/**/Cargo.toml') }}
${{ matrix.platform }}-stable-cargo-core-
- name: Cache CLI cargo target
uses: actions/cache@v2
with:
path: tooling/cli.rs/target
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}-${{ env.CURRENT_DATE }}
key: ${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}
${{ matrix.platform }}-stable-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}
${{ matrix.platform }}-stable-cargo-cli-
- name: build and install cli.rs
run: cargo install --path tooling/cli.rs
run: cargo install --path tooling/cli
- name: Check whether code signing should be enabled
id: enablecodesigning
env:
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
run: |
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
# run only on tauri-apps/tauri repo (require secrets)
- name: build sample artifacts + code signing (updater)
if: steps.enablecodesigning.outputs.enabled == 'true'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
- cron: '0 0 * * *'
push:
paths:
- "**/Cargo.lock"
- "**/Cargo.toml"
- "**/package.json"
- "**/yarn.lock"
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**/package.json'
- '**/yarn.lock'

jobs:
audit-rust:
Expand All @@ -30,5 +30,5 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: yarn audit
working-directory: tooling/cli.rs/node
working-directory: tooling/cli/node
run: yarn audit
2 changes: 1 addition & 1 deletion .github/workflows/build-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: build and install cli.rs
run: cargo install --path tauri/tooling/cli.rs
run: cargo install --path tauri/tooling/cli
- name: install and build assets
working-directory: "example/${{ github.event.inputs.dir }}"
run: ${{ github.event.inputs.buildAssets }}
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/core-lint-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- '.github/workflows/core-lint-fmt.yml'
- 'core/**'
- 'examples/**'
- 'tooling/cli.rs/**'
- 'tooling/cli/**'

jobs:
workspace_clippy_fmt_check:
Expand Down Expand Up @@ -89,20 +89,20 @@ jobs:

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./tooling/cli.rs/Cargo.toml --all-targets --all-features -- -D warnings
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
name: cli

- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Cache cargo registry
uses: actions/cache@v2.1.4
with:
Expand All @@ -128,18 +128,18 @@ jobs:
- name: Cache CLI cargo target
uses: actions/cache@v2
with:
path: tooling/cli.rs/target
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}-${{ env.CURRENT_DATE }}
key: ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}
ubuntu-latest-nightly-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}
ubuntu-latest-nightly-cargo-cli-
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./tooling/cli.rs/Cargo.toml --all -- --check
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check

core_clippy_check:
runs-on: ubuntu-latest
Expand All @@ -156,10 +156,10 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy

- name: Get current date
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ jobs:
- name: Cache CLI cargo target
uses: actions/cache@v2
with:
path: tooling/cli.rs/target
path: tooling/cli/target
# Add date to the cache to keep it up to date
key: ubuntu-latest-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}-${{ env.CURRENT_DATE }}
key: ubuntu-latest-stable-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
ubuntu-latest-stable-cargo-cli-${{ hashFiles('tooling/cli.rs/Cargo.lock') }}
ubuntu-latest-stable-cargo-cli-${{ hashFiles('tooling/cli/Cargo.lock') }}
ubuntu-latest-stable-cargo-cli-
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli.rs/Cargo.toml
args: --manifest-path ./tooling/cli/Cargo.toml

- name: cargo login
run: cargo login ${{ secrets.crate_token }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
paths:
- '.github/workflows/js-lint.yml'
- 'tooling/cli.rs/node/**'
- 'tooling/cli/node/**'
- 'tooling/api/**'
- 'tooling/create-tauri-app/**'

Expand All @@ -23,14 +23,14 @@ jobs:
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: install cli.js deps via yarn
working-directory: ./tooling/cli.rs/node/
working-directory: ./tooling/cli/node/
run: yarn
# nothing to lint
#- name: run cli.js lint
# working-directory: ./tooling/cli.rs/node/
# working-directory: ./tooling/cli/node/
# run: yarn lint
- name: run cli.js format
working-directory: ./tooling/cli.rs/node/
working-directory: ./tooling/cli/node/
run: yarn format:check

- name: install api deps via yarn
Expand Down
Loading

0 comments on commit 4334865

Please sign in to comment.