-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from InDIOS/development
Bump to version 0.2.0
- Loading branch information
Showing
52 changed files
with
6,061 additions
and
2,329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ install: | |
script: | ||
- npm run build:src | ||
- npm run build:tools | ||
- npm test | ||
cache: | ||
directories: | ||
- "node_modules" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,40 @@ | ||
# trebor | ||
|
||
[![Build Status](https://travis-ci.org/InDIOS/trebor.svg?branch=master)](https://travis-ci.org/InDIOS/trebor) | ||
[![NPM Version][npm-image]][npm-url] | ||
[![NPM Downloads][downloads-image]][downloads-url] | ||
[![Release][github-img]][github-url] | ||
[![Build Status][travis-image]][travis-url] | ||
|
||
A node js module to make standalone web components. | ||
|
||
# How to use | ||
|
||
## How to install | ||
Locally | ||
```bash | ||
npm i trebor -D | ||
``` | ||
or | ||
or globally | ||
|
||
```bash | ||
npm i trebor -g | ||
``` | ||
|
||
# Example | ||
|
||
### Let's make a `Counter` component: | ||
|
||
First we'll make an html file with name `counter`. | ||
```html | ||
<!-- counter.html --> | ||
<style> | ||
.negative { | ||
color: crimson; | ||
} | ||
</style> | ||
|
||
<div class="container"> | ||
<h3 class="title is-3">Counter Example</h3> | ||
<label>Counter: </label> | ||
<strong :class="negative">{{ count }}</strong> | ||
<br/> | ||
<button class="button is-primary" @click="increment()">Increment</button> | ||
<button class="button is-danger" @click="decrement()">Decrement</button> | ||
</div> | ||
## Documentation | ||
|
||
<script> | ||
export default { | ||
model: { | ||
count: 0, | ||
get negative() { | ||
return { 'negative': this.count < 0 }; | ||
}, | ||
increment() { | ||
this.$set('count', this.count + 1); | ||
}, | ||
decrement() { | ||
this.$set('count', this.count - 1); | ||
} | ||
} | ||
}; | ||
</script> | ||
``` | ||
Then we'll compile the `counter` file to convert it in a standalone component | ||
Read the documentation [here](https://github.com/InDIOS/trebor/wiki) | ||
|
||
```bash | ||
trebor -i counter.html | ||
``` | ||
In the directory will appear one `js` file with `umd` sufix. Make a file named `index.html` like that | ||
## Contributions | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
>TO-DO | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>Counter Component</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.0/css/bulma.min.css"> | ||
</head> | ||
## License | ||
|
||
<body> | ||
<main></main> | ||
|
||
<!-- Load Counter component --> | ||
<script src="counter.umd.js"></script> | ||
<!-- Initialize and Mount Counter component --> | ||
<script> | ||
var counter = new Counter(); | ||
counter.$mount('main'); | ||
</script> | ||
</body> | ||
[MIT](https://github.com/InDIOS/trebor/blob/master/LICENSE) | ||
|
||
</html> | ||
``` | ||
Open the `index.html` file in the browser and see how the magic happens 🎉👍😁 | ||
[npm-image]: https://img.shields.io/npm/v/trebor.svg | ||
[npm-url]: https://npmjs.org/package/trebor | ||
[downloads-image]: https://img.shields.io/npm/dm/trebor.svg | ||
[downloads-url]: https://npmjs.org/package/trebor | ||
[github-img]: https://img.shields.io/github/release/InDIOS/trebor.svg | ||
[github-url]: https://github.com/InDIOS/trebor/releases/latest | ||
[travis-image]: https://img.shields.io/travis/InDIOS/trebor/master.svg?label=build | ||
[travis-url]: https://travis-ci.org/InDIOS/trebor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.