Skip to content

New build process #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
parserOptions: {
parser: 'babel-eslint',
},
};
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
node_modules/
public/dist/
dist/
coverage/
npm-debug.log
yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cache:
install:
- yarn install
script:
- yarn run test
- yarn test:unit
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Contribute
39 changes: 4 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ $ npm i -S vue-tiny-pagination

```html
<div id="#app">
<tiny-pagination
:total="currentTotal"
@tiny:change-page="changePage"></tiny-pagination>
<tiny-pagination
:total="currentTotal"
@tiny:change-page="changePage"></tiny-pagination>
</div>
```

Expand Down Expand Up @@ -76,41 +76,10 @@ Example in browser here: https://jsfiddle.net/coderdiaz/g5vLex83/3/

For see the complete documentation go to the [official website](https://coderdiaz.me/vue-tiny-pagination).

### Donate

<a href="https://www.buymeacoffee.com/coderdiaz" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

### Development

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build docs with minification
npm run compile:docs

# build project
npm run build

# run tests
npm run test
```

### What's Included

- `npm run dev`: Webpack + `vue-loader` with proper config for source maps & hot-reload.

- `npm run build`: build with HTML/CSS/JS minification.

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader). Also check out the [breaking changes in [email protected]](https://github.com/vuejs/vue-loader/releases/tag/v9.0.0).

### Contributions
All contributions are welcome send your PR and Issues.

### License
This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-tiny-pagination/master/LICENSE)

##### Crafted by Javier Diaz
##### Crafted by Javier Diaz
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app',
],
};
19 changes: 0 additions & 19 deletions build/rollup.config.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/vue-tiny-pagination.esm.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/vue-tiny-pagination.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/vue-tiny-pagination.umd.js

This file was deleted.

21 changes: 0 additions & 21 deletions index.html

This file was deleted.

31 changes: 11 additions & 20 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import TinyPagination from './src/components/TinyPagination.vue'
import TinyPagination from './packages/TinyPagination/index';

export function install (Vue) {
if (install.installed) return
install.installed = true
Vue.component('TinyPagination', TinyPagination)
}

const plugin = {
install
}
const install = (Vue) => {
Vue.component(TinyPagination.name, TinyPagination);
};

let GlobalVue = null
if (typeof window !== 'undefined') {
GlobalVue = window.Vue
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue
}
if (GlobalVue) {
GlobalVue.use(plugin)
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}

export { TinyPagination }
export default plugin
export default {
version: '0.2.3',
install,
TinyPagination,
};
23 changes: 23 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue',
],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
snapshotSerializers: [
'jest-serializer-vue',
],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)',
],
testURL: 'http://localhost/',
};
Loading