-
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.
- Loading branch information
0 parents
commit 240be38
Showing
19 changed files
with
281 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"plugins": [ | ||
"transform-flow-strip-types", | ||
"transform-object-assign" | ||
], | ||
"presets": [ | ||
"es2015", | ||
"stage-0" | ||
] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# .editorconfig | ||
# | ||
|
||
# -------------------------------------- | ||
root = true | ||
|
||
[*] # ---------------------------------- | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] # ------------------------------- | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# .eslintignore | ||
# | ||
|
||
# -------------------------------------- | ||
**/dist/** | ||
**/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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "natron" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# .gitignore | ||
# | ||
|
||
# -------------------------------------- | ||
.DS_Store | ||
|
||
# npm ---------------------------------- | ||
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"natronfile": "build/natronfile" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# .travis.yml | ||
# | ||
|
||
language: "node_js" | ||
|
||
node_js: | ||
- "stable" | ||
- "0.12" | ||
- "0.10" | ||
# Long-term Support | ||
- "4.2" # Argon | ||
|
||
install: | ||
# Install Global Modules | ||
- "npm install eslint babel-eslint natronjs/eslint-config-natron" | ||
- "npm install mocha" | ||
|
||
# Install Standard Library | ||
- "npm install core-js" | ||
|
||
# Install Local Modules | ||
- "npm install" | ||
|
||
# Install Test Modules | ||
- "npm --prefix test install" | ||
|
||
script: | ||
# ESLint: Lint Packages | ||
- "node_modules/.bin/eslint packages/*/src" | ||
|
||
# Mocha: Test Packages | ||
- "node_modules/.bin/mocha packages/*/test" |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Stefan Rumzucker | ||
|
||
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. |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# [![Natron][natron-img]][natron-url] | ||
|
||
[natron-img]: http://static.natronjs.com/img/natronjs.svg | ||
[natron-url]: http://natronjs.com/ | ||
|
||
**A JavaScript Task Runner** | ||
|
||
[![Version][npm-img]][npm-url] | ||
[![Downloads][dlm-img]][npm-url] | ||
[![Build Status][travis-img]][travis-url] | ||
[![ReadMe][readme-img]][readme-url] | ||
|
||
[![Gitter Chat][gitter-img]][gitter-url] | ||
|
||
[npm-img]: https://img.shields.io/npm/v/natron.svg | ||
[npm-url]: https://npmjs.org/package/natron | ||
[dlm-img]: https://img.shields.io/npm/dm/natron.svg | ||
[travis-img]: https://travis-ci.org/natronjs/natron.svg | ||
[travis-url]: https://travis-ci.org/natronjs/natron | ||
[readme-img]: https://img.shields.io/badge/read-me-orange.svg | ||
[readme-url]: https://natron.readme.io/ | ||
|
||
[gitter-img]: https://badges.gitter.im/Join%20Chat.svg | ||
[gitter-url]: https://gitter.im/natronjs/natron | ||
|
||
## Documentation | ||
|
||
See the [documentation for Natron][readme-url] |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"transpiler": "babel", | ||
"logging": { | ||
"wrapConsole": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Natron Build | ||
|
||
## Building Packages | ||
|
||
``` | ||
$ natron build [package] [...targets = cjs] | ||
``` | ||
|
||
**Example `natron-core`** | ||
|
||
``` | ||
$ natron build core | ||
Building: package = core, targets = cjs | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* @module natron | ||
* build | ||
*/ | ||
import {resolve} from "path"; | ||
import {task} from "natron"; | ||
import {src, dest} from "natron-vinyl"; | ||
import {transform} from "vinyl-tf-babel"; | ||
|
||
const PKG_DIR = resolve(__dirname, ".."); | ||
|
||
function builder(target: string, options?: Object): Function { | ||
return (pkg: string) => { | ||
let pkgDir = resolve(PKG_DIR, "packages", pkg); | ||
|
||
return (src(resolve(pkgDir, "src", "**/*.js")) | ||
.pipe(transform(options)) | ||
.pipe(dest(resolve(pkgDir, "dist", target))) | ||
); | ||
}; | ||
} | ||
|
||
let builderTasks = { | ||
"cjs": task(builder("cjs", { | ||
"babelrc": false, | ||
"plugins": [ | ||
"transform-flow-strip-types", | ||
"transform-object-assign", | ||
], | ||
"presets": [ | ||
"es2015", | ||
"stage-0", | ||
], | ||
})), | ||
"es6": task(builder("es6", { | ||
"babelrc": false, | ||
"plugins": [ | ||
"transform-flow-strip-types", | ||
], | ||
"presets": [ | ||
"stage-0", | ||
], | ||
})), | ||
}; | ||
|
||
export function build(pkg: string, ...targets: string): Promise { | ||
/* eslint-disable no-console */ | ||
if (!pkg) { | ||
console.error("No package specified"); | ||
return; | ||
} | ||
if (!targets.length) { | ||
targets = ["cjs"]; | ||
} | ||
|
||
let tasks = []; | ||
for (let target of targets) { | ||
if (!builderTasks[target]) { | ||
console.error(`No builder for ${target}`); | ||
return; | ||
} | ||
tasks.push(builderTasks[target]); | ||
} | ||
|
||
console.log(`Building: package = ${pkg}, targets = ${targets.join(", ")}`); | ||
|
||
return task([tasks]).run(pkg); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"natron": "^0.1.0", | ||
"natron-vinyl": "^0.1.0", | ||
"vinyl-tf-babel": "^0.1.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"private": true, | ||
"homepage": "http://natronjs.com/", | ||
"author": "Stefan Rumzucker", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/natronjs/natron.git" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.0.0", | ||
"babel-plugin-transform-flow-strip-types": "^6.0.0", | ||
"babel-plugin-transform-object-assign": "^6.0.0", | ||
"babel-preset-es2015": "^6.0.0", | ||
"babel-preset-stage-0": "^6.0.0", | ||
"babel-register": "^6.0.0" | ||
}, | ||
"license": "MIT" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "natron/test", | ||
"globals": { | ||
"assert": true | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--compilers js:babel-register | ||
--require test/support/node |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"chai": "^3.4.0", | ||
"chai-as-promised": "^5.1.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @module natron | ||
* test | ||
*/ | ||
import chai from "chai"; | ||
import chaiAsPromised from "chai-as-promised"; | ||
import "./polyfills/v0.10"; | ||
|
||
chai.use(chaiAsPromised); | ||
|
||
Object.assign(global, { | ||
assert: chai.assert, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* @module natron | ||
* test | ||
*/ | ||
if (process.version.match(/^v0\.10/)) { | ||
require("core-js"); | ||
} |