commit
7262ad631f
29
.babelrc.js
Normal file
29
.babelrc.js
Normal file
@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
let envOpts = {
|
||||
loose: true
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
comments: false,
|
||||
presets: [
|
||||
[
|
||||
"env", envOpts
|
||||
],
|
||||
"stage-0",
|
||||
"flow",
|
||||
],
|
||||
env: {
|
||||
cov: {
|
||||
auxiliaryCommentBefore: "istanbul ignore next",
|
||||
plugins: ["istanbul"]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.BABEL_ENV === 'development') {
|
||||
envOpts.targets = {
|
||||
node: "current"
|
||||
};
|
||||
envOpts.debug = true;
|
||||
};
|
||||
@ -16,14 +16,11 @@ env:
|
||||
|
||||
script:
|
||||
- 'if [ "$JOB" = "test" ]; then make test-ci; fi'
|
||||
- 'if [ "$JOB" = "test-coverage" ]; then make test-ci-coverage; fi'
|
||||
- 'if [ "$JOB" = "lint" ]; then make lint && make flow; fi'
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "7"
|
||||
env: JOB=test-coverage
|
||||
- node_js: "node"
|
||||
env: JOB=lint
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@ const watch = require("gulp-watch");
|
||||
const gutil = require("gulp-util");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const babelConfig = require("./.babelrc");
|
||||
|
||||
const scripts = "./packages/*/src/**/*.js";
|
||||
|
||||
let srcEx, libFragment;
|
||||
|
||||
if (path.win32 === path) {
|
||||
@ -39,7 +39,7 @@ gulp.task("build", function () {
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file.path) + "'...");
|
||||
callback(null, file);
|
||||
}))
|
||||
.pipe(babel())
|
||||
.pipe(babel(babelConfig))
|
||||
.pipe(through.obj(function (file, enc, callback) {
|
||||
file._path = file.path;
|
||||
file.path = mapToDest(file.path);
|
||||
@ -67,7 +67,7 @@ gulp.task("build-watch", function () {
|
||||
gutil.log("Compiling", "'" + chalk.cyan(file._path) + "'...");
|
||||
callback(null, file);
|
||||
}))
|
||||
.pipe(babel())
|
||||
.pipe(babel(babelConfig))
|
||||
.pipe(gulp.dest(dest));
|
||||
});
|
||||
|
||||
|
||||
6
Makefile
6
Makefile
@ -16,16 +16,16 @@ build-dist: build
|
||||
|
||||
watch: clean
|
||||
rm -rf packages/*/lib
|
||||
./node_modules/.bin/gulp watch
|
||||
BABEL_ENV=development ./node_modules/.bin/gulp watch
|
||||
|
||||
lint:
|
||||
./node_modules/.bin/eslint scripts packages Gulpfile.js --format=codeframe
|
||||
./node_modules/.bin/eslint scripts packages *.js --format=codeframe
|
||||
|
||||
flow:
|
||||
./node_modules/.bin/flow check
|
||||
|
||||
fix:
|
||||
./node_modules/.bin/eslint scripts packages Gulpfile.js --format=codeframe --fix
|
||||
./node_modules/.bin/eslint scripts packages *.js --format=codeframe --fix
|
||||
|
||||
clean: test-clean
|
||||
rm -rf packages/babel-polyfill/browser*
|
||||
|
||||
@ -13,4 +13,4 @@ dependencies:
|
||||
|
||||
test:
|
||||
override:
|
||||
- make test-ci
|
||||
- make test-ci-coverage
|
||||
|
||||
37
package.json
37
package.json
@ -10,14 +10,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"async": "^1.5.0",
|
||||
"babel-core": "^6.13.2",
|
||||
"babel-core": "7.0.0-alpha.3",
|
||||
"babel-eslint": "^7.0.0",
|
||||
"babel-plugin-istanbul": "^2.0.1",
|
||||
"babel-plugin-transform-class-properties": "^6.6.0",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.3.13",
|
||||
"babel-preset-es2015": "^6.13.2",
|
||||
"babel-preset-stage-0": "^6.0.0",
|
||||
"babel-register": "^6.14.0",
|
||||
"babel-preset-env": "2.0.0-alpha.3",
|
||||
"babel-preset-flow": "7.0.0-alpha.3",
|
||||
"babel-preset-stage-0": "7.0.0-alpha.3",
|
||||
"babel-register": "7.0.0-alpha.4",
|
||||
"browserify": "^13.1.1",
|
||||
"bundle-collapser": "^1.2.1",
|
||||
"chai": "^3.5.0",
|
||||
@ -29,7 +28,7 @@
|
||||
"eslint-plugin-flowtype": "^2.20.0",
|
||||
"flow-bin": "^0.41.0",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-babel": "^6.0.0",
|
||||
"gulp-babel": "babel/gulp-babel#b7-alpha",
|
||||
"gulp-newer": "^1.0.0",
|
||||
"gulp-plumber": "^1.0.1",
|
||||
"gulp-util": "^3.0.7",
|
||||
@ -49,30 +48,6 @@
|
||||
"node": ">= 4.x <= 7.x",
|
||||
"npm": "2.x || 3.x || 4.x"
|
||||
},
|
||||
"babel": {
|
||||
"comments": false,
|
||||
"presets": [
|
||||
[
|
||||
"es2015",
|
||||
{
|
||||
"loose": true
|
||||
}
|
||||
],
|
||||
"stage-0"
|
||||
],
|
||||
"plugins": [
|
||||
"transform-class-properties",
|
||||
"transform-flow-strip-types"
|
||||
],
|
||||
"env": {
|
||||
"cov": {
|
||||
"auxiliaryCommentBefore": "istanbul ignore next",
|
||||
"plugins": [
|
||||
"istanbul"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"exclude": [
|
||||
|
||||
@ -1,25 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
const babel = require("../package.json").babel;
|
||||
const register = require("babel-register");
|
||||
const path = require("path");
|
||||
|
||||
if (babel.plugins) {
|
||||
// correct path of relative plugins
|
||||
babel.plugins = babel.plugins.map(function (plugin) {
|
||||
if (plugin.charAt(0) === ".") {
|
||||
return plugin.replace(/^\./, path.join(__dirname, ".."));
|
||||
}
|
||||
|
||||
return plugin;
|
||||
});
|
||||
}
|
||||
const babel = require("../.babelrc");
|
||||
const register = require("babel-register").default;
|
||||
|
||||
register(babel);
|
||||
register({
|
||||
extensions: [".js"],
|
||||
// Only js files in the test folder but not in the subfolder fixtures.
|
||||
only: /packages\/.+\/test\/(?!fixtures\/).+\.js$/,
|
||||
only: [/packages\/.+\/test\/(?!fixtures\/).+\.js$/],
|
||||
babelrc: false,
|
||||
compact: true,
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user