browserslist 4.14.1 → 4.14.2

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,10 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.14.2
5
+ * Fixed `--update-db` on Windows (by James Ross).
6
+ * Improved `--update-db` output.
7
+
4
8
  ## 4.14.1
5
9
  * Added `--update-db` explanation (by Justin Zelinsky).
6
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.14.1",
3
+ "version": "4.14.2",
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.30001124",
19
- "electron-to-chromium": "^1.3.562",
18
+ "caniuse-lite": "^1.0.30001125",
19
+ "electron-to-chromium": "^1.3.564",
20
20
  "escalade": "^3.0.2",
21
- "node-releases": "^1.1.60"
21
+ "node-releases": "^1.1.61"
22
22
  },
23
23
  "engines": {
24
24
  "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
package/update-db.js CHANGED
@@ -47,13 +47,13 @@ function getCurrentVersion (lock) {
47
47
  return dependencies['caniuse-lite'].version
48
48
  }
49
49
  } else if (lock.mode === 'yarn') {
50
- match = /caniuse-lite@[^:]+:\n\s+version\s+"([^"]+)"/.exec(lock.content)
50
+ match = /caniuse-lite@[^:]+:\r?\n\s+version\s+"([^"]+)"/.exec(lock.content)
51
51
  if (match[1]) return match[1]
52
52
  }
53
53
  return null
54
54
  }
55
55
 
56
- function getLastestInfo () {
56
+ function getLatestInfo () {
57
57
  return JSON.parse(
58
58
  childProcess.execSync('npm show caniuse-lite --json').toString()
59
59
  )
@@ -119,18 +119,29 @@ module.exports = function updateDB (print) {
119
119
  lock.content = fs.readFileSync(lock.file).toString()
120
120
 
121
121
  var current = getCurrentVersion(lock)
122
- var latest = getLastestInfo()
122
+ var latest = getLatestInfo()
123
123
 
124
124
  if (typeof current === 'string') {
125
125
  print('Current version: ' + current + '\n')
126
126
  }
127
127
  print(
128
128
  'New version: ' + latest.version + '\n' +
129
- 'Updating caniuse-lite…\n'
129
+ 'Removing old caniuse-lite from lock file…\n'
130
130
  )
131
131
 
132
132
  fs.writeFileSync(lock.file, updateLockfile(lock, latest))
133
- childProcess.execSync(lock.mode + ' install')
134
133
 
135
- print('caniuse-lite has been successfully updated')
134
+ print(
135
+ 'Installing new caniuse-lite version…\n' +
136
+ '$ ' + lock.mode + ' install\n'
137
+ )
138
+ try {
139
+ childProcess.execSync(lock.mode + ' install')
140
+ } catch (e) /* istanbul ignore next */ {
141
+ print(e.stack)
142
+ print('\nProblem with `' + lock.mode + ' install` call. Run it manually.\n')
143
+ process.exit(1)
144
+ }
145
+
146
+ print('caniuse-lite has been successfully updated\n')
136
147
  }