Skip to content

Commit

Permalink
packaging setup and npm metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Nov 15, 2016
1 parent 285b3dc commit c43ec88
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
.DS_Store
node_modules/
dist/
lib/
npm-debug.log
test/unit/coverage
test/unit/coverage
gh-pages
yarn.lock
*.tgz
9 changes: 9 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
static
test
build
config
docs
.*
yarn.lock
*.html
*.tgz
19 changes: 9 additions & 10 deletions build/webpack.bundle.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
const base = require('./webpack.base.conf')
const config = require('../config')

// this is used only for umd browser bundle,
// refer to .babelrc for lib configuration

base.entry = {
lib: './src/index.js'
'vue-validation': './src/index.js',
'validators': './src/validators/index.js'
}

base.output = {
path: config.bundle.assetsRoot,
publicPath: config.bundle.assetsPublicPath,
filename: 'vue-validation.min.js',
library: 'vue-validation',
libraryTarget: 'umd'
filename: '[name].min.js',
libraryTarget: 'umd',
library: '[name]'
}

var webpackConfig = Object.assign({}, base)
Expand All @@ -26,12 +30,7 @@ webpackConfig.plugins = (webpackConfig.plugins || []).concat([
new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false }
}),
new webpack.optimize.OccurenceOrderPlugin(),
new CopyWebpackPlugin([
{ from: './src/' }
], {
ignore: ['.DS_Store', 'index.js']
})
new webpack.optimize.OccurenceOrderPlugin()
])

module.exports = webpackConfig
36 changes: 22 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,43 @@
"name": "vue-validation",
"version": "0.1.0",
"description": "Simple, lightweight model-based validation for Vue.js",
"author": "Damian Dulisz <damian.dulisz@monterail.com>",
"private": true,
"contributors": [
"Damian Dulisz <damian.dulisz@monterail.com>",
"Paweł Grabarz <pawel.grabarz@monterail.com>"
],
"license": "MIT",
"main": "lib/index.js",
"scripts": {
"dev": "node build/dev-server.js",
"bundle": "webpack --config build/webpack.bundle.conf.js",
"bundle:web": "rm -rf dist && webpack --config build/webpack.bundle.conf.js",
"bundle:lib": "rm -rf lib && babel src --out-dir lib",
"build": "npm run bundle:lib && npm run bundle:web",
"docs": "rm -rf gh-pages && mkdir gh-pages && node build/build.js",
"unit": "karma start test/unit/karma.conf.js --watch",
"test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit/specs"
"test": "karma start test/unit/karma.conf.js --single-run",
"lint": "eslint --ext .js,.vue src test/unit/specs",
"prepublish": "npm run lint && npm test && npm run build"
},
"devDependencies": {
"autoprefixer": "^6.4.0",
"babel-cli": "^6.18.0",
"babel-core": "^6.0.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.0.0",
"babel-register": "^6.0.0",
"chai": "^3.5.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.1.0",
"copy-webpack-plugin": "^4.0.0",
"css-loader": "^0.25.0",
"eslint": "^3.7.1",
"eslint-config-standard": "^6.1.0",
"eslint-friendly-formatter": "^2.0.5",
"eslint-loader": "^1.5.0",
"eslint-plugin-html": "^1.3.0",
"eslint-config-standard": "^6.1.0",
"eslint-plugin-promise": "^2.0.1",
"eslint-plugin-standard": "^2.0.1",
"eventsource-polyfill": "^0.9.6",
Expand All @@ -39,6 +48,8 @@
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.8.1",
"http-proxy-middleware": "^0.17.2",
"inject-loader": "^2.0.1",
"isparta-loader": "^2.0.0",
"json-loader": "^0.5.4",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
Expand All @@ -50,20 +61,17 @@
"karma-webpack": "^1.7.0",
"lolex": "^1.4.0",
"mocha": "^3.1.0",
"chai": "^3.5.0",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"inject-loader": "^2.0.1",
"isparta-loader": "^2.0.0",
"phantomjs-prebuilt": "^2.1.3",
"node-sass": "^3.4.2",
"sass-loader": "^3.2.0",
"semver": "^5.3.0",
"opn": "^4.0.2",
"ora": "^0.3.0",
"phantomjs-prebuilt": "^2.1.3",
"pug": "2.0.0-beta6",
"pug-loader": "^2.3.0",
"sass-loader": "^3.2.0",
"semver": "^5.3.0",
"shelljs": "^0.7.4",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"url-loader": "^0.5.7",
"vue": "^2.0.4",
"vue-loader": "^9.4.0",
Expand Down
6 changes: 5 additions & 1 deletion src/validators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import maxLength from './maxLength'
import minLength from './minLength'
import required from './required'
import sameAs from './sameAs'
import or from './or'
import and from './and'

export {
alpha,
Expand All @@ -13,5 +15,7 @@ export {
maxLength,
minLength,
required,
sameAs
sameAs,
or,
and
}

0 comments on commit c43ec88

Please sign in to comment.