Compare commits

...

19 Commits

Author SHA1 Message Date
Sebastian McKenzie
2cff9519e1 v5.4.2 2015-05-15 02:35:07 +01:00
Sebastian McKenzie
f9c2c6e988 Merge branch 'master' of github.com:babel/babel
# Conflicts:
#	CHANGELOG.md
2015-05-15 02:34:11 +01:00
Sebastian McKenzie
5ae3dc01f1 make path patterns used by only and ignore **very** liberal, this will ease a lot of pain in dealing with them 2015-05-15 02:33:40 +01:00
Sebastian McKenzie
af4fd69dd0 make path patterns used by only and ignore **very** liberal, this will ease a lot of pain in dealing with them 2015-05-15 02:33:22 +01:00
Sebastian McKenzie
4d4493f325 elaborate on shouldIgnore changes in 5.4.1 2015-05-15 02:03:02 +01:00
Sebastian McKenzie
e70d474b39 5.4.1 2015-05-15 02:01:42 +01:00
Sebastian McKenzie
1b45f64858 v5.4.1 2015-05-15 02:00:18 +01:00
Sebastian McKenzie
b89cf6768f fix shouldIgnore only matches switch 2015-05-15 01:57:10 +01:00
Sebastian McKenzie
36ad1108b4 fix loose mode loop being weirdly inserted 2015-05-15 01:56:34 +01:00
Sebastian McKenzie
4c04371ea4 remove loop label due to babel bug 2015-05-15 01:48:47 +01:00
Sebastian McKenzie
d3e385c554 one last try fixing the shouldIgnore only filter... 2015-05-15 01:46:36 +01:00
Sebastian McKenzie
6afcef9805 actually fix shouldIgnore algorithm this time, ugh 2015-05-15 01:44:57 +01:00
Sebastian McKenzie
ed861e230b fix shouldIgnore method for only 2015-05-15 01:41:49 +01:00
Sebastian McKenzie
e15ced2922 add 5.4.1 changelog 2015-05-15 01:37:48 +01:00
Sebastian McKenzie
93052e532f Merge branch 'master' of github.com:babel/babel 2015-05-15 01:35:43 +01:00
Sebastian McKenzie
198d51ddaa heavily improve shouldIgnore algorithm - fixes #1539 2015-05-15 01:34:58 +01:00
Sebastian McKenzie
8730b24def Merge pull request #1540 from browncolyn/master
Added slash as needed dependency
2015-05-15 01:30:50 +01:00
Colyn Brown
f09c0d5998 Added slash as needed dependency 2015-05-14 17:28:20 -07:00
Sebastian McKenzie
21e4481ab7 5.4.0 2015-05-15 00:32:36 +01:00
7 changed files with 43 additions and 9 deletions

View File

@@ -13,6 +13,18 @@ _Note: Gaps between patch versions are faulty/broken releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 5.4.2
* **Polish**
* `ignore` and `only` patterns are now **very** liberal. The pattern can now exist anywhere in the path.
## 5.4.1
* **Bug Fix**
* Add missing `slash` dependency. Thanks [@browncolyn](https://github.com/browncolyn)!
* **Polish**
* Clean up `shouldIgnore` algorithm to work how you'd expect rather than being a hacky piece of shit. It now crawls the entire path, checking each section of it against the input ignore/only patterns. This means that the pattern `foo` will ignore the paths `foo/bar.js`, `bar/foo` etc.
## 5.4.0
* **New Feature**

View File

@@ -1,7 +1,7 @@
{
"name": "babel-core",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.4.0",
"version": "5.4.2",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",

View File

@@ -1,14 +1,14 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "5.3.3",
"version": "5.4.1",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"license": "MIT",
"repository": "babel/babel",
"preferGlobal": true,
"dependencies": {
"babel-core": "^5.3.3",
"babel-core": "^5.4.1",
"chokidar": "^1.0.0",
"commander": "^2.6.0",
"convert-source-map": "^1.1.0",
@@ -17,7 +17,8 @@
"lodash": "^3.2.0",
"output-file-sync": "^1.1.0",
"path-is-absolute": "^1.0.0",
"source-map": "^0.4.0"
"source-map": "^0.4.0",
"slash": "^1.0.0"
},
"bin": {
"babel": "./bin/babel/index.js",

View File

@@ -1,7 +1,7 @@
{
"name": "babel-runtime",
"description": "babel selfContained runtime",
"version": "5.3.3",
"version": "5.4.1",
"license": "MIT",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>",

View File

@@ -33,7 +33,7 @@ export function ForOfStatement(node, parent, scope, file) {
this.parentPath.replaceWithMultiple(build.node);
this.remove();
} else {
this.replaceWithMultiple(build.node);
return build.node;
}
}

View File

@@ -1,7 +1,7 @@
import "./patch";
import escapeRegExp from "lodash/string/escapeRegExp";
import startsWith from "lodash/string/startsWith";
import cloneDeep from "lodash/lang/cloneDeep";
import isBoolean from "lodash/lang/isBoolean";
import * as messages from "./messages";
@@ -69,9 +69,22 @@ export function list(val: string): Array<string> {
export function regexify(val: any): RegExp {
if (!val) return new RegExp(/.^/);
if (Array.isArray(val)) val = new RegExp(val.map(escapeRegExp).join("|"), "i");
if (isString(val)) return minimatch.makeRe(val, { nocase: true });
if (isString(val)) {
// normalise path separators
val = slash(val);
// remove relative separator if present
if (startsWith(val, "./")) val = val.slice(2);
var regex = minimatch.makeRe(val, { nocase: true });
return new RegExp(regex.source.slice(1, -1), "i");
}
if (isRegExp(val)) return val;
throw new TypeError("illegal type for regexify");
}
@@ -96,6 +109,7 @@ export function booleanify(val: any): boolean {
export function shouldIgnore(filename, ignore, only) {
filename = slash(filename);
if (only.length) {
for (var pattern of (only: Array)) {
if (pattern.test(filename)) return false;

View File

@@ -80,9 +80,16 @@ suite("util", function () {
assert.deepEqual(util.regexify(null), /.^/);
assert.deepEqual(util.regexify(""), /.^/);
assert.deepEqual(util.regexify(["foo", "bar"]), /foo|bar/i);
assert.deepEqual(util.regexify("foobar"), /^(?:(?=.)foobar)$/i);
assert.deepEqual(util.regexify("foobar"), /(?:(?=.)foobar)/i);
assert.deepEqual(util.regexify(/foobar/), /foobar/);
assert.ok(util.regexify("foo/bar").test("bar/foo/bar"));
assert.ok(util.regexify("foo/*").test("foo/bar.js"));
assert.ok(util.regexify("*.js").test("bar.js"));
assert.ok(util.regexify("./foo").test("foo"));
assert.ok(util.regexify("./foo/bar.js").test("foo/bar.js"));
assert.ok(util.regexify("foobar").test("foobar"));
assert.throws(function () {
util.regexify({});
}, /illegal type for regexify/);