Permalink
Browse files

Init ...

  • Loading branch information...
stefanr committed Dec 12, 2015
0 parents commit 240be383ae41d358606f5912646c9ff7ef8292f0
Showing with 281 additions and 0 deletions.
  1. +10 −0 .babelrc
  2. +18 −0 .editorconfig
  3. +7 −0 .eslintignore
  4. +3 −0 .eslintrc
  5. +9 −0 .gitignore
  6. +3 −0 .natronrc
  7. +33 −0 .travis.yml
  8. +21 −0 LICENSE
  9. +28 −0 README.md
  10. +6 −0 build/.natronrc
  11. +14 −0 build/README.md
  12. +68 −0 build/natronfile.js
  13. +8 −0 build/package.json
  14. +18 −0 package.json
  15. +6 −0 test/.eslintrc
  16. +2 −0 test/mocha.opts
  17. +7 −0 test/package.json
  18. +13 −0 test/support/node.js
  19. +7 −0 test/support/polyfills/v0.10.js
@@ -0,0 +1,10 @@
{
"plugins": [
"transform-flow-strip-types",
"transform-object-assign"
],
"presets": [
"es2015",
"stage-0"
]
}
@@ -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
@@ -0,0 +1,7 @@
#
# .eslintignore
#
# --------------------------------------
**/dist/**
**/node_modules/**
@@ -0,0 +1,3 @@
{
"extends": "natron"
}
@@ -0,0 +1,9 @@
#
# .gitignore
#
# --------------------------------------
.DS_Store
# npm ----------------------------------
node_modules
@@ -0,0 +1,3 @@
{
"natronfile": "build/natronfile"
}
@@ -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"
21 LICENSE
@@ -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.
@@ -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]
@@ -0,0 +1,6 @@
{
"transpiler": "babel",
"logging": {
"wrapConsole": true
}
}
@@ -0,0 +1,14 @@
# Natron Build
## Building Packages
```
$ natron build [package] [...targets = cjs]
```
**Example `natron-core`**
```
$ natron build core
Building: package = core, targets = cjs
```
@@ -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);
}
@@ -0,0 +1,8 @@
{
"private": true,
"dependencies": {
"natron": "^0.1.0",
"natron-vinyl": "^0.1.0",
"vinyl-tf-babel": "^0.1.0"
}
}
@@ -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"
}
@@ -0,0 +1,6 @@
{
"extends": "natron/test",
"globals": {
"assert": true
}
}
@@ -0,0 +1,2 @@
--compilers js:babel-register
--require test/support/node
@@ -0,0 +1,7 @@
{
"private": true,
"dependencies": {
"chai": "^3.4.0",
"chai-as-promised": "^5.1.0"
}
}
@@ -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,
});
@@ -0,0 +1,7 @@
/**
* @module natron
* test
*/
if (process.version.match(/^v0\.10/)) {
require("core-js");
}

0 comments on commit 240be38

Please sign in to comment.