diff --git a/.gitignore b/.gitignore index 14bf7101..47ad7f2f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ dist vs out bin -.yarnrc +# .yarnrc b.bat *.pfx diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 00000000..b4a8ce4f --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +registry "https://registry.yarnpkg.com" diff --git a/README.md b/README.md index 068a9add..4112fd65 100644 --- a/README.md +++ b/README.md @@ -143,13 +143,18 @@ yarn run start ## 更新日志 [最新发布](https://github.com/purocean/yn/releases) -### [v2.3.8](https://github.com/purocean/yn/releases/tag/v2.3.8) 2020-09-01 -1. 增加开机自动启动功能 +### [v2.4.0](https://github.com/purocean/yn/releases/tag/v2.4.0) 2020-10-26 +1. Vue 框架升级到 3.0 +2. 升级 Electron 版本 +3. 升级前端依赖,更好的支持 Mermaid 图形
展开查看更多版本记录 -### [v2.3.8](https://github.com/purocean/yn/releases/tag/v2.3.7) 2020-08-03 +### [v2.3.8](https://github.com/purocean/yn/releases/tag/v2.3.8) 2020-09-01 +1. 增加开机自动启动功能 + +### [v2.3.7](https://github.com/purocean/yn/releases/tag/v2.3.7) 2020-08-03 1. 优化预览鼠标事件响应 ### [v2.3.6](https://github.com/purocean/yn/releases/tag/v2.3.6) 2020-06-30 diff --git a/frontend/.browserslistrc b/frontend/.browserslistrc index 9dee6464..214388fe 100644 --- a/frontend/.browserslistrc +++ b/frontend/.browserslistrc @@ -1,3 +1,3 @@ > 1% last 2 versions -not ie <= 8 +not dead diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 16be3646..9e01c2e2 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -3,16 +3,32 @@ module.exports = { env: { node: true }, - 'extends': [ - 'plugin:vue/essential', - '@vue/standard' + extends: [ + 'plugin:vue/vue3-essential', + '@vue/standard', + '@vue/typescript/recommended' ], - rules: { - 'comma-dangle': 'off', - 'no-console': 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' - }, parserOptions: { - parser: 'babel-eslint' - } + ecmaVersion: 2020 + }, + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/camelcase': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'comma-dangle': 'off', + }, + overrides: [ + { + files: [ + '**/__tests__/*.{j,t}s?(x)', + '**/tests/unit/**/*.spec.{j,t}s?(x)' + ], + env: { + mocha: true + } + } + ] } diff --git a/frontend/.gitignore b/frontend/.gitignore index a0dddc6f..403adbc1 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -2,6 +2,7 @@ node_modules /dist + # local env files .env.local .env.*.local @@ -10,6 +11,7 @@ node_modules npm-debug.log* yarn-debug.log* yarn-error.log* +pnpm-debug.log* # Editor directories and files .idea diff --git a/frontend/.yarnrc b/frontend/.yarnrc new file mode 100644 index 00000000..b4a8ce4f --- /dev/null +++ b/frontend/.yarnrc @@ -0,0 +1 @@ +registry "https://registry.yarnpkg.com" diff --git a/frontend/README.md b/frontend/README.md index e690f90a..a6ceac3f 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,4 +1,4 @@ -# frontend2 +# frontend-vue3 ## Project setup ``` @@ -7,22 +7,22 @@ yarn install ### Compiles and hot-reloads for development ``` -yarn run serve +yarn serve ``` ### Compiles and minifies for production ``` -yarn run build +yarn build ``` -### Run your tests +### Run your unit tests ``` -yarn run test +yarn test:unit ``` ### Lints and fixes files ``` -yarn run lint +yarn lint ``` ### Customize configuration diff --git a/frontend/babel.config.js b/frontend/babel.config.js index ba179669..e9558405 100644 --- a/frontend/babel.config.js +++ b/frontend/babel.config.js @@ -1,5 +1,5 @@ module.exports = { presets: [ - '@vue/app' + '@vue/cli-plugin-babel/preset' ] } diff --git a/frontend/package.json b/frontend/package.json index a6f0a3c9..9deb4e95 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,52 +1,77 @@ { - "name": "frontend", + "name": "yn-frontend", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", + "test:unit": "vue-cli-service test:unit", "lint": "vue-cli-service lint" }, "dependencies": { - "core-js": "^2.6.5", - "crypto-js": "^3.1.9-1", - "dayjs": "^1.8.12", - "echarts": "^4.2.1", - "github-markdown-css": "^3.0.1", - "highlight": "^0.2.4", - "highlight.js": "^9.15.6", + "core-js": "^3.6.5", + "crypto-js": "^4.0.0", + "dayjs": "^1.9.3", + "echarts": "^4.9.0", + "github-markdown-css": "^4.0.0", + "highlight.js": "^10.3.1", "katex": "^0.6.0", - "markdown-it": "^8.4.2", - "markdown-it-attrs": "^2.3.2", + "loadsh": "^0.0.4", + "markdown-it": "^12.0.1", + "markdown-it-attrs": "^3.0.3", "markdown-it-footnote": "^3.0.2", "markdown-it-katex": "^2.0.3", - "markdown-it-multimd-table": "^3.1.3", + "markdown-it-multimd-table": "^4.0.3", "markdown-it-task-lists": "^2.1.1", - "mermaid": "^8.2.6", - "mime-types": "^2.1.24", - "monaco-editor": "^0.17.1", + "mermaid": "^8.8.2", + "mime-types": "^2.1.27", + "mitt": "^2.1.0", + "monaco-editor": "^0.21.2", "normalize.css": "^8.0.1", - "socket.io-client": "^2.2.0", - "sortablejs": "^1.10.1", - "transliteration": "^2.1.3", - "turndown": "^5.0.3", - "vue": "^2.6.10", - "vue-awesome": "^3.5.4", - "vue-bus": "^1.2.1", - "vue-router": "^3.0.3", - "vuex": "^3.0.1", - "xterm": "^3.12.2" + "socket.io-client": "^2.3.1", + "sortablejs": "^1.12.0", + "transliteration": "^2.1.11", + "turndown": "^7.0.0", + "vue": "^3.0.0", + "vue-router": "^4.0.0-0", + "vuex": "^4.0.0-0", + "xterm": "^4.9.0", + "xterm-addon-fit": "^0.4.0" }, "devDependencies": { - "@vue/cli-plugin-babel": "^3.6.0", - "@vue/cli-plugin-eslint": "^3.6.0", - "@vue/cli-service": "^3.6.0", - "@vue/eslint-config-standard": "^4.0.0", - "babel-eslint": "^10.0.1", - "eslint": "^5.16.0", - "eslint-plugin-vue": "^5.0.0", - "less": "^3.0.4", - "less-loader": "^4.1.0", - "vue-template-compiler": "^2.5.21" + "@types/chai": "^4.2.11", + "@types/crypto-js": "^4.0.1", + "@types/echarts": "^4.8.3", + "@types/lodash": "^4.14.162", + "@types/markdown-it": "^10.0.2", + "@types/mermaid": "^8.2.1", + "@types/mime-types": "^2.1.0", + "@types/mocha": "^5.2.4", + "@types/socket.io-client": "^1.4.34", + "@types/sortablejs": "^1.10.6", + "@types/turndown": "^5.0.0", + "@typescript-eslint/eslint-plugin": "^2.33.0", + "@typescript-eslint/parser": "^2.33.0", + "@vue/cli-plugin-babel": "~4.5.0", + "@vue/cli-plugin-eslint": "~4.5.0", + "@vue/cli-plugin-router": "~4.5.0", + "@vue/cli-plugin-typescript": "~4.5.0", + "@vue/cli-plugin-unit-mocha": "~4.5.0", + "@vue/cli-plugin-vuex": "~4.5.0", + "@vue/cli-service": "~4.5.0", + "@vue/compiler-sfc": "^3.0.0", + "@vue/eslint-config-standard": "^5.1.2", + "@vue/eslint-config-typescript": "^5.0.2", + "@vue/test-utils": "^2.0.0-0", + "chai": "^4.1.2", + "eslint": "^6.7.2", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.0", + "eslint-plugin-vue": "^7.0.0-0", + "sass": "^1.26.5", + "sass-loader": "^8.0.2", + "typescript": "~3.9.3" } } diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js deleted file mode 100644 index 961986e2..00000000 --- a/frontend/postcss.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: { - autoprefixer: {} - } -} diff --git a/frontend/public/index.html b/frontend/public/index.html index 86dff2a2..204dc82b 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -2,7 +2,9 @@ + + Yank Note - - diff --git a/frontend/src/components/Tabs.vue b/frontend/src/components/Tabs.vue index 5371a0d3..fe4ed310 100644 --- a/frontend/src/components/Tabs.vue +++ b/frontend/src/components/Tabs.vue @@ -1,5 +1,5 @@ - diff --git a/frontend/src/components/Toast.vue b/frontend/src/components/Toast.vue index d63c5d1c..7d0a11c3 100644 --- a/frontend/src/components/Toast.vue +++ b/frontend/src/components/Toast.vue @@ -2,24 +2,33 @@
{{toast.content}}
-