Skip to content

Commit 56458f8

Browse files
build: Migrate from webpack to Vite & upgrade Tauri to V2 (#122)
* Migrate from webpack to vite * refactor: upgrade dependencies - Remove webpack config - Install the latest quasar library with vite plugin - Update the SaSS imports - Add APPLICATION_VERSION to the vite config - update Github Actions to recent versions with Ubuntu 22 for Linux build and Node Version 21. * feat: migrate tauri to version 2 --------- Co-authored-by: Arunmozhi <[email protected]>
1 parent 15f7121 commit 56458f8

37 files changed

+18493
-9704
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
platform: [ubuntu-20.04, windows-latest]
12+
platform: [ubuntu-22.04, windows-latest]
1313

1414
runs-on: ${{ matrix.platform }}
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: setup node
18-
uses: actions/setup-node@v1
19-
with:
20-
node-version: 14
21-
- name: install Rust stable
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: stable
25-
- name: install dependencies (ubuntu only)
26-
if: matrix.platform == 'ubuntu-20.04'
27-
run: |
28-
sudo apt-get update
29-
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
30-
- name: install app dependencies and build it
31-
run: yarn --network-timeout 600000 && yarn tauri:build
32-
- uses: tauri-apps/tauri-action@v0.2
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
with:
36-
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
37-
releaseName: "Version __VERSION__"
38-
releaseBody: "See the assets to download this version and install."
39-
releaseDraft: true
40-
prerelease: false
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 21
20+
- name: install Rust stable
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- name: install dependencies (ubuntu only)
24+
if: matrix.platform == 'ubuntu-22.04'
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
28+
29+
- name: install app dependencies and build it
30+
run: yarn --network-timeout 600000 && yarn tauri build
31+
32+
- uses: tauri-apps/tauri-action@v0
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
37+
releaseName: "Version __VERSION__"
38+
releaseBody: "See the assets to download this version and install."
39+
releaseDraft: true
40+
prerelease: false

.github/workflows/test-build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Run UI Build
22
on: [push]
33
jobs:
4-
build:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/setup-node@v2
9-
with:
10-
node-version: '14'
11-
cache: 'yarn'
12-
cache-dependency-path: yarn.lock
13-
- run: yarn && yarn build
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-node@v4
9+
with:
10+
node-version: "21"
11+
cache: "yarn"
12+
cache-dependency-path: yarn.lock
13+
- run: yarn && yarn build

.github/workflows/test-prs.yml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,46 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
platform: [ubuntu-20.04, windows-latest]
9+
platform: [ubuntu-22.04, windows-latest]
1010

1111
runs-on: ${{ matrix.platform }}
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: setup node
15-
uses: actions/setup-node@v1
16-
with:
17-
node-version: 14
18-
- name: install Rust stable
19-
uses: actions-rs/toolchain@v1
20-
with:
21-
toolchain: stable
22-
- name: install dependencies (ubuntu only)
23-
if: matrix.platform == 'ubuntu-20.04'
24-
run: |
25-
sudo apt-get update
26-
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
27-
- name: install app dependencies and build it
28-
run: yarn --network-timeout 600000 && yarn tauri:build
29-
- uses: tauri-apps/[email protected]
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 21
17+
18+
- name: Install Rust stable
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Install system dependencies (ubuntu only)
22+
if: matrix.platform == 'ubuntu-22.04'
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
26+
27+
- name: Install JS dependencies
28+
run: yarn install
29+
30+
- name: Build Desktop app - Tauri Build
31+
id: tauri_build
32+
uses: tauri-apps/tauri-action@v0
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Upload Linux build artifacts
37+
uses: actions/upload-artifact@v4
38+
if: matrix.platform == 'ubuntu-22.04'
39+
with:
40+
path: |
41+
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.deb
42+
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.rpm
43+
${{ github.workspace }}/src-tauri/target/release/bundle/**/*.AppImage
44+
45+
- name: Upload Windows build artifacts
46+
uses: actions/upload-artifact@v4
47+
if: matrix.platform == 'windows-latest'
48+
with:
49+
path: |
50+
${{ github.workspace }}\src-tauri\target\release\bundle\**\*.exe
51+
${{ github.workspace }}\src-tauri\target\release\bundle\**\*.nsis

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,37 @@ node_modules/
2424
*.njsproj
2525
*.sln
2626
*.sw?
27+
28+
# Logs
29+
logs
30+
*.log
31+
npm-debug.log*
32+
yarn-debug.log*
33+
yarn-error.log*
34+
pnpm-debug.log*
35+
lerna-debug.log*
36+
37+
node_modules
38+
.DS_Store
39+
dist
40+
dist-ssr
41+
coverage
42+
*.local
43+
44+
/cypress/videos/
45+
/cypress/screenshots/
46+
47+
# Editor directories and files
48+
.vscode/*
49+
!.vscode/extensions.json
50+
.idea
51+
*.suo
52+
*.ntvs*
53+
*.njsproj
54+
*.sln
55+
*.sw?
56+
57+
*.tsbuildinfo
58+
59+
test-results/
60+
playwright-report/

public/index.html renamed to index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
87
<title>NER Annotator for SpaCy</title>
98
</head>
109
<body>
11-
<noscript>
12-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13-
</noscript>
1410
<div id="app"></div>
11+
<script type="module" src="./src/main.js" type="text/javascript"></script>
1512
<!-- built files will be auto injected -->
1613
</body>
1714
</html>

jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"@/*": ["./src/*"]
5+
}
6+
},
7+
"exclude": ["node_modules", "dist"]
8+
}

package.json

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,67 @@
11
{
22
"name": "ner-annotator",
3-
"version": "1.5.0",
3+
"version": "2.0.0-alpha",
44
"private": true,
5+
"type": "module",
56
"scripts": {
6-
"serve": "vue-cli-service serve",
7-
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint",
97
"tauri": "tauri",
10-
"tauri:build": "vue-cli-service tauri:build",
11-
"tauri:serve": "vue-cli-service tauri:serve",
12-
"tauri:build-win": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service tauri:build",
13-
"tauri:serve-win": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service tauri:serve",
14-
"test": "jest"
8+
"test": "jest",
9+
"dev": "vite",
10+
"build": "vite build",
11+
"preview": "vite preview",
12+
"test:unit": "vitest",
13+
"test:e2e": "playwright test",
14+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
15+
"format": "prettier --write src/"
1516
},
1617
"dependencies": {
1718
"@fortawesome/fontawesome-svg-core": "^6.4.0",
1819
"@fortawesome/free-solid-svg-icons": "^6.4.0",
1920
"@fortawesome/vue-fontawesome": "^3.0.3",
20-
"@quasar/extras": "^1.16.2",
21-
"@tauri-apps/api": "^1.0.0-beta.8",
21+
"@quasar/extras": "^1.16.13",
22+
"@tauri-apps/api": "^2.0.0",
23+
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
24+
"@tauri-apps/plugin-dialog": "~2",
25+
"@tauri-apps/plugin-fs": "~2",
26+
"@tauri-apps/plugin-global-shortcut": "~2",
27+
"@tauri-apps/plugin-http": "~2",
28+
"@tauri-apps/plugin-notification": "~2",
29+
"@tauri-apps/plugin-os": "~2",
30+
"@tauri-apps/plugin-process": "~2",
31+
"@tauri-apps/plugin-shell": "~2",
2232
"core-js": "^3.30.1",
2333
"es6-promise": "^4.2.8",
24-
"quasar": "^2.11.10",
34+
"quasar": "^2.17.4",
2535
"treebank-tokenizer": "^0.0.1",
26-
"vue": "^3.2.47",
36+
"vue": "^3.4.29",
2737
"vuex": "^4.1.0"
2838
},
2939
"devDependencies": {
30-
"@tauri-apps/cli": "^1.0.0-beta.10",
31-
"@vue/cli-plugin-babel": "~5.0.8",
32-
"@vue/cli-plugin-eslint": "~5.0.8",
33-
"@vue/cli-service": "~5.0.8",
34-
"@vue/compiler-sfc": "^3.2.47",
3540
"@babel/eslint-parser": "^7.21.3",
36-
"eslint": "^8.38.0",
41+
"@playwright/test": "^1.44.1",
42+
"@quasar/vite-plugin": "^1.8.1",
43+
"@rushstack/eslint-patch": "^1.8.0",
44+
"@tauri-apps/cli": "^2.1.0",
45+
"@vitejs/plugin-vue": "^5.0.5",
46+
"@vitejs/plugin-vue-jsx": "^4.0.0",
47+
"@vue/eslint-config-prettier": "^9.0.0",
48+
"@vue/test-utils": "^2.4.6",
49+
"bulma": "^1.0.2",
50+
"eslint": "^9.9.1",
3751
"eslint-config-prettier": "^9.1.0",
52+
"eslint-plugin-playwright": "^1.6.2",
3853
"eslint-plugin-prettier": "^5.0.1",
39-
"eslint-plugin-vue": "^9.11.0",
54+
"eslint-plugin-vue": "^9.23.0",
4055
"jest": "^29.5.0",
41-
"node-sass": "^8.0.0",
42-
"prettier": "^3.1.1",
43-
"sass": "^1.62.0",
44-
"sass-loader": "^13.2.2",
56+
"jsdom": "^25.0.0",
57+
"prettier": "^3.2.5",
58+
"sass": "^1.78.0",
59+
"sass-embedded": "^1.80.2",
60+
"vite": "^5.3.1",
61+
"vite-plugin-vue-devtools": "^7.3.1",
62+
"vitest": "^2.0.5",
4563
"vue-cli-plugin-quasar": "^5.0.2",
46-
"vue-cli-plugin-tauri": "~1.0.0-beta.6"
64+
"vue-cli-plugin-tauri": "^1.0.0"
4765
},
4866
"browserslist": [
4967
"> 1%",

0 commit comments

Comments
 (0)