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

refactor: change package names to match published packages #6795

Merged
merged 10 commits into from
May 22, 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
2 changes: 1 addition & 1 deletion .changes/cli-profile.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'cli.rs': 'patch'
'tauri-cli': 'patch'
---

Fix building with a custom cargo profile
10 changes: 5 additions & 5 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@
}
},
"packages": {
"api": {
"@tauri-apps/api": {
"path": "./tooling/api",
"manager": "javascript",
"assets": [
{
"path": "./tooling/api/dist/tauri-apps-api-${ pkgFile.version }.tgz",
"name": "api-${ pkgFile.version }.tgz"
"name": "tauri-apps-api-${ pkgFile.version }.tgz"
}
],
"prepublish": [
Expand Down Expand Up @@ -240,11 +240,11 @@
],
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
},
"cli.js": {
"@tauri-apps/cli": {
"path": "./tooling/cli/node",
"manager": "javascript",
"getPublishedVersion": "node ../../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
"dependencies": ["cli.rs"],
"dependencies": ["tauri-cli"],
"postversion": [
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
Expand All @@ -253,7 +253,7 @@
"publish": [],
"postpublish": []
},
"cli.rs": {
"tauri-cli": {
"path": "./tooling/cli",
"manager": "rust",
"dependencies": ["tauri-bundler", "tauri-utils"],
Expand Down
4 changes: 2 additions & 2 deletions .changes/fix-feature-removal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'cli.rs': 'patch'
'cli.js': 'patch'
'tauri-cli': 'patch'
'@tauri-apps/cli': 'patch'
---

Fixes Cargo.toml feature rewriting.
2 changes: 1 addition & 1 deletion .changes/nsis-custom-language-files.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
'tauri-bundler': 'minor'
'tauri-utils': 'minor'
'cli.rs': 'minor'
'tauri-cli': 'minor'
---

Allow specifying custom language files of Tauri's custom messages for the NSIS installer
4 changes: 2 additions & 2 deletions .changes/nsis-custom-template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
'tauri-utils': 'minor'
'tauri-bundler': 'minor'
'cli.rs': 'minor'
'cli.js': 'minor'
'tauri-cli': 'minor'
'@tauri-apps/cli': 'minor'
---

Add `nsis > template` option to specify custom NSIS installer template.
2 changes: 1 addition & 1 deletion .changes/nsis-updater-restart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'tauri': 'minor'
'cli.rs': 'minor'
'tauri-cli': 'minor'
---

Restart the app after the NSIS updater is finished.
4 changes: 2 additions & 2 deletions .changes/rustls-default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
'tauri-cli': patch
'@tauri-apps/cli': patch
---

Add `rustls` as default Cargo feature.
2 changes: 1 addition & 1 deletion .changes/tauri-info-msvc-detection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'cli.rs': 'patch'
'tauri-cli': 'patch'
---

Improve Visual Studio installation detection in `tauri info` command to check for the necessary components instead of whole workloads. This also fixes the detection of minimal installations and auto-installations done by `rustup`.
16 changes: 8 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ Some Tauri packages will be automatically built when running one of the examples

### Packages Overview

- The JS API (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
- 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.
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
- The Rust CLI aka `tauri-cli` (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
- The JS CLI aka `@tauri-apps/cli` (`/tooling/cli/node`) is a Node.js CLI wrapper for `tauri-cli`.
- The JS API aka `@tauri-apps/api` (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.

### Developing The Node.js CLI (cli.js)
### Developing Tauri Bundler and Rust CLI

`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.
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.

### Developing Tauri Bundler and Rust CLI
### Developing The Node.js CLI (`@tauri-apps/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`. 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.
`@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.

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: benches
name: bench

on:
push:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: Check generated files
name: check generated files

on:
pull_request:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- 'tooling/cli/schema.json'
- 'core/tauri-config-schema/schema.json'

check-api:
api:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.api == 'true'
Expand All @@ -64,7 +64,7 @@ jobs:
git restore tooling/api/docs/js-api.json
./.scripts/ci/has-diff.sh

check-schema:
schema:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.schema == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-license-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: Check generated files
name: check license headers

on:
pull_request:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: version or publish
name: covector version or publish

on:
push:
Expand Down Expand Up @@ -115,21 +115,21 @@ jobs:
repository: tauri-apps/tauri-docs
event-type: update-docs

- name: Trigger cli.js publishing workflow
- name: Trigger `@tauri-apps/cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-clijs
client-payload: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }'
event-type: publish-js-cli
client-payload: '{"releaseId": "${{ steps.covector.outputs.-tauri-apps-cli-releaseId }}" }'

- name: Trigger cli.rs publishing workflow
- name: Trigger `tauri-cli` publishing workflow
if: |
steps.covector.outputs.successfulPublish == 'true' &&
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: cli clippy and fmt check
name: lint cli

on:
push:
Expand All @@ -11,7 +11,7 @@ on:
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-cli.yml'
- '.github/workflows/lint-cli.yml'
- 'tooling/cli/**'

env:
Expand All @@ -23,7 +23,7 @@ concurrency:
cancel-in-progress: true

jobs:
fmt_check:
fmt:
runs-on: ubuntu-latest

steps:
Expand All @@ -41,7 +41,7 @@ jobs:
command: fmt
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check

cli_clippy_check:
clippy:
runs-on: ubuntu-latest

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: core clippy and fmt check
name: lint core

on:
push:
Expand All @@ -11,7 +11,7 @@ on:
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-core.yml'
- '.github/workflows/lint-core.yml'
- 'core/**'
- '!core/tauri/scripts/**'
- 'examples/**'
Expand All @@ -25,7 +25,7 @@ concurrency:
cancel-in-progress: true

jobs:
fmt_check:
fmt:
runs-on: ubuntu-latest

steps:
Expand All @@ -43,7 +43,7 @@ jobs:
command: fmt
args: --all -- --check

core_clippy_check:
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: api and cli.js lint check
name: lint js

on:
pull_request:
Expand All @@ -16,32 +16,42 @@ concurrency:
cancel-in-progress: true

jobs:
eslint-check:
eslint-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
- name: install cli.js deps via yarn
cache-dependency-path: tooling/cli/node/yarn.lock
- name: install deps via yarn
working-directory: ./tooling/cli/node/
run: yarn
# nothing to lint
#- name: run cli.js lint
#- name: run lint
# working-directory: ./tooling/cli/node/
# run: yarn lint
- name: run cli.js format
- name: run format
working-directory: ./tooling/cli/node/
run: yarn format:check

- name: install api deps via yarn
eslint-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: yarn
cache-dependency-path: tooling/api/yarn.lock

- name: install deps via yarn
working-directory: ./tooling/api/
run: yarn
- name: run api lint
- name: run lint
working-directory: ./tooling/api/
run: yarn lint
- name: run api format
- name: run format
working-directory: ./tooling/api/
run: yarn format:check
6 changes: 3 additions & 3 deletions .github/workflows/publish-cli-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: publish cli.js
name: publish `@tauri-apps/cli`
env:
DEBUG: napi:*
APP_NAME: cli
Expand All @@ -11,10 +11,10 @@ on:
workflow_dispatch:
inputs:
releaseId:
description: 'ID of the cli.js release'
description: 'ID of the `@tauri-apps/cli` release'
required: true
repository_dispatch:
types: [publish-clijs]
types: [publish-js-cli]

defaults:
run:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-cli-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: publish cli.rs
name: publish `tauri-cli`
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
on:
Expand Down Expand Up @@ -80,12 +80,12 @@ jobs:
run: ./.scripts/ci/pack-cli.sh

- name: Get CLI version
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."@tauri-apps/cli".version' -r)" >> $GITHUB_ENV

- name: Publish release
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
with:
tag_name: cli.rs-v${{ env.CLI_VERSION }}
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
files: |
outputs/cargo-tauri-*.zip
outputs/cargo-tauri-*.tgz
Loading