browserslist 4.14.7 → 4.15.0
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 +3 -0
- package/README.md +4 -5
- package/error.d.ts +7 -0
- package/index.d.ts +172 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
|
4
|
+
## 4.15
|
|
5
|
+
* Add TypeScript types (by Dmitry Semigradsky).
|
|
6
|
+
|
|
4
7
|
## 4.14.7
|
|
5
8
|
* Fixed Yarn Workspaces support to `--update-db` (by Fausto Núñez Alberro).
|
|
6
9
|
* Added browser changes to `--update-db` (by @AleksandrSl).
|
package/README.md
CHANGED
|
@@ -21,7 +21,6 @@ when you add the following to `package.json`:
|
|
|
21
21
|
"browserslist": [
|
|
22
22
|
"defaults",
|
|
23
23
|
"not IE 11",
|
|
24
|
-
"not IE_Mob 11",
|
|
25
24
|
"maintained node versions"
|
|
26
25
|
]
|
|
27
26
|
```
|
|
@@ -33,7 +32,6 @@ Or in `.browserslistrc` config:
|
|
|
33
32
|
|
|
34
33
|
defaults
|
|
35
34
|
not IE 11
|
|
36
|
-
not IE_Mob 11
|
|
37
35
|
maintained node versions
|
|
38
36
|
```
|
|
39
37
|
|
|
@@ -45,8 +43,6 @@ Browserslist will take queries from tool option,
|
|
|
45
43
|
`browserslist` config, `.browserslistrc` config,
|
|
46
44
|
`browserslist` section in `package.json` or environment variables.
|
|
47
45
|
|
|
48
|
-
[Browserslist Example] shows how every tool uses Browserslist.
|
|
49
|
-
|
|
50
46
|
[cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
|
51
47
|
[cult]: https://cultofmartians.com/done.html
|
|
52
48
|
|
|
@@ -92,6 +88,8 @@ Browserslist will take queries from tool option,
|
|
|
92
88
|
|
|
93
89
|
* [`browserl.ist`](https://browserl.ist/) is an online tool to check
|
|
94
90
|
what browsers will be selected by some query.
|
|
91
|
+
* [`browserslist-vscode`] adds `.browserslistrc` syntax highlighting
|
|
92
|
+
to Visual Studio Code.
|
|
95
93
|
* [`browserslist-ga`] and [`browserslist-ga-export`] download your website
|
|
96
94
|
browsers statistics to use it in `> 0.5% in my stats` query.
|
|
97
95
|
* [`browserslist-useragent-regexp`] compiles Browserslist query to a RegExp
|
|
@@ -112,6 +110,7 @@ Browserslist will take queries from tool option,
|
|
|
112
110
|
[`browserslist-browserstack`]: https://github.com/xeroxinteractive/browserslist-browserstack
|
|
113
111
|
[`browserslist-ga-export`]: https://github.com/browserslist/browserslist-ga-export
|
|
114
112
|
[`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
|
|
113
|
+
[`browserslist-vscode`]: https://marketplace.visualstudio.com/items?itemName=webben.browserslist
|
|
115
114
|
[`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
|
|
116
115
|
[`caniuse-api`]: https://github.com/Nyalab/caniuse-api
|
|
117
116
|
|
|
@@ -155,7 +154,7 @@ You need to do it regularly for two reasons:
|
|
|
155
154
|
`last 2 versions` or `>1%`. For example, if you created your project
|
|
156
155
|
2 years ago and did not update your dependencies, `last 1 version`
|
|
157
156
|
will return 2 year old browsers.
|
|
158
|
-
2. `
|
|
157
|
+
2. `caniuse-lite` deduplication: to synchronize version in different tools.
|
|
159
158
|
|
|
160
159
|
> What is deduplication?
|
|
161
160
|
|
package/error.d.ts
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return array of browsers by selection queries.
|
|
3
|
+
*
|
|
4
|
+
* ```js
|
|
5
|
+
* browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* @param queries Browser queries.
|
|
9
|
+
* @returns Array with browser names in Can I Use.
|
|
10
|
+
*/
|
|
11
|
+
declare function browserslist (
|
|
12
|
+
queries?: string | readonly string[] | null,
|
|
13
|
+
opts?: browserslist.Options
|
|
14
|
+
): string[]
|
|
15
|
+
|
|
16
|
+
declare namespace browserslist {
|
|
17
|
+
interface Options {
|
|
18
|
+
/**
|
|
19
|
+
* Path to processed file. It will be used to find config files.
|
|
20
|
+
*/
|
|
21
|
+
path?: string | false
|
|
22
|
+
/**
|
|
23
|
+
* Processing environment. It will be used to take right queries
|
|
24
|
+
* from config file.
|
|
25
|
+
*/
|
|
26
|
+
env?: string
|
|
27
|
+
/**
|
|
28
|
+
* Custom browser usage statistics for "> 1% in my stats" query.
|
|
29
|
+
*/
|
|
30
|
+
stats?: Stats | string
|
|
31
|
+
/**
|
|
32
|
+
* Path to config file with queries.
|
|
33
|
+
*/
|
|
34
|
+
config?: string
|
|
35
|
+
/**
|
|
36
|
+
* Do not throw on unknown version in direct query.
|
|
37
|
+
*/
|
|
38
|
+
ignoreUnknownVersions?: boolean
|
|
39
|
+
/**
|
|
40
|
+
* Disable security checks for extend query.
|
|
41
|
+
*/
|
|
42
|
+
dangerousExtend?: boolean
|
|
43
|
+
/**
|
|
44
|
+
* Alias mobile browsers to the desktop version when Can I Use
|
|
45
|
+
* doesn’t have data about the specified version.
|
|
46
|
+
*/
|
|
47
|
+
mobileToDesktop?: boolean
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type Config = {
|
|
51
|
+
defaults: string[]
|
|
52
|
+
[section: string]: string[] | undefined
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface Stats {
|
|
56
|
+
[browser: string]: {
|
|
57
|
+
[version: string]: number
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Browser names aliases.
|
|
63
|
+
*/
|
|
64
|
+
let aliases: {
|
|
65
|
+
[alias: string]: string | undefined
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Aliases to work with joined versions like `ios_saf 7.0-7.1`.
|
|
70
|
+
*/
|
|
71
|
+
let versionAliases: {
|
|
72
|
+
[browser: string]:
|
|
73
|
+
| {
|
|
74
|
+
[version: string]: string | undefined
|
|
75
|
+
}
|
|
76
|
+
| undefined
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Can I Use only provides a few versions for some browsers (e.g. `and_chr`).
|
|
81
|
+
*
|
|
82
|
+
* Fallback to a similar browser for unknown versions.
|
|
83
|
+
*/
|
|
84
|
+
let desktopNames: {
|
|
85
|
+
[browser: string]: string | undefined
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let data: {
|
|
89
|
+
[browser: string]:
|
|
90
|
+
| {
|
|
91
|
+
name: string
|
|
92
|
+
versions: string[]
|
|
93
|
+
released: string[]
|
|
94
|
+
releaseDate: {
|
|
95
|
+
[version: string]: number | undefined | null
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
| undefined
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface Usage {
|
|
102
|
+
[version: string]: number
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let usage: {
|
|
106
|
+
global?: Usage
|
|
107
|
+
custom?: Usage | null
|
|
108
|
+
[country: string]: Usage | undefined | null
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
let cache: {
|
|
112
|
+
[feature: string]: {
|
|
113
|
+
[name: string]: 'y' | 'n'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Default browsers query
|
|
119
|
+
*/
|
|
120
|
+
let defaults: readonly string[]
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Which statistics should be used. Country code or custom statistics.
|
|
124
|
+
* Pass `"my stats"` to load statistics from `Browserslist` files.
|
|
125
|
+
*/
|
|
126
|
+
type StatsOptions = string | 'my stats' | Stats | { dataByBrowser: Stats }
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Return browsers market coverage.
|
|
130
|
+
*
|
|
131
|
+
* ```js
|
|
132
|
+
* browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @param browsers Browsers names in Can I Use.
|
|
136
|
+
* @param stats Which statistics should be used.
|
|
137
|
+
* @returns Total market coverage for all selected browsers.
|
|
138
|
+
*/
|
|
139
|
+
function coverage (browsers: readonly string[], stats?: StatsOptions): number
|
|
140
|
+
|
|
141
|
+
function clearCaches (): void
|
|
142
|
+
|
|
143
|
+
function parseConfig (string: string): Config
|
|
144
|
+
|
|
145
|
+
function readConfig (file: string): Config
|
|
146
|
+
|
|
147
|
+
function findConfig (...pathSegments: string[]): Config | undefined
|
|
148
|
+
|
|
149
|
+
interface LoadConfigOptions {
|
|
150
|
+
config?: string
|
|
151
|
+
path?: string
|
|
152
|
+
env?: string
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function loadConfig (options: LoadConfigOptions): string[] | undefined
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare global {
|
|
159
|
+
namespace NodeJS {
|
|
160
|
+
interface ProcessEnv {
|
|
161
|
+
BROWSERSLIST?: string
|
|
162
|
+
BROWSERSLIST_CONFIG?: string
|
|
163
|
+
BROWSERSLIST_DANGEROUS_EXTEND?: string
|
|
164
|
+
BROWSERSLIST_DISABLE_CACHE?: string
|
|
165
|
+
BROWSERSLIST_ENV?: string
|
|
166
|
+
BROWSERSLIST_IGNORE_OLD_DATA?: string
|
|
167
|
+
BROWSERSLIST_STATS?: string
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export = browserslist
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browserslist",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
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,11 +15,11 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": "browserslist/browserslist",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"caniuse-lite": "^1.0.
|
|
18
|
+
"caniuse-lite": "^1.0.30001164",
|
|
19
19
|
"colorette": "^1.2.1",
|
|
20
|
-
"electron-to-chromium": "^1.3.
|
|
20
|
+
"electron-to-chromium": "^1.3.612",
|
|
21
21
|
"escalade": "^3.1.1",
|
|
22
|
-
"node-releases": "^1.1.
|
|
22
|
+
"node-releases": "^1.1.67"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"bin": {
|
|
28
28
|
"browserslist": "cli.js"
|
|
29
29
|
},
|
|
30
|
+
"types": "./index.d.ts",
|
|
30
31
|
"browser": {
|
|
31
32
|
"./node.js": "./browser.js",
|
|
32
33
|
"path": false
|