browserslist 4.14.5 → 4.14.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,10 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## 4.14.6
5
+ * Fixed Yarn support n `--update-db` (by Ivan Storck).
6
+ * Fixed npm 7 support in `--update-db`.
7
+
4
8
  ## 4.14.5
5
9
  * Fixed `last 2 electron versions` query (by Sergey Melyukov).
6
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browserslist",
3
- "version": "4.14.5",
3
+ "version": "4.14.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",
@@ -15,15 +15,17 @@
15
15
  "license": "MIT",
16
16
  "repository": "browserslist/browserslist",
17
17
  "dependencies": {
18
- "caniuse-lite": "^1.0.30001135",
19
- "electron-to-chromium": "^1.3.571",
20
- "escalade": "^3.1.0",
21
- "node-releases": "^1.1.61"
18
+ "caniuse-lite": "^1.0.30001154",
19
+ "electron-to-chromium": "^1.3.585",
20
+ "escalade": "^3.1.1",
21
+ "node-releases": "^1.1.65"
22
22
  },
23
23
  "engines": {
24
24
  "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
25
25
  },
26
- "bin": "./cli.js",
26
+ "bin": {
27
+ "browserslist": "cli.js"
28
+ },
27
29
  "browser": {
28
30
  "./node.js": "./browser.js",
29
31
  "path": false
package/update-db.js CHANGED
@@ -53,10 +53,16 @@ function getCurrentVersion (lock) {
53
53
  return null
54
54
  }
55
55
 
56
- function getLatestInfo () {
57
- return JSON.parse(
58
- childProcess.execSync('npm show caniuse-lite --json').toString()
59
- )
56
+ function getLatestInfo (lock) {
57
+ if (lock.mode !== 'yarn') {
58
+ return JSON.parse(
59
+ childProcess.execSync('npm show caniuse-lite --json').toString()
60
+ )
61
+ } else {
62
+ return JSON.parse(
63
+ childProcess.execSync('yarn info caniuse-lite --json').toString()
64
+ ).data
65
+ }
60
66
  }
61
67
 
62
68
  function updateLockfile (lock, latest) {
@@ -119,29 +125,37 @@ module.exports = function updateDB (print) {
119
125
  lock.content = fs.readFileSync(lock.file).toString()
120
126
 
121
127
  var current = getCurrentVersion(lock)
122
- var latest = getLatestInfo()
128
+ var latest = getLatestInfo(lock)
123
129
 
124
130
  if (typeof current === 'string') {
125
131
  print('Current version: ' + current + '\n')
126
132
  }
127
133
  print(
128
134
  'New version: ' + latest.version + '\n' +
129
- 'Removing old caniuse-lite from lock file…\n'
135
+ 'Removing old caniuse-lite from lock file\n'
130
136
  )
131
137
 
132
138
  fs.writeFileSync(lock.file, updateLockfile(lock, latest))
133
139
 
140
+ var install = lock.mode === 'yarn' ? 'yarn add' : lock.mode + ' install'
134
141
  print(
135
- 'Installing new caniuse-lite version…\n' +
136
- '$ ' + lock.mode + ' install\n'
142
+ 'Installing new caniuse-lite version\n' +
143
+ '$ ' + install + ' caniuse-lite\n'
137
144
  )
138
145
  try {
139
- childProcess.execSync(lock.mode + ' install')
146
+ childProcess.execSync(install + ' caniuse-lite')
140
147
  } catch (e) /* istanbul ignore next */ {
141
148
  print(e.stack)
142
149
  print('\nProblem with `' + lock.mode + ' install` call. Run it manually.\n')
143
150
  process.exit(1)
144
151
  }
145
152
 
153
+ var del = lock.mode === 'yarn' ? 'yarn remove' : lock.mode + ' uninstall'
154
+ print(
155
+ 'Cleaning package.json dependencies from caniuse-lite\n' +
156
+ '$ ' + del + ' caniuse-lite\n'
157
+ )
158
+ childProcess.execSync(del + ' caniuse-lite')
159
+
146
160
  print('caniuse-lite has been successfully updated\n')
147
161
  }