Browse Source

Merge branch 'master' into master

visuddhinanda 5 years ago
parent
commit
f8233ae792

+ 2 - 2
.gitignore

@@ -1,5 +1,5 @@
 /user
 /dicttext/system/*.db
 /dicttext/rich/*.db
-font
-appdata
+/font
+/appdata

+ 11 - 0
.vscode/settings.json

@@ -0,0 +1,11 @@
+{
+    "files.autoSave": "onFocusChange",
+    "workbench.iconTheme": "vscode-icons",
+    "workbench.colorTheme": "One Dark Pro",
+    "editor.formatOnSave": true,
+    "editor.fontFamily": "source code pro",
+    "editor.mouseWheelZoom": true,
+    "editor.codeActionsOnSave": {
+        "source.fixAll.eslint": true
+    }
+}

+ 5 - 0
Cargo.lock

@@ -0,0 +1,5 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "mint"
+version = "0.1.0"

+ 17 - 0
Cargo.toml

@@ -0,0 +1,17 @@
+[package]
+name = "mint"
+version = "0.1.0"
+authors = ["Jeremy Zheng <jitang.zheng@gmail.com>"]
+edition = "2018"
+description = "A totaly rewrite of PCD-Suite(by rust & react)."
+homepage = "https://github.com/iapt-platform/mint"
+license = "MIT"
+readme = "README.md"
+
+[profile.release]
+lto = true
+
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]

+ 67 - 2
README.md

@@ -1,2 +1,67 @@
-# mint
-rewrite of PCD
+# [PCD-Suite](https://github.com/iapt-platform/PCD-Suite)的 Rust&React 重写版
+
+## 开发
+
+### 工具
+
+推荐使用 **VSCode**, 常用插件列表
+
+- [ESLint](https://github.com/Microsoft/vscode-eslint)
+- [Rust(rls)](https://github.com/rust-lang/rls-vscode)
+- [Icons](https://github.com/vscode-icons/vscode-icons)
+- [OneDark Pro](https://github.com/Binaryify/OneDark-Pro)
+- [Better Toml](https://github.com/bungcip/better-toml)
+- [Prettier - Code formatter](https://github.com/prettier/prettier-vscode)
+- [SQL Formatter](https://github.com/kufii/vscode-sql-formatter)
+
+### Git commit message 规范
+
+- 遵循 git pull request 流程
+- 所有代码必须经过格式化
+- 禁止提交测试中间数据、key、db 等文件
+- Git commit message 格式
+  - 每条 message 不超过一行
+  - 每个 commit 应该是独立的一个 issue 任务
+  - message 格式 `:code: message body`
+  - code 定义
+    - bug fix: `:bug:`
+    - new feature: `:construction:`
+    - document: `:pencil:`
+    - ops: `:rocket:`
+    - config file: `:wrench:`
+    - test case: `::white_check_mark:`
+
+### 资源格式
+
+- 文字统一使用**markdown**格式
+- 图片
+  - 尽量使用**png**格式
+  - 如果是 svg 或 graphiz 绘图,**附带源代码**
+  - **禁止**使用未经授权的图片
+
+## 部署
+
+```bash
+$ ssh-copy-id deploy@xxx.xxx.xxx.xxx
+$ RUST_LOG=info axis -i staging -r deploy
+```
+
+## 文档
+
+### 后端
+
+- [MinIO is a high performance object storage server compatible with Amazon S3 APIs](https://github.com/minio/minio)
+- [Diesel: A safe, extensible ORM and Query Builder for Rust](https://github.com/diesel-rs/diesel)
+- [Actix web is a small, pragmatic, and extremely fast rust web framework](https://github.com/actix/actix-web)
+
+### 前端
+
+- [Pluggable enterprise-level react application framework](https://umijs.org/)
+- [Ant Desigh Pro](https://pro.ant.design/docs/getting-started)
+- [Third-Party Libraries](https://ant.design/docs/react/recommendation)
+
+### Git
+
+- [About git pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
+- [how to write a git commit message:](https://chris.beams.io/posts/git-commit/)
+- [An emoji guide for your commit messages](https://gitmoji.carloscuesta.me/)

+ 16 - 0
dashboard/.editorconfig

@@ -0,0 +1,16 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[Makefile]
+indent_style = tab

+ 9 - 0
dashboard/.gitignore

@@ -0,0 +1,9 @@
+# dependencies
+/node_modules/
+/yarn.lock
+
+# production
+/dist/
+
+# umi
+/src/.umi

+ 8 - 0
dashboard/.prettierignore

@@ -0,0 +1,8 @@
+**/*.md
+**/*.svg
+**/*.ejs
+**/*.html
+package.json
+.umi
+.umi-production
+.umi-test

+ 11 - 0
dashboard/.prettierrc

@@ -0,0 +1,11 @@
+{
+  "singleQuote": true,
+  "trailingComma": "all",
+  "printWidth": 80,
+  "overrides": [
+    {
+      "files": ".prettierrc",
+      "options": { "parser": "json" }
+    }
+  ]
+}

+ 10 - 0
dashboard/.umirc.ts

@@ -0,0 +1,10 @@
+import { defineConfig } from 'umi';
+
+export default defineConfig({
+  nodeModulesTransform: {
+    type: 'none',
+  },
+  routes: [
+    { path: '/', component: '@/pages/index' },
+  ],
+});

+ 0 - 0
dashboard/mock/.gitkeep


+ 32 - 0
dashboard/package.json

@@ -0,0 +1,32 @@
+{
+  "private": true,
+  "scripts": {
+    "start": "umi dev",
+    "build": "umi build",
+    "postinstall": "umi generate tmp",
+    "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
+    "test": "umi-test",
+    "test:coverage": "umi-test --coverage"
+  },
+  "gitHooks": {
+    "pre-commit": "lint-staged"
+  },
+  "lint-staged": {
+    "*.{js,jsx,less,md,json}": [
+      "prettier --write"
+    ],
+    "*.ts?(x)": [
+      "prettier --parser=typescript --write"
+    ]
+  },
+  "dependencies": {
+    "@umijs/preset-react": "1.x",
+    "@umijs/test": "^3.2.3",
+    "lint-staged": "^10.0.7",
+    "prettier": "^1.19.1",
+    "react": "^16.12.0",
+    "react-dom": "^16.12.0",
+    "umi": "^3.2.3",
+    "yorkie": "^2.0.0"
+  }
+}

+ 7 - 0
dashboard/src/pages/index.less

@@ -0,0 +1,7 @@
+
+.normal {
+}
+
+.title {
+  background: rgb(121, 242, 157);
+}

+ 10 - 0
dashboard/src/pages/index.tsx

@@ -0,0 +1,10 @@
+import React from 'react';
+import styles from './index.less';
+
+export default () => {
+  return (
+    <div>
+      <h1 className={styles.title}>Page index</h1>
+    </div>
+  );
+}

+ 25 - 0
dashboard/tsconfig.json

@@ -0,0 +1,25 @@
+{
+  "compilerOptions": {
+    "target": "esnext",
+    "module": "esnext",
+    "moduleResolution": "node",
+    "importHelpers": true,
+    "jsx": "react",
+    "esModuleInterop": true,
+    "sourceMap": true,
+    "baseUrl": "./",
+    "strict": true,
+    "paths": {
+      "@/*": ["src/*"],
+      "@@/*": ["src/.umi/*"]
+    },
+    "allowSyntheticDefaultImports": true
+  },
+  "include": [
+    "mock/**/*",
+    "src/**/*",
+    "config/**/*",
+    ".umirc.ts",
+    "typings.d.ts"
+  ]
+}

+ 8 - 0
dashboard/typings.d.ts

@@ -0,0 +1,8 @@
+declare module '*.css';
+declare module '*.less';
+declare module "*.png";
+declare module '*.svg' {
+  export function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement
+  const url: string
+  export default url
+}

+ 3 - 0
src/main.rs

@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}