Skip to content

Commit

Permalink
feat!: add frontend(tauri) & move current to core_lib
Browse files Browse the repository at this point in the history
The idea is to have the frontend(tauri), handle the UI and all
while the core_lib will be included as a library (no shit)
into the tauri app.

Signed-off-by: Martichou <[email protected]>
  • Loading branch information
Martichou committed Feb 15, 2024
1 parent 2aa4701 commit 2f5cedc
Show file tree
Hide file tree
Showing 71 changed files with 9,796 additions and 11 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/build_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build-ubuntu
name: Build-(Core & Tauri)

on:
push:
Expand All @@ -14,16 +14,38 @@ env:
CARGO_TERM_COLOR: always

jobs:
build-ubuntu:
build-core:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v3
- uses: arduino/setup-protoc@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev
- run: cargo build
sudo apt-get install -y libdbus-1-dev
- run: |
cd ./core_lib
cargo build
build-tauri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: true
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build Vite + Tauri
run: pnpm build
18 changes: 16 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ env:
jobs:
clippy_check:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- directory: ./core_lib
clippy_args: "--all-features --all"
- directory: ./frontend/src-tauri
clippy_args: "--no-default-features"
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -25,5 +32,12 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libdbus-1-dev
- run: cargo clippy --all-features --all
sudo apt-get install -y libdbus-1-dev
- name: Install Linux dependencies
if: matrix.directory == './frontend/src-tauri'
run: |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Clippy Check
run: |
cd ${{ matrix.directory }}
cargo clippy ${{ matrix.clippy_args }}
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ env:
jobs:
style:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- directory: ./core_lib
- directory: ./frontend/src-tauri
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
- run: |
cd ${{ matrix.directory }}
cargo fmt --all --check
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"rust-analyzer.showUnlinkedFileNotification": false
"rust-analyzer.linkedProjects": [
"core_lib/Cargo.toml",
"frontend/src-tauri/Cargo.toml",
],
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions frontend/.eslintrc-auto-import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"globals": {
"Component": true,
"ComponentPublicInstance": true,
"ComputedRef": true,
"EffectScope": true,
"InjectionKey": true,
"PropType": true,
"Ref": true,
"VNode": true,
"computed": true,
"createApp": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"effectScope": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCssModule": true,
"useCssVars": true,
"useSlots": true,
"watch": true,
"watchEffect": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"toValue": true,
"ExtractDefaultPropTypes": true,
"ExtractPropTypes": true,
"ExtractPublicPropTypes": true,
"WritableComputedRef": true
}
}
28 changes: 28 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
'plugin:security/recommended',
'prettier',
'./.eslintrc-auto-import.json',
],
parserOptions: {
ecmaVersion: 2021,
},
rules: {
'no-var': 'error',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'comma-dangle': ['error', 'only-multiline'],
},
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
defineExpose: 'readonly',
withDefaults: 'readonly',
},
}
30 changes: 30 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist/**
!dist/keep
dist-ssr
*.local

# Editor directories and files
.vscode/settings.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

src-tauri/target

.env
LOCAL_NOTES.md
.gitpod.yml
8 changes: 8 additions & 0 deletions frontend/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb"
]
}
21 changes: 21 additions & 0 deletions frontend/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug Tauri",
"program": "cargo",
"args": [
"run",
"--manifest-path=./src-tauri/Cargo.toml",
"--no-default-features"
],
"cwd": "${workspaceFolder}",
"preLaunchTask": "ui:dev"
}
]
}
20 changes: 20 additions & 0 deletions frontend/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "ui:dev",
"type": "shell",
// `dev` keeps running in the background
// ideally you should also configure a `problemMatcher`
// see https://code.visualstudio.com/docs/editor/tasks#_can-a-background-task-be-used-as-a-prelaunchtask-in-launchjson
"isBackground": true,
// Why do I get "command not found" when running a task?
// see https://code.visualstudio.com/docs/editor/tasks#_why-do-i-get-command-not-found-when-running-a-task
// or https://stackoverflow.com/a/70243581
"command": "pnpm",
"args": ["vite:dev"]
}
]
}
13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
46 changes: 46 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "rquickshare",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "cross-env RUST_BACKTRACE=1 concurrently -k \"tauri dev\" \"pnpm devtools\"",
"build": "tauri build",
"vite:dev": "vite dev",
"vite:build": "vite build",
"test": "vitest",
"devtools": "pnpm vue-devtools",
"ts-check": "vue-tsc --noEmit",
"preview": "vite preview",
"check": "cd src-tauri && cargo check"
},
"dependencies": {
"@tauri-apps/api": "1.5.1",
"vue": "3.3.11"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
"@tauri-apps/cli": "1.5.7",
"@types/node": "20.10.4",
"@vitejs/plugin-vue": "4.5.2",
"@vue/devtools": "6.5.1",
"@vue/eslint-config-typescript": "12.0.0",
"autoprefixer": "10.4.16",
"concurrently": "8.2.2",
"cross-env": "7.0.3",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-security": "2.1.0",
"eslint-plugin-vue": "9.19.2",
"postcss": "8.4.32",
"postcss-import": "15.1.0",
"postcss-nesting": "12.0.1",
"tailwindcss": "3.4.0",
"typescript": "5.3.3",
"unplugin-auto-import": "0.17.2",
"vite": "5.0.7",
"vitest": "1.1.0",
"vue-tsc": "1.8.25"
}
}
Loading

0 comments on commit 2f5cedc

Please sign in to comment.