Skip to content

Commit

Permalink
feat(ui): 准备添加 Vue 组件,通过 JSpider 载入来实现操作
Browse files Browse the repository at this point in the history
  • Loading branch information
KonghaYao committed Aug 3, 2021
1 parent 7f3a68c commit 1506de8
Show file tree
Hide file tree
Showing 18 changed files with 4,475 additions and 2 deletions.
4 changes: 2 additions & 2 deletions VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

- [x] JSpider 中的事件系统

- [ ] JSpider 需要实现 MVVM 模型来实现爬虫系统的可视化
- [x] JSpider 需要实现 MVVM 模型来实现爬虫系统的可视化

- 重构所有的核心代码

Expand All @@ -23,6 +23,6 @@
- [x] Control Panel 重试功能(非流内自动重试)

- 重构 plugins
- [ ] plugins 分包导入
- [x] plugins 分包导入

> 因为是 3.2 版本才更新这个文件,所以以前的版本都丢失了。
6 changes: 6 additions & 0 deletions package/jspider-ui/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["env", { "modules": false }],
"stage-3"
]
}
15 changes: 15 additions & 0 deletions package/jspider-ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# /.editorconfig

root = true

[*]

indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
32 changes: 32 additions & 0 deletions package/jspider-ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
commonjs: true,
},
plugins: ['prettier'],
extends: ['eslint:recommended', 'prettier', 'google'],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
requireConfigFile: false,
},
rules: {
'prettier/prettier': ['error'],
'no-console': 0,
'no-prototype-builtins': 0, // 不调用 object 本身的属性
'no-useless-escape': 0, // 正则表达式转义的时候的一个错误
'require-jsdoc': 0,
'new-cap': 0, // 函数首字母不能大写
indent: 0, // prettier 已经处理好了
'object-curly-spacing': 0, // prettier 自动格式化这个部分
'max-len': ['error', 120],
'operator-linebreak': ['error', 'before'],
'quote-props': ['error', 'as-needed'],
'operator-linebreak': 0,
'no-unused-vars': 1,
'space-before-function-paren': 0, // 交由 prettier 管理
},
};
12 changes: 12 additions & 0 deletions package/jspider-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.DS_Store
node_modules/
dist/
npm-debug.log
yarn-error.log

# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
10 changes: 10 additions & 0 deletions package/jspider-ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"endOfLine": "auto",
"singleQuote": true,
"semi": true,
"trailingComma": "all",
"bracketSpacing": true
}
Empty file added package/jspider-ui/LICENSE
Empty file.
18 changes: 18 additions & 0 deletions package/jspider-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# jspider-ui

> A Vue.js project
## Build Setup

```bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build
```

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
35 changes: 35 additions & 0 deletions package/jspider-ui/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>jspider-vue</title>
</head>

<body>
<div id="app">
<js-spider></js-spider>
</div>

</body>
<script src="./lib/vue.min.js"></script>
<script type='module'>
import App from './dist/jspider-user-interface.js'
import Mock from './lib/mock.esm.js'
const Mirror = Mock.mock({
"tasks|10": [{

}]
})
new Vue({
el: '#app',
components: {
"js-spider": App
},
data: {
views: Mirror
}
})
</script>

</html>
51 changes: 51 additions & 0 deletions package/jspider-ui/lib/mock.esm.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions package/jspider-ui/lib/vue.min.js

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions package/jspider-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@js-spider/user-interface",
"description": "A Vue.js project",
"version": "1.0.0",
"author": "KonghaYao <20192831006@m.scnu.edu.cn>",
"license": "MIT",
"private": true,
"main": "dist/jspider-user-interface.js",
"scripts": {
"dev": "rollup --config rollup.config.dev.js -w",
"build": "rollup --config rollup.config.build.js"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.0.0",
"@rollup/plugin-node-resolve": "^13.0.2",
"@rollup/plugin-replace": "^2.4.2",
"postcss": "^8.3.5",
"rollup": "^2.53.2",
"rollup-plugin-delete": "^2.0.0",
"rollup-plugin-license": "^2.4.0",
"rollup-plugin-livereload": "^2.0.5",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "5.1.9",
"vue-template-compiler": "^2.6.14"
}
}
Loading

0 comments on commit 1506de8

Please sign in to comment.