This repository has been archived by the owner on May 11, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug messaging to usage plugin (#291)
- Loading branch information
1 parent
28e0ce2
commit 7531362
Showing
18 changed files
with
400 additions
and
83 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/lib | ||
debug-fixtures | ||
fixtures | ||
/data | ||
/flow-typed |
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,20 @@ | ||
import semver from "semver"; | ||
import { prettifyVersion, semverify } from "./utils"; | ||
|
||
export const logMessage = (message, context) => { | ||
const pre = context ? `[${context}] ` : ""; | ||
const logStr = ` ${pre}${message}`; | ||
console.log(logStr); | ||
}; | ||
|
||
export const logPlugin = (plugin, targets, list, context) => { | ||
const envList = list[plugin] || {}; | ||
const filteredList = Object.keys(targets).reduce((a, b) => { | ||
if (!envList[b] || semver.lt(targets[b], semverify(envList[b]))) { | ||
a[b] = prettifyVersion(targets[b]); | ||
} | ||
return a; | ||
}, {}); | ||
|
||
logMessage(`${plugin} ${JSON.stringify(filteredList)}`, context); | ||
}; |
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
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
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
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
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 @@ | ||
var foo = "bar"; |
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,5 @@ | ||
var x = 0; | ||
|
||
for (var i = 0; i < 5; i++) { | ||
x += i; | ||
} |
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 @@ | ||
{ | ||
"presets": [ | ||
["../../lib", { | ||
"debug": true, | ||
"targets": { | ||
"chrome": 52, | ||
"firefox": 50, | ||
"ie": 11 | ||
}, | ||
"useBuiltIns": "usage" | ||
}] | ||
] | ||
} |
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,40 @@ | ||
babel-preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"chrome": "52", | ||
"firefox": "50", | ||
"ie": "11" | ||
} | ||
|
||
Modules transform: commonjs | ||
|
||
Using plugins: | ||
check-es2015-constants {"firefox":"50","ie":"11"} | ||
transform-es2015-arrow-functions {"ie":"11"} | ||
transform-es2015-block-scoping {"firefox":"50","ie":"11"} | ||
transform-es2015-classes {"ie":"11"} | ||
transform-es2015-computed-properties {"ie":"11"} | ||
transform-es2015-destructuring {"firefox":"50","ie":"11"} | ||
transform-es2015-duplicate-keys {"ie":"11"} | ||
transform-es2015-for-of {"firefox":"50","ie":"11"} | ||
transform-es2015-function-name {"firefox":"50","ie":"11"} | ||
transform-es2015-literals {"firefox":"50","ie":"11"} | ||
transform-es2015-object-super {"ie":"11"} | ||
transform-es2015-parameters {"firefox":"50","ie":"11"} | ||
transform-es2015-shorthand-properties {"ie":"11"} | ||
transform-es2015-spread {"ie":"11"} | ||
transform-es2015-sticky-regex {"ie":"11"} | ||
transform-es2015-template-literals {"ie":"11"} | ||
transform-es2015-typeof-symbol {"ie":"11"} | ||
transform-es2015-unicode-regex {"ie":"11"} | ||
transform-regenerator {"firefox":"50","ie":"11"} | ||
transform-exponentiation-operator {"firefox":"50","ie":"11"} | ||
transform-async-to-generator {"chrome":"52","firefox":"50","ie":"11"} | ||
syntax-trailing-function-commas {"chrome":"52","firefox":"50","ie":"11"} | ||
|
||
Polyfills | ||
========= | ||
|
||
src/in.js -> lib/in.js | ||
src/in2.js -> lib/in2.js |
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 @@ | ||
const foo = new Promise((resolve) => { | ||
resolve(new Map()); | ||
}); |
Oops, something went wrong.