# app-decorators-simple-it

> Simple it tester

Latest version **0.8.252** (published 2017-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install app-decorators-simple-it
pnpm add app-decorators-simple-it
yarn add app-decorators-simple-it
bun add app-decorators-simple-it
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.252 |
| Published | 2017-12-19 |
| First published | 2017-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Serkan Sipahi |
| Maintainers | bitcollage |
| Keywords | test, it, simple |

## Links

- npm: https://www.npmjs.com/package/app-decorators-simple-it
- Repository: https://github.com/SerkanSipahi/app-decorators/tree/master/packages/app-decorators-simple-it
- npm.io page: https://npm.io/package/app-decorators-simple-it

## Dependencies (2)

- [babel-cli](https://npm.io/package/babel-cli.md) 6.26.0
- [babel-plugin-transform-es2015-modules-commonjs](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs.md) 6.26.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.8.252 (latest) — 2017-12-19
- 0.8.251 — 2017-12-10
- 0.8.250 — 2017-10-02
- 0.8.249 — 2017-10-01
- 0.8.248 — 2017-10-01
- 0.8.247 — 2017-10-01
- 0.8.245 — 2017-09-30
- 0.8.244 — 2017-09-21

## README

## app-decorates (Beta)

#### Quickstart with app-decorators-cli
```sh
# For Mac
npm install appdec-cli-osx --global

# For Windows
npm install appdec-cli-win --global

# For Linux
npm install appdec-cli-linux --global

# then
appdec create --name mymodule
appdec run --name mymodule --watch --server
```

See [`app-decorators-cli`](https://github.com/SerkanSipahi/app-decorators-cli)(Beta)

---

#### Why app-decorators?
- compiler first [AOT-Compiler](https://en.wikipedia.org/wiki/Ahead-of-time_compilation), do computation at compile time and not at runtime
- write less, do more
- and more (coming soon)

#### Runtime package

| Package | Version | Dependencies | DevDependencies |
|--------|-------|------------|------------|
| [`app-decorators`](https://github.com/SerkanSipahi/app-decorators) | [![npm](https://img.shields.io/npm/v/app-decorators.svg?maxAge=2592000)](https://www.npmjs.com/package/app-decorators) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg)](https://david-dm.org/SerkanSipahi/app-decorators) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?type=dev) |

#### Core compiler packages

| Package | Version | Dependencies | DevDependencies |
|--------|-------|------------|------------|
| [`app-decorators-component`](/packages/babel-plugin-app-decorators-component) | [![npm](https://img.shields.io/npm/v/babel-plugin-app-decorators-component.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-app-decorators-component) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-component)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-component) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-component&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-component&type=dev) |
| [`app-decorators-view-precompile`](/packages/babel-plugin-app-decorators-view-precompile) | [![npm](https://img.shields.io/npm/v/babel-plugin-app-decorators-view-precompile.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-app-decorators-view-precompile) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-view-precompile)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-view-precompile) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-view-precompile&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-view-precompile&type=dev) |
| [`app-decorators-style-precompile`](/packages/babel-plugin-app-decorators-style-precompile) | [![npm](https://img.shields.io/npm/v/babel-plugin-app-decorators-style-precompile.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-app-decorators-style-precompile) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-style-precompile)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-style-precompile) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-style-precompile&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-style-precompile&type=dev) |
| [`app-decorators-component-register`](/packages/babel-plugin-app-decorators-component-register) | [![npm](https://img.shields.io/npm/v/babel-plugin-app-decorators-component-register.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-plugin-app-decorators-component-register) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-component-register)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-component-register) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-plugin-app-decorators-component-register&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-plugin-app-decorators-component-register&type=dev) |
| [`postcss-parse-atrule-events`](/packages/postcss-parse-atrule-events) | [![npm](https://img.shields.io/npm/v/postcss-parse-atrule-events.svg?maxAge=2592000)](https://www.npmjs.com/package/postcss-parse-atrule-events) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/postcss-parse-atrule-events)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/postcss-parse-atrule-events) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/postcss-parse-atrule-events&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/postcss-parse-atrule-events&type=dev) |
| [`preset-app-decorators`](/packages/babel-preset-app-decorators) | [![npm](https://img.shields.io/npm/v/babel-preset-app-decorators.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-app-decorators) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-preset-app-decorators)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-preset-app-decorators) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/babel-preset-app-decorators&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/babel-preset-app-decorators&type=dev) |

#### Command line tools (Cli) for Mac, Linux or Windows

| Package | Version | Dependencies | DevDependencies |
|--------|-------|------------|------------|
| [`appdec-cli-osx`](https://github.com/SerkanSipahi/app-decorators-cli) | [![npm](https://img.shields.io/npm/v/appdec-cli-osx.svg?maxAge=2592000)](https://www.npmjs.com/package/appdec-cli-osx) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/osx)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/osx) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/osx&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/osx&type=dev) |
| [`appdec-cli-win`](https://github.com/SerkanSipahi/app-decorators-cli) | [![npm](https://img.shields.io/npm/v/appdec-cli-win.svg?maxAge=2592000)](https://www.npmjs.com/package/appdec-cli-win) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/win)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/win) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/win&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/win&type=dev) |
| [`appdec-cli-linux`](https://github.com/SerkanSipahi/app-decorators-cli) | [![npm](https://img.shields.io/npm/v/appdec-cli-linux.svg?maxAge=2592000)](https://www.npmjs.com/package/appdec-cli-linux) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/linux)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/linux) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators-cli.svg?path=bin/linux&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators-cli?path=bin/linux&type=dev) |

#### Todomvc

| Package | Version | Dependencies | DevDependencies |
|--------|-------|------------|------------|
| [`app-decorators-todomvc`](/packages/app-decorators-todomvc) | [![npm](https://img.shields.io/npm/v/app-decorators-todomvc.svg?maxAge=2592000)](https://www.npmjs.com/package/app-decorators-todomvc) | [![Dependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/app-decorators-todomvc)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/app-decorators-todomvc) | [![DevDependency Status](https://david-dm.org/SerkanSipahi/app-decorators.svg?path=packages/app-decorators-todomvc&type=dev)](https://david-dm.org/SerkanSipahi/app-decorators?path=packages/app-decorators-todomvc&type=dev) |

---

#### Simple example

##### Item.js
```js
import { component, view, on, action, style } from 'app-decorators';

@style(`
    /** These atrule (@) events will be loaded asynchronous (non blocking) **/
    
    /** will be loaded on load event **/
    @on load {
        @fetch path/to/on/load.css;
    }
    
    /** will be loaded when clicked .up class **/
    @on click .up {
        @fetch path/to/on/click/up.css;
    }

    /** will be loaded when url changed **/
    @action hello/my/friend.html {
        @fetch path/to/on/some/route/action.css;
    }

    /** critical path (inline css will appear immediately) **/
    my-box div {
        width: 100px;
        height: 100px;
    }
`)
@view(`
    <h3>{{head}}</h3>
    <div class="count">{{count}}</div>
    <div>
        <span class="up"> + </span>
        <span class="down"> - </span>
    </div>
    <div>
        <a href="?state=reset">clear count</a>
        <a href="?state=destroy">destroy</a>
        <a href="hello/my/friend.html">destroy</a>
    </div>
`)
@component({
    name: 'my-box'
})
class Item {

    @view.bind count = 0;
    
    @on('click .up') onClickUp() {
        ++this.count
    }
    
    @on('click .down') onClickUp() {
        --this.count
    }
    
    @action('?state={{type}}') onUrlStateChanged({ params }){
        
        let { type } = params;
        if(type === 'reset'){
            this.count = 0;   
        }
        // remove it self
        else if(type === 'destroy') {
            this.parentNode.removeChild(this);
        }
    }
}

export {
    Item
}
```

#### app.js
```js

let item = Item.create({
    head: 'Some description'
});

document.body.appendChild(item);
```

#### Result in Markup
```html
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>my com-item</title>
    </head>
    <body>
        <com-item>
            <!-- for fast rendering, style will be appended onLoad -->
            <style>
                my-box h3 {
                    font-size: 14px;
                }
                my-box div {
                    border: 1px solid gray;
                }
            </style>
            <h3>Some description</h3>
            <div class="count">0</div>
            <!-- on click .up or .down it will increment/decrement .count -->
            <div>
                <span class="up"> + </span>
                <span class="down"> - </span>
            </div>  
            <div>
                <a href="?state=reset">clear count</a>
                <a href="?state=destroy">destroy</a>
            </div>
        </com-item>
    </body>
</html>
```

#### Its also possible to put `<com-item></com-item>` direct in the dom like:
```html
<body>
    <!-- It will render, see above (result in markup) -->
    <com-item></com-item>
</body>
```

## Browser Support

| Tables                      | Version                         |
| --------------------------- |:-------------------------------:|
| Chrome                      | latest stable                   |
| Edge                        | latest stable                   |
| Firefox                     | latest stable                   |
| Opera                       | latest stable                   |
| Safari MacOS                | >=  9                           |
| IE                          | >= 11                           |
| --------------------------- | ------------------------------- |
| iOS Safari                  | >= 10.0.0                       |
| iOS Chrome                  | >= 58.0.0                       |
| iOS Firefox                 | >= 55.0.0                       |
| --------------------------- | ------------------------------- |
| Android Chrome              | >= 58.0.0                       |
| Android Firefox             | >= 55.0.0                       |

## Documentation

##### Decorators
* [@component](./docs/decorators/component.md)
* [@view](./docs/decorators/view.md)
* [@on](./docs/decorators/on.md)
* [@action](./docs/decorators/action.md)
* [@style](./docs/decorators/style.md)

##### Libraries
* [Router](./docs/libs/router.md)
* [Customelement](./docs/libs/customelement.md)
* [Eventhandler](./docs/libs/eventhandler.md)
* [View](./docs/libs/view.md)
* [Stylesheet](./docs/libs/stylesheet.md)

## Tests and Contributors guidelines
```
// init
npm install --global lerna

// install and test packages
make lerna-bootstrap
make lerna-test

// install and compile for browser tests
make install
make compile // required for node css fixture server
make test // and run this in separate window
```

## Contributors guidelines (currently internal info)
build new binary on new version 

## Contributors guidelines (currently internal info)
```
// init
npm install --global lerna

// lerna-bootstrap for packages
lerna bootstrap -- --no-package-lock

// or make install for acceptance tests
cd packages/app-decorators
jspm install
cd ../..
make prepare-compile // ignore the :4000 error
make gulp-compile

// browser test
make test

// packages test
make lerna-test

// clean packages
make lerna-clean
make clean
git checkout packages/app-decorators/package.json
git checkout jspm.config.js

// when publish
- *1 update in package.json version
- update babel-preset-app-decorators to same in *1
- packages/app-decorators-todomvc update preset

```

app-decorators and its [packages](https://github.com/SerkanSipahi/app-decorators/tree/master/packages) are distributed as a [monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md).

## (c) 2015 - 2018 Serkan Sipahi
App-Decorators may be freely distributed under the [MIT license](https://github.com/SerkanSipahi/app-decorators/blob/master/LICENSE).

---
_Source: https://npm.io/package/app-decorators-simple-it · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
