diff --git a/.babelrc b/.babelrc
index 5be35c4..961129b 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,7 +1,14 @@
{
- "presets": [
- "es2015",
- "stage-2"
- ],
- "plugins": ["transform-runtime"]
+ "env": {
+ "build": {
+ "presets": [
+ ["es2015", { "modules": false }],
+ "stage-2"
+ ],
+ "plugins": [ "external-helpers"]
+ },
+ "test": {
+ "presets": ["es2015", "stage-2"]
+ }
+ }
}
diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 0000000..8524cf1
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": "airbnb-base",
+ "env": {
+ "jest": true
+ }
+}
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 300569d..0000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
- root: true,
- formatter: require('eslint-friendly-formatter'),
- parserOptions: {
- sourceType: 'module'
- },
- extends: 'airbnb-base',
- plugins: [
- "chai-expect"
- ],
- rules: {
- "no-unused-expressions": 0,
- "chai-expect/missing-assertion": 2,
- },
- env: {
- mocha: true,
- }
-}
diff --git a/.gitignore b/.gitignore
index 3c6b173..9bf4f0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
-# Created by https://www.gitignore.io/api/node,macos,visualstudiocode
+# Created by https://www.gitignore.io/api/node,macos,windows,visualstudiocode,webstorm
### macOS ###
*.DS_Store
@@ -9,7 +9,6 @@
# Icon must end with two \r
Icon
-
# Thumbnails
._*
@@ -22,18 +21,13 @@ Icon
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
-# Directories potentially created on remote AFP share
-.AppleDB
-.AppleDesktop
-Network Trash Folder
-Temporary Items
-.apdisk
-
### Node ###
# Logs
logs
*.log
npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
# Runtime data
pids
@@ -50,21 +44,12 @@ coverage
# nyc test coverage
.nyc_output
-# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
-.grunt
-
-# Bower dependency directory (https://bower.io/)
-bower_components
-
-# node-waf configuration
-.lock-wscript
-
-# Compiled binary addons (http://nodejs.org/api/addons.html)
-build/Release
-
# Dependency directories
-node_modules
-jspm_packages
+node_modules/
+jspm_packages/
+
+# Typescript v1 declaration files
+typings/
# Optional npm cache directory
.npm
@@ -87,10 +72,85 @@ jspm_packages
### VisualStudioCode ###
.vscode/*
-.history/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
+.history
+
+### WebStorm ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/dictionaries
+
+# Sensitive or high-churn files:
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.xml
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+
+# Gradle:
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Mongo Explorer plugin:
+.idea/**/mongoSettings.xml
+
+
+## Plugin-specific files:
+
+# IntelliJ
+/out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Ruby plugin and RubyMine
+/.rakeTasks
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+### WebStorm Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+# .idea/misc.xml
+# *.ipr
+
+# Sonarlint plugin
+.idea/sonarlint
+
+### Windows ###
+# Windows thumbnail cache files
+Thumbs.db
+ehthumbs.db
+ehthumbs_vista.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows shortcuts
+*.lnk
-# End of https://www.gitignore.io/api/node,macos,visualstudiocode
+# End of https://www.gitignore.io/api/node,macos,windows,visualstudiocode,webstorm
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index c33bc60..2743767 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,13 +5,13 @@ cache:
notifications:
email: false
node_js:
- - '7'
- - '6'
- - '4'
+ - '8'
before_script:
- npm prune
script:
- - npm run test
+ - yarn
+ - yarn run build
+ - yarn run test
branches:
except:
- /^v\d+\.\d+\.\d+$/
diff --git a/.yarnclean b/.yarnclean
new file mode 100644
index 0000000..b591611
--- /dev/null
+++ b/.yarnclean
@@ -0,0 +1,45 @@
+# test directories
+__tests__
+test
+tests
+powered-test
+
+# asset directories
+docs
+doc
+website
+images
+assets
+
+# examples
+example
+examples
+
+# code coverage directories
+coverage
+.nyc_output
+
+# build scripts
+Makefile
+Gulpfile.js
+Gruntfile.js
+
+# configs
+appveyor.yml
+circle.yml
+codeship-services.yml
+codeship-steps.yml
+wercker.yml
+.tern-project
+.gitattributes
+.editorconfig
+.*ignore
+.eslintrc
+.jshintrc
+.flowconfig
+.documentup.json
+.yarn-metadata.json
+.travis.yml
+
+# misc
+*.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7b4266..60df3ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,12 +4,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.0.0] - 2017-01-03
+### Added
+- 'hyphenate' option in settings - hyphenation the resulting class name
+- 'methodName' option in settings - name of the method for generating the class name
+
+### Changed
+- New build system with Rollup. Now, only two types of distributed files - ES6 module for modern build systems and UMD.
+- Reducing build size ( less than 1 KB with minification and gzip )
+- Changed the structure of the settings object (more in the [API section](#api))
+- Updated README.md. New "[Default settings](#default-settings)" section
+- Fixed typos in CHANGELOG.md
+
+### Removed
+- CommonJS module build
+
## [0.1.1] - 2017-01-03
### Added
- This CHANGELOG file
### Removed
-- `module` in package.json from `package.json` (#2)
+- `module` from `package.json` (#2)
-[0.1.1]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.1.1
+[1.0.0]: https://github.com/c01nd01r/vue-bem-cn/compare/v0.1.1...v1.0.0
+[0.1.1]: https://github.com/c01nd01r/vue-bem-cn/compare/v0.1.0...v0.1.1
diff --git a/README.md b/README.md
index d29f1fa..5d6004c 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
[![npm](https://img.shields.io/npm/v/vue-bem-cn.svg)](https://www.npmjs.com/package/vue-bem-cn)
[![vue-version](https://img.shields.io/badge/Vue.JS-2.+-brightgreen.svg)](https://github.com/vuejs/vue/)
-Simple [BEM](http://getbem.com/)-style class name generator for Vue.JS 2.*, based on [bem-cn-lite](https://github.com/mistakster/bem-cn-lite)
+Simple [BEM](http://getbem.com/)-style class name generator for Vue.JS 2.*
## Table of Contents
@@ -16,18 +16,18 @@ Simple [BEM](http://getbem.com/)-style class name generator for Vue.JS 2.*, base
## Quick example
Live demo: [codepen](http://codepen.io/c01nd01r/pen/Qdeovv)
-Block **btn**. Vue [Single File Component](https://vuejs.org/v2/guide/single-file-components.html):
+Block **ui-button**. Vue [Single File Component](https://vuejs.org/v2/guide/single-file-components.html):
```vue
```
-Using **btn** block in App.vue:
+Using **ui-button** block in App.vue:
```vue
- I am BEM button!
+ I am BEM button!
@@ -58,9 +60,9 @@ Will be compile to:
```html
-