browserslist 4.14.0 → 4.14.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 +13 -0
- package/README.md +45 -3
- package/index.js +3 -1
- package/node.js +4 -1
- package/package.json +5 -5
- package/update-db.js +17 -6
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.14.4
|
|
5
|
+
* Fixed `Unknown version 59 of op_mob` error.
|
|
6
|
+
|
|
7
|
+
## 4.14.3
|
|
8
|
+
* Update Firefox ESR.
|
|
9
|
+
|
|
10
|
+
## 4.14.2
|
|
11
|
+
* Fixed `--update-db` on Windows (by James Ross).
|
|
12
|
+
* Improved `--update-db` output.
|
|
13
|
+
|
|
14
|
+
## 4.14.1
|
|
15
|
+
* Added `--update-db` explanation (by Justin Zelinsky).
|
|
16
|
+
|
|
4
17
|
## 4.14
|
|
5
18
|
* Add `BROWSERSLIST_DANGEROUS_EXTEND` support (by Timo Mayer).
|
|
6
19
|
|
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ Browserslist will take queries from tool option,
|
|
|
70
70
|
|
|
71
71
|
* [Tools](#tools)
|
|
72
72
|
* [Best Practices](#best-practices)
|
|
73
|
+
* [Browsers Data Updating](#browsers-data-updating)
|
|
73
74
|
* [Queries](#queries)
|
|
74
75
|
* [Query Composition](#query-composition)
|
|
75
76
|
* [Full List](#full-list)
|
|
@@ -143,6 +144,46 @@ Browserslist will take queries from tool option,
|
|
|
143
144
|
and desktop Safari combined.
|
|
144
145
|
|
|
145
146
|
|
|
147
|
+
## Browsers Data Updating
|
|
148
|
+
|
|
149
|
+
`npx browserslist@latest --update-db` updates `caniuse-lite` version
|
|
150
|
+
in your npm, yarn or pnpm lock file.
|
|
151
|
+
|
|
152
|
+
You need to do it regularly for two reasons:
|
|
153
|
+
|
|
154
|
+
1. To use the latest browser’s versions and statistics in queries like
|
|
155
|
+
`last 2 versions` or `>1%`. For example, if you created your project
|
|
156
|
+
2 years ago and did not update your dependencies, `last 1 version`
|
|
157
|
+
will return 2 year old browsers.
|
|
158
|
+
2. `caiuse-lite` deduplication: to synchronize version in different tools.
|
|
159
|
+
|
|
160
|
+
> What is deduplication?
|
|
161
|
+
|
|
162
|
+
Due to how npm architecture is setup, you may have a situation
|
|
163
|
+
where you have multiple versions of a single dependency required.
|
|
164
|
+
|
|
165
|
+
Imagine you begin a project, and you add `autoprefixer` as a dependency.
|
|
166
|
+
npm looks for the latest `caniuse-lite` version (1.0.30000700) and adds it to
|
|
167
|
+
`package-lock.json` under `autoprefixer` dependencies.
|
|
168
|
+
|
|
169
|
+
A year later, you decide to add Babel. At this moment, we have a
|
|
170
|
+
new version of `canuse-lite` (1.0.30000900). npm took the latest version
|
|
171
|
+
and added it to your lock file under `@babel/preset-env` dependencies.
|
|
172
|
+
|
|
173
|
+
Now your lock file looks like this:
|
|
174
|
+
|
|
175
|
+
```ocaml
|
|
176
|
+
autoprefixer 7.1.4
|
|
177
|
+
browserslist 3.1.1
|
|
178
|
+
caniuse-lite 1.0.30000700
|
|
179
|
+
@babel/preset-env 7.10.0
|
|
180
|
+
browserslist 4.13.0
|
|
181
|
+
caniuse-lite 1.0.30000900
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
As you can see, we now have two versions of `caniuse-lite` installed.
|
|
185
|
+
|
|
186
|
+
|
|
146
187
|
## Queries
|
|
147
188
|
|
|
148
189
|
Browserslist will use browsers and Node.js versions query
|
|
@@ -354,10 +395,11 @@ naming or prefixing the module with `@scope/browserslist-config`, such as
|
|
|
354
395
|
`@scope/browserslist-config` or `@scope/browserslist-config-mycompany`.
|
|
355
396
|
|
|
356
397
|
If you don’t accept Browserslist queries from users, you can disable the
|
|
357
|
-
validation by using the `
|
|
398
|
+
validation by using the or `BROWSERSLIST_DANGEROUS_EXTEND` environment variable
|
|
399
|
+
or `dangerousExtend` option.
|
|
358
400
|
|
|
359
|
-
```
|
|
360
|
-
|
|
401
|
+
```sh
|
|
402
|
+
BROWSERSLIST_DANGEROUS_EXTEND=1 npx webpack
|
|
361
403
|
```
|
|
362
404
|
|
|
363
405
|
Because this uses `npm`'s resolution, you can also reference specific files
|
package/index.js
CHANGED
|
@@ -1005,7 +1005,7 @@ var QUERIES = [
|
|
|
1005
1005
|
{
|
|
1006
1006
|
regexp: /^(firefox|ff|fx)\s+esr$/i,
|
|
1007
1007
|
select: function () {
|
|
1008
|
-
return ['firefox
|
|
1008
|
+
return ['firefox 78']
|
|
1009
1009
|
}
|
|
1010
1010
|
},
|
|
1011
1011
|
{
|
|
@@ -1169,6 +1169,8 @@ var QUERIES = [
|
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
+
|
|
1173
|
+
browserslist.versionAliases.op_mob['59'] = '58'
|
|
1172
1174
|
}())
|
|
1173
1175
|
|
|
1174
1176
|
module.exports = browserslist
|
package/node.js
CHANGED
|
@@ -372,7 +372,10 @@ module.exports = {
|
|
|
372
372
|
if (latest !== 0 && latest < halfYearAgo) {
|
|
373
373
|
console.warn(
|
|
374
374
|
'Browserslist: caniuse-lite is outdated. Please run:\n' +
|
|
375
|
-
'npx browserslist@latest --update-db'
|
|
375
|
+
'npx browserslist@latest --update-db\n' +
|
|
376
|
+
'\n' +
|
|
377
|
+
'Why you should do it regularly:\n' +
|
|
378
|
+
'https://github.com/browserslist/browserslist#browsers-data-updating'
|
|
376
379
|
)
|
|
377
380
|
}
|
|
378
381
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserslist",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.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",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": "browserslist/browserslist",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"caniuse-lite": "^1.0.
|
|
19
|
-
"electron-to-chromium": "^1.3.
|
|
20
|
-
"escalade": "^3.0
|
|
21
|
-
"node-releases": "^1.1.
|
|
18
|
+
"caniuse-lite": "^1.0.30001135",
|
|
19
|
+
"electron-to-chromium": "^1.3.570",
|
|
20
|
+
"escalade": "^3.1.0",
|
|
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
|
|
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 =
|
|
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
|
-
'
|
|
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(
|
|
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
|
}
|