Skip to content

Commit bc2d93e

Browse files
committed
refactor: restructure project
1 parent 28ac12e commit bc2d93e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+21743
-2711
lines changed

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.github
2+
.webpack
3+
build
4+
src-tauri
5+
tmp
6+
7+
*.js

.eslintrc.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
3+
parser: '@typescript-eslint/parser',
4+
plugins: ['@typescript-eslint'],
5+
6+
// plugins: ['@typescript-eslint'],
7+
rules: {
8+
// A temporary hack related to IDE not resolving correct package.json
9+
'import/no-extraneous-dependencies': 'off',
10+
'react/react-in-jsx-scope': 'off',
11+
'react/jsx-filename-extension': 'off',
12+
'import/extensions': 'off',
13+
'import/no-unresolved': 'off',
14+
'import/no-import-module-exports': 'off',
15+
'no-shadow': 'off',
16+
'@typescript-eslint/no-shadow': 'off',
17+
'no-unused-vars': 'off',
18+
'@typescript-eslint/no-unused-vars': 'off',
19+
'@typescript-eslint/no-extra-semi': 'off',
20+
},
21+
parserOptions: {
22+
ecmaVersion: 2020,
23+
sourceType: 'module',
24+
// project: './tsconfig.json',
25+
tsconfigRootDir: __dirname,
26+
createDefaultProgram: true,
27+
},
28+
settings: {
29+
'import/parsers': {
30+
'@typescript-eslint/parser': ['.ts', '.tsx'],
31+
},
32+
},
33+
}

.github/ISSUE_TEMPLATE/bug_report.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve / BUG 反馈(提交前请搜索是否存在重复issues)
4-
title: "[BUG]"
4+
title: '[BUG]'
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Bug Description**
1110
Please provide a clear and concise description of what the bug is.
1211

1312
**Steps to Reproduce**
1413
Please provide the steps to reproduce the bug:
14+
1515
1. Go to "..."
1616
2. Click on "..."
1717
3. Scroll down to "..."
@@ -27,19 +27,21 @@ Please provide a clear and concise description of what actually happened.
2727
If possible, please add screenshots to help explain the issue.
2828

2929
**Desktop (please complete the following information):**
30-
- Operating System: [e.g. macOS]
31-
- Application Version: [e.g. 2.0.1]
30+
31+
- Operating System: [e.g. macOS]
32+
- Application Version: [e.g. 2.0.1]
3233

3334
**Additional Context**
3435
Please provide any additional context about the issue, such as interactions with other software or applications.
3536

36-
-------------------------------------
37+
---
3738

3839
**Bug 描述**
3940
清晰简洁地描述这个 bug 是什么。
4041

4142
**重现步骤**
4243
请提供能够让我们重现这个 bug 的步骤:
44+
4345
1. 前往 "......"
4446
2. 点击 "......"
4547
3. 滚动到 "......"
@@ -55,8 +57,9 @@ Please provide any additional context about the issue, such as interactions with
5557
如果可行,添加截图以帮助解释问题。
5658

5759
**桌面端(请填写以下信息):**
58-
- 操作系统:[例如 macOS]
59-
- 应用程序版本:[例如 2.0.1]
60+
61+
- 操作系统:[例如 macOS]
62+
- 应用程序版本:[例如 2.0.1]
6063

6164
**其他上下文**
6265
在这里提供关于问题的任何其他上下文,例如与其他软件或应用程序的交互等。

.github/ISSUE_TEMPLATE/custom.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
---
22
name: Custom issue template
33
about: Describe this issue template's purpose here. / 其他建设性意见与讨论
4-
title: "[Other]"
4+
title: '[Other]'
55
labels: ''
66
assignees: ''
7-
87
---
9-
10-

.github/ISSUE_TEMPLATE/feature_request.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project / 新功能新特性的想法(提交前请检查是否有重复 issues)
4-
title: "[Feature]"
4+
title: '[Feature]'
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Problem Description**
@@ -16,7 +15,7 @@ Please provide a clear and concise description of what you would like to see in
1615
**Additional Context**
1716
Please provide any additional context or information that would help better understanding your feature request, such as screenshots, examples, or use cases.
1817

19-
-----------------------
18+
---
2019

2120
**问题描述**
2221
请描述您遇到的问题或难题,以及为什么这使得使用软件变得困难或令人沮丧。

.github/workflows/publish.yml

+71-71
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
11
name: 'publish'
22
on:
3-
push:
4-
tags: [ v\d+\.\d+\.\d+ ]
3+
push:
4+
tags: [v\d+\.\d+\.\d+]
55

66
jobs:
7-
publish-tauri:
8-
permissions:
9-
contents: write
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
include:
14-
- target: aarch64-apple-darwin
15-
platform: macos-latest
16-
- target: x86_64-apple-darwin
17-
platform: macos-latest
18-
- target: x86_64-unknown-linux-gnu
19-
platform: ubuntu-20.04
20-
- target: x86_64-pc-windows-msvc
21-
platform: windows-latest
7+
publish-tauri:
8+
permissions:
9+
contents: write
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- target: aarch64-apple-darwin
15+
platform: macos-latest
16+
- target: x86_64-apple-darwin
17+
platform: macos-latest
18+
- target: x86_64-unknown-linux-gnu
19+
platform: ubuntu-20.04
20+
- target: x86_64-pc-windows-msvc
21+
platform: windows-latest
2222

23-
runs-on: ${{ matrix.platform }}
24-
steps:
25-
- uses: actions/checkout@v3
23+
runs-on: ${{ matrix.platform }}
24+
steps:
25+
- uses: actions/checkout@v3
2626

27-
- name: Get version
28-
id: get_version
29-
uses: battila7/get-version-action@v2
27+
- name: Get version
28+
id: get_version
29+
uses: battila7/get-version-action@v2
3030

31-
- name: setup node
32-
uses: actions/setup-node@v3
33-
with:
34-
node-version: 16
31+
- name: setup node
32+
uses: actions/setup-node@v3
33+
with:
34+
node-version: 16
3535

36-
- name: install Rust stable
37-
uses: dtolnay/rust-toolchain@stable
36+
- name: install Rust stable
37+
uses: dtolnay/rust-toolchain@stable
3838

39-
- name: Rust cache
40-
uses: swatinem/rust-cache@v2
41-
with:
42-
workspaces: './src-tauri -> target'
39+
- name: Rust cache
40+
uses: swatinem/rust-cache@v2
41+
with:
42+
workspaces: './src-tauri -> target'
4343

44-
- name: install dependencies (ubuntu only)
45-
if: matrix.platform == 'ubuntu-20.04'
46-
run: |
47-
sudo apt-get update
48-
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libx11-dev libxdo-dev libxcb-shape0-dev libxcb-xfixes0-dev
49-
- name: install dependencies (mac only)
50-
if: matrix.platform == 'macos-latest'
51-
run: |
52-
rustup target add aarch64-apple-darwin
53-
- uses: actions/cache@v2
54-
with:
55-
path: '**/node_modules'
56-
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
44+
- name: install dependencies (ubuntu only)
45+
if: matrix.platform == 'ubuntu-20.04'
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libx11-dev libxdo-dev libxcb-shape0-dev libxcb-xfixes0-dev
49+
- name: install dependencies (mac only)
50+
if: matrix.platform == 'macos-latest'
51+
run: |
52+
rustup target add aarch64-apple-darwin
53+
- uses: actions/cache@v2
54+
with:
55+
path: '**/node_modules'
56+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
5757

58-
- name: install frontend dependencies
59-
run: yarn install # change this to npm or pnpm depending on which one you use
58+
- name: install frontend dependencies
59+
run: yarn install # change this to npm or pnpm depending on which one you use
6060

61-
- name: Change Version
62-
env:
63-
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
64-
run: make change-version
61+
- name: Change Version
62+
env:
63+
VERSION: '${{ steps.get_version.outputs.version-without-v }}'
64+
run: make change-version
6565

66-
- name: Build Tauri App
67-
uses: tauri-apps/tauri-action@dev
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
70-
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
71-
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
72-
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
73-
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
74-
APPLE_ID: ${{ secrets.APPLE_ID }}
75-
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
76-
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
77-
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
78-
with:
79-
tagName: Chatbox-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
80-
releaseName: 'Chatbox v__VERSION__'
81-
releaseBody: 'See the assets to download this version and install.'
82-
releaseDraft: true
83-
prerelease: false
84-
args: --target ${{matrix.target}}
66+
- name: Build Tauri App
67+
uses: tauri-apps/tauri-action@dev
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
70+
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
71+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
72+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
73+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
74+
APPLE_ID: ${{ secrets.APPLE_ID }}
75+
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
76+
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
77+
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
78+
with:
79+
tagName: Chatbox-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
80+
releaseName: 'Chatbox v__VERSION__'
81+
releaseBody: 'See the assets to download this version and install.'
82+
releaseDraft: true
83+
prerelease: false
84+
args: --target ${{matrix.target}}

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github
2+
.webpack
3+
build
4+
src-tauri
5+
tmp

0 commit comments

Comments
 (0)