Update esm and electron mappings in preset-env (#9573)

This commit is contained in:
Brian Ng 2019-02-25 16:51:38 -06:00 committed by GitHub
parent 0e3968124c
commit 434fd32c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 69 deletions

View File

@ -6,6 +6,6 @@
"safari": "10.1",
"opera": "48",
"ios_saf": "10.3",
"and_ff": "60"
"and_ff": "64"
}
}

View File

@ -17,7 +17,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -40,7 +40,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -73,7 +73,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -106,7 +106,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -119,7 +119,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -142,7 +142,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -155,7 +155,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -178,7 +178,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -191,7 +191,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -204,7 +204,7 @@
"safari": "3.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -215,10 +215,10 @@
"edge": "12",
"firefox": "5",
"safari": "10.1",
"node": "10.0",
"node": "10",
"ie": "9",
"ios": "10.3",
"electron": "3"
"electron": "3.1"
},
"es6.array.species": {
"chrome": "51",
@ -238,7 +238,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -251,7 +251,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -264,7 +264,7 @@
"safari": "10",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "10",
"electron": "1.1"
},
@ -286,7 +286,7 @@
"safari": "3.1",
"node": "0.12",
"ie": "10",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -299,9 +299,10 @@
"safari": "5.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2"
"phantom": "2",
"electron": "5"
},
"es6.function.has-instance": {
"chrome": "51",
@ -320,7 +321,7 @@
"firefox": "2",
"safari": "4",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -624,7 +625,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -637,7 +638,7 @@
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
"electron": "3.1"
},
"es7.object.define-setter": {
"chrome": "62",
@ -647,7 +648,7 @@
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
"electron": "3.1"
},
"es6.object.define-property": {
"chrome": "5",
@ -657,7 +658,7 @@
"safari": "5.1",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -670,7 +671,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -742,7 +743,7 @@
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
"electron": "3.1"
},
"es7.object.lookup-setter": {
"chrome": "62",
@ -751,7 +752,7 @@
"node": "8.10",
"ios": "9",
"opera": "49",
"electron": "3"
"electron": "3.1"
},
"es6.object.prevent-extensions": {
"chrome": "44",
@ -859,10 +860,10 @@
"edge": "18",
"firefox": "58",
"safari": "11.1",
"node": "10.0",
"node": "10",
"ios": "11.3",
"opera": "50",
"electron": "3"
"electron": "3.1"
},
"es6.reflect.apply": {
"chrome": "49",
@ -1080,10 +1081,10 @@
"chrome": "63",
"firefox": "57",
"safari": "12",
"node": "10.0",
"node": "10",
"ios": "12",
"opera": "50",
"electron": "3"
"electron": "3.1"
},
"es6.string.anchor": {
"chrome": "5",
@ -1091,7 +1092,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1102,7 +1103,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1113,7 +1114,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1124,7 +1125,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1155,7 +1156,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1166,7 +1167,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1177,7 +1178,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1208,7 +1209,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1229,7 +1230,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1280,7 +1281,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1301,7 +1302,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1312,7 +1313,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1323,7 +1324,7 @@
"firefox": "17",
"safari": "6",
"node": "0.12",
"android": "4.0",
"android": "4",
"ios": "7",
"phantom": "2",
"electron": "1.1"
@ -1336,7 +1337,7 @@
"safari": "4",
"node": "0.10",
"ie": "9",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -1359,7 +1360,7 @@
"safari": "5.1",
"node": "0.12",
"ie": "10",
"android": "4.0",
"android": "4",
"ios": "6",
"phantom": "2",
"electron": "1.1"
@ -1478,7 +1479,7 @@
"chrome": "69",
"firefox": "62",
"safari": "12",
"node": "11.0",
"node": "11",
"ios": "12",
"opera": "56",
"electron": "4"

View File

@ -125,7 +125,7 @@
"node": "8.10",
"ios": "11.3",
"opera": "49",
"electron": "3"
"electron": "3.1"
},
"transform-unicode-regex": {
"chrome": "50",
@ -231,10 +231,10 @@
"chrome": "63",
"firefox": "57",
"safari": "12",
"node": "10.0",
"node": "10",
"ios": "12",
"opera": "50",
"electron": "3"
"electron": "3.1"
},
"proposal-object-rest-spread": {
"chrome": "60",
@ -248,35 +248,35 @@
"proposal-unicode-property-regex": {
"chrome": "64",
"safari": "11.1",
"node": "10.0",
"node": "10",
"ios": "11.3",
"opera": "51",
"electron": "3"
"electron": "3.1"
},
"proposal-json-strings": {
"chrome": "66",
"firefox": "62",
"safari": "12",
"node": "10.0",
"node": "10",
"ios": "12",
"opera": "53",
"electron": "3"
"electron": "3.1"
},
"proposal-optional-catch-binding": {
"chrome": "66",
"firefox": "58",
"safari": "11.1",
"node": "10.0",
"node": "10",
"ios": "11.3",
"opera": "53",
"electron": "3"
"electron": "3.1"
},
"transform-named-capturing-groups-regex": {
"chrome": "64",
"safari": "11.1",
"node": "10.0",
"node": "10",
"ios": "11.3",
"opera": "51",
"electron": "3"
"electron": "3.1"
}
}

View File

@ -53,7 +53,7 @@
"@babel/plugin-transform-template-literals": "^7.2.0",
"@babel/plugin-transform-typeof-symbol": "^7.2.0",
"@babel/plugin-transform-unicode-regex": "^7.2.0",
"browserslist": "^4.3.4",
"browserslist": "^4.4.2",
"invariant": "^2.2.2",
"js-levenshtein": "^1.1.3",
"semver": "^5.3.0"
@ -66,8 +66,8 @@
"@babel/core": "^7.3.4",
"@babel/helper-fixtures": "^7.2.0",
"@babel/helper-plugin-test-runner": "^7.0.0",
"caniuse-db": "1.0.30000851",
"caniuse-db": "1.0.30000938",
"compat-table": "kangax/compat-table#1e7b377fbdda9243cf9602872fcb493cdbdd565f",
"electron-to-chromium": "1.3.79"
"electron-to-chromium": "1.3.113"
}
}

View File

@ -254,7 +254,14 @@ const generateData = (environments, features) => {
const version = getLowestImplementedVersion(options, env);
if (version !== null) {
plugin[env] = version.toString();
const versionString = version.toString();
// NOTE(bng): A number of environments in compat-table changed to
// include a trailing zero (node10 -> node10_0), so for now stripping
// it to be consistent
plugin[env] = versionString.endsWith(".0")
? versionString.slice(0, -2)
: versionString;
}
});

View File

@ -3,23 +3,22 @@ const fs = require("fs");
const moduleSupport = require("caniuse-db/features-json/es6-module.json");
const acceptedWithCaveats = {
safari: true,
ios_saf: true,
};
const skipList = new Set(["and_chr", "android", "samsung"]);
const acceptedWithCaveats = new Set(["safari", "ios_saf"]);
const { stats } = moduleSupport;
const allowedBrowsers = {};
Object.keys(stats).forEach(browser => {
if (browser !== "and_chr") {
if (!skipList.has(browser)) {
const browserVersions = stats[browser];
const allowedVersions = Object.keys(browserVersions)
.filter(value => {
return acceptedWithCaveats[browser]
// Edge 16/17 are marked as "y #6"
return acceptedWithCaveats.has(browser)
? browserVersions[value][0] === "a"
: browserVersions[value] === "y";
: browserVersions[value].startsWith("y");
})
.sort((a, b) => a - b);