-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
songruigang
committed
Aug 1, 2017
0 parents
commit 759e135
Showing
18 changed files
with
332 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["env"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
coverage | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "standard", | ||
"plugins": [ "html" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
coverage | ||
lib | ||
*.log | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
src | ||
test | ||
build | ||
docs | ||
test | ||
.babelrc | ||
.eslintignore | ||
.eslintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sass_binary_site=http://npm.sankuai.com/dist/node-sass | ||
profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/ | ||
fse_binary_host_mirror=https://npm.taobao.org/mirrors/fsevents/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"generator-vue-component-template": { | ||
"promptValues": { | ||
"authorName": "relign", | ||
"authorEmail": "songruigang0803@163.com" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# image-view | ||
|
||
> vue | ||
<div style="text-align:center"> | ||
</div> | ||
|
||
### Development Setup | ||
|
||
```bash | ||
# install dependencies | ||
$ npm install | ||
|
||
# dev mode | ||
$ npm run dev | ||
|
||
# test | ||
$ npm run test | ||
|
||
# build | ||
$ npm run build | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template lang="pug"> | ||
.docs | ||
hello-world(emoji="🤔") | ||
h3 Usage | ||
pre | ||
code(v-text="sourcecode") | ||
</template> | ||
|
||
<script> | ||
import HelloWorld from '../src/HelloWorld.vue' | ||
export default { | ||
name: 'App', | ||
components: { HelloWorld }, | ||
data () { | ||
return { sourcecode: 'hello-world(emoji="🤔")' } | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.docs { | ||
width: 50%; | ||
margin: auto; | ||
padding: 10px; | ||
} | ||
code { | ||
margin-top: 20px; | ||
padding: 10px; | ||
border-radius: 5px; | ||
background: #3d3d3d; | ||
color: #f3f3fe; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
|
||
new Vue({ // eslint-disable-line no-new | ||
el: '#app', | ||
render: h => h(App) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title> Docs | image-view</title> | ||
<link rel="icon" href="favicon.ico" type="image/x-icon"> | ||
<style> | ||
html { | ||
text-align: center; | ||
font-family: courier; | ||
color: #62B486; | ||
background: #f3f3f3; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>image-view</h1> | ||
<main id="app"></main> | ||
</body> | ||
|
||
<script src='docs/build/docs.js'></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "image-upload-view", | ||
"version": "0.0.1", | ||
"description": "vue", | ||
"main": "dist/image-view.min.js", | ||
"author": { | ||
"name": "relign", | ||
"email": "songruigang0803@163.com" | ||
}, | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", | ||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules", | ||
"start": "serve --single" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.1.21", | ||
"babel-loader": "^6.1.0", | ||
"babel-preset-env": "^1.6.0", | ||
"cross-env": "^3.0.0", | ||
"css-loader": "^0.25.0", | ||
"eslint": "^4.2.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-loader": "^1.9.0", | ||
"eslint-plugin-html": "^3.0.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-node": "^5.1.0", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"file-loader": "^0.9.0", | ||
"node-sass": "^3.4.1", | ||
"pug": "^2.0.0-beta6", | ||
"sass-loader": "^3.1.1", | ||
"vue": "^2.4.0", | ||
"vue-loader": "^12.1.0", | ||
"vue-template-compiler": "^2.3.3", | ||
"webpack": "^2.7.0", | ||
"webpack-dev-server": "^2.4.5" | ||
}, | ||
"pre-commit": [ | ||
"eslint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template lang="pug"> | ||
div | ||
h2 Hello World! | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import HelloWorld from './HelloWorld.vue' | ||
export default HelloWorld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* global describe before it */ | ||
|
||
const path = require('path') | ||
const assert = require('yeoman-assert') | ||
const helpers = require('yeoman-test') | ||
|
||
describe('generator-vue-component:app', () => { | ||
before(() => | ||
helpers.run(path.join(__dirname, '../generators/app')) | ||
.withPrompts({ someAnswer: true }).toPromise() | ||
) | ||
|
||
it('creates files', () => { | ||
assert.file([ | ||
'src/HelloWorld.vue', | ||
'src/index.js', | ||
'src/assets/vue.png', | ||
'.babelrc', | ||
'.editorconfig', | ||
'.eslintignore', | ||
'.eslintrc', | ||
'.gitignore', | ||
'.npmignore', | ||
'LICENSE', | ||
'index.html', | ||
'favicon.ico', | ||
'package.json', | ||
'README.md', | ||
'docs/App.vue', | ||
'docs/main.js', | ||
'webpack.config.js' | ||
]) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
entry: './docs/main.js', | ||
|
||
output: { | ||
path: path.resolve(__dirname, './docs/build'), | ||
publicPath: 'docs/build/', | ||
filename: 'docs.js' | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(js|vue)$/, | ||
loader: 'eslint-loader', | ||
enforce: 'pre', | ||
include: [path.resolve(__dirname, './src')] | ||
}, | ||
{ | ||
test: /\.vue$/, | ||
loader: 'vue-loader', | ||
options: { | ||
loaders: { | ||
'scss': 'vue-style-loader!css-loader!sass-loader', | ||
'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' | ||
} | ||
} | ||
}, | ||
{ | ||
test: /\.js$/, | ||
loader: 'babel-loader', | ||
exclude: /node_modules/ | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif|svg)$/, | ||
loader: 'file-loader', | ||
options: { | ||
name: '[name].[ext]?[hash]' | ||
} | ||
} | ||
] | ||
}, | ||
resolve: { | ||
alias: { | ||
'vue$': 'vue/dist/vue.esm.js' | ||
} | ||
}, | ||
devServer: { | ||
historyApiFallback: true, | ||
noInfo: false | ||
}, | ||
performance: { | ||
hints: false | ||
}, | ||
devtool: '#eval-source-map' | ||
} | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports.entry = './src/index.js' | ||
|
||
module.exports.output = { | ||
path: path.resolve(__dirname, './dist'), | ||
publicPath: 'dist/', | ||
filename: 'image-view.min.js', | ||
libraryTarget: 'umd' | ||
} | ||
|
||
module.exports.devtool = '#source-map' | ||
module.exports.plugins = (module.exports.plugins || []).concat([ | ||
new webpack.DefinePlugin({ | ||
'process.env': { | ||
NODE_ENV: '"production"' | ||
} | ||
}), | ||
new webpack.optimize.UglifyJsPlugin({ | ||
sourceMap: true, | ||
compress: { | ||
warnings: false | ||
} | ||
}), | ||
new webpack.LoaderOptionsPlugin({ | ||
minimize: true | ||
}) | ||
]) | ||
} |