Skip to content

Commit

Permalink
Merge pull request #8 from coderdiaz/feature/new-approach
Browse files Browse the repository at this point in the history
New build approach
  • Loading branch information
Javier Diaz Chamorro authored Jul 20, 2019
2 parents eb6f34d + af2ed50 commit 44154e7
Show file tree
Hide file tree
Showing 34 changed files with 4,373 additions and 4,249 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
["env", { "modules": false }]
],
"env": {
"test": {
"presets": [
["env", { "targets": { "node": "current" } }]
]
}
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
node_modules/
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',
'airbnb-base',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
parserOptions: {
parser: 'babel-eslint',
},
};
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## Issue report

## Current behavior
<!-- Describe how the issue manifests. -->

## Input Code
<!-- REPL or Repo link if applicable: -->
```js
const your = (code) => here;
```

## Expected behavior
<!-- A clear and concise description of what you expected to happen (or code). -->

## Posible solution
<!-- Only if you have suggestions on a fix for the bug -->

## Environment
<pre><code>
Plugin version: X.Y.Z
<!-- Check whether this is still an issue in the most recent version -->

For tooling issue:
- Node version: XX <!-- run `node --version` -->
- Platform: <!-- Mac, Linux, Windows -->

Others:
<!-- Anything else relevant? Operating system version, IDE, package manager, etc. -->
</pre></code>
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## PR Checklist
Please check if your PR fulfills the following requirements:

- [ ] The commit message follows our guidelines: https://github.com/coderdiaz/vue-status-indicator/blob/master/CONTRIBUTING.md
- [ ] Tests for the changes have been added (for bug fixes / features).
- [ ] Docs have been added / updated (for bug fixes / features).

## PR Type
What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->
```
[ ] Bugfixes
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:
```

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

## What is the new behaviour?

## Does this PR introduce a breaking change?
```
[ ] Yes
[ ] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
node_modules/
node_modules/
dist/
coverage/
yarn-error.log
npm-debug.log
.DS_Store

# Editor directories
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- 8
- 10
cache:
yarn: true
directories: node_modules
install:
- yarn
script:
- yarn test:unit
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Contribute
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:

## Development Setup
You will need Node.js version +8.9.0.
1. After clonning the repo, run:
```bash
$ npm i # or yarn install
```

### Commonly use NPM scripts
```bash
# build all packages
$ npm run build

# run full unit-tests suite
$ npm run test:unit

# run linter
$ npm run lint
```

## Found a Bug?
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.

## Missing a Feature?
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:
- 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".
- **Small Features** can be crafted and firectly submitted as a Pull Request.

## Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
- All feature or bug fixes **must be tested** by one or more specs (unit-tests).
- We follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript), but wrap all code at **100 characters**.

## Commit Message Guidelines
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**.

### Type
Must be one of the following:
- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm).
- **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs).
- **docs**: Documentation only changes.
- **feature**: A new feature.
- **bugfix**: A bug fix.
- **refactor**: A code change that neither fixes a bug nor adds a feature.
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc).
- **test**: Adding missing tests or correcting existing tests.
12 changes: 7 additions & 5 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) Tan Nhu, Javier Diaz
MIT License

Copyright (c) 2018 Javier Diaz Chamorro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
142 changes: 52 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,67 @@
<p align="center">
<a href="https://github.com/coderdiaz/vue-status-indicator">
<img src="https://vuejs.org/images/logo.png" width="120">
</a>
<h2 align="center">&lt;vue-status-indicator /&gt;</h2>
</p>

<p align="center">
A Vue component to show status indicator as colored dots. <a href="https://coderdiaz.me/vue-status-indicator/">Demo</a>. This is a fork of <a href="https://github.com/tnhu/status-indicator">status-indicator</a> with a few changes for use with Vue.js.
</p>

<p align="center">
<a href="https://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/dt/vue-status-indicator.svg?style=flat-square"></a>
<a href="https://github.com/coderdiaz/vue-status-indicator/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square"></a>
<a href="https://github.com/coderdiaz/vue-status-indicator/stargazers"><img src="https://img.shields.io/github/stars/coderdiaz/vue-status-indicator.svg?style=flat-square"></a>
<a href="http://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/v/vue-status-indicator.svg?style=flat-square"></a>
<a href="http://npmjs.com/package/vue-status-indicator"><img src="https://img.shields.io/npm/dm/vue-status-indicator.svg?style=flat-square"></a>
<a href="https://www.paypal.me/coderdiaz"><img src="https://img.shields.io/badge/invite-coffee-red.svg?style=flat-square"></a>
</a>

---

![Screenshot](https://i.imgur.com/v1vJ3Ue.gif)

## Install

```bash
npm i -S vue-status-indicator
```

### Donate
# [Status Indicator](https://github.com/coderdiaz/vue-status-indicator) &middot; [![NPMVERSION](https://img.shields.io/npm/v/vue-status-indicator.svg)](http://npmjs.com/package/vue-status-indicator) [![GITHUBSTARS](https://img.shields.io/github/stars/coderdiaz/vue-status-indicator.svg)](https://github.com/coderdiaz/vue-status-indicator/stargazers) [![BUILD](https://travis-ci.org/coderdiaz/vue-status-indicator.svg?branch=master)](https://travis-ci.org/coderdiaz/vue-status-indicator) [![DOWNLOADS](https://img.shields.io/npm/dt/vue-status-indicator.svg)](https://npmjs.com/package/vue-status-indicator)

<a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/coderdiaz"><img src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:5px">Buy me a coffee</span></a>
A Vue component to show a status indicator as colored dots. This is a fork of [status-indicator](https://github.com/tnhu/status-indicator) with a few changes for use it with Vue.

## Usage
Import status-indicator.css in your CSS or JavaScript.
## Install/Usage
<!-- Replace the docs for usage the plugin -->
```sh
# Install with npm
$ npm i -S vue-status-indicator

CSS:

```css
@import 'vue-status-indicator'
# or yarn
$ yarn add vue-status-indicator
```

JavaScript:
```html
<div id="app">
<status-indicator status="active" />
</div>
```

```javascript
import 'vue-status-indicator/styles.css'
You can use **Local Registration**:
```js
import { StatusIndicator } from 'vue-status-indicator';
new Vue({
el: '#app',
components: {
StatusIndicator,
},
});
```

Import component `status-indicator`.
or **Global Registration**:
```js
import StatusIndicator from 'vue-status-indicator';
Vue.use(StatusIndicator);

```javascript
import { StatusIndicator } from 'vue-status-indicator'
// or with a custom component name
import { StatusIndicator } from 'vue-status-indicator';
Vue.component('custom-name', StatusIndicator);
```

HTML/Vue:
### Usage in browser
<!-- Write an example for use the plugin in browser from CDN -->
In browser you can use Unpkg, Jsdelivr, CDN.js, etc.
```sh
# Unpkg
https://unpkg.com/vue-status-indicator@latest/dist/vue-status-indicator.js

```html
<template>
<status-indicator active pulse></status-indicator>
</template>
<script>
import { StatusIndicator } from 'vue-status-indicator'
export default {
components: {
StatusIndicator
}
}
</script>
# JSDelivr
https://cdn.jsdelivr.net/npm/vue-status-indicator@latest/dist/vue-status-indicator.min.js
```

Usage in Browser:
```
https://unpkg.com/vue-status-indicator@latest/dist/vue-status-indicator.min.js
https://unpkg.com/vue-status-indicator@latest/styles.css
```
**Example**: https://jsfiddle.net/coderdiaz/k038cdf3/
### Supported Browsers
Latest versions of Chrome/Firefox/Safari/IE/Opera.

### API

```html
<status-indicator active|positive|intermediary|negative pulse></status-indicator>
```
## Documentation
<!-- Add all documentation about the plugin: props, events, etc -->
### Props
|Name|Description|Type|Default|Required|
|---|---|---|---|---|
|status|Status color for the dot|String|""|false|
|pulse|Enable or disable the pulse effect|Boolean|false|false|

### Customatization
You are able to customize the dot by CSS variables, default configuration is listed below.

```css
Expand Down Expand Up @@ -111,26 +91,8 @@ You are able to customize the dot by CSS variables, default configuration is lis
}
```

## Development

``` bash
# install dependencies
npm install

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

# build for production with minification
npm run build
```

For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).


### Supported Browsers

Latest versions of Chrome/Firefox/Safari/IE/Opera.

### LICENSE
## Community
All feedback and suggestions are welcome!

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

0 comments on commit 44154e7

Please sign in to comment.