Skip to content

Commit 1734585

Browse files
author
Javier Diaz Chamorro
authored
Merge pull request #10 from coderdiaz/feature/new-approach
New build approach
2 parents c21ddab + 4610f36 commit 1734585

18 files changed

+2305
-3358
lines changed

Diff for: .babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
["env", { "modules": false }]
4+
],
5+
"env": {
6+
"test": {
7+
"presets": [
8+
["env", { "targets": { "node": "current" } }]
9+
]
10+
}
11+
}
12+
}

Diff for: .editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ indent_style = space
66
indent_size = 2
77
end_of_line = lf
88
insert_final_newline = true
9-
trim_trailing_whitespace = true
9+
trim_trailing_whitespace = true

Diff for: .eslintignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/dist
2-
/node_modules
1+
dist/
2+
node_modules/

Diff for: .eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ module.exports = {
1414
parserOptions: {
1515
parser: 'babel-eslint',
1616
},
17-
};
17+
};

Diff for: .github/ISSUE_TEMPLATE.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Issue report
2+
3+
## Current behavior
4+
<!-- Describe how the issue manifests. -->
5+
6+
## Input Code
7+
<!-- REPL or Repo link if applicable: -->
8+
```js
9+
const your = (code) => here;
10+
```
11+
12+
## Expected behavior
13+
<!-- A clear and concise description of what you expected to happen (or code). -->
14+
15+
## Posible solution
16+
<!-- Only if you have suggestions on a fix for the bug -->
17+
18+
## Environment
19+
<pre><code>
20+
Plugin version: X.Y.Z
21+
<!-- Check whether this is still an issue in the most recent version -->
22+
23+
For tooling issue:
24+
- Node version: XX <!-- run `node --version` -->
25+
- Platform: <!-- Mac, Linux, Windows -->
26+
27+
Others:
28+
<!-- Anything else relevant? Operating system version, IDE, package manager, etc. -->
29+
</pre></code>

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## PR Checklist
2+
Please check if your PR fulfills the following requirements:
3+
4+
- [ ] The commit message follows our guidelines: https://github.com/coderdiaz/vue-tiny-pagination/blob/master/CONTRIBUTING.md
5+
- [ ] Tests for the changes have been added (for bug fixes / features).
6+
- [ ] Docs have been added / updated (for bug fixes / features).
7+
8+
## PR Type
9+
What kind of change does this PR introduce?
10+
11+
<!-- Please check the one that applies to this PR using "x". -->
12+
```
13+
[ ] Bugfixes
14+
[ ] Feature
15+
[ ] Code style update (formatting, local variables)
16+
[ ] Refactoring (no functional changes, no api changes)
17+
[ ] Build related changes
18+
[ ] CI related changes
19+
[ ] Other... Please describe:
20+
```
21+
22+
## What is the current behavior?
23+
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
24+
25+
## What is the new behaviour?
26+
27+
## Does this PR introduce a breaking change?
28+
```
29+
[ ] Yes
30+
[ ] No
31+
```
32+
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->

Diff for: .gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
.DS_Store
21
node_modules/
32
dist/
43
coverage/
5-
npm-debug.log
64
yarn-error.log
5+
npm-debug.log
6+
.DS_Store
77

8-
# Editor directories and files
8+
# Editor directories
99
.idea
1010
*.suo
1111
*.ntvs*
1212
*.njsproj
13-
*.sln
13+
*.sln

Diff for: .travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ node_js:
44
- 10
55
cache:
66
yarn: true
7-
directories:
8-
- node_modules
7+
directories: node_modules
98
install:
10-
- yarn install
9+
- yarn
1110
script:
1211
- yarn test:unit

Diff for: CONTRIBUTING.md

+47
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
11
## Contribute
2+
We would love for you to contribute and help make it even better than it is todat! As a contributor, here are the guidelines we would like you to follow:
3+
4+
## Development Setup
5+
You will need Node.js version +8.9.0.
6+
1. After clonning the repo, run:
7+
```bash
8+
$ npm i # or yarn install
9+
```
10+
11+
### Commonly use NPM scripts
12+
```bash
13+
# build all packages
14+
$ npm run build
15+
16+
# run full unit-tests suite
17+
$ npm run test:unit
18+
19+
# run linter
20+
$ npm run lint
21+
```
22+
23+
## Found a Bug?
24+
If you find a bug in source code, you can help us by submitting an issue to our GitHub repository. Even better, you can submit a Pull Request with a fix.
25+
26+
## Missing a Feature?
27+
You can request a new feature by submitting an issue to our GitHub repository. If you would like to implement a new feature, please submit an issue with a proposal for your work first, to be sure that we can use it. Please consider what kind of change it is:
28+
- For a **Major Feature**, first open an issue and outline your proposal so that it can be discussed. This will also allow us to better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted in the project. For your issue name, please prefix your proposal with `[discussion]`, for example "[discussion]: your feature idea".
29+
- **Small Features** can be crafted and firectly submitted as a Pull Request.
30+
31+
## Coding Rules
32+
To ensure consistency throughout the source code, keep these rules in mind as you are working:
33+
- All feature or bug fixes **must be tested** by one or more specs (unit-tests).
34+
- We follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), but wrap all code at **100 characters**.
35+
36+
## Commit Message Guidelines
37+
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. But also, we use git commit messages to **generate the change log**.
38+
39+
### Type
40+
Must be one of the following:
41+
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm).
42+
- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs).
43+
- **docs**: Documentation only changes.
44+
- **feature**: A new feature.
45+
- **bugfix**: A bug fix.
46+
- **refactor**: A code change that neither fixes a bug nor adds a feature.
47+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
48+
- **test**: Adding missing tests or correcting existing tests.

Diff for: LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Javier Diaz Chamorro
3+
Copyright (c) 2018-2019 Javier Diaz Chamorro
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

Diff for: README.md

+60-45
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<p align="center">
2-
<a href="https://github.com/coderdiaz/vue-tiny-pagination">
3-
<img src="https://vuejs.org/images/logo.png" width="120">
4-
</a>
5-
<h2 align="center">&lt;vue-tiny-pagination /&gt;</h2>
6-
</p>
7-
8-
<p align="center">
9-
A Vue component for create a tiny pagination with Flexbox
2+
<a href="#"><img src="logotype.png" width="380"></a>
3+
<h4 align="center">A Vue component for create a tiny pagination with Flexbox</h4>
104
</p>
115

126
<p align="center">
@@ -15,71 +9,92 @@
159
<a href="https://github.com/coderdiaz/vue-tiny-pagination/stargazers"><img src="https://img.shields.io/github/stars/coderdiaz/vue-tiny-pagination.svg?style=flat-square"></a>
1610
<a href="http://npmjs.com/package/vue-tiny-pagination"><img src="https://img.shields.io/npm/v/vue-tiny-pagination.svg?style=flat-square"></a>
1711
<a href="http://npmjs.com/package/vue-tiny-pagination"><img src="https://img.shields.io/npm/dm/vue-tiny-pagination.svg?style=flat-square"></a>
18-
<a href="https://www.paypal.me/coderdiaz"><img src="https://img.shields.io/badge/invite-coffee-red.svg?style=flat-square"></a>
1912
<a href="https://travis-ci.org/coderdiaz/vue-tiny-pagination"><img src="https://travis-ci.org/coderdiaz/vue-tiny-pagination.svg?branch=master&style=flat-square"></a>
20-
</a>
13+
</p>
2114

2215
---
2316

24-
### Install/Usage
25-
26-
```
17+
## Install/Usage
18+
<!-- Replace the docs for usage the plugin -->
19+
```sh
20+
# Install with npm
2721
$ npm i -S vue-tiny-pagination
22+
23+
# or yarn
24+
$ yarn add vue-tiny-pagination
2825
```
2926

3027
```html
31-
<div id="#app">
28+
<div id="app">
3229
<tiny-pagination
3330
:total="currentTotal"
34-
@tiny:change-page="changePage"></tiny-pagination>
31+
@tiny:change-page="changePage" />
3532
</div>
3633
```
3734

38-
You can use **local registration**
39-
```javascript
40-
import {TinyPagination} from 'vue-tiny-pagination'
41-
35+
You can use **Local Registration**:
36+
```js
37+
import { TinyPagination } from 'vue-tiny-pagination';
4238
new Vue({
4339
el: '#app',
4440
data() {
4541
return {
4642
currentTotal: 100,
47-
currentPage: 1
48-
}
43+
currentPage: 1,
44+
};
4945
},
5046
methods: {
5147
changePage (pagination) {
52-
this.currentPage = pagination.page
53-
}
48+
this.currentPage = pagination.page;
49+
},
5450
},
5551
components: {
56-
TinyPagination
57-
}
52+
TinyPagination,
53+
},
5854
});
5955
```
60-
or **global registration**
61-
```javascript
62-
import TinyPagination from 'vue-tiny-pagination'
63-
Vue.use(TinyPagination)
64-
```
6556

66-
### Usage in browser
57+
or **Global Registration**:
58+
```js
59+
import TinyPagination from 'vue-tiny-pagination';
60+
Vue.use(TinyPagination);
6761

68-
In browser you can use Unpkg:
69-
```
70-
https://unpkg.com/vue-tiny-pagination@latest/dist/vue-tiny-pagination.js
62+
// or with a custom component name
63+
import { TinyPagination } from 'vue-tiny-pagination';
64+
Vue.component('custom-name', TinyPagination);
7165
```
7266

73-
Example in browser here: https://jsfiddle.net/coderdiaz/da7h5wnk/
74-
75-
### Documentation
76-
77-
For see the complete documentation go to the [official website](https://coderdiaz.me/vue-tiny-pagination).
78-
79-
### Contributions
80-
All contributions are welcome send your PR and Issues.
67+
### Usage in browser
68+
<!-- Write an example for use the plugin in browser from CDN -->
69+
In browser you can use Unpkg, Jsdelivr, CDN.js, etc.
70+
```sh
71+
# Unpkg
72+
https://unpkg.com/vue-tiny-pagination@latest/dist/vue-tiny-pagination.js
8173

82-
### License
83-
This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-tiny-pagination/master/LICENSE)
74+
# JSDelivr
75+
https://cdn.jsdelivr.net/npm/vue-tiny-pagination@latest/dist/vue-tiny-pagination.min.js
76+
```
8477

85-
##### Crafted by Javier Diaz
78+
## Documentation
79+
<!-- Add all documentation about the plugin: props, events, etc -->
80+
### Props
81+
|Name|Description|Type|Default|Required|
82+
|---|---|---|---|---|
83+
|total|A number of total items|Number|-|true|
84+
|page|Prop to set a default page|Number|1|false|
85+
|lang|Default language to show (Available: en, es)|String|en|false|
86+
|customClass|Prop to set a custom class.|String|""|false|
87+
|limits|Prop to set a default limits to page sizes.|Array|[10, 15, 20,50,100]|false|
88+
|showLimit|Prop to disable the limit selector|Boolean|true|false|
89+
90+
### Events
91+
|Event|Description|
92+
|---|---|
93+
|tiny:change-page|Get the current page from pagination `payload: { page: 1 }`|
94+
|tiny:change-limit|Get the current limit from pagination `payload: { limit: 1 }`|
95+
96+
## Community
97+
All feedback and suggestions are welcome!
98+
99+
## License
100+
This is a open-source software licensed under the [MIT license](https://raw.githubusercontent.com/coderdiaz/vue-tiny-pagination/master/LICENSE)

Diff for: babel.config.js

-3
This file was deleted.

Diff for: bili.config.ts

-40
This file was deleted.

0 commit comments

Comments
 (0)