browserslist 4.5.2 → 4.5.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.5.6
5
+ * Make `Node > 5` and `node > 5` queries case insensitive.
6
+
7
+ ## 4.5.5
8
+ * Fix CLI help (by Marcel Gerber).
9
+ * Add KaiOS browser to docs.
10
+
11
+ ## 4.5.4
12
+ * Update docs (by Andrew Leedham and Dan Onoshko).
13
+
14
+ ## 4.5.3
15
+ * Fix splitting string to queries.
16
+
4
17
  ## 4.5.2
5
18
  * Show default browsers in CLI on project without config.
6
19
 
package/README.md CHANGED
@@ -73,19 +73,51 @@ You can test Browserslist queries in [online demo].
73
73
 
74
74
  * [`browserslist-ga`] downloads your website browsers statistics
75
75
  to use it in `> 0.5% in my stats` query.
76
- * [`browserslist-useragent`] checks browser by user agent string
77
- to match Browserslist target browsers query.
76
+ * [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp
77
+ to test browser useragent.
78
78
  * [`browserslist-useragent-ruby`] is a Ruby library to checks browser
79
79
  by user agent string to match Browserslist.
80
+ * [`browserslist-browserstack`] runs BrowserStack tests for all browsers
81
+ in Browserslist config.
80
82
  * [`caniuse-api`] returns browsers which support some specific feature.
81
83
  * Run `npx browserslist` in your project directory to see project’s
82
84
  target browsers. This CLI tool is built-in and available in any project
83
85
  with Autoprefixer.
84
86
 
85
- [`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
86
- [`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
87
- [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
88
- [`caniuse-api`]: https://github.com/Nyalab/caniuse-api
87
+ [`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
88
+ [`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
89
+ [`browserslist-useragent-regexp`]: https://github.com/browserslist/browserslist-useragent-regexp
90
+ [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
91
+ [`caniuse-api`]: https://github.com/Nyalab/caniuse-api
92
+ [`browserslist-browserstack`]: https://github.com/xeroxinteractive/browserslist-browserstack
93
+
94
+
95
+ ## Best Practices
96
+
97
+ * Select browsers directly (`last 2 Chrome versions`) only if you are making
98
+ a web app for a kiosk with one browser. There are a lot of browsers
99
+ on the market. If you are making general web app you should respect
100
+ browsers diversity.
101
+ * There is a `defaults` query, which gives a reasonable configuration
102
+ for most users:
103
+
104
+ ```json
105
+ "browserslist": [
106
+ "defaults"
107
+ ]
108
+ ```
109
+
110
+ * If you want to change the default set of browsers we recommend to combine
111
+ `last 1 version`, `not dead` with `> 0.2%` (or `> 1% in US`,
112
+ `> 1% in my stats`). `last n versions` adds too many dead browsers
113
+ and does not add popular old versions. Choosing a percentage above `0.2%`
114
+ will in the long run make popular browsers even more popular. We might run
115
+ into a monopoly and stagnation situation, as we had with Internet Explorer 6.
116
+ Please use this setting with caution.
117
+ * Don’t remove browsers just because you don’t know them. Opera Mini has
118
+ 100 million users in Africa and it is more popular in the global market
119
+ than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
120
+ and desktop Safari altogether.
89
121
 
90
122
 
91
123
  ## Queries
@@ -128,25 +160,6 @@ _A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`
128
160
  in your terminal._
129
161
 
130
162
 
131
- ### Best Practices
132
-
133
- * Select browsers directly (`last 2 Chrome versions`) only if you are making
134
- a web app for a kiosk with one browser. There are a lot of browsers
135
- on the market. If you are making general web app you should respect
136
- browsers diversity.
137
- * If you want to change the default set of browsers we recommend to combine
138
- `last 1 version`, `not dead` with `> 0.2%` (or `> 1% in US`,
139
- `> 1% in my stats`). `last n versions` adds too many dead browsers
140
- and does not add popular old versions. Choosing a percentage above `0.2%`
141
- will in the long run make popular browsers even more popular. We might run
142
- into a monopoly and stagnation situation, as we had with Internet Explorer 6.
143
- Please use this setting with caution.
144
- * Don’t remove browsers just because you don’t know them. Opera Mini has
145
- 100 million users in Africa and it is more popular in the global market
146
- than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
147
- and desktop Safari altogether.
148
-
149
-
150
163
  ### Full List
151
164
 
152
165
  You can specify the browser and Node.js versions by queries (case insensitive):
@@ -256,6 +269,7 @@ Names are case insensitive:
256
269
  * `Safari` for desktop Safari.
257
270
  * `Samsung` for Samsung Internet.
258
271
  * `UCAndroid` or `and_uc` for UC Browser for Android.
272
+ * `kaios` for KaiOS Browser.
259
273
 
260
274
 
261
275
  ## `package.json`
@@ -556,13 +570,9 @@ To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`
556
570
  environment variable.
557
571
 
558
572
 
559
- ## Contributors
573
+ ## Security Contact
574
+
575
+ To report a security vulnerability, please use the [Tidelift security contact].
576
+ Tidelift will coordinate the fix and disclosure.
560
577
 
561
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/0" alt="" width="76" height="90" align="left">
562
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/1" alt="" width="76" height="90" align="left">
563
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/2" alt="" width="76" height="90" align="left">
564
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/3" alt="" width="76" height="90" align="left">
565
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/4" alt="" width="76" height="90" align="left">
566
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/5" alt="" width="76" height="90" align="left">
567
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/6" alt="" width="76" height="90" align="left">
568
- <img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/7" alt="" width="76" height="90" align="left">
578
+ [Tidelift security contact]: https://tidelift.com/security
package/cli.js CHANGED
@@ -13,7 +13,7 @@ var USAGE = 'Usage:\n' +
13
13
  ' ' + pkg.name + ' --config="path/to/browserlist/file"\n' +
14
14
  ' ' + pkg.name + ' --coverage "QUERIES"\n' +
15
15
  ' ' + pkg.name + ' --coverage=US "QUERIES"\n' +
16
- ' ' + pkg.name + ' --coverage=US,RU,world "QUERIES"\n' +
16
+ ' ' + pkg.name + ' --coverage=US,RU,global "QUERIES"\n' +
17
17
  ' ' + pkg.name + ' --env="environment name defined in config"\n' +
18
18
  ' ' + pkg.name + ' --stats="path/to/browserlist/stats/file"'
19
19
 
package/index.js CHANGED
@@ -364,29 +364,26 @@ function doMatch (string, qs) {
364
364
  var or = /^(?:,\s*|\s+OR\s+)(.*)/i
365
365
  var and = /^\s+AND\s+(.*)/i
366
366
 
367
- return find(
368
- string,
369
- function (parsed, n, max) {
370
- if (and.test(parsed)) {
371
- qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })
372
- return true
373
- } else if (or.test(parsed)) {
374
- qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })
375
- return true
376
- } else if (n === max) {
377
- qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })
378
- return true
379
- }
380
- return false
367
+ return find(string, function (parsed, n, max) {
368
+ if (and.test(parsed)) {
369
+ qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })
370
+ return true
371
+ } else if (or.test(parsed)) {
372
+ qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })
373
+ return true
374
+ } else if (n === max) {
375
+ qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })
376
+ return true
381
377
  }
382
- )
378
+ return false
379
+ })
383
380
  }
384
381
 
385
382
  function find (string, predicate) {
386
383
  for (var n = 1, max = string.length; n <= max; n++) {
387
384
  var parsed = string.substr(-n, n)
388
385
  if (predicate(parsed, n, max)) {
389
- return string.replace(parsed, '')
386
+ return string.slice(0, -n)
390
387
  }
391
388
  }
392
389
  return ''
@@ -785,7 +782,7 @@ var QUERIES = [
785
782
  }
786
783
  },
787
784
  {
788
- regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/,
785
+ regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i,
789
786
  select: function (context, sign, version) {
790
787
  var nodeVersions = jsReleases.filter(function (i) {
791
788
  return i.name === 'nodejs'
package/node.js CHANGED
@@ -291,6 +291,7 @@ module.exports = {
291
291
  oldDataWarning: function oldDataWarning (agentsObj) {
292
292
  if (dataTimeChecked) return
293
293
  dataTimeChecked = true
294
+ if (process.env.BROWSERSLIST_IGNORE_OLD_DATA) return
294
295
 
295
296
  var latest = latestReleaseTime(agentsObj)
296
297
  var halfYearAgo = Date.now() - TIME_TO_UPDATE_CANIUSE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.5.2",
3
+ "version": "4.5.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,18 +11,13 @@
11
11
  "license": "MIT",
12
12
  "repository": "browserslist/browserslist",
13
13
  "dependencies": {
14
- "caniuse-lite": "^1.0.30000951",
15
- "electron-to-chromium": "^1.3.116",
16
- "node-releases": "^1.1.11"
14
+ "caniuse-lite": "^1.0.30000963",
15
+ "electron-to-chromium": "^1.3.127",
16
+ "node-releases": "^1.1.17"
17
17
  },
18
18
  "bin": "./cli.js",
19
19
  "browser": {
20
20
  "./node.js": "./browser.js",
21
21
  "path": false
22
- },
23
- "husky": {
24
- "hooks": {
25
- "pre-commit": "lint-staged"
26
- }
27
22
  }
28
23
  }