browserslist 4.5.0 → 4.5.4

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,18 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.5.4
5
+ * Update docs (by Andrew Leedham and Dan Onoshko).
6
+
7
+ ## 4.5.3
8
+ * Fix splitting string to queries.
9
+
10
+ ## 4.5.2
11
+ * Show default browsers in CLI on project without config.
12
+
13
+ ## 4.5.1
14
+ * Improve text for the warning about outdated `caniuse-lite`.
15
+
4
16
  ## 4.5
5
17
  * Add `>=`, `>`, and `<=` support for Node.js version (by Mathspy Terabithian).
6
18
 
package/README.md CHANGED
@@ -77,15 +77,20 @@ You can test Browserslist queries in [online demo].
77
77
  to match Browserslist target browsers query.
78
78
  * [`browserslist-useragent-ruby`] is a Ruby library to checks browser
79
79
  by user agent string to match Browserslist.
80
+ * [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp
81
+ to test browser useragent.
82
+ * [`browserslist-browserstack`] runs BrowserStack tests for all browsers in Browserslist config.
80
83
  * [`caniuse-api`] returns browsers which support some specific feature.
81
84
  * Run `npx browserslist` in your project directory to see project’s
82
85
  target browsers. This CLI tool is built-in and available in any project
83
86
  with Autoprefixer.
84
87
 
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
88
+ [`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
89
+ [`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
90
+ [`browserslist-useragent-regexp`]: https://github.com/browserslist/browserslist-useragent-regexp
91
+ [`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
92
+ [`caniuse-api`]: https://github.com/Nyalab/caniuse-api
93
+ [`browserslist-browserstack`]: https://github.com/xeroxinteractive/browserslist-browserstack
89
94
 
90
95
 
91
96
  ## Queries
@@ -556,13 +561,9 @@ To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`
556
561
  environment variable.
557
562
 
558
563
 
559
- ## Contributors
564
+ ## Security Contact
560
565
 
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">
566
+ To report a security vulnerability, please use the [Tidelift security contact].
567
+ Tidelift will coordinate the fix and disclosure.
568
+
569
+ [Tidelift security contact]: https://tidelift.com/security
package/cli.js CHANGED
@@ -72,17 +72,6 @@ if (isArg('--help') || isArg('-h')) {
72
72
 
73
73
  var browsers
74
74
  try {
75
- if (!queries && !opts.config) {
76
- if (browserslist.findConfig(process.cwd())) {
77
- opts.path = process.cwd()
78
- } else {
79
- error(
80
- 'Browserslist config was not found. ' +
81
- 'Define queries or config path.' +
82
- '\n\n' + USAGE
83
- )
84
- }
85
- }
86
75
  browsers = browserslist(queries, opts)
87
76
  } catch (e) {
88
77
  if (e.name === 'BrowserslistError') {
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 ''
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
@@ -306,7 +307,8 @@ module.exports = {
306
307
  })
307
308
  console.warn(
308
309
  'Browserslist: caniuse-lite is outdated. ' +
309
- 'Please run next command `' + command + ' caniuse-lite browserslist`')
310
+ 'Please run next command `' + command + '`'
311
+ )
310
312
  }
311
313
  },
312
314
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.5.0",
3
+ "version": "4.5.4",
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.30000948",
15
- "electron-to-chromium": "^1.3.116",
16
- "node-releases": "^1.1.10"
14
+ "caniuse-lite": "^1.0.30000955",
15
+ "electron-to-chromium": "^1.3.122",
16
+ "node-releases": "^1.1.13"
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
  }