Skip to content

Commit 917d7c6

Browse files
committed
checkout v2
1 parent 1ea7cdf commit 917d7c6

File tree

155 files changed

+1103
-14789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1103
-14789
lines changed

.babelrc

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
{
22
"presets": [
3-
["latest", {
4-
"es2015": { "modules": false }
5-
}]
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
610
],
7-
"plugins": ["transform-object-rest-spread"]
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
12+
"env": {
13+
"test": {
14+
"presets": ["env", "stage-2"],
15+
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
16+
}
17+
}
818
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/build/
2+
/config/
3+
/dist/
4+
/*.js
5+
/test/unit/coverage/

.eslintrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// https://eslint.org/docs/user-guide/configuring
2+
3+
module.exports = {
4+
root: true,
5+
parser: 'babel-eslint',
6+
parserOptions: {
7+
sourceType: 'module'
8+
},
9+
env: {
10+
browser: true,
11+
},
12+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
13+
extends: 'standard',
14+
// required to lint *.vue files
15+
plugins: [
16+
'html'
17+
],
18+
// add your custom rules here
19+
rules: {
20+
// allow async-await
21+
'generator-star-spacing': 'off',
22+
// allow debugger during development
23+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
24+
}
25+
}

.gitignore

+14-99
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,17 @@
1-
# customary
2-
.tern-project
3-
requests/
4-
data/
5-
public/uploads
6-
dist/images/*
7-
dist/0.js*
8-
dist/1.js*
9-
dist/build.css*
10-
dist/build.js*
11-
dist/vendor.js*
12-
stats.json
13-
14-
# macOS
15-
16-
*.DS_Store
17-
.AppleDouble
18-
.LSOverride
19-
20-
# Icon must end with two \r
21-
Icon
22-
23-
24-
# Thumbnails
25-
._*
26-
27-
# Files that might appear in the root of a volume
28-
.DocumentRevisions-V100
29-
.fseventsd
30-
.Spotlight-V100
31-
.TemporaryItems
32-
.Trashes
33-
.VolumeIcon.icns
34-
.com.apple.timemachine.donotpresent
35-
36-
# Directories potentially created on remote AFP share
37-
.AppleDB
38-
.AppleDesktop
39-
Network Trash Folder
40-
Temporary Items
41-
.apdisk
42-
43-
44-
# Node
45-
# Logs
46-
logs
47-
*.log
1+
.DS_Store
2+
node_modules/
3+
/dist/
484
npm-debug.log*
495
yarn-debug.log*
506
yarn-error.log*
51-
52-
# Runtime data
53-
pids
54-
*.pid
55-
*.seed
56-
*.pid.lock
57-
58-
# Directory for instrumented libs generated by jscoverage/JSCover
59-
lib-cov
60-
61-
# Coverage directory used by tools like istanbul
62-
coverage
63-
64-
# nyc test coverage
65-
.nyc_output
66-
67-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
68-
.grunt
69-
70-
# Bower dependency directory (https://bower.io/)
71-
bower_components
72-
73-
# node-waf configuration
74-
.lock-wscript
75-
76-
# Compiled binary addons (http://nodejs.org/api/addons.html)
77-
build/Release
78-
79-
# Dependency directories
80-
node_modules/
81-
jspm_packages/
82-
83-
# Typescript v1 declaration files
84-
typings/
85-
86-
# Optional npm cache directory
87-
.npm
88-
89-
# Optional eslint cache
90-
.eslintcache
91-
92-
# Optional REPL history
93-
.node_repl_history
94-
95-
# Output of 'npm pack'
96-
*.tgz
97-
98-
# Yarn Integrity file
99-
.yarn-integrity
100-
101-
# dotenv environment variables file
102-
.env
7+
/test/unit/coverage/
8+
/test/e2e/reports/
9+
selenium-debug.log
10+
11+
# Editor directories and files
12+
.idea
13+
.vscode
14+
*.suo
15+
*.ntvs*
16+
*.njsproj
17+
*.sln

.postcssrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
"postcss-import": {},
6+
"postcss-url": {},
7+
// to edit target browsers: use "browserslist" field in package.json
8+
"autoprefixer": {}
9+
}
10+
}

LICENSE

-21
This file was deleted.

README.md

+21-31
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
1-
# PutongOJ-FE
1+
# project
22

3-
[Putong OJ](https://github.com/lazzzis/PutongOJ) 的前端部分
3+
> A Vue.js project
44
5-
[Preview](http://acm.cjlu.edu.cn)
5+
## Build Setup
66

7-
一个采用 vue, vue-router, vuex 而成的单页应用
7+
``` bash
8+
# install dependencies
9+
npm install
810

9-
# 主要组件的版本
10-
- Vue 2.3.2
11-
- vue-router 2.5.3
12-
- vuex 2.3.1
13-
- axios 0.16.1
11+
# serve with hot reload at localhost:8080
12+
npm run dev
1413

15-
# 项目结构
14+
# build for production with minification
15+
npm run build
1616

17-
```
18-
├── dist // 生成打包好的文件
19-
│   ├── fonts
20-
│   └── images
21-
└── src
22-
│ main.js // 项目入口
23-
│ router.js // 路由文件,说明了各个路由将会使用的组件
24-
25-
├── assets // 主要是 sass 文件,本项目的大部分 css 样式集中于此
26-
│   ├── bulma-0.4.1 // 本项目在 bulma 基础上做了一些自定义修改,bulma 项目地址 https://bulma.io
27-
│   └── utils
28-
├── components // 一些小组件
29-
├── store // vuex 文件
30-
│   └── modules // 子模块
31-
└── views // 路由对应的组件 (这些组件在 router.js 中都被引入)
32-
├── Admin
33-
├── Contest
34-
└── User
17+
# build for production and view the bundle analyzer report
18+
npm run build --report
3519

36-
```
20+
# run unit tests
21+
npm run unit
3722

38-
# TODO
23+
# run e2e tests
24+
npm run e2e
25+
26+
# run all tests
27+
npm test
28+
```
3929

40-
- [ ] 开发文档
30+
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

build/build.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict'
2+
require('./check-versions')()
3+
4+
process.env.NODE_ENV = 'production'
5+
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
13+
14+
const spinner = ora('building for production...')
15+
spinner.start()
16+
17+
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18+
if (err) throw err
19+
webpack(webpackConfig, (err, stats) => {
20+
spinner.stop()
21+
if (err) throw err
22+
process.stdout.write(stats.toString({
23+
colors: true,
24+
modules: false,
25+
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26+
chunks: false,
27+
chunkModules: false
28+
}) + '\n\n')
29+
30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
35+
console.log(chalk.cyan(' Build complete.\n'))
36+
console.log(chalk.yellow(
37+
' Tip: built files are meant to be served over an HTTP server.\n' +
38+
' Opening index.html over file:// won\'t work.\n'
39+
))
40+
})
41+
})

build/check-versions.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
'use strict'
2+
const chalk = require('chalk')
3+
const semver = require('semver')
4+
const packageConfig = require('../package.json')
5+
const shell = require('shelljs')
6+
7+
function exec (cmd) {
8+
return require('child_process').execSync(cmd).toString().trim()
9+
}
10+
11+
const versionRequirements = [
12+
{
13+
name: 'node',
14+
currentVersion: semver.clean(process.version),
15+
versionRequirement: packageConfig.engines.node
16+
}
17+
]
18+
19+
if (shell.which('npm')) {
20+
versionRequirements.push({
21+
name: 'npm',
22+
currentVersion: exec('npm --version'),
23+
versionRequirement: packageConfig.engines.npm
24+
})
25+
}
26+
27+
module.exports = function () {
28+
const warnings = []
29+
30+
for (let i = 0; i < versionRequirements.length; i++) {
31+
const mod = versionRequirements[i]
32+
33+
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34+
warnings.push(mod.name + ': ' +
35+
chalk.red(mod.currentVersion) + ' should be ' +
36+
chalk.green(mod.versionRequirement)
37+
)
38+
}
39+
}
40+
41+
if (warnings.length) {
42+
console.log('')
43+
console.log(chalk.yellow('To use this template, you must update following to modules:'))
44+
console.log()
45+
46+
for (let i = 0; i < warnings.length; i++) {
47+
const warning = warnings[i]
48+
console.log(' ' + warning)
49+
}
50+
51+
console.log()
52+
process.exit(1)
53+
}
54+
}

build/logo.png

6.69 KB
Loading

0 commit comments

Comments
 (0)