Skip to content

Commit 29c7804

Browse files
committed
first-commit
1 parent c1b7897 commit 29c7804

Some content is hidden

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

104 files changed

+6627
-34
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": ["es2015", "stage-2"],
3+
"plugins": ["transform-runtime"],
4+
"comments": false
5+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
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

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
root: true,
3+
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
4+
extends: 'standard',
5+
// required to lint *.vue files
6+
plugins: [
7+
'html'
8+
],
9+
// add your custom rules here
10+
'rules': {
11+
// allow paren-less arrow functions
12+
'arrow-parens': 0,
13+
'no-multiple-empty-lines':0,
14+
'comma-spacing':[0, { "before": false, "after": true }],
15+
"comma-style": [0, "last"],
16+
"indent": [0, 0, { "SwitchCase": 0 }],
17+
"key-spacing": [0, { "beforeColon": false, "afterColon": true }],
18+
"space-before-function-paren": [0, "always"],
19+
"space-before-blocks": [0, "always"],
20+
"no-trailing-spaces":0,
21+
// allow debugger during development
22+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
23+
}
24+
}

.gitignore

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18-
.grunt
19-
20-
# node-waf configuration
21-
.lock-wscript
22-
23-
# Compiled binary addons (http://nodejs.org/api/addons.html)
24-
build/Release
25-
26-
# Dependency directory
27-
node_modules
28-
29-
# Optional npm cache directory
30-
.npm
31-
32-
# Optional REPL history
33-
.node_repl_history
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log
5+
selenium-debug.log
6+
test/unit/coverage
7+
test/e2e/reports

README.md

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,79 @@
11
# vue-spectre
2-
spectre components built with Vue.js
2+
3+
> spectre components built with Vue.js
4+
5+
6+
(example)[https://vace.me/a/vue-spectre/index.html]
7+
8+
## Build Setup
9+
10+
spectre components built with Vue.js.
11+
12+
This repository contains a set of native Vue.js components based on Bootspectre's markup and CSS. As a result no dependency on jQuery or Bootspectre's JavaScript is required. The only required dependencies are:
13+
14+
* [Vue.js](http://vuejs.org/) (required ^v1.x.x, test with v1.0.21).
15+
* [Spectre CSS](https://picturepan2.github.io/spectre)
16+
17+
### NPM
18+
19+
```bash
20+
$ npm install vue-spectre
21+
```
22+
23+
### CommonJS
24+
```js
25+
var btn = require('vue-spectre').Btn;
26+
27+
new Vue({
28+
components: {
29+
'btn': btn
30+
}
31+
})
32+
```
33+
34+
### ES6
35+
import { Btn } from 'vue-spectre'
36+
37+
new Vue({
38+
components: {
39+
Btn
40+
}
41+
})
42+
```
43+
44+
### AMD
45+
```js
46+
$ bower install vue-spectre
47+
48+
define(['vue-spectre'], function(VueSpectre) { var Btn = VueSpectre.Btn });
49+
```
50+
51+
### Browser globals
52+
The `dist` folder contains `vue-spectre.js` and `vue-spectre.min.js` with all components exported in the <code>window.VueSpectre</code> object.
53+
and on both the Bower and NPM packages.
54+
55+
you can see [test/index](test/index.html)
56+
57+
```html
58+
<script src="path/to/vue.js"></script>
59+
<script src="path/to/vue-spectre.js"></script>
60+
<script>
61+
var vm = new Vue({
62+
components: {
63+
Btn: VueSpectre.Btn
64+
}
65+
})
66+
</script>
67+
```
68+
69+
## Docs
70+
See the [documentation](https://vace.me/a/vue-spectre/index.html) with live editable examples.
71+
72+
## Local Setup
73+
* Install with `npm install`
74+
* Run the docs site in development mode with `npm run build`. This will watch for file changes as you work.
75+
* Build with `npm run dist`.
76+
77+
78+
## License
79+
vue-spectre is licensed under [The MIT License](LICENSE).

build/build.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// https://github.com/shelljs/shelljs
2+
require('shelljs/global')
3+
env.NODE_ENV = 'production'
4+
5+
var path = require('path')
6+
var config = require('../config')
7+
var ora = require('ora')
8+
var webpack = require('webpack')
9+
var webpackConfig = require('./webpack.prod.conf')
10+
11+
console.log(
12+
' Tip:\n' +
13+
' Built files are meant to be served over an HTTP server.\n' +
14+
' Opening index.html over file:// won\'t work.\n'
15+
)
16+
17+
var spinner = ora('building for production...')
18+
spinner.start()
19+
20+
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory)
21+
rm('-rf', assetsPath)
22+
mkdir('-p', assetsPath)
23+
cp('-R', 'static/', assetsPath)
24+
25+
webpack(webpackConfig, function (err, stats) {
26+
spinner.stop()
27+
if (err) throw err
28+
process.stdout.write(stats.toString({
29+
colors: true,
30+
modules: false,
31+
children: false,
32+
chunks: false,
33+
chunkModules: false
34+
}) + '\n')
35+
})

build/dev-client.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
require('eventsource-polyfill')
3+
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4+
5+
hotClient.subscribe(function (event) {
6+
if (event.action === 'reload') {
7+
window.location.reload()
8+
}
9+
})

build/dev-server.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
var path = require('path')
2+
var express = require('express')
3+
var webpack = require('webpack')
4+
var config = require('../config')
5+
var proxyMiddleware = require('http-proxy-middleware')
6+
var webpackConfig = process.env.NODE_ENV === 'testing'
7+
? require('./webpack.prod.conf')
8+
: require('./webpack.dev.conf')
9+
10+
// default port where dev server listens for incoming traffic
11+
var port = process.env.PORT || config.dev.port
12+
// Define HTTP proxies to your custom API backend
13+
// https://github.com/chimurai/http-proxy-middleware
14+
var proxyTable = config.dev.proxyTable
15+
16+
var app = express()
17+
var compiler = webpack(webpackConfig)
18+
19+
var devMiddleware = require('webpack-dev-middleware')(compiler, {
20+
publicPath: webpackConfig.output.publicPath,
21+
stats: {
22+
colors: true,
23+
chunks: false
24+
}
25+
})
26+
27+
var hotMiddleware = require('webpack-hot-middleware')(compiler)
28+
// force page reload when html-webpack-plugin template changes
29+
compiler.plugin('compilation', function (compilation) {
30+
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
31+
hotMiddleware.publish({ action: 'reload' })
32+
cb()
33+
})
34+
})
35+
36+
// proxy api requests
37+
Object.keys(proxyTable).forEach(function (context) {
38+
var options = proxyTable[context]
39+
if (typeof options === 'string') {
40+
options = { target: options }
41+
}
42+
app.use(proxyMiddleware(context, options))
43+
})
44+
45+
// handle fallback for HTML5 history API
46+
app.use(require('connect-history-api-fallback')())
47+
48+
// serve webpack bundle output
49+
app.use(devMiddleware)
50+
51+
// enable hot-reload and state-preserving
52+
// compilation error display
53+
app.use(hotMiddleware)
54+
55+
// serve pure static assets
56+
var staticPath = path.posix.join(config.build.assetsPublicPath, config.build.assetsSubDirectory)
57+
app.use(staticPath, express.static('./static'))
58+
59+
module.exports = app.listen(port, function (err) {
60+
if (err) {
61+
console.log(err)
62+
return
63+
}
64+
console.log('Listening at http://localhost:' + port + '\n')
65+
})

build/utils.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
var path = require('path')
2+
var config = require('../config')
3+
var ExtractTextPlugin = require('extract-text-webpack-plugin')
4+
5+
exports.assetsPath = function (_path) {
6+
return path.posix.join(config.build.assetsSubDirectory, _path)
7+
}
8+
9+
exports.cssLoaders = function (options) {
10+
options = options || {}
11+
// generate loader string to be used with extract text plugin
12+
function generateLoaders (loaders) {
13+
var sourceLoader = loaders.map(function (loader) {
14+
var extraParamChar
15+
if (/\?/.test(loader)) {
16+
loader = loader.replace(/\?/, '-loader?')
17+
extraParamChar = '&'
18+
} else {
19+
loader = loader + '-loader'
20+
extraParamChar = '?'
21+
}
22+
return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '')
23+
}).join('!')
24+
25+
if (options.extract) {
26+
return ExtractTextPlugin.extract('vue-style-loader', sourceLoader)
27+
} else {
28+
return ['vue-style-loader', sourceLoader].join('!')
29+
}
30+
}
31+
32+
// http://vuejs.github.io/vue-loader/configurations/extract-css.html
33+
return {
34+
css: generateLoaders(['css']),
35+
postcss: generateLoaders(['css']),
36+
less: generateLoaders(['css', 'less']),
37+
sass: generateLoaders(['css', 'sass?indentedSyntax']),
38+
scss: generateLoaders(['css', 'sass']),
39+
stylus: generateLoaders(['css', 'stylus']),
40+
styl: generateLoaders(['css', 'stylus'])
41+
}
42+
}
43+
44+
// Generate loaders for standalone style files (outside of .vue)
45+
exports.styleLoaders = function (options) {
46+
var output = []
47+
var loaders = exports.cssLoaders(options)
48+
for (var extension in loaders) {
49+
var loader = loaders[extension]
50+
output.push({
51+
test: new RegExp('\\.' + extension + '$'),
52+
loader: loader
53+
})
54+
}
55+
return output
56+
}

0 commit comments

Comments
 (0)