browserslist
Advanced tools
Comparing version 4.12.2 to 4.13.0
@@ -24,6 +24,11 @@ var BrowserslistError = require('./error') | ||
throw new BrowserslistError( | ||
'Country statistics is not supported ' + | ||
'Country statistics are not supported ' + | ||
'in client-side build of Browserslist') | ||
}, | ||
loadFeature: function loadFeature () { | ||
throw new BrowserslistError( | ||
'Supports queries are not available in client-side build of Browserslist') | ||
}, | ||
currentNode: function currentNode (resolve, context) { | ||
@@ -30,0 +35,0 @@ return resolve(['maintained node versions'], context)[0] |
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 4.13 | ||
* Added `supports` query to select browsers (by Jesús Leganés-Combarro). | ||
## 4.12.2 | ||
@@ -10,2 +13,3 @@ * Update Firefox ESR. | ||
* Improve docs (by Mukundan Senthil). | ||
* Drop Node.js 13.0-13.6 support because of ES modules bug in that versions. | ||
@@ -17,3 +21,3 @@ ## 4.12 | ||
## 4.11.1 | ||
* FIx Node.js 6 support. | ||
* Fix Node.js 6 support. | ||
@@ -20,0 +24,0 @@ ## 4.11 |
15
index.js
@@ -508,2 +508,3 @@ var jsReleases = require('node-releases/data/processed/envs.json') | ||
// Will be filled by Can I Use data below | ||
browserslist.cache = { } | ||
browserslist.data = { } | ||
@@ -892,2 +893,16 @@ browserslist.usage = { | ||
{ | ||
regexp: /^supports\s+([\w-]+)$/, | ||
select: function (context, feature) { | ||
env.loadFeature(browserslist.cache, feature) | ||
var features = browserslist.cache[feature] | ||
return Object.keys(features).reduce(function (result, version) { | ||
var flags = features[version] | ||
if (flags.indexOf('y') >= 0 || flags.indexOf('a') >= 0) { | ||
result.push(version) | ||
} | ||
return result | ||
}, []) | ||
} | ||
}, | ||
{ | ||
regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, | ||
@@ -894,0 +909,0 @@ select: function (context, from, to) { |
18
node.js
@@ -0,1 +1,2 @@ | ||
var feature = require('caniuse-lite/dist/unpacker/feature').default | ||
var region = require('caniuse-lite/dist/unpacker/region').default | ||
@@ -240,2 +241,17 @@ var path = require('path') | ||
loadFeature: function loadFeature (features, name) { | ||
name = name.replace(/[^\w-]/g, '') | ||
if (features[name]) return | ||
// eslint-disable-next-line security/detect-non-literal-require | ||
var compressed = require('caniuse-lite/data/features/' + name + '.js') | ||
var stats = feature(compressed).stats | ||
features[name] = { } | ||
for (var i in stats) { | ||
for (var j in stats[i]) { | ||
features[name][i + ' ' + j] = stats[i][j] | ||
} | ||
} | ||
}, | ||
parseConfig: function parseConfig (string) { | ||
@@ -341,2 +357,4 @@ var result = { defaults: [] } | ||
configCache = { } | ||
this.cache = { } | ||
}, | ||
@@ -343,0 +361,0 @@ |
{ | ||
"name": "browserslist", | ||
"version": "4.12.2", | ||
"version": "4.13.0", | ||
"description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset", | ||
@@ -18,4 +18,4 @@ "keywords": [ | ||
"dependencies": { | ||
"caniuse-lite": "^1.0.30001088", | ||
"electron-to-chromium": "^1.3.483", | ||
"caniuse-lite": "^1.0.30001093", | ||
"electron-to-chromium": "^1.3.488", | ||
"escalade": "^3.0.1", | ||
@@ -22,0 +22,0 @@ "node-releases": "^1.1.58" |
@@ -187,3 +187,2 @@ # Browserslist [![Cult Of Martians][cult-img]][cult] | ||
### Full List | ||
@@ -197,36 +196,41 @@ | ||
`>=`, `<` and `<=` work too. | ||
* `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code]. | ||
* `> 5% in alt-AS`: uses Asia region usage statistics. List of all region codes | ||
can be found at [`caniuse-lite/data/regions`]. | ||
* `> 5% in my stats`: uses [custom usage data]. | ||
* `> 5% in browserslist-config-mycompany stats`: uses [custom usage data] | ||
from `browserslist-config-mycompany/browserslist-stats.json`. | ||
* `cover 99.5%`: most popular browsers that provide coverage. | ||
* `cover 99.5% in US`: same as above, with [two-letter country code]. | ||
* `cover 99.5% in my stats`: uses [custom usage data]. | ||
* `maintained node versions`: all Node.js versions, which are [still maintained] | ||
by Node.js Foundation. | ||
* `> 5% in US`: uses USA usage statistics. | ||
It accepts [two-letter country code]. | ||
* `> 5% in alt-AS`: uses Asia region usage statistics. | ||
List of all region codes can be found at [`caniuse-lite/data/regions`]. | ||
* `> 5% in my stats`: uses [custom usage data]. | ||
* `> 5% in browserslist-config-mycompany stats`: uses [custom usage data] | ||
from `browserslist-config-mycompany/browserslist-stats.json`. | ||
* `cover 99.5%`: most popular browsers that provide coverage. | ||
* `cover 99.5% in US`: same as above, with [two-letter country code]. | ||
* `cover 99.5% in my stats`: uses [custom usage data]. | ||
* `dead`: browsers without official support or updates for 24 months. | ||
Right now it is `IE 10`, `IE_Mob 11`, `BlackBerry 10`, `BlackBerry 7`, | ||
`Samsung 4` and `OperaMobile 12.1`. | ||
* `last 2 versions`: the last 2 versions for *each* browser. | ||
* `last 2 Chrome versions`: the last 2 versions of Chrome browser. | ||
* `last 2 major versions` or `last 2 iOS major versions`: | ||
all minor/patch releases of last 2 major versions. | ||
* `node 10` and `node 10.4`: selects latest Node.js `10.x.x` | ||
or `10.4.x` release. | ||
* `current node`: Node.js version used by Browserslist right now. | ||
* `current node`: Node.js version used by Browserslist right now. | ||
* `maintained node versions`: all Node.js versions, which are [still maintained] | ||
by Node.js Foundation. | ||
* `iOS 7`: the iOS browser version 7 directly. | ||
* `Firefox > 20`: versions of Firefox newer than 20. | ||
`>=`, `<` and `<=` work too. It also works with Node.js. | ||
* `ie 6-8`: selects an inclusive range of versions. | ||
* `Firefox ESR`: the latest [Firefox ESR] version. | ||
* `PhantomJS 2.1` and `PhantomJS 1.9`: selects Safari versions similar | ||
to PhantomJS runtime. | ||
* `extends browserslist-config-mycompany`: take queries from | ||
`browserslist-config-mycompany` npm package. | ||
* `ie 6-8`: selects an inclusive range of versions. | ||
* `Firefox > 20`: versions of Firefox newer than 20. | ||
`>=`, `<` and `<=` work too. It also works with Node.js. | ||
* `iOS 7`: the iOS browser version 7 directly. | ||
* `Firefox ESR`: the latest [Firefox ESR] version. | ||
* `PhantomJS 2.1` and `PhantomJS 1.9`: selects Safari versions similar | ||
to PhantomJS runtime. | ||
* `supports rtcpeerconnection`: browsers with support for specific features. | ||
`rtcpeerconnection` here is the `feat` parameter at the URL of the [Can I Use] | ||
page. A list of all available features can be found at | ||
[`caniuse-lite/data/features`]. | ||
* `since 2015` or `last 2 years`: all versions released since year 2015 | ||
(also `since 2015-03` and `since 2015-03-10`). | ||
* `unreleased versions` or `unreleased Chrome versions`: | ||
alpha and beta versions. | ||
* `last 2 major versions` or `last 2 iOS major versions`: | ||
all minor/patch releases of last 2 major versions. | ||
* `since 2015` or `last 2 years`: all versions released since year 2015 | ||
(also `since 2015-03` and `since 2015-03-10`). | ||
* `dead`: browsers without official support or updates for 24 months. | ||
Right now it is `IE 10`, `IE_Mob 11`, `BlackBerry 10`, `BlackBerry 7`, | ||
`Samsung 4` and `OperaMobile 12.1`. | ||
* `last 2 versions`: the last 2 versions for *each* browser. | ||
* `last 2 Chrome versions`: the last 2 versions of Chrome browser. | ||
* `not ie <= 8`: exclude browsers selected by previous queries. | ||
@@ -237,2 +241,3 @@ | ||
[`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions | ||
[`caniuse-lite/data/features`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/features | ||
[two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements | ||
@@ -239,0 +244,0 @@ [custom usage data]: #custom-usage-data |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87585
1741
646
24
Updatedcaniuse-lite@^1.0.30001093