Skip to content

Commit fb51e9e

Browse files
author
surmon
committed
Update to v4.0.0
1 parent b23bbdc commit fb51e9e

Some content is hidden

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

43 files changed

+1468
-11657
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,11 @@
1-
### 中文用户请注意:
21

3-
1. issue 只接受带重现的 bug 报告,请不要用来提问题!不符合要求的 issue 会被直接关闭。
4-
2. 请尽量用英文描述你的 issue,这样能够让尽可能多的人帮到你。
5-
6-
### Got a question?
2+
### 中文用户注意:
73

8-
- The issue list of this repo is **exclusively** for bug reports and feature requests. For simple questions, please use the following resources:
9-
10-
- Read the docs: https://vuejs.org/guide/
11-
- Look for/ask questions on stack overflow: https://stackoverflow.com/questions/ask?tags=vue.js
12-
13-
### Reporting a bug?
14-
15-
- Try to search for your issue, it may have already been answered or even fixed in the development branch.
16-
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
17-
18-
- It is recommended that you make a JSFiddle/JSBin/Codepen to demonstrate your issue. You could start with [this template](https://jsfiddle.net/39epgLj0/) that already includes the latest version of Vue.
19-
20-
- For potential SSR (Server Side Rendering) issue or bugs that involves build setups, you can create a reproduction repository with steps in the README.
21-
22-
- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
23-
24-
### Have a feature request?
25-
26-
- Remove the template from below and provide thoughtful commentary *and code samples* on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric.
4+
1. 尽量用英文描述你的 issue
5+
2. 不要把内容堆彻在标题上,逻辑清晰地写在内容区
6+
3. 贴代码要提前格式化好,有颜色高亮那种,贴文本,不要贴图片
7+
4. 提问题前,必须仔细阅读 REMADE.md + 在已关闭的问题中寻找与自身相关的问题,90% 的可能它已经被解决
8+
5. **如果无法做到提一个合格、优秀的问题,则问题会被 close + block**
279

2810
### BUG REPORT TEMPLATE
2911

@@ -35,6 +17,6 @@
3517

3618
#### Steps to reproduce
3719

38-
#### What is Expected?
20+
#### What is Expected?
3921

4022
#### What is actually happening?

.gitignore

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# Logs
22
logs
33
*.log
4+
npm-debug.log
5+
selenium-debug.log
46
npm-debug.log*
57

6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
8+
# System
9+
.DS_Store
1010

11-
*.DS_Store
11+
# Optional npm cache directory
12+
.npm
1213

13-
# Directory for instrumented libs generated by jscoverage/JSCover
14-
lib-cov
14+
# Optional REPL history
15+
.node_repl_history
1516

16-
# Coverage directory used by tools like istanbul
17-
coverage
17+
# Project
18+
.editorconfig
1819

1920
# nyc test coverage
2021
.nyc_output
@@ -25,15 +26,28 @@ coverage
2526
# node-waf configuration
2627
.lock-wscript
2728

29+
# Runtime data
30+
pids
31+
*.pid
32+
*.seed
33+
34+
# Package
35+
package-lock.json
36+
37+
# Test
38+
test/unit/coverage
39+
test/e2e/reports
40+
41+
# Directory for instrumented libs generated by jscoverage/JSCover
42+
lib-cov
43+
44+
# Coverage directory used by tools like istanbul
45+
coverage
46+
2847
# Compiled binary addons (http://nodejs.org/api/addons.html)
2948
build/Release
3049

3150
# Dependency directories
3251
node_modules
52+
node_modules/
3353
jspm_packages
34-
35-
# Optional npm cache directory
36-
.npm
37-
38-
# Optional REPL history
39-
.node_repl_history

.npmignore

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1-
# Dependency directories
1+
.github
2+
.DS_Store
3+
.babelrc
4+
.editorconfig
5+
.eslintrc.js
6+
.eslintignore
7+
.gitignore
8+
.travis.yml
9+
10+
test/
11+
test/unit/coverage
12+
test/e2e/reports
13+
14+
gh-pages/
15+
static/
16+
build/
17+
config/
218
node_modules
19+
node_modules/
20+
npm-debug.log
321
examples
22+
23+
index.html
24+
config.js
25+
bower.json
26+
package-lock.json
27+
selenium-debug.log

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
## CHANGELOG
3+
4+
### v4.0.0
5+
6+
- fix import es module bug
7+
- add test script
8+
- assign options to ssr.js
9+
- add global default events
10+
- update the options assign logic
11+
- add global default options
12+
- update `editor` to `codemirror`
13+
14+
#### project
15+
- add brower support
16+
- add test scripts
17+
- update babel and webpack configs
18+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Simon Babay
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

bower.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "vue-codemirror",
3+
"description": "CodeMirror component for Vue",
4+
"main": "./dist/vue-codemirror.js",
5+
"author": {
6+
"name": "Surmon",
7+
"email": "surmon@foxmail.com",
8+
"url": "http://surmon.me"
9+
},
10+
"license": "MIT",
11+
"keywords": [
12+
"vue-codemirror",
13+
"vue codemirror",
14+
"codemirror",
15+
"vue"
16+
],
17+
"homepage": "https://surmon-china.github.io/vue-codemirror",
18+
"moduleType": [],
19+
"ignore": [
20+
"**/.*",
21+
"node_modules",
22+
"bower_components",
23+
"test",
24+
"tests"
25+
]
26+
}

config/base.conf.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
const path = require('path')
3+
const webpack = require('webpack')
4+
5+
const resolve = dir => path.join(__dirname, '..', dir)
6+
7+
const env = process.env.NODE_ENV === 'testing'
8+
? { NODE_ENV: '"testing"' }
9+
: { NODE_ENV: '"production"' }
10+
11+
module.exports = {
12+
module: {
13+
rules: [
14+
{
15+
test: /\.(js|vue)$/,
16+
loader: 'eslint-loader',
17+
enforce: 'pre',
18+
include: [resolve('src'), resolve('test')],
19+
options: {
20+
formatter: require('eslint-friendly-formatter')
21+
}
22+
},
23+
{
24+
test: /\.vue$/,
25+
loader: 'vue-loader',
26+
options: {}
27+
},
28+
{
29+
test: /\.js$/,
30+
loader: 'babel-loader',
31+
include: [resolve('src'), resolve('test')]
32+
}
33+
]
34+
},
35+
plugins: [
36+
new webpack.DefinePlugin({
37+
'process.env': env
38+
}),
39+
new webpack.optimize.UglifyJsPlugin({
40+
compress: { warnings: false }
41+
})
42+
]
43+
}

config/build.conf.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
const path = require('path')
3+
const merge = require('webpack-merge')
4+
const baseConfig = require('./base.conf')
5+
6+
const resolve = dir => path.join(__dirname, '..', dir)
7+
8+
module.exports = merge(baseConfig, {
9+
entry: {
10+
'vue-codemirror': './src/index.js'
11+
},
12+
externals: {
13+
codemirror: 'codemirror'
14+
},
15+
output: {
16+
path: path.resolve(__dirname, '../dist'),
17+
publicPath: '/',
18+
filename: '[name].js',
19+
library: 'VueCodemirror',
20+
libraryTarget: 'umd'
21+
},
22+
devtool: '#source-map',
23+
resolve: {
24+
extensions: ['.js', '.vue', '.json'],
25+
modules: [
26+
resolve('src'),
27+
resolve('node_modules')
28+
],
29+
alias: {
30+
'codemirror': 'codemirror/lib/codemirror.js',
31+
}
32+
}
33+
})

config/test.conf.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This is the webpack config used for unit tests.
2+
3+
const merge = require('webpack-merge')
4+
const baseConfig = require('./base.conf')
5+
6+
module.exports = merge(baseConfig, {
7+
// use inline sourcemap for karma-sourcemap-loader
8+
devtool: '#inline-source-map'
9+
})
10+

0 commit comments

Comments
 (0)