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

feat: migrate to tauri 2.0 #21

Merged
merged 9 commits into from
Nov 26, 2024
Merged

Conversation

0xbrayo
Copy link
Member

@0xbrayo 0xbrayo commented Nov 11, 2024

Important

Migrate project to Tauri 2.0, updating dependencies, refactoring code, and adding new capabilities and permissions.

  • Migration to Tauri 2.0:
    • Update package.json dependencies to Tauri 2.0 and related plugins.
    • Update Cargo.lock with new versions of dependencies.
    • Modify tauri.conf.json to use Tauri 2.0 schema.
  • Code Refactoring:
    • Move main logic from main.rs to lib.rs and update main.rs to call aw_tauri_lib::run().
    • Refactor tray menu setup in manager.rs to use Tauri 2.0 APIs.
  • New Features:
    • Add new capabilities and permissions in src-tauri/capabilities and src-tauri/gen/schemas.
    • Implement new greet command in lib.rs and update App.vue to use it.
  • Build and Configuration:
    • Update vite.config.ts for Tauri 2.0 compatibility.
    • Modify tsconfig.node.json for module resolution changes.

This description was created by Ellipsis for d92dfad. It will automatically update as commits are pushed.

- Update package.json and package-lock.json with Tauri 2.0 dependencies
- Update Cargo.toml and Cargo.lock for Tauri 2.0
- Update tauri.conf.json for Tauri 2.0 format
- Update TypeScript and Vite configurations
- Add Tauri 2.0 capabilities and schemas
- Update main.rs and manager.rs for Tauri 2.0 APIs
- Add lib.rs for shared functionality
- Implement new Tauri 2.0 system tray features
- Update App.vue for Tauri 2.0 APIs
- Update main.ts entry point
- Update index.html template
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to d92dfad in 3 minutes and 19 seconds

More details
  • Looked at 8216 lines of code in 19 files
  • Skipped 2 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. vite.config.ts:10
  • Draft comment:
    Consider making the development server port configurable or handle port conflicts gracefully to avoid issues if the port is already in use.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The vite.config.ts file has a hardcoded port number for the development server. This could cause conflicts if the port is already in use. It's better to make this configurable or handle port conflicts gracefully.
2. src-tauri/Cargo.lock:295
  • Draft comment:
    The jni package version in Cargo.lock is 0.21.1, but in Cargo.toml, it is specified as 0.20.0. Ensure both files have consistent versions to avoid potential issues.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. src-tauri/Cargo.lock:308
  • Draft comment:
    Ensure that the version downgrades for dependencies like toml are intentional and compatible with Tauri 2.0. This could potentially introduce compatibility issues or bugs.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR updates the Tauri version and related dependencies. However, the Cargo.lock file has a lot of changes, including version downgrades for some dependencies like toml. This could potentially introduce compatibility issues or bugs. It's important to ensure that all dependencies are compatible with the new Tauri version.

Workflow ID: wflow_ulTH9yzplW7aQZtp


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@0xbrayo 0xbrayo force-pushed the tauri2-migration branch 3 times, most recently from 7bc778a to 6e26d45 Compare November 11, 2024 13:51
@0xbrayo
Copy link
Member Author

0xbrayo commented Nov 11, 2024

Most of these are failing because of a new library that needs a custom_build command for.

src-tauri/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Member

@ErikBjare ErikBjare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to review, but looks good!
What's up with all the schemas?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these schemas need to be committed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They seem to be autogenerated. No need to track. I deleted them and make dev runs. make build regenerates them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tauri website says they are for autocompletion in IDE. link. Let's keep them for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a duplicate of linux-schema.json?

@ErikBjare
Copy link
Member

Ubuntu build fails with:

The following warnings were emitted during compilation:

warning: [email protected]: 

error: failed to run custom build command for `glib-sys v0.18.1`

Caused by:
  process didn't exit successfully: `/home/runner/work/aw-tauri/aw-tauri/src-tauri/target/release/build/glib-sys-2af436f5e2da36ff/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=GLIB_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:warning=
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags glib-2.0 glib-2.0 >= 2.70

  The system library `glib-2.0` required by crate `glib-sys` was not found.
  The file `glib-2.0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `glib-2.0.pc`.

warning: build failed, waiting for other jobs to finish...
failed to build app: failed to build app
    Error failed to build app: failed to build app
Error: Command failed with exit code 1: npm run tauri build

I guess it needs some glib apt package?

@0xbrayo
Copy link
Member Author

0xbrayo commented Nov 14, 2024

Will try fixing the tests tonight

@0xbrayo 0xbrayo force-pushed the tauri2-migration branch 2 times, most recently from dd0a74a to 7248aa6 Compare November 26, 2024 15:14
- Update Ubuntu runner from 20.04 to 22.04
- Update WebKit2GTK from 4.0 to 4.1
@0xbrayo
Copy link
Member Author

0xbrayo commented Nov 26, 2024

@ErikBjare fixed the tests :). Got caught up last week, but I am back 👍

@ErikBjare
Copy link
Member

Nice! Let's go 🚀

@ErikBjare ErikBjare merged commit 4c5e76d into ActivityWatch:master Nov 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants