browserslist 4.6.2 → 4.6.6

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,19 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.6.6
5
+ * Remove Safari from `dead` query.
6
+
7
+ ## 4.6.5
8
+ * Add Samsung 4 browser to `dead` query.
9
+ * Remove dirty fix for `android all` error.
10
+
11
+ ## 4.6.4
12
+ * Add Firefox 68 to `Firefox ESR` query.
13
+
14
+ ## 4.6.3
15
+ * Dirty fix for `android all` error.
16
+
4
17
  ## 4.6.2
5
18
  * Fix `last x version` and similar queries for Android (by Tony Ross).
6
19
 
package/README.md CHANGED
@@ -14,7 +14,6 @@ front-end tools. It is used in:
14
14
  * [postcss-normalize]
15
15
  * [obsolete-webpack-plugin]
16
16
 
17
- [Browserslist Example] shows how every tool uses Browserslist.
18
17
  All tools will find target browsers automatically,
19
18
  when you add the following to `package.json`:
20
19
 
@@ -47,6 +46,7 @@ Browserslist will take queries from tool option,
47
46
  `browserslist` section in `package.json` or environment variables.
48
47
 
49
48
  You can test Browserslist queries in [online demo].
49
+ [Browserslist Example] shows how every tool uses Browserslist.
50
50
 
51
51
  [cult-img]: https://cultofmartians.com/assets/badges/badge.svg
52
52
  [cult]: https://cultofmartians.com/done.html
@@ -67,6 +67,18 @@ You can test Browserslist queries in [online demo].
67
67
  [Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
68
68
  [obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
69
69
 
70
+ ## Table of Contents
71
+
72
+ 1. [Tools](#tools)
73
+ 2. [Best Practices](#best-practices)
74
+ 3. [Queries](#queries)
75
+ 4. [Config File](#config-file)
76
+ 5. [Configuring for Different Environments](#configuring-for-different-environments)
77
+ 6. [Custom Usage Data](#custom-usage-data)
78
+ 7. [JS API](#js-api)
79
+ 8. [Environment Variables](#environment-variables)
80
+ 9. [Cache](#cache)
81
+
70
82
  ## Tools
71
83
 
72
84
  * [`browserslist-ga`] downloads your website browsers statistics
@@ -115,7 +127,7 @@ You can test Browserslist queries in [online demo].
115
127
  * Don’t remove browsers just because you don’t know them. Opera Mini has
116
128
  100 million users in Africa and it is more popular in the global market
117
129
  than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
118
- and desktop Safari altogether.
130
+ and desktop Safari combined.
119
131
 
120
132
 
121
133
  ## Queries
@@ -144,14 +156,14 @@ intersection of the previous query: `last 1 version and > 1%`.
144
156
  There is 3 different ways to combine queries as depicted below. First you start
145
157
  with a single query and then we combine the queries to get our final list.
146
158
 
147
- Obviously you can *not* start with a `not` combiner, since the is no left-hand
159
+ Obviously you can *not* start with a `not` combiner, since there is no left-hand
148
160
  side query to combine it with.
149
161
 
150
162
  | Query combiner type | Illustration | Example |
151
163
  | ------------------- | :----------: | ------- |
152
- |`or`/ `,` combiner <br> (union) | ![Union of queries](img/union.svg) | `'> .5% or last 2 versions'` <br> `'> .5%, last 2 versions'` |
153
- | `and` combiner <br> (intersection) | ![intersection of queries](img/intersection.svg) | `'> .5% and last 2 versions'` |
154
- | `not` combiner <br> (relative complement) | ![Relative complement of queries](img/complement.svg) | `'> .5% and not last 2 versions'` <br> `'> .5% or not last 2 versions'` <br> `'> .5%, not last 2 versions'` |
164
+ |`or`/`,` combiner <br> (union) | ![Union of queries](img/union.svg) | `> .5% or last 2 versions` <br> `> .5%, last 2 versions` |
165
+ | `and` combiner <br> (intersection) | ![intersection of queries](img/intersection.svg) | `> .5% and last 2 versions` |
166
+ | `not` combiner <br> (relative complement) | ![Relative complement of queries](img/complement.svg) | `> .5% and not last 2 versions` <br> `> .5% or not last 2 versions` <br> `> .5%, not last 2 versions` |
155
167
 
156
168
  _A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`
157
169
  in your terminal._
@@ -188,10 +200,9 @@ You can specify the browser and Node.js versions by queries (case insensitive):
188
200
  all minor/patch releases of last 2 major versions.
189
201
  * `since 2015` or `last 2 years`: all versions released since year 2015
190
202
  (also `since 2015-03` and `since 2015-03-10`).
191
- * `dead`: browsers from `last 2 version` query, but with less than 0.5%
192
- in global usage statistics and without official support or updates
193
- for 24 months. Right now it is `IE 10`, `IE_Mob 10`, `BlackBerry 10`,
194
- `BlackBerry 7`, and `OperaMobile 12.1`.
203
+ * `dead`: browsers without official support or updates for 24 months.
204
+ Right now it is `IE 10`, `IE_Mob 10`, `BlackBerry 10`, `BlackBerry 7`,
205
+ `Samsung 4` and `OperaMobile 12.1`.
195
206
  * `last 2 versions`: the last 2 versions for *each* browser.
196
207
  * `last 2 Chrome versions`: the last 2 versions of Chrome browser.
197
208
  * `defaults`: Browserslist’s default browsers
@@ -200,6 +211,12 @@ You can specify the browser and Node.js versions by queries (case insensitive):
200
211
 
201
212
  You can add `not ` to any query.
202
213
 
214
+ [`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions
215
+ [two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
216
+ [custom usage data]: #custom-usage-data
217
+ [still maintained]: https://github.com/nodejs/Release
218
+ [Can I Use]: https://caniuse.com/
219
+
203
220
 
204
221
  ### Debug
205
222
 
@@ -225,23 +242,6 @@ samsung 5
225
242
  ```
226
243
 
227
244
 
228
- ### Notes
229
-
230
- Browserslist works with separated versions of browsers.
231
- You should avoid queries like `Firefox > 0`.
232
- The list of the specified browsers acts as a white list which means other browsers are ignored.
233
-
234
- All queries are based on the [Can I Use] support table,
235
- e.g. `last 3 iOS versions` might select `8.4, 9.2, 9.3` (mixed major and minor),
236
- whereas `last 3 Chrome versions` might select `50, 49, 48` (major only).
237
-
238
- [`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions
239
- [two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
240
- [custom usage data]: #custom-usage-data
241
- [still maintained]: https://github.com/nodejs/Release
242
- [Can I Use]: https://caniuse.com/
243
-
244
-
245
245
  ### Browsers
246
246
 
247
247
  Names are case insensitive:
@@ -269,7 +269,9 @@ Names are case insensitive:
269
269
  * `kaios` for KaiOS Browser.
270
270
 
271
271
 
272
- ## `package.json`
272
+ ## Config File
273
+
274
+ ### `package.json`
273
275
 
274
276
  If you want to reduce config files in project root, you can specify
275
277
  browsers in `package.json` with `browserslist` key:
@@ -289,9 +291,9 @@ browsers in `package.json` with `browserslist` key:
289
291
  ```
290
292
 
291
293
 
292
- ## Config File
294
+ ### `.browserslistrc`
293
295
 
294
- Browserslist config should be named `.browserslistrc` or `browserslist`
296
+ Separated Browserslist config should be named `.browserslistrc`
295
297
  and have browsers queries split by a new line. Comments starts with `#` symbol:
296
298
 
297
299
  ```yaml
@@ -354,46 +356,7 @@ module.exports = [
354
356
  ```
355
357
 
356
358
 
357
- ## Environment Variables
358
-
359
- If some tool use Browserslist inside, you can change browsers settings
360
- by [environment variables]:
361
-
362
- * `BROWSERSLIST` with browsers queries.
363
-
364
- ```sh
365
- BROWSERSLIST="> 5%" gulp css
366
- ```
367
-
368
- * `BROWSERSLIST_CONFIG` with path to config file.
369
-
370
- ```sh
371
- BROWSERSLIST_CONFIG=./config/browserslist gulp css
372
- ```
373
-
374
- * `BROWSERSLIST_ENV` with environments string.
375
-
376
- ```sh
377
- BROWSERSLIST_ENV="development" gulp css
378
- ```
379
-
380
- * `BROWSERSLIST_STATS` with path to the custom usage data
381
- for `> 1% in my stats` query.
382
-
383
- ```sh
384
- BROWSERSLIST_STATS=./config/usage_data.json gulp css
385
- ```
386
-
387
- * `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.
388
-
389
- ```sh
390
- BROWSERSLIST_DISABLE_CACHE=1 gulp css
391
- ```
392
-
393
- [environment variables]: https://en.wikipedia.org/wiki/Environment_variable
394
-
395
-
396
- ## Environments
359
+ ## Configuring for Different Environments
397
360
 
398
361
  You can also specify different browser queries for various environments.
399
362
  Browserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV`
@@ -408,9 +371,12 @@ In `package.json`:
408
371
  "> 1%",
409
372
  "ie 10"
410
373
  ],
411
- "development": [
374
+ "modern": [
412
375
  "last 1 chrome version",
413
376
  "last 1 firefox version"
377
+ ],
378
+ "ssr": [
379
+ "node 12"
414
380
  ]
415
381
  }
416
382
  ```
@@ -418,13 +384,16 @@ In `package.json`:
418
384
  In `.browserslistrc` config:
419
385
 
420
386
  ```ini
421
- [production staging]
387
+ [production]
422
388
  > 1%
423
389
  ie 10
424
390
 
425
- [development]
391
+ [modern]
426
392
  last 1 chrome version
427
393
  last 1 firefox version
394
+
395
+ [ssr]
396
+ node 12
428
397
  ```
429
398
 
430
399
 
@@ -507,9 +476,6 @@ For non-JS environment and debug purpose you can use CLI tool:
507
476
  browserslist "> 1%, IE 10"
508
477
  ```
509
478
 
510
-
511
- ## Coverage
512
-
513
479
  You can get total users coverage for selected browsers by JS API:
514
480
 
515
481
  ```js
@@ -555,6 +521,45 @@ These browsers account for 83.1% of all users in custom statistics
555
521
  ```
556
522
 
557
523
 
524
+ ## Environment Variables
525
+
526
+ If some tool use Browserslist inside, you can change browsers settings
527
+ by [environment variables]:
528
+
529
+ * `BROWSERSLIST` with browsers queries.
530
+
531
+ ```sh
532
+ BROWSERSLIST="> 5%" gulp css
533
+ ```
534
+
535
+ * `BROWSERSLIST_CONFIG` with path to config file.
536
+
537
+ ```sh
538
+ BROWSERSLIST_CONFIG=./config/browserslist gulp css
539
+ ```
540
+
541
+ * `BROWSERSLIST_ENV` with environments string.
542
+
543
+ ```sh
544
+ BROWSERSLIST_ENV="development" gulp css
545
+ ```
546
+
547
+ * `BROWSERSLIST_STATS` with path to the custom usage data
548
+ for `> 1% in my stats` query.
549
+
550
+ ```sh
551
+ BROWSERSLIST_STATS=./config/usage_data.json gulp css
552
+ ```
553
+
554
+ * `BROWSERSLIST_DISABLE_CACHE` if you want to disable config reading cache.
555
+
556
+ ```sh
557
+ BROWSERSLIST_DISABLE_CACHE=1 gulp css
558
+ ```
559
+
560
+ [environment variables]: https://en.wikipedia.org/wiki/Environment_variable
561
+
562
+
558
563
  ## Cache
559
564
 
560
565
  Browserslist caches the configuration it reads from `package.json` and
package/index.js CHANGED
@@ -857,7 +857,7 @@ var QUERIES = [
857
857
  {
858
858
  regexp: /^(firefox|ff|fx)\s+esr$/i,
859
859
  select: function () {
860
- return ['firefox 60']
860
+ return ['firefox 68', 'firefox 60']
861
861
  }
862
862
  },
863
863
  {
@@ -960,7 +960,12 @@ var QUERIES = [
960
960
  {
961
961
  regexp: /^dead$/i,
962
962
  select: function (context) {
963
- var dead = ['ie <= 10', 'ie_mob <= 10', 'bb <= 10', 'op_mob <= 12.1']
963
+ var dead = [
964
+ 'ie <= 10', 'ie_mob <= 10',
965
+ 'bb <= 10',
966
+ 'op_mob <= 12.1',
967
+ 'samsung 4'
968
+ ]
964
969
  return resolve(dead, context)
965
970
  }
966
971
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.6.2",
3
+ "version": "4.6.6",
4
4
  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
5
5
  "keywords": [
6
6
  "caniuse",
@@ -11,9 +11,9 @@
11
11
  "license": "MIT",
12
12
  "repository": "browserslist/browserslist",
13
13
  "dependencies": {
14
- "caniuse-lite": "^1.0.30000974",
15
- "electron-to-chromium": "^1.3.150",
16
- "node-releases": "^1.1.23"
14
+ "caniuse-lite": "^1.0.30000984",
15
+ "electron-to-chromium": "^1.3.191",
16
+ "node-releases": "^1.1.25"
17
17
  },
18
18
  "bin": "./cli.js",
19
19
  "browser": {