first commit

This commit is contained in:
Sebastian McKenzie 2016-03-10 06:24:44 +00:00
parent f8e33840b0
commit 64ff4c3561
12 changed files with 168 additions and 30 deletions

4
.babelrc Normal file
View File

@ -0,0 +1,4 @@
{
"presets": ["es2015", "react", "stage-0"],
"plugins": ["transform-runtime"]
}

2
.eslintignore Normal file
View File

@ -0,0 +1,2 @@
test
lib

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
lib
node_modules

19
.travis.yml Normal file
View File

@ -0,0 +1,19 @@
---
git:
depth: 1
sudo: false
language: node_js
cache:
directories:
- node_modules
node_js:
- "5"
- "4"
- iojs
- "0.12"
script: npm test
notifications:
slack: babeljs:5Wy4QX13KVkGy9CnU0rmvgeK

13
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,13 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)

5
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,5 @@
# Contributing
Contributions are always welcome, no matter how large or small. Before
contributing, please read the
[code of conduct](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md).

View File

@ -5,15 +5,29 @@
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"repository": "https://github.com/babel/babel/tree/master/packages/babylon",
"repository": "https://github.com/babel/babylon",
"main": "lib/index.js",
"dependencies": {
"babel-runtime": "^5.0.0"
"babel-runtime": "^6.0.0"
},
"devDependencies": {
"babel-helper-fixtures": "^6.6.5"
"ava": "^0.12.0",
"babel-cli": "^6.0.0",
"babel-helper-fixtures": "^6.6.5",
"babel-plugin-transform-class-properties": "^6.6.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-react": "^6.0.0",
"babel-preset-stage-0": "^6.5.0",
"kcheck": "^2.0.1"
},
"bin": {
"babylon": "./bin/babylon.js"
},
"scripts": {
"test": "npm run build && npm run lint && ava test/",
"lint": "kcheck",
"build": "babel src --out-dir lib",
"watch": "babel src --out-dir lib --watch"
}
}

View File

@ -1,7 +0,0 @@
var fs = require("fs");
exports.updateMain = function (main) {
var pkg = require("../package.json");
pkg.main = main;
fs.writeFileSync(__dirname + "/../package.json", JSON.stringify(pkg, null, " "));
};

View File

@ -1,2 +0,0 @@
require("./_util").updateMain("lib/index.js");
require("fs").unlinkSync(__dirname + "/../index.js");

View File

@ -1,8 +0,0 @@
require("./_util").updateMain("index.js");
require("child_process").execSync(
__dirname + "/../../../node_modules/.bin/browserify " +
"--standalone babylon " +
"--entry " + __dirname + "/../lib/index.js " +
"--plugin bundle-collapser/plugin " +
"--plugin derequire/plugin " +
"--outfile " + __dirname + "/../index.js", { encoding: "utf8" });

View File

@ -0,0 +1,97 @@
{
"type": "File",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"expression": {
"type": "BinaryExpression",
"start": 0,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 7
}
},
"left": {
"type": "Identifier",
"start": 0,
"end": 1,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 1
}
},
"name": "a"
},
"operator": "<==",
"right": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "b"
}
}
}
],
"directives": []
}
}

View File

@ -1,21 +1,20 @@
var getFixtures = require("babel-helper-fixtures").multiple;
var parse = require("../lib").parse;
var test = require("ava");
var _ = require("lodash");
var fixtures = getFixtures(__dirname + "/fixtures");
_.each(fixtures, function (suites, name) {
_.each(suites, function (testSuite) {
suite(name + "/" + testSuite.title, function () {
_.each(testSuite.tests, function (task) {
test(task.title, !task.disabled && function () {
try {
return runTest(task);
} catch (err) {
err.message = task.actual.loc + ": " + err.message;
throw err;
}
});
_.each(testSuite.tests, function (task) {
test(name + "/" + testSuite.title + "/" + task.title, !task.disabled && function () {
try {
return runTest(task);
} catch (err) {
err.message = task.actual.loc + ": " + err.message;
throw err;
}
});
});
});