init
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules
|
||||
.git
|
||||
.gitignore
|
||||
Dockerfile
|
10
.eslintrc.js
Normal file
@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
// This tells ESLint to load the config from the package `eslint-config-custom`
|
||||
extends: ["custom"],
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: ["apps/*/"],
|
||||
},
|
||||
},
|
||||
};
|
42
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: "publish"
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release
|
||||
|
||||
jobs:
|
||||
publish-tauri:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [macos-latest, ubuntu-latest, windows-latest]
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 16
|
||||
- name: install Rust stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
|
||||
- name: install app dependencies and build it
|
||||
run: yarn && yarn build
|
||||
- uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} # 密钥,需要提前配置在 Github Secrets中
|
||||
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_PRIVATE_KEY_PASSWORD }} # 密钥的加密文本,与ssh-keygen时输入的密码一致即可。 需要提前配置在 Github Secrets中
|
||||
with:
|
||||
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
|
||||
releaseName: "v__VERSION__"
|
||||
releaseBody: "See the assets to download this version and install."
|
||||
releaseDraft: true # 不需要 draft 的可以改成 false
|
||||
prerelease: false
|
36
.gitignore
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
node_modules
|
||||
.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
coverage
|
||||
|
||||
# next.js
|
||||
.next/
|
||||
out/
|
||||
build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# turbo
|
||||
.turbo
|
||||
|
||||
lib/
|
||||
out/
|
||||
build
|
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM node:16.13.0 as builder
|
||||
WORKDIR /app
|
||||
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
RUN yarn config set registry https://registry.npm.taobao.org -g
|
||||
RUN npm config set registry https://registry.npm.taobao.org
|
||||
COPY . .
|
||||
RUN yarn install && yarn build
|
||||
|
||||
FROM nginx:latest
|
||||
COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint2.sh
|
||||
COPY --from=builder /app/nginx.conf.template /
|
||||
COPY --from=builder /app/apps/web/build /usr/share/nginx/html
|
||||
ENTRYPOINT ["sh", "/docker-entrypoint2.sh"]
|
||||
CMD ["nginx","-g","daemon off;"]
|
6
Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
build:
|
||||
docker build -t tsdaodaoweb .
|
||||
deploy:
|
||||
docker build -t tsdaodaoweb .
|
||||
docker tag tsdaodaoweb registry.cn-shanghai.aliyuncs.com/wukongim/tsdaodaoweb:latest
|
||||
docker push registry.cn-shanghai.aliyuncs.com/wukongim/tsdaodaoweb:latest
|
77
README.md
Normal file
@ -0,0 +1,77 @@
|
||||
## 运行
|
||||
|
||||
1. yarn install
|
||||
|
||||
2. yarn dev
|
||||
|
||||
|
||||
## 发布镜像
|
||||
|
||||
修改api地址 packages/tsdaodaoweb/src/index.tsx 修改 WKApp.apiClient.config.apiURL = "/api/v1/"
|
||||
|
||||
|
||||
make deploy
|
||||
|
||||
|
||||
## PC端运行
|
||||
|
||||
tauri 环境安装 (https://tauri.app/v1/guides/getting-started/prerequisites)
|
||||
|
||||
#### 调试
|
||||
|
||||
yarn tauri dev
|
||||
|
||||
#### 打包
|
||||
|
||||
yarn tauri build
|
||||
(window打包的时候 要去掉package.json里的 build里的REACT_APP_VERSION=$npm_package_version 要不然执行yarn tauri build 会报错)
|
||||
(如果需要打包M1架构的包 需要安装 aarch64-apple-darwin(执行:rustup target add aarch64-apple-darwin))
|
||||
|
||||
yarn tauri build --target aarch64-apple-darwin (M1架构的包)
|
||||
|
||||
yarn tauri build --target universal-apple-darwin (通用架构,生成可在 Apple 芯片和基于 Intel 的 Mac 上运行的通用 macOS 二进制文件。)
|
||||
|
||||
|
||||
## 其他技巧
|
||||
|
||||
icon生成
|
||||
|
||||
```
|
||||
npx @tauri-apps/tauricon [ICON-PATH]
|
||||
```
|
||||
|
||||
准备一张1024x1024的icon 执行上面命令 即可生成各种尺寸的icon
|
||||
|
||||
```
|
||||
icon.icns = macOS
|
||||
icon.ico = MS Windows
|
||||
*.png = Linux
|
||||
```
|
||||
|
||||
**注意**
|
||||
|
||||
添加依赖
|
||||
|
||||
yarn workspace @tsdaodao/web add react-avatar-editor
|
||||
|
||||
|
||||
|
||||
## 使用Github Action 自动构建各端PC版本
|
||||
|
||||
需要先全局安装 @tauri-apps/cli
|
||||
yarn global add @tauri-apps/cli
|
||||
|
||||
tauri signer generate -w ~/.tauri/tsdaodao.key
|
||||
|
||||
上面 的命令会自动生成一个公钥、私钥对。公钥可以公开分享,私钥必须严密保存。
|
||||
|
||||
在Github Secrets中 配置 TAURI_PRIVATE_KEY 和 TAURI_PRIVATE_KEY_PASSWORD
|
||||
|
||||
|
||||
(参考:https://www.banyudu.com/posts/tauri-version-release-and-update-guide)
|
||||
|
||||
## 自动更新
|
||||
|
||||
1. 修改 tauri.conf.json 里的 updater.pubkey的内容(上面通过tauri signer generate 生成的公钥)
|
||||
|
||||
2. 修改 tauri.conf.json 里的 updater.endpoints 的内容为自己服务器的更新地址
|
64
apps/web/config-overrides.js
Normal file
@ -0,0 +1,64 @@
|
||||
var path = require('path')
|
||||
|
||||
const { override, babelInclude, addWebpackPlugin } = require('customize-cra')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
|
||||
// module.exports = override(
|
||||
// // 注意是production环境启动该plugin
|
||||
// process.env.NODE_ENV === 'production' && addWebpackPlugin(
|
||||
// new UglifyJsPlugin({
|
||||
// // 开启打包缓存
|
||||
// cache: true,
|
||||
// // 开启多线程打包
|
||||
// parallel: true,
|
||||
// uglifyOptions: {
|
||||
// // 删除警告
|
||||
// warnings: false,
|
||||
// // 压缩
|
||||
// compress: {
|
||||
// // 移除console
|
||||
// drop_console: true,
|
||||
// // 移除debugger
|
||||
// drop_debugger: true
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
// )
|
||||
|
||||
module.exports = function (config, env) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.devtool = false;
|
||||
}
|
||||
return Object.assign(
|
||||
config,
|
||||
override(
|
||||
// 判断环境变量ANALYZER参数的值
|
||||
process.env.ANALYZER && addWebpackPlugin(new BundleAnalyzerPlugin()),
|
||||
process.env.NODE_ENV === 'production' && addWebpackPlugin(
|
||||
new UglifyJsPlugin({
|
||||
cache: true,
|
||||
// 开启多线程打包
|
||||
parallel: true,
|
||||
uglifyOptions: {
|
||||
// 删除警告
|
||||
warnings: false,
|
||||
// 压缩
|
||||
compress: {
|
||||
// 移除console
|
||||
drop_console: true,
|
||||
// 移除debugger
|
||||
drop_debugger: true
|
||||
}
|
||||
},
|
||||
})
|
||||
),
|
||||
babelInclude([
|
||||
/* transpile (converting to es5) code in src/ and shared component library */
|
||||
path.resolve('src'),
|
||||
path.resolve('../../packages'),
|
||||
])
|
||||
)(config, env)
|
||||
)
|
||||
}
|
59
apps/web/package.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "@tsdaodao/web",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"homepage": "./",
|
||||
"dependencies": {
|
||||
"@tsdaodao/base": "*",
|
||||
"@tsdaodao/contacts": "*",
|
||||
"@tsdaodao/datasource": "*",
|
||||
"@tsdaodao/login": "*",
|
||||
"@tauri-apps/api": "1.1.0",
|
||||
"@types/react-mentions": "^4.1.5",
|
||||
"classnames": "^2.3.1",
|
||||
"react": "^17.0.2",
|
||||
"react-app-rewired": "^2.1.8",
|
||||
"react-mentions": "^4.3.1",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "1.1.0",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
"@testing-library/user-event": "^7.1.2",
|
||||
"@types/jest": "^24.0.0",
|
||||
"@types/node": "^12.0.0",
|
||||
"@types/react": "^16.9.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"customize-cra": "^1.0.0",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "4.0.3",
|
||||
"typescript": "~3.7.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "cross-env BROWSER=none REACT_APP_VERSION=$npm_package_version react-app-rewired start",
|
||||
"dev": "cross-env BROWSER=none REACT_APP_VERSION=$npm_package_version react-app-rewired start",
|
||||
"build": "cross-env REACT_APP_VERSION=$npm_package_version react-app-rewired build",
|
||||
"build:analyzer": "cross-env ANALYZER=true REACT_APP_VERSION=$npm_package_version react-app-rewired build",
|
||||
"test": "react-app-rewired test",
|
||||
"eject": "react-app-rewired eject",
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
BIN
apps/web/public/emoji/0_0.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_1.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_10.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
apps/web/public/emoji/0_100.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_101.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_102.png
Normal file
After Width: | Height: | Size: 1008 B |
BIN
apps/web/public/emoji/0_103.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
apps/web/public/emoji/0_104.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_105.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
apps/web/public/emoji/0_106.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
apps/web/public/emoji/0_107.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
apps/web/public/emoji/0_108.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
apps/web/public/emoji/0_109.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
apps/web/public/emoji/0_11.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
apps/web/public/emoji/0_110.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
apps/web/public/emoji/0_111.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
apps/web/public/emoji/0_112.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
apps/web/public/emoji/0_113.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
apps/web/public/emoji/0_114.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
apps/web/public/emoji/0_115.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/web/public/emoji/0_116.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
apps/web/public/emoji/0_117.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/web/public/emoji/0_118.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/web/public/emoji/0_119.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_12.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_120.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_121.png
Normal file
After Width: | Height: | Size: 887 B |
BIN
apps/web/public/emoji/0_122.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_123.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
apps/web/public/emoji/0_124.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
apps/web/public/emoji/0_125.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
apps/web/public/emoji/0_126.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
apps/web/public/emoji/0_127.png
Normal file
After Width: | Height: | Size: 786 B |
BIN
apps/web/public/emoji/0_128.png
Normal file
After Width: | Height: | Size: 838 B |
BIN
apps/web/public/emoji/0_129.png
Normal file
After Width: | Height: | Size: 814 B |
BIN
apps/web/public/emoji/0_13.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_130.png
Normal file
After Width: | Height: | Size: 728 B |
BIN
apps/web/public/emoji/0_131.png
Normal file
After Width: | Height: | Size: 877 B |
BIN
apps/web/public/emoji/0_132.png
Normal file
After Width: | Height: | Size: 986 B |
BIN
apps/web/public/emoji/0_133.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_134.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_135.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
apps/web/public/emoji/0_136.png
Normal file
After Width: | Height: | Size: 978 B |
BIN
apps/web/public/emoji/0_137.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
apps/web/public/emoji/0_138.png
Normal file
After Width: | Height: | Size: 944 B |
BIN
apps/web/public/emoji/0_139.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_14.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
apps/web/public/emoji/0_140.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
apps/web/public/emoji/0_141.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/web/public/emoji/0_142.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
apps/web/public/emoji/0_143.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/web/public/emoji/0_144.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_145.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_146.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
apps/web/public/emoji/0_147.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_148.png
Normal file
After Width: | Height: | Size: 1020 B |
BIN
apps/web/public/emoji/0_149.png
Normal file
After Width: | Height: | Size: 841 B |
BIN
apps/web/public/emoji/0_15.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_150.png
Normal file
After Width: | Height: | Size: 879 B |
BIN
apps/web/public/emoji/0_151.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_16.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
apps/web/public/emoji/0_17.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
apps/web/public/emoji/0_18.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
apps/web/public/emoji/0_19.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_2.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_20.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_21.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_22.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
apps/web/public/emoji/0_23.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_24.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
apps/web/public/emoji/0_25.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
apps/web/public/emoji/0_26.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
apps/web/public/emoji/0_27.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
apps/web/public/emoji/0_28.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
apps/web/public/emoji/0_29.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
apps/web/public/emoji/0_3.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
apps/web/public/emoji/0_30.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_31.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
apps/web/public/emoji/0_32.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
apps/web/public/emoji/0_33.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
apps/web/public/emoji/0_34.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_35.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_36.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
apps/web/public/emoji/0_37.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_38.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_39.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_4.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
apps/web/public/emoji/0_40.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_41.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
apps/web/public/emoji/0_42.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
apps/web/public/emoji/0_43.png
Normal file
After Width: | Height: | Size: 1.6 KiB |