Skip to content

Commit

Permalink
Babel for Fly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Bucaran committed Jul 6, 2015
0 parents commit d329f1d
Show file tree
Hide file tree
Showing 9 changed files with 146 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .eslintrc
@@ -0,0 +1,9 @@
{
"env": {
"node": true
},
"rules": {
"semi": [2, "never"],
"curly": 0
}
}
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.log
node_modules/
7 changes: 7 additions & 0 deletions .travis.yml
@@ -0,0 +1,7 @@
language: node_js
node_js:
- "0.11"
- "0.12"
- "iojs"

script: "npm run test-ci"
24 changes: 24 additions & 0 deletions LICENSE
@@ -0,0 +1,24 @@
The MIT License (MIT)

Copyright (c) 2015 Jorge Bucaran

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights 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 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.
51 changes: 51 additions & 0 deletions README.md
@@ -0,0 +1,51 @@
<div align="center">
<a href="http://github.com/flyjs/fly">
<img width=200px src="https://cloud.githubusercontent.com/assets/8317250/8430194/35c6043a-1f6a-11e5-8cbd-af6cc86baa84.png">
</a>
</div>

> [Babel](babeljs.io) plugin for _[Fly][fly]_.
[![][fly-badge]][fly]
[![npm package][npm-ver-link]][releases]
[![][dl-badge]][npm-pkg-link]
[![][travis-badge]][travis-link]
[![][mit-badge]][mit]

## Usage
> Check out the [documentation](https://babeljs.io/docs/usage/options/) to see the available options.
### Install

```a
npm install -D fly-babel
```

### Example

```js
export function* text () {
yield this
.source("src/**/*.js")
.babel({ stage: 0 })
.target("dist/")
}
```

# License

[MIT][mit] © [Jorge Bucaran][author] et [al][contributors]


[mit]: http://opensource.org/licenses/MIT
[author]: http://about.bucaran.me
[contributors]: https://github.com/bucaran/fly-babel/graphs/contributors
[releases]: https://github.com/bucaran/fly-babel/releases
[fly]: https://www.github.com/flyjs/fly
[fly-badge]: https://img.shields.io/badge/fly-JS-05B3E1.svg?style=flat-square
[mit-badge]: https://img.shields.io/badge/license-MIT-444444.svg?style=flat-square
[npm-pkg-link]: https://www.npmjs.org/package/fly-babel
[npm-ver-link]: https://img.shields.io/npm/v/fly-babel.svg?style=flat-square
[dl-badge]: http://img.shields.io/npm/dm/fly-babel.svg?style=flat-square
[travis-link]: https://travis-ci.org/bucaran/fly-babel
[travis-badge]: http://img.shields.io/travis/bucaran/fly-babel.svg?style=flat-square
6 changes: 6 additions & 0 deletions index.js
@@ -0,0 +1,6 @@
module.exports = function () {
return this.filter("babel", (src, opts) => {
try { return require("babel").transform(src, opts).code }
catch (e) { throw e }
})
}
29 changes: 29 additions & 0 deletions package.json
@@ -0,0 +1,29 @@
{
"name": "fly-babel",
"version": "0.1.1",
"description": "Babel plugin for Fly",
"license": "MIT",
"repository": "https://github.com/bucaran/fly-babel",
"main": "index.js",
"scripts": {
"lint": "eslint *.js",
"tape": "tape test/*.js",
"test": "npm run lint && npm run tape | tspec",
"build": "echo No build task specified.",
"deploy": "npm run test && git push origin master && npm publish",
"test-ci": "node --harmony --harmony_arrow_functions ./node_modules/tape/bin/tape test/*.js"
},
"author": "Jorge Bucaran",
"dependencies": {
"babel": "^5.6.14"
},
"devDependencies": {
"eslint": "^0.21.2",
"tap-spec": "^4.0.2",
"tape": "^4.0.0"
},
"engines": {
"iojs": ">= 1.0.0",
"node": ">= 0.11.0"
}
}
6 changes: 6 additions & 0 deletions test/index.js
@@ -0,0 +1,6 @@
const test = require("tape").test

test("fly-babel", function (t) {
t.ok(true, "ok")
t.end()
})

0 comments on commit d329f1d

Please sign in to comment.