browserslist 4.13.0 → 4.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.14
5
+ * Add `BROWSERSLIST_DANGEROUS_EXTEND` support (by Timo Mayer).
6
+
4
7
  ## 4.13
5
8
  * Added `supports` query to select browsers (by Jesús Leganés-Combarro).
6
9
 
package/README.md CHANGED
@@ -164,7 +164,9 @@ An `or` combiner can use the keyword `or` as well as `,`.
164
164
  `last 1 version or > 1%` is equal to `last 1 version, > 1%`.
165
165
 
166
166
  `and` query combinations are also supported to perform an
167
- intersection of the previous query: `last 1 version and > 1%`.
167
+ intersection of all the previous queries:
168
+ `last 1 version or chrome > 75 and > 1%` will select
169
+ (`browser last version` or `Chrome since 76`) and `more than 1% marketshare`.
168
170
 
169
171
  There is 3 different ways to combine queries as depicted below. First you start
170
172
  with a single query and then we combine the queries to get our final list.
@@ -173,8 +175,6 @@ Obviously you can *not* start with a `not` combiner, since there is no left-hand
173
175
  side query to combine it with. The left-hand is always resolved as `and`
174
176
  combiner even if `or` is used (this is an API implementation specificity).
175
177
 
176
- `and` combiner has precedence over `or` combiner.
177
-
178
178
  | Query combiner type | Illustration | Example |
179
179
  | ------------------- | :----------: | ------- |
180
180
  |`or`/`,` combiner <br> (union) | ![Union of queries](img/union.svg) | `> .5% or last 2 versions` <br> `> .5%, last 2 versions` |
@@ -223,8 +223,8 @@ You can specify the browser and Node.js versions by queries (case insensitive):
223
223
  to PhantomJS runtime.
224
224
  * `extends browserslist-config-mycompany`: take queries from
225
225
  `browserslist-config-mycompany` npm package.
226
- * `supports rtcpeerconnection`: browsers with support for specific features.
227
- `rtcpeerconnection` here is the `feat` parameter at the URL of the [Can I Use]
226
+ * `supports es6-module`: browsers with support for specific features.
227
+ `es6-module` here is the `feat` parameter at the URL of the [Can I Use]
228
228
  page. A list of all available features can be found at
229
229
  [`caniuse-lite/data/features`].
230
230
  * `since 2015` or `last 2 years`: all versions released since year 2015
@@ -579,32 +579,39 @@ with [environment variables]:
579
579
  * `BROWSERSLIST` with browsers queries.
580
580
 
581
581
  ```sh
582
- BROWSERSLIST="> 5%" gulp css
582
+ BROWSERSLIST="> 5%" npx webpack
583
583
  ```
584
584
 
585
585
  * `BROWSERSLIST_CONFIG` with path to config file.
586
586
 
587
587
  ```sh
588
- BROWSERSLIST_CONFIG=./config/browserslist gulp css
588
+ BROWSERSLIST_CONFIG=./config/browserslist npx webpack
589
589
  ```
590
590
 
591
591
  * `BROWSERSLIST_ENV` with environments string.
592
592
 
593
593
  ```sh
594
- BROWSERSLIST_ENV="development" gulp css
594
+ BROWSERSLIST_ENV="development" npx webpack
595
595
  ```
596
596
 
597
597
  * `BROWSERSLIST_STATS` with path to the custom usage data
598
598
  for `> 1% in my stats` query.
599
599
 
600
600
  ```sh
601
- BROWSERSLIST_STATS=./config/usage_data.json gulp css
601
+ BROWSERSLIST_STATS=./config/usage_data.json npx webpack
602
602
  ```
603
603
 
604
604
  * `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.
605
605
 
606
606
  ```sh
607
- BROWSERSLIST_DISABLE_CACHE=1 gulp css
607
+ BROWSERSLIST_DISABLE_CACHE=1 npx webpack
608
+ ```
609
+
610
+ * `BROWSERSLIST_DANGEROUS_EXTEND` to disable security shareable config
611
+ name check.
612
+
613
+ ```sh
614
+ BROWSERSLIST_DANGEROUS_EXTEND=1 npx webpack
608
615
  ```
609
616
 
610
617
  [environment variables]: https://en.wikipedia.org/wiki/Environment_variable
package/node.js CHANGED
@@ -153,8 +153,10 @@ function normalizeUsageData (usageData, data) {
153
153
  }
154
154
 
155
155
  module.exports = {
156
- loadQueries: function loadQueries (context, name) {
157
- if (!context.dangerousExtend) checkExtend(name)
156
+ loadQueries: function loadQueries (ctx, name) {
157
+ if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
158
+ checkExtend(name)
159
+ }
158
160
  // eslint-disable-next-line security/detect-non-literal-require
159
161
  var queries = require(require.resolve(name, { paths: ['.'] }))
160
162
  if (queries) {
@@ -162,7 +164,7 @@ module.exports = {
162
164
  return queries
163
165
  } else if (typeof queries === 'object') {
164
166
  if (!queries.defaults) queries.defaults = []
165
- return pickEnv(queries, context, name)
167
+ return pickEnv(queries, ctx, name)
166
168
  }
167
169
  }
168
170
  throw new BrowserslistError(
@@ -171,8 +173,10 @@ module.exports = {
171
173
  )
172
174
  },
173
175
 
174
- loadStat: function loadStat (context, name, data) {
175
- if (!context.dangerousExtend) checkExtend(name)
176
+ loadStat: function loadStat (ctx, name, data) {
177
+ if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
178
+ checkExtend(name)
179
+ }
176
180
  // eslint-disable-next-line security/detect-non-literal-require
177
181
  var stats = require(
178
182
  require.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
5
5
  "keywords": [
6
6
  "caniuse",
@@ -15,10 +15,10 @@
15
15
  "license": "MIT",
16
16
  "repository": "browserslist/browserslist",
17
17
  "dependencies": {
18
- "caniuse-lite": "^1.0.30001093",
19
- "electron-to-chromium": "^1.3.488",
20
- "escalade": "^3.0.1",
21
- "node-releases": "^1.1.58"
18
+ "caniuse-lite": "^1.0.30001111",
19
+ "electron-to-chromium": "^1.3.523",
20
+ "escalade": "^3.0.2",
21
+ "node-releases": "^1.1.60"
22
22
  },
23
23
  "engines": {
24
24
  "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"