Skip to content

Commit

Permalink
refactor: restructure project
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin-Huang committed Aug 9, 2023
1 parent 28ac12e commit bc2d93e
Show file tree
Hide file tree
Showing 64 changed files with 21,743 additions and 2,711 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.github
.webpack
build
src-tauri
tmp

*.js
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],

// plugins: ['@typescript-eslint'],
rules: {
// A temporary hack related to IDE not resolving correct package.json
'import/no-extraneous-dependencies': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-import-module-exports': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-extra-semi': 'off',
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
// project: './tsconfig.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
}
17 changes: 10 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve / BUG 反馈(提交前请搜索是否存在重复issues)
title: "[BUG]"
title: '[BUG]'
labels: ''
assignees: ''

---

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

**Steps to Reproduce**
Please provide the steps to reproduce the bug:

1. Go to "..."
2. Click on "..."
3. Scroll down to "..."
Expand All @@ -27,19 +27,21 @@ Please provide a clear and concise description of what actually happened.
If possible, please add screenshots to help explain the issue.

**Desktop (please complete the following information):**
- Operating System: [e.g. macOS]
- Application Version: [e.g. 2.0.1]

- Operating System: [e.g. macOS]
- Application Version: [e.g. 2.0.1]

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

-------------------------------------
---

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

**重现步骤**
请提供能够让我们重现这个 bug 的步骤:

1. 前往 "......"
2. 点击 "......"
3. 滚动到 "......"
Expand All @@ -55,8 +57,9 @@ Please provide any additional context about the issue, such as interactions with
如果可行,添加截图以帮助解释问题。

**桌面端(请填写以下信息):**
- 操作系统:[例如 macOS]
- 应用程序版本:[例如 2.0.1]

- 操作系统:[例如 macOS]
- 应用程序版本:[例如 2.0.1]

**其他上下文**
在这里提供关于问题的任何其他上下文,例如与其他软件或应用程序的交互等。
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---
name: Custom issue template
about: Describe this issue template's purpose here. / 其他建设性意见与讨论
title: "[Other]"
title: '[Other]'
labels: ''
assignees: ''

---


5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project / 新功能新特性的想法(提交前请检查是否有重复 issues)
title: "[Feature]"
title: '[Feature]'
labels: ''
assignees: ''

---

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

-----------------------
---

**问题描述**
请描述您遇到的问题或难题,以及为什么这使得使用软件变得困难或令人沮丧。
Expand Down
142 changes: 71 additions & 71 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
name: 'publish'
on:
push:
tags: [ v\d+\.\d+\.\d+ ]
push:
tags: [v\d+\.\d+\.\d+]

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
platform: macos-latest
- target: x86_64-apple-darwin
platform: macos-latest
- target: x86_64-unknown-linux-gnu
platform: ubuntu-20.04
- target: x86_64-pc-windows-msvc
platform: windows-latest
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
platform: macos-latest
- target: x86_64-apple-darwin
platform: macos-latest
- target: x86_64-unknown-linux-gnu
platform: ubuntu-20.04
- target: x86_64-pc-windows-msvc
platform: windows-latest

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3

- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Get version
id: get_version
uses: battila7/get-version-action@v2

- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
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
- name: install dependencies (mac only)
if: matrix.platform == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
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
- name: install dependencies (mac only)
if: matrix.platform == 'macos-latest'
run: |
rustup target add aarch64-apple-darwin
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}

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

- name: Change Version
env:
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
run: make change-version
- name: Change Version
env:
VERSION: '${{ steps.get_version.outputs.version-without-v }}'
run: make change-version

- name: Build Tauri App
uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: Chatbox-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'Chatbox v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: --target ${{matrix.target}}
- name: Build Tauri App
uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: Chatbox-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'Chatbox v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: --target ${{matrix.target}}
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.webpack
build
src-tauri
tmp
Loading

0 comments on commit bc2d93e

Please sign in to comment.