nav tabs on admin dashboard
This commit is contained in:
126
node_modules/browserslist/CHANGELOG.md
generated
vendored
126
node_modules/browserslist/CHANGELOG.md
generated
vendored
@@ -1,6 +1,126 @@
|
||||
# Change Log
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## 4.4.2
|
||||
* Allow to have string in `package.json` (by @dmarkhas).
|
||||
|
||||
## 4.4.1
|
||||
* Allow to use `.` in scope name of shareable config (by Gustav Nikolaj).
|
||||
|
||||
## 4.4
|
||||
* Added `and` and `or` keywords to combine queries (by Jon Ege Ronnenberg).
|
||||
|
||||
## 4.3.7
|
||||
* Fix fraction years support in `last 1.5 years` (by Clément P).
|
||||
* Fix version-less browser support.
|
||||
|
||||
## 4.3.6
|
||||
* Fix version-less browser support in custom statistics (by Alex Walter).
|
||||
|
||||
## 4.3.5
|
||||
* Fix `not` query for wrong Can I Use data.
|
||||
|
||||
## 4.3.4
|
||||
* Allow to update `node-releases` without new Browserslist releases.
|
||||
|
||||
## 4.3.3
|
||||
* Fix Node.js 11 support.
|
||||
|
||||
## 4.3.2
|
||||
* Fix `Unknown version 11 of Node.js` error (by Dan Onoshko).
|
||||
|
||||
## 4.3.1
|
||||
* Fix conflict between `caniuse-lite` and custom browsers statistics.
|
||||
|
||||
## 4.3
|
||||
* Allow to use `extends browserslist-config-a/file` (by @Schweinepriester).
|
||||
|
||||
## 4.2.1
|
||||
* Use new `node-releases` support (by Sergey Rubanov).
|
||||
|
||||
## 4.2
|
||||
* Add `--json` argument for CLI.
|
||||
* Allow to pass multiple areas in CLI by `--coverage=US,alt-AS,global`.
|
||||
|
||||
## 4.1.2
|
||||
* Better `unknow query` error message.
|
||||
* Use latest `node-releases`.
|
||||
|
||||
## 4.1.1
|
||||
* Update Firefox ESR versions.
|
||||
|
||||
## 4.1
|
||||
* Add `current node` query.
|
||||
* Add contributors widget to docs (by Sergey Surkov).
|
||||
|
||||
## 4.0.2
|
||||
* Fix new `node-releases` support (by Sergey Rubanov).
|
||||
* Fix error text (by Josh Smith).
|
||||
|
||||
## 4.0.1
|
||||
* Reduce npm package size.
|
||||
* Fix docs.
|
||||
|
||||
## 4.0.0 “Erinaceus amurensis”
|
||||
* Add `node X` and `maintained node versions` queries (by Pavel Vostrikov).
|
||||
* Remove Node.js 4 support.
|
||||
* Show warning if `caniuse-lite` is old (by Anton Tuzhik).
|
||||
* Add comma support in config file.
|
||||
|
||||
## 3.2.8
|
||||
* Add IE 9-5.5 to dead browsers.
|
||||
* Remove development configs from npm package.
|
||||
|
||||
## 3.2.7
|
||||
* Add Firefox 60 as Firefox ESR.
|
||||
|
||||
## 3.2.6
|
||||
* Add Opera Mini 12 to dead browsers.
|
||||
* Update docs (by Jamie Kyle).
|
||||
|
||||
## 3.2.5
|
||||
* Fix excluding Opera Mini and other browsers with `all` version.
|
||||
|
||||
## 3.2.4
|
||||
* Resolve shareable config from current working directory.
|
||||
|
||||
## 3.2.3
|
||||
* Fix `package.json` config validation for single string case.
|
||||
* Fix CLI error reporting.
|
||||
|
||||
## 3.2.2
|
||||
* Add `package.json` config validation.
|
||||
* Move project to `browserlist` GitHub organization.
|
||||
|
||||
## 3.2.1
|
||||
* Fix error text (by Steve Schrab).
|
||||
|
||||
## 3.2
|
||||
* Add `cover 99%` query (by Vasily Fedoseyev).
|
||||
* Add `cover 99% in US` query (by Vasily Fedoseyev).
|
||||
* Add `cover 99% in my stats` query (by Vasily Fedoseyev).
|
||||
* Add `"my stats"` support to `browserlist.coverage()` (by Vasily Fedoseyev).
|
||||
|
||||
## 3.1.2
|
||||
* Add more clear error on missed browser version.
|
||||
|
||||
## 3.1.1
|
||||
* Fix JSDoc (by Sylvain Pollet-Villard).
|
||||
|
||||
## 3.1
|
||||
* Add `ignoreUnknownVersions` option.
|
||||
* Fix docs (by Pascal Duez).
|
||||
|
||||
## 3.0 “Atelerix sclateri”
|
||||
* Remove country statistics from client-side build of Browserslist.
|
||||
* Change `> 1%` to `> 0.5%` in default query.
|
||||
* Add `not dead` to default query.
|
||||
* Change default environment to `production` (by Marco Fugaro).
|
||||
* Add `dead` query support with IE 10 and BlackBerry browser.
|
||||
* Add multiple environments in one section support (by Evilebot Tnawi).
|
||||
* Add custom statistics support to `browserlist.coverage()`.
|
||||
* Fix `path` option check.
|
||||
|
||||
## 2.11.3
|
||||
* Fix for `path: undefined` option.
|
||||
|
||||
@@ -92,7 +212,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## 2.1
|
||||
* Add `>= 5%`, `>= 5% in US` and `>= 5% in my stats` queries.
|
||||
|
||||
## 2.0
|
||||
## 2.0 “Atelerix frontalis”
|
||||
* `last n versions` returns versions for all browsers, not only main browsers.
|
||||
* Cache file system operations (by Aarni Koskela).
|
||||
* Use `caniuse-lite` 1 MB instead of `caniuse-db` 7 MB (by Ben Briggs).
|
||||
@@ -191,7 +311,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## 1.0.1
|
||||
* Update Firefox ESR (by Rouven Weßling).
|
||||
|
||||
## 1.0
|
||||
## 1.0 “Atelerix algirus”
|
||||
* Remove Opera 12.1 from default query.
|
||||
* Add `not` keyword and exclude browsers by query.
|
||||
* Add Microsoft Edge support (by Andrey Polischuk).
|
||||
@@ -230,5 +350,5 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
## 0.1.1
|
||||
* Sort browsers by name and version.
|
||||
|
||||
## 0.1
|
||||
## 0.1 “Atelerix albiventris”
|
||||
* Initial release.
|
||||
|
||||
297
node_modules/browserslist/README.md
generated
vendored
297
node_modules/browserslist/README.md
generated
vendored
@@ -1,27 +1,30 @@
|
||||
# Browserslist
|
||||
# Browserslist [![Cult Of Martians][cult-img]][cult]
|
||||
|
||||
<img align="right" width="120" height="120"
|
||||
src="./logo.svg" alt="Browserslist logo by Anton Lovchikov">
|
||||
<img width="120" height="120" alt="Browserslist logo by Anton Lovchikov"
|
||||
src="https://browserslist.github.io/browserslist/logo.svg" align="right">
|
||||
|
||||
Library to share target browsers between different front-end tools.
|
||||
It is used in:
|
||||
The config to share target browsers and Node.js versions between different
|
||||
front-end tools. It is used in:
|
||||
|
||||
* [Autoprefixer]
|
||||
* [babel-preset-env]
|
||||
(external config in `package.json` or `browserslist` will be supported in 7.0)
|
||||
* [Babel]
|
||||
* [postcss-preset-env]
|
||||
* [eslint-plugin-compat]
|
||||
* [stylelint-no-unsupported-browser-features]
|
||||
* [postcss-normalize]
|
||||
* [obsolete-webpack-plugin]
|
||||
|
||||
All tools that rely on Browserslist will find its config automatically,
|
||||
when you add the following to `package.json`:
|
||||
[Browserslist Example] shows how every tool uses Browserslist.
|
||||
All tools will find target browsers automatically,
|
||||
when you add the following to `package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"browserslist": [
|
||||
"last 1 version",
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
"maintained node versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -31,73 +34,137 @@ Or in `.browserslistrc` config:
|
||||
```yaml
|
||||
# Browsers that we support
|
||||
|
||||
last 1 version
|
||||
> 1%
|
||||
Last 2 versions
|
||||
IE 10 # sorry
|
||||
maintained node versions
|
||||
not dead
|
||||
```
|
||||
|
||||
Developers set browsers list in queries like `last 2 version`
|
||||
to be free from updating browser versions manually.
|
||||
Browserslist will use [Can I Use] data for this queries.
|
||||
Developers set versions list in queries like `last 2 version`
|
||||
to be free from updating versions manually.
|
||||
Browserslist will use [Can I Use] data for this queries.
|
||||
|
||||
Browserslist will take browsers queries from tool option,
|
||||
Browserslist will take queries from tool option,
|
||||
`browserslist` config, `.browserslistrc` config,
|
||||
`browserslist` section in `package.json` or environment variables.
|
||||
`browserslist` section in `package.json` or environment variables.
|
||||
|
||||
You can test Browserslist queries in [online demo].
|
||||
|
||||
[cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
||||
[cult]: https://cultofmartians.com/done.html
|
||||
|
||||
<a href="https://evilmartians.com/?utm_source=browserslist">
|
||||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
||||
alt="Sponsored by Evil Martians"
|
||||
width="236"
|
||||
height="54"
|
||||
\>
|
||||
alt="Sponsored by Evil Martians" width="236" height="54">
|
||||
</a>
|
||||
|
||||
[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
|
||||
[eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat
|
||||
[postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env
|
||||
[babel-preset-env]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
||||
[Browserslist Example]: https://github.com/browserslist/browserslist-example
|
||||
[postcss-preset-env]: https://github.com/jonathantneal/postcss-preset-env
|
||||
[postcss-normalize]: https://github.com/jonathantneal/postcss-normalize
|
||||
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
||||
[online demo]: http://browserl.ist/
|
||||
[Can I Use]: http://caniuse.com/
|
||||
[online demo]: https://browserl.ist/
|
||||
[Can I Use]: https://caniuse.com/
|
||||
[Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
||||
[obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
|
||||
|
||||
## Tools
|
||||
|
||||
* [`browserslist-ga`] downloads your website browsers statistics
|
||||
to use it in `> 0.5% in my stats` query.
|
||||
* [`browserslist-useragent`] checks browser by user agent string
|
||||
to match Browserslist target browsers query.
|
||||
* [`browserslist-useragent-ruby`] is a Ruby library to checks browser
|
||||
by user agent string to match Browserslist.
|
||||
* [`caniuse-api`] returns browsers which support some specific feature.
|
||||
* Run `npx browserslist` in your project directory to see project’s
|
||||
target browsers. This CLI tool is built-in and available in any project
|
||||
with Autoprefixer.
|
||||
|
||||
[`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
|
||||
[`caniuse-api`]: https://github.com/Nyalab/caniuse-api
|
||||
[`browserslist-useragent-ruby`]: https://github.com/browserslist/browserslist-useragent-ruby
|
||||
[`browserslist-useragent`]: https://github.com/pastelsky/browserslist-useragent
|
||||
[`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
|
||||
[`caniuse-api`]: https://github.com/Nyalab/caniuse-api
|
||||
|
||||
|
||||
## Queries
|
||||
|
||||
Browserslist will use browsers query from one of this sources:
|
||||
Browserslist will use browsers and Node.js versions query
|
||||
from one of this sources:
|
||||
|
||||
1. Tool options. For example `browsers` option in Autoprefixer.
|
||||
2. `BROWSERSLIST` environment variable.
|
||||
3. `browserslist` config file in current or parent directories.
|
||||
3. `.browserslistrc` config file in current or parent directories.
|
||||
4. `browserslist` key in `package.json` file in current or parent directories.
|
||||
1. `browserslist` key in `package.json` file in current or parent directories.
|
||||
**We recommend this way.**
|
||||
5. If the above methods did not produce a valid result
|
||||
Browserslist will use defaults: `> 1%, last 2 versions, Firefox ESR`.
|
||||
2. Tool options. For example `browsers` option in Autoprefixer.
|
||||
3. `BROWSERSLIST` environment variable.
|
||||
4. `browserslist` config file in current or parent directories.
|
||||
5. `.browserslistrc` config file in current or parent directories.
|
||||
6. If the above methods did not produce a valid result
|
||||
Browserslist will use defaults:
|
||||
`> 0.5%, last 2 versions, Firefox ESR, not dead`.
|
||||
|
||||
You can specify the versions by queries (case insensitive):
|
||||
|
||||
* `last 2 versions`: the last 2 versions for each browser.
|
||||
* `last 2 Chrome versions`: the last 2 versions of Chrome browser.
|
||||
* `> 5%`: versions selected by global usage statistics.
|
||||
### Query Composition
|
||||
|
||||
An `or` combiner can use the keyword `or` as well as `,`.
|
||||
`last 1 version or > 1%` is equal to `last 1 version, > 1%`.
|
||||
|
||||
`and` query combinations are also supported to perform an
|
||||
intersection of the previous query: `last 1 version and > 1%`.
|
||||
|
||||
There is 3 different ways to combine queries as depicted below. First you start
|
||||
with a single query and then we combine the queries to get our final list.
|
||||
|
||||
Obviously you can *not* start with a `not` combiner, since the is no left-hand
|
||||
side query to combine it with.
|
||||
|
||||
| Query combiner type | Illustration | Example |
|
||||
| ------------------- | :----------: | ------- |
|
||||
|`or`/ `,` combiner <br> (union) |  | `'> .5% or last 2 versions'` <br> `'> .5%, last 2 versions'` |
|
||||
| `and` combiner <br> (intersection) |  | `'> .5% and last 2 versions'` |
|
||||
| `not` combiner <br> (relative complement) |  | `'> .5% and not last 2 versions'` <br> `'> .5% or not last 2 versions'` <br> `'> .5%, not last 2 versions'` |
|
||||
|
||||
_A quick way to test your query is to do `npx browserslist '> 0.5%, not IE 11'`
|
||||
in your terminal._
|
||||
|
||||
|
||||
### Best Practices
|
||||
|
||||
* Select browsers directly (`last 2 Chrome versions`) only if you are making
|
||||
a web app for a kiosk with one browser. There are a lot of browsers
|
||||
on the market. If you are making general web app you should respect
|
||||
browsers diversity.
|
||||
* If you want to change the default set of browsers we recommend to combine
|
||||
`last 1 version`, `not dead` with `> 0.2%` (or `> 1% in US`,
|
||||
`> 1% in my stats`). `last n versions` adds too many dead browsers
|
||||
and does not add popular old versions. Choosing a percentage above `0.2%`
|
||||
will in the long run make popular browsers even more popular. We might run
|
||||
into a monopoly and stagnation situation, as we had with Internet Explorer 6.
|
||||
Please use this setting with caution.
|
||||
* Don’t remove browsers just because you don’t know them. Opera Mini has
|
||||
100 million users in Africa and it is more popular in the global market
|
||||
than Microsoft Edge. Chinese QQ Browsers has more market share than Firefox
|
||||
and desktop Safari altogether.
|
||||
|
||||
|
||||
### Full List
|
||||
|
||||
You can specify the browser and Node.js versions by queries (case insensitive):
|
||||
|
||||
* `> 5%`: browsers versions selected by global usage statistics.
|
||||
`>=`, `<` and `<=` work too.
|
||||
* `> 5% in US`: uses USA usage statistics. It accepts [two-letter country code].
|
||||
* `> 5% in alt-AS`: uses Asia region usage statistics. List of all region codes
|
||||
can be found at [`caniuse-lite/data/regions`].
|
||||
* `> 5% in my stats`: uses [custom usage data].
|
||||
* `cover 99.5%`: most popular browsers that provide coverage.
|
||||
* `cover 99.5% in US`: same as above, with [two-letter country code].
|
||||
* `cover 99.5% in my stats`: uses [custom usage data].
|
||||
* `maintained node versions`: all Node.js versions, which are [still maintained]
|
||||
by Node.js Foundation.
|
||||
* `node 10` and `node 10.4`: selects latest Node.js `10.x.x`
|
||||
or `10.4.x` release.
|
||||
* `current node`: Node.js version used by Browserslist right now.
|
||||
* `extends browserslist-config-mycompany`: take queries from
|
||||
`browserslist-config-mycompany` npm package.
|
||||
* `ie 6-8`: selects an inclusive range of versions.
|
||||
@@ -111,10 +178,19 @@ You can specify the versions by queries (case insensitive):
|
||||
all minor/patch releases of last 2 major versions.
|
||||
* `since 2015` or `last 2 years`: all versions released since year 2015
|
||||
(also `since 2015-03` and `since 2015-03-10`).
|
||||
* `dead`: browsers from `last 2 version` query, but with less than 0.5%
|
||||
in global usage statistics and without official support or updates
|
||||
for 24 months. Right now it is `IE 10`, `IE_Mob 10`, `BlackBerry 10`,
|
||||
`BlackBerry 7`, and `OperaMobile 12.1`.
|
||||
* `last 2 versions`: the last 2 versions for *each* browser.
|
||||
* `last 2 Chrome versions`: the last 2 versions of Chrome browser.
|
||||
* `defaults`: Browserslist’s default browsers
|
||||
(`> 0.5%, last 2 versions, Firefox ESR, not dead`).
|
||||
* `not ie <= 8`: exclude browsers selected by previous queries.
|
||||
|
||||
You can add `not ` to any query.
|
||||
|
||||
|
||||
### Debug
|
||||
|
||||
Run `npx browserslist` in project directory to see what browsers was selected
|
||||
@@ -138,22 +214,23 @@ safari 11
|
||||
samsung 5
|
||||
```
|
||||
|
||||
|
||||
### Notes
|
||||
|
||||
Browserslist works with separated versions of browsers.
|
||||
You should avoid queries like `Firefox > 0`.
|
||||
|
||||
Multiple criteria are combined as a boolean `OR`. A browser version must match
|
||||
at least one of the criteria to be selected.
|
||||
The list of the specified browsers acts as a white list which means other browsers are ignored.
|
||||
|
||||
All queries are based on the [Can I Use] support table,
|
||||
e.g. `last 3 iOS versions` might select `8.4, 9.2, 9.3` (mixed major and minor),
|
||||
whereas `last 3 Chrome versions` might select `50, 49, 48` (major only).
|
||||
|
||||
[`caniuse-lite/data/regions`]: https://github.com/ben-eb/caniuse-lite/tree/master/data/regions
|
||||
[two-letter country code]: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
[two-letter country code]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
|
||||
[custom usage data]: #custom-usage-data
|
||||
[Can I Use]: http://caniuse.com/
|
||||
[still maintained]: https://github.com/nodejs/Release
|
||||
[Can I Use]: https://caniuse.com/
|
||||
|
||||
|
||||
### Browsers
|
||||
|
||||
@@ -171,6 +248,7 @@ Names are case insensitive:
|
||||
* `Firefox` or `ff` for Mozilla Firefox.
|
||||
* `FirefoxAndroid` or `and_ff` for Firefox for Android.
|
||||
* `iOS` or `ios_saf` for iOS Safari.
|
||||
* `Node` for Node.js.
|
||||
* `Opera` for Opera.
|
||||
* `OperaMini` or `op_mini` for Opera Mini.
|
||||
* `OperaMobile` or `op_mob` for Opera Mobile.
|
||||
@@ -179,6 +257,7 @@ Names are case insensitive:
|
||||
* `Samsung` for Samsung Internet.
|
||||
* `UCAndroid` or `and_uc` for UC Browser for Android.
|
||||
|
||||
|
||||
## `package.json`
|
||||
|
||||
If you want to reduce config files in project root, you can specify
|
||||
@@ -191,12 +270,14 @@ browsers in `package.json` with `browserslist` key:
|
||||
"autoprefixer": "^6.5.4"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 version",
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
"IE 10"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Config File
|
||||
|
||||
Browserslist config should be named `.browserslistrc` or `browserslist`
|
||||
@@ -205,9 +286,9 @@ and have browsers queries split by a new line. Comments starts with `#` symb
|
||||
```yaml
|
||||
# Browsers that we support
|
||||
|
||||
last 1 version
|
||||
> 1%
|
||||
Last 2 versions
|
||||
IE 8 # sorry
|
||||
IE 10 # sorry
|
||||
```
|
||||
|
||||
Browserslist will check config in every directory in `path`.
|
||||
@@ -216,6 +297,7 @@ So, if tool process `app/styles/main.css`, you can put config to root,
|
||||
|
||||
You can specify direct path in `BROWSERSLIST_CONFIG` environment variables.
|
||||
|
||||
|
||||
## Shareable Configs
|
||||
|
||||
You can use the following query to reference an exported Browserslist config
|
||||
@@ -254,11 +336,13 @@ When writing a shared Browserslist package, just export an array.
|
||||
|
||||
```js
|
||||
module.exports = [
|
||||
'last 2 versions',
|
||||
'ie 9'
|
||||
'last 1 version',
|
||||
'> 1%',
|
||||
'ie 10'
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
## Environment Variables
|
||||
|
||||
If some tool use Browserslist inside, you can change browsers settings
|
||||
@@ -297,23 +381,25 @@ by [environment variables]:
|
||||
|
||||
[environment variables]: https://en.wikipedia.org/wiki/Environment_variable
|
||||
|
||||
|
||||
## Environments
|
||||
|
||||
You can also specify different browser queries for various environments.
|
||||
Browserslist will choose query according to `BROWSERSLIST_ENV` or `NODE_ENV`
|
||||
variables. If none of them is declared, Browserslist will firstly look
|
||||
for `development` queries and then use defaults.
|
||||
for `production` queries and then use defaults.
|
||||
|
||||
In `package.json`:
|
||||
|
||||
```js
|
||||
"browserslist": {
|
||||
"production": [
|
||||
"last 2 version",
|
||||
"ie 9"
|
||||
"> 1%",
|
||||
"ie 10"
|
||||
],
|
||||
"development": [
|
||||
"last 1 version"
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version"
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -321,27 +407,25 @@ In `package.json`:
|
||||
In `.browserslistrc` config:
|
||||
|
||||
```ini
|
||||
[production]
|
||||
last 2 version
|
||||
ie 9
|
||||
[production staging]
|
||||
> 1%
|
||||
ie 10
|
||||
|
||||
[development]
|
||||
last 1 version
|
||||
last 1 chrome version
|
||||
last 1 firefox version
|
||||
```
|
||||
|
||||
|
||||
## Custom Usage Data
|
||||
|
||||
If you have a website, you can query against the usage statistics of your site:
|
||||
If you have a website, you can query against the usage statistics of your site.
|
||||
[`browserslist-ga`] will ask access to Google Analytics and then generate
|
||||
`browserslist-stats.json`:
|
||||
|
||||
1. Import your Google Analytics data into [Can I Use].
|
||||
Press `Import…` button in Settings page.
|
||||
2. Open browser DevTools on [Can I Use] and paste this snippet
|
||||
into the browser console:
|
||||
|
||||
```js
|
||||
var e=document.createElement('a');e.setAttribute('href', 'data:text/plain;charset=utf-8,'+encodeURIComponent(JSON.stringify(JSON.parse(localStorage['usage-data-by-id'])[localStorage['config-primary_usage']])));e.setAttribute('download','stats.json');document.body.appendChild(e);e.click();document.body.removeChild(e);
|
||||
```
|
||||
3. Save the data to a `browserslist-stats.json` file in your project.
|
||||
```
|
||||
npx browserslist-ga
|
||||
```
|
||||
|
||||
Of course, you can generate usage statistics file by any other method.
|
||||
File format should be like:
|
||||
@@ -364,27 +448,9 @@ Note that you can query against your custom usage data
|
||||
while also querying against global or regional data.
|
||||
For example, the query `> 1% in my stats, > 5% in US, 10%` is permitted.
|
||||
|
||||
[Can I Use]: http://caniuse.com/
|
||||
[`browserslist-ga`]: https://github.com/browserslist/browserslist-ga
|
||||
[Can I Use]: https://caniuse.com/
|
||||
|
||||
## Webpack
|
||||
|
||||
If you plan to use Browserslist on client-side (e. g., tools like CodePen)
|
||||
Browserslist could take big part of your bundle (150 KB).
|
||||
|
||||
But the biggest part of this size will be region usage statistics, which could
|
||||
be useless for you. `IgnorePlugin` could cut it:
|
||||
|
||||
```js
|
||||
const webpackConfig = {
|
||||
…
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/)
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
This plugin will reduce Browserslist size from 150 KB to 6 KB. But you loose
|
||||
`> 1% in US` queries support.
|
||||
|
||||
## JS API
|
||||
|
||||
@@ -402,29 +468,53 @@ var process = function (source, opts) {
|
||||
}
|
||||
```
|
||||
|
||||
Queries can be a string `"> 5%, last 1 version"`
|
||||
or an array `['> 5%', 'last 1 version']`.
|
||||
Queries can be a string `"> 1%, IE 10"`
|
||||
or an array `['> 1%', 'IE 10']`.
|
||||
|
||||
If a query is missing, Browserslist will look for a config file.
|
||||
You can provide a `path` option (that can be a file) to find the config file
|
||||
relatively to it.
|
||||
|
||||
Options:
|
||||
|
||||
* `path`: file or a directory path to look for config file. Default is `.`.
|
||||
* `env`: what environment section use from config. Default is `production`.
|
||||
* `stats`: custom usage statistics data.
|
||||
* `config`: path to config if you want to set it manually.
|
||||
* `ignoreUnknownVersions`: do not throw on direct query (like `ie 12`).
|
||||
Default is `false.`
|
||||
* `dangerousExtend`: Disable security checks for `extend` query.
|
||||
Default is `false.`
|
||||
|
||||
For non-JS environment and debug purpose you can use CLI tool:
|
||||
|
||||
```sh
|
||||
browserslist "> 1%, last 2 versions"
|
||||
browserslist "> 1%, IE 10"
|
||||
```
|
||||
|
||||
|
||||
## Coverage
|
||||
|
||||
You can get total users coverage for selected browsers by JS API:
|
||||
|
||||
```js
|
||||
browserslist.coverage(browserslist('> 1%')) //=> 81.4
|
||||
browserslist.coverage(browserslist('> 1%'))
|
||||
//=> 81.4
|
||||
```
|
||||
|
||||
```js
|
||||
browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1
|
||||
browserslist.coverage(browserslist('> 1% in US'), 'US')
|
||||
//=> 83.1
|
||||
```
|
||||
|
||||
```js
|
||||
browserslist.coverage(browserslist('> 1% in my stats'), 'my stats')
|
||||
//=> 83.1
|
||||
```
|
||||
|
||||
```js
|
||||
browserslist.coverage(browserslist('> 1% in my stats', { stats }), stats)
|
||||
//=> 82.2
|
||||
```
|
||||
|
||||
Or by CLI:
|
||||
@@ -439,6 +529,17 @@ $ browserslist --coverage=US "> 1% in US"
|
||||
These browsers account for 83.1% of all users in the US
|
||||
```
|
||||
|
||||
```sh
|
||||
$ browserslist --coverage "> 1% in my stats"
|
||||
These browsers account for 83.1% of all users in custom statistics
|
||||
```
|
||||
|
||||
```sh
|
||||
$ browserslist --coverage "> 1% in my stats" --stats=./stats.json
|
||||
These browsers account for 83.1% of all users in custom statistics
|
||||
```
|
||||
|
||||
|
||||
## Cache
|
||||
|
||||
Browserslist caches the configuration it reads from `package.json` and
|
||||
@@ -453,3 +554,15 @@ browserslist.clearCaches();
|
||||
|
||||
To disable the caching altogether, set the `BROWSERSLIST_DISABLE_CACHE`
|
||||
environment variable.
|
||||
|
||||
|
||||
## Contributors
|
||||
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/0" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/1" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/2" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/3" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/4" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/5" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/6" alt="" width="76" height="90" align="left">
|
||||
<img src="https://sourcerer.io/fame/ai/browserslist/browserslist/images/7" alt="" width="76" height="90" align="left">
|
||||
|
||||
14
node_modules/browserslist/browser.js
generated
vendored
14
node_modules/browserslist/browser.js
generated
vendored
@@ -19,11 +19,23 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
loadCountry: function loadCountry () {
|
||||
throw new BrowserslistError(
|
||||
'Country statistics is not supported ' +
|
||||
'in client-side build of Browserslist')
|
||||
},
|
||||
|
||||
currentNode: function currentNode (resolve, context) {
|
||||
return resolve(['maintained node versions'], context)[0]
|
||||
},
|
||||
|
||||
parseConfig: noop,
|
||||
|
||||
readConfig: noop,
|
||||
|
||||
findConfig: noop,
|
||||
|
||||
clearCaches: noop
|
||||
clearCaches: noop,
|
||||
|
||||
oldDataWarning: noop
|
||||
}
|
||||
|
||||
95
node_modules/browserslist/cli.js
generated
vendored
95
node_modules/browserslist/cli.js
generated
vendored
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require('fs')
|
||||
|
||||
var browserslist = require('./')
|
||||
var pkg = require('./package.json')
|
||||
var args = process.argv.slice(2)
|
||||
@@ -7,9 +9,11 @@ var args = process.argv.slice(2)
|
||||
var USAGE = 'Usage:\n' +
|
||||
' ' + pkg.name + '\n' +
|
||||
' ' + pkg.name + ' "QUERIES"\n' +
|
||||
' ' + pkg.name + ' --json "QUERIES"\n' +
|
||||
' ' + pkg.name + ' --config="path/to/browserlist/file"\n' +
|
||||
' ' + pkg.name + ' --coverage "QUERIES"\n' +
|
||||
' ' + pkg.name + ' --coverage=US "QUERIES"\n' +
|
||||
' ' + pkg.name + ' --coverage=US,RU,world "QUERIES"\n' +
|
||||
' ' + pkg.name + ' --env="environment name defined in config"\n' +
|
||||
' ' + pkg.name + ' --stats="path/to/browserlist/stats/file"'
|
||||
|
||||
@@ -32,11 +36,11 @@ if (isArg('--help') || isArg('-h')) {
|
||||
var mode = 'browsers'
|
||||
var opts = { }
|
||||
var queries
|
||||
var country
|
||||
var areas
|
||||
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
if (args[i][0] !== '-') {
|
||||
queries = args[i].replace(/^['"]|['"]$/g, '')
|
||||
queries = args[i].replace(/^["']|["']$/g, '')
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -44,7 +48,7 @@ if (isArg('--help') || isArg('-h')) {
|
||||
var name = arg[0]
|
||||
var value = arg[1]
|
||||
|
||||
if (value) value = value.replace(/^['"]|['"]$/g, '')
|
||||
if (value) value = value.replace(/^["']|["']$/g, '')
|
||||
|
||||
if (name === '--config' || name === '-b') {
|
||||
opts.config = value
|
||||
@@ -53,27 +57,32 @@ if (isArg('--help') || isArg('-h')) {
|
||||
} else if (name === '--stats' || name === '-s') {
|
||||
opts.stats = value
|
||||
} else if (name === '--coverage' || name === '-c') {
|
||||
mode = 'coverage'
|
||||
if (value) country = value
|
||||
if (mode !== 'json') mode = 'coverage'
|
||||
if (value) {
|
||||
areas = value.split(',')
|
||||
} else {
|
||||
areas = ['global']
|
||||
}
|
||||
} else if (name === '--json') {
|
||||
mode = 'json'
|
||||
} else {
|
||||
error('Unknown arguments ' + args[i] + '.\n\n' + USAGE)
|
||||
}
|
||||
}
|
||||
|
||||
if (!queries && !opts.config) {
|
||||
if (browserslist.findConfig(process.cwd())) {
|
||||
opts.path = process.cwd()
|
||||
} else {
|
||||
error(
|
||||
'Browserslist config did not found. ' +
|
||||
'Define queries or config path.' +
|
||||
'\n\n' + USAGE
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
var browsers
|
||||
try {
|
||||
if (!queries && !opts.config) {
|
||||
if (browserslist.findConfig(process.cwd())) {
|
||||
opts.path = process.cwd()
|
||||
} else {
|
||||
error(
|
||||
'Browserslist config was not found. ' +
|
||||
'Define queries or config path.' +
|
||||
'\n\n' + USAGE
|
||||
)
|
||||
}
|
||||
}
|
||||
browsers = browserslist(queries, opts)
|
||||
} catch (e) {
|
||||
if (e.name === 'BrowserslistError') {
|
||||
@@ -83,21 +92,55 @@ if (isArg('--help') || isArg('-h')) {
|
||||
}
|
||||
}
|
||||
|
||||
var coverage
|
||||
if (mode === 'browsers') {
|
||||
browsers.forEach(function (browser) {
|
||||
process.stdout.write(browser + '\n')
|
||||
})
|
||||
} else {
|
||||
var result = browserslist.coverage(browsers, country)
|
||||
var round = Math.round(result * 100) / 100.0
|
||||
} else if (areas) {
|
||||
coverage = areas.map(function (area) {
|
||||
var stats
|
||||
if (area !== 'global') {
|
||||
stats = area
|
||||
} else if (opts.stats) {
|
||||
stats = JSON.parse(fs.readFileSync(opts.stats))
|
||||
}
|
||||
var result = browserslist.coverage(browsers, stats)
|
||||
var round = Math.round(result * 100) / 100.0
|
||||
|
||||
var end = 'globally'
|
||||
if (country && country !== 'global') {
|
||||
end = 'in the ' + country.toUpperCase()
|
||||
return [area, round]
|
||||
})
|
||||
|
||||
if (mode === 'coverage') {
|
||||
var prefix = 'These browsers account for '
|
||||
process.stdout.write(prefix)
|
||||
coverage.forEach(function (data, index) {
|
||||
var area = data[0]
|
||||
var round = data[1]
|
||||
var end = 'globally'
|
||||
if (area && area !== 'global') {
|
||||
end = 'in the ' + area.toUpperCase()
|
||||
} else if (opts.stats) {
|
||||
end = 'in custom statistics'
|
||||
}
|
||||
|
||||
if (index !== 0) {
|
||||
process.stdout.write(prefix.replace(/./g, ' '))
|
||||
}
|
||||
|
||||
process.stdout.write(round + '% of all users ' + end + '\n')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
process.stdout.write(
|
||||
'These browsers account for ' + round + '% of all users ' +
|
||||
end + '\n')
|
||||
if (mode === 'json') {
|
||||
var data = { browsers: browsers }
|
||||
if (coverage) {
|
||||
data.coverage = coverage.reduce(function (object, j) {
|
||||
object[j[0]] = j[1]
|
||||
return object
|
||||
}, { })
|
||||
}
|
||||
process.stdout.write(JSON.stringify(data, null, ' ') + '\n')
|
||||
}
|
||||
}
|
||||
|
||||
2
node_modules/browserslist/error.js
generated
vendored
2
node_modules/browserslist/error.js
generated
vendored
@@ -1,6 +1,6 @@
|
||||
function BrowserslistError (message) {
|
||||
this.name = 'BrowserslistError'
|
||||
this.message = message || ''
|
||||
this.message = message
|
||||
this.browserslist = true
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, BrowserslistError)
|
||||
|
||||
406
node_modules/browserslist/index.js
generated
vendored
406
node_modules/browserslist/index.js
generated
vendored
@@ -1,13 +1,31 @@
|
||||
var jsReleases = require('node-releases/data/processed/envs.json')
|
||||
var agents = require('caniuse-lite/dist/unpacker/agents').agents
|
||||
var jsEOL = require('node-releases/data/release-schedule/release-schedule.json')
|
||||
var path = require('path')
|
||||
var e2c = require('electron-to-chromium/versions')
|
||||
|
||||
var agents = require('caniuse-lite/dist/unpacker/agents').agents
|
||||
var region = require('caniuse-lite/dist/unpacker/region').default
|
||||
|
||||
var BrowserslistError = require('./error')
|
||||
var env = require('./node') // Will load browser.js in webpack
|
||||
|
||||
var FLOAT_RANGE = /^\d+(\.\d+)?(-\d+(\.\d+)?)*$/
|
||||
var YEAR = 365.259641 * 24 * 60 * 60 * 1000
|
||||
|
||||
// Enum values MUST be powers of 2, so combination are safe
|
||||
/** @constant {number} */
|
||||
var QUERY_OR = 1
|
||||
/** @constant {number} */
|
||||
var QUERY_AND = 2
|
||||
|
||||
function isVersionsMatch (versionA, versionB) {
|
||||
return (versionA + '.').indexOf(versionB + '.') === 0
|
||||
}
|
||||
|
||||
function isEolReleased (name) {
|
||||
var version = name.slice(1)
|
||||
return jsReleases.some(function (i) {
|
||||
return isVersionsMatch(i.version, version)
|
||||
})
|
||||
}
|
||||
|
||||
function normalize (versions) {
|
||||
return versions.filter(function (version) {
|
||||
@@ -91,21 +109,8 @@ function normalizeVersion (data, version) {
|
||||
}
|
||||
}
|
||||
|
||||
function loadCountryStatistics (country) {
|
||||
country = country.replace(/[^\w-]/g, '')
|
||||
if (!browserslist.usage[country]) {
|
||||
var usage = { }
|
||||
// eslint-disable-next-line security/detect-non-literal-require
|
||||
var compressed = require('caniuse-lite/data/regions/' + country + '.js')
|
||||
var data = region(compressed)
|
||||
for (var i in data) {
|
||||
fillUsage(usage, i, data[i])
|
||||
}
|
||||
browserslist.usage[country] = usage
|
||||
}
|
||||
}
|
||||
|
||||
function filterByYear (since) {
|
||||
since = since / 1000
|
||||
return Object.keys(agents).reduce(function (selected, name) {
|
||||
var data = byName(name)
|
||||
if (!data) return selected
|
||||
@@ -128,10 +133,30 @@ function checkName (name) {
|
||||
return data
|
||||
}
|
||||
|
||||
function unknownQuery (query) {
|
||||
return new BrowserslistError(
|
||||
'Unknown browser query `' + query + '`. ' +
|
||||
'Maybe you are using old Browserslist or made typo in query.'
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves queries into a browser list.
|
||||
* @param {string|string[]} queries Queries to combine.
|
||||
* Either an array of queries or a long string of queries.
|
||||
* @param {object} [context] Optional arguments to
|
||||
* the select function in `queries`.
|
||||
* @returns {string[]} A list of browsers
|
||||
*/
|
||||
function resolve (queries, context) {
|
||||
return queries.reduce(function (result, selection, index) {
|
||||
selection = selection.trim()
|
||||
if (selection === '') return result
|
||||
if (Array.isArray(queries)) {
|
||||
queries = flatten(queries.map(parse))
|
||||
} else {
|
||||
queries = parse(queries)
|
||||
}
|
||||
|
||||
return queries.reduce(function (result, query, index) {
|
||||
var selection = query.queryString
|
||||
|
||||
var isExclude = selection.indexOf('not ') === 0
|
||||
if (isExclude) {
|
||||
@@ -148,20 +173,48 @@ function resolve (queries, context) {
|
||||
var match = selection.match(type.regexp)
|
||||
if (match) {
|
||||
var args = [context].concat(match.slice(1))
|
||||
var array = type.select.apply(browserslist, args)
|
||||
if (isExclude) {
|
||||
array = array.concat(array.map(function (j) {
|
||||
return j.replace(/\s\d+/, ' 0')
|
||||
}))
|
||||
return result.filter(function (j) {
|
||||
return array.indexOf(j) === -1
|
||||
})
|
||||
var array = type.select.apply(browserslist, args).map(function (j) {
|
||||
var parts = j.split(' ')
|
||||
if (parts[1] === '0') {
|
||||
return parts[0] + ' ' + byName(parts[0]).versions[0]
|
||||
} else {
|
||||
return j
|
||||
}
|
||||
})
|
||||
|
||||
switch (query.type) {
|
||||
case QUERY_AND:
|
||||
if (isExclude) {
|
||||
return result.filter(function (j) {
|
||||
// remove result items that are in array
|
||||
// (the relative complement of array in result)
|
||||
return array.indexOf(j) === -1
|
||||
})
|
||||
} else {
|
||||
return result.filter(function (j) {
|
||||
// remove result items not in array
|
||||
// (intersect of result and array)
|
||||
return array.indexOf(j) !== -1
|
||||
})
|
||||
}
|
||||
case QUERY_OR:
|
||||
default:
|
||||
if (isExclude) {
|
||||
var filter = { }
|
||||
array.forEach(function (j) {
|
||||
filter[j] = true
|
||||
})
|
||||
return result.filter(function (j) {
|
||||
return !filter[j]
|
||||
})
|
||||
}
|
||||
// union of result and array
|
||||
return result.concat(array)
|
||||
}
|
||||
return result.concat(array)
|
||||
}
|
||||
}
|
||||
|
||||
throw new BrowserslistError('Unknown browser query `' + selection + '`')
|
||||
throw unknownQuery(selection)
|
||||
}, [])
|
||||
}
|
||||
|
||||
@@ -169,16 +222,20 @@ function resolve (queries, context) {
|
||||
* Return array of browsers by selection queries.
|
||||
*
|
||||
* @param {(string|string[])} [queries=browserslist.defaults] Browser queries.
|
||||
* @param {object} opts Options.
|
||||
* @param {object} [opts] Options.
|
||||
* @param {string} [opts.path="."] Path to processed file.
|
||||
* It will be used to find config files.
|
||||
* @param {string} [opts.env="development"] Processing environment.
|
||||
* It will be used to take right
|
||||
* queries from config file.
|
||||
* @param {string} [opts.env="production"] Processing environment.
|
||||
* It will be used to take right
|
||||
* queries from config file.
|
||||
* @param {string} [opts.config] Path to config file with queries.
|
||||
* @param {object} [opts.stats] Custom browser usage statistics
|
||||
* for "> 1% in my stats" query.
|
||||
* @return {string[]} Array with browser names in Can I Use.
|
||||
* @param {boolean} [opts.ignoreUnknownVersions=false] Do not throw on unknown
|
||||
* version in direct query.
|
||||
* @param {boolean} [opts.dangerousExtend] Disable security checks
|
||||
* for extend query.
|
||||
* @returns {string[]} Array with browser names in Can I Use.
|
||||
*
|
||||
* @example
|
||||
* browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']
|
||||
@@ -186,12 +243,12 @@ function resolve (queries, context) {
|
||||
function browserslist (queries, opts) {
|
||||
if (typeof opts === 'undefined') opts = { }
|
||||
|
||||
if (!opts.hasOwnProperty('path')) {
|
||||
if (typeof opts.path === 'undefined') {
|
||||
opts.path = path.resolve ? path.resolve('.') : '.'
|
||||
}
|
||||
|
||||
if (typeof queries === 'undefined' || queries === null) {
|
||||
var config = env.loadConfig(opts)
|
||||
var config = browserslist.loadConfig(opts)
|
||||
if (config) {
|
||||
queries = config
|
||||
} else {
|
||||
@@ -199,38 +256,26 @@ function browserslist (queries, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof queries === 'string') {
|
||||
queries = queries.split(/,\s*/)
|
||||
}
|
||||
|
||||
if (!Array.isArray(queries)) {
|
||||
if (!(typeof queries === 'string' || Array.isArray(queries))) {
|
||||
throw new BrowserslistError(
|
||||
'Browser queries must be an array. Got ' + typeof queries + '.')
|
||||
'Browser queries must be an array or string. Got ' + typeof queries + '.')
|
||||
}
|
||||
|
||||
var context = { dangerousExtend: opts.dangerousExtend }
|
||||
var context = {
|
||||
ignoreUnknownVersions: opts.ignoreUnknownVersions,
|
||||
dangerousExtend: opts.dangerousExtend
|
||||
}
|
||||
|
||||
var stats = env.getStat(opts)
|
||||
env.oldDataWarning(browserslist.data)
|
||||
var stats = env.getStat(opts, browserslist.data)
|
||||
if (stats) {
|
||||
if ('dataByBrowser' in stats) {
|
||||
stats = stats.dataByBrowser
|
||||
}
|
||||
context.customUsage = { }
|
||||
for (var browser in stats) {
|
||||
fillUsage(context.customUsage, browser, stats[browser])
|
||||
}
|
||||
}
|
||||
|
||||
var result = resolve(queries, context).map(function (i) {
|
||||
var parts = i.split(' ')
|
||||
var name = parts[0]
|
||||
var version = parts[1]
|
||||
if (version === '0') {
|
||||
return name + ' ' + byName(name).versions[0]
|
||||
} else {
|
||||
return i
|
||||
}
|
||||
}).sort(function (name1, name2) {
|
||||
var result = resolve(queries, context).sort(function (name1, name2) {
|
||||
name1 = name1.split(' ')
|
||||
name2 = name2.split(' ')
|
||||
if (name1[0] === name2[0]) {
|
||||
@@ -247,6 +292,74 @@ function browserslist (queries, opts) {
|
||||
return uniq(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} BrowserslistQuery
|
||||
* @property {number} type A type constant like QUERY_OR @see QUERY_OR.
|
||||
* @property {string} queryString A query like "not ie < 11".
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parse a browserslist string query
|
||||
* @param {string} queries One or more queries as a string
|
||||
* @returns {BrowserslistQuery[]} An array of BrowserslistQuery
|
||||
*/
|
||||
function parse (queries) {
|
||||
var qs = []
|
||||
|
||||
do {
|
||||
queries = doMatch(queries, qs)
|
||||
} while (queries)
|
||||
|
||||
return qs
|
||||
}
|
||||
|
||||
/**
|
||||
* Find query matches in a string. This function is meant to be called
|
||||
* repeatedly with the returned query string until there is no more matches.
|
||||
* @param {string} string A string with one or more queries.
|
||||
* @param {BrowserslistQuery[]} qs Out parameter,
|
||||
* will be filled with `BrowserslistQuery`.
|
||||
* @returns {string} The rest of the query string minus the matched part.
|
||||
*/
|
||||
function doMatch (string, qs) {
|
||||
var or = /^(?:,\s*|\s+OR\s+)(.*)/i
|
||||
var and = /^\s+AND\s+(.*)/i
|
||||
|
||||
return find(
|
||||
string,
|
||||
function (parsed, n, max) {
|
||||
if (and.test(parsed)) {
|
||||
qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })
|
||||
return true
|
||||
} else if (or.test(parsed)) {
|
||||
qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })
|
||||
return true
|
||||
} else if (n === max) {
|
||||
qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function find (string, predicate) {
|
||||
for (var n = 1, max = string.length; n <= max; n++) {
|
||||
var parsed = string.substr(-n, n)
|
||||
if (predicate(parsed, n, max)) {
|
||||
return string.replace(parsed, '')
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
function flatten (array) {
|
||||
if (!Array.isArray(array)) return [array]
|
||||
return array.reduce(function (a, b) {
|
||||
return a.concat(flatten(b))
|
||||
}, [])
|
||||
}
|
||||
|
||||
// Will be filled by Can I Use data below
|
||||
browserslist.data = { }
|
||||
browserslist.usage = {
|
||||
@@ -256,9 +369,10 @@ browserslist.usage = {
|
||||
|
||||
// Default browsers query
|
||||
browserslist.defaults = [
|
||||
'> 1%',
|
||||
'> 0.5%',
|
||||
'last 2 versions',
|
||||
'Firefox ESR'
|
||||
'Firefox ESR',
|
||||
'not dead'
|
||||
]
|
||||
|
||||
// Browser names aliases
|
||||
@@ -284,34 +398,61 @@ browserslist.clearCaches = env.clearCaches
|
||||
browserslist.parseConfig = env.parseConfig
|
||||
browserslist.readConfig = env.readConfig
|
||||
browserslist.findConfig = env.findConfig
|
||||
browserslist.loadConfig = env.loadConfig
|
||||
|
||||
/**
|
||||
* Return browsers market coverage.
|
||||
*
|
||||
* @param {string[]} browsers Browsers names in Can I Use.
|
||||
* @param {string} [country="global"] Which country statistics should be used.
|
||||
* @param {string|object} [stats="global"] Which statistics should be used.
|
||||
* Country code or custom statistics.
|
||||
* Pass `"my stats"` to load statistics
|
||||
* from Browserslist files.
|
||||
*
|
||||
* @return {number} Total market coverage for all selected browsers.
|
||||
*
|
||||
* @example
|
||||
* browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1
|
||||
*/
|
||||
browserslist.coverage = function (browsers, country) {
|
||||
if (country && country !== 'global') {
|
||||
if (country.length > 2) {
|
||||
country = country.toLowerCase()
|
||||
} else {
|
||||
country = country.toUpperCase()
|
||||
browserslist.coverage = function (browsers, stats) {
|
||||
var data
|
||||
if (typeof stats === 'undefined') {
|
||||
data = browserslist.usage.global
|
||||
} else if (stats === 'my stats') {
|
||||
var opts = {}
|
||||
opts.path = path.resolve ? path.resolve('.') : '.'
|
||||
var customStats = env.getStat(opts)
|
||||
if (!customStats) {
|
||||
throw new BrowserslistError('Custom usage statistics was not provided')
|
||||
}
|
||||
loadCountryStatistics(country)
|
||||
data = {}
|
||||
for (var browser in customStats) {
|
||||
fillUsage(data, browser, customStats[browser])
|
||||
}
|
||||
} else if (typeof stats === 'string') {
|
||||
if (stats.length > 2) {
|
||||
stats = stats.toLowerCase()
|
||||
} else {
|
||||
stats = stats.toUpperCase()
|
||||
}
|
||||
env.loadCountry(browserslist.usage, stats)
|
||||
data = browserslist.usage[stats]
|
||||
} else {
|
||||
country = 'global'
|
||||
if ('dataByBrowser' in stats) {
|
||||
stats = stats.dataByBrowser
|
||||
}
|
||||
data = { }
|
||||
for (var name in stats) {
|
||||
for (var version in stats[name]) {
|
||||
data[name + ' ' + version] = stats[name][version]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return browsers.reduce(function (all, i) {
|
||||
var usage = browserslist.usage[country][i]
|
||||
var usage = data[i]
|
||||
if (usage === undefined) {
|
||||
usage = browserslist.usage[country][i.replace(/ [\d.]+$/, ' 0')]
|
||||
usage = data[i.replace(/ \S+$/, ' 0')]
|
||||
}
|
||||
return all + (usage || 0)
|
||||
}, 0)
|
||||
@@ -407,12 +548,9 @@ var QUERIES = [
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^last\s+(\d+)\s+years?$/i,
|
||||
regexp: /^last\s+(\d*.?\d+)\s+years?$/i,
|
||||
select: function (context, years) {
|
||||
var date = new Date()
|
||||
var since = date.setFullYear(date.getFullYear() - years) / 1000
|
||||
|
||||
return filterByYear(since)
|
||||
return filterByYear(Date.now() - YEAR * years)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -421,9 +559,7 @@ var QUERIES = [
|
||||
year = parseInt(year)
|
||||
month = parseInt(month || '01') - 1
|
||||
date = parseInt(date || '01')
|
||||
var since = Date.UTC(year, month, date, 0, 0, 0) / 1000
|
||||
|
||||
return filterByYear(since)
|
||||
return filterByYear(Date.UTC(year, month, date, 0, 0, 0))
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -494,7 +630,7 @@ var QUERIES = [
|
||||
place = place.toLowerCase()
|
||||
}
|
||||
|
||||
loadCountryStatistics(place)
|
||||
env.loadCountry(browserslist.usage, place)
|
||||
var usage = browserslist.usage[place]
|
||||
|
||||
return Object.keys(usage).reduce(function (result, version) {
|
||||
@@ -517,6 +653,52 @@ var QUERIES = [
|
||||
}, [])
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^cover\s+(\d*\.?\d+)%(\s+in\s+(my\s+stats|(alt-)?\w\w))?$/,
|
||||
select: function (context, coverage, statMode) {
|
||||
coverage = parseFloat(coverage)
|
||||
|
||||
var usage = browserslist.usage.global
|
||||
if (statMode) {
|
||||
if (statMode.match(/^\s+in\s+my\s+stats$/)) {
|
||||
if (!context.customUsage) {
|
||||
throw new BrowserslistError(
|
||||
'Custom usage statistics was not provided'
|
||||
)
|
||||
}
|
||||
usage = context.customUsage
|
||||
} else {
|
||||
var match = statMode.match(/\s+in\s+((alt-)?\w\w)/)
|
||||
var place = match[1]
|
||||
if (place.length === 2) {
|
||||
place = place.toUpperCase()
|
||||
} else {
|
||||
place = place.toLowerCase()
|
||||
}
|
||||
env.loadCountry(browserslist.usage, place)
|
||||
usage = browserslist.usage[place]
|
||||
}
|
||||
}
|
||||
|
||||
var versions = Object.keys(usage).sort(function (a, b) {
|
||||
return usage[b] - usage[a]
|
||||
})
|
||||
|
||||
var coveraged = 0
|
||||
var result = []
|
||||
var version
|
||||
for (var i = 0; i <= versions.length; i++) {
|
||||
version = versions[i]
|
||||
if (usage[version] === 0) break
|
||||
|
||||
coveraged += usage[version]
|
||||
result.push(version)
|
||||
if (coveraged >= coverage) break
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i,
|
||||
select: function (context, from, to) {
|
||||
@@ -581,7 +763,7 @@ var QUERIES = [
|
||||
{
|
||||
regexp: /^(firefox|ff|fx)\s+esr$/i,
|
||||
select: function () {
|
||||
return ['firefox 52']
|
||||
return ['firefox 60']
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -601,6 +783,46 @@ var QUERIES = [
|
||||
return ['chrome ' + chrome]
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^node\s+(\d+(\.\d+)?(\.\d+)?)$/i,
|
||||
select: function (context, version) {
|
||||
var nodeReleases = jsReleases.filter(function (i) {
|
||||
return i.name === 'nodejs'
|
||||
})
|
||||
var matched = nodeReleases.filter(function (i) {
|
||||
return isVersionsMatch(i.version, version)
|
||||
})
|
||||
if (matched.length === 0) {
|
||||
if (context.ignoreUnknownVersions) {
|
||||
return []
|
||||
} else {
|
||||
throw new BrowserslistError(
|
||||
'Unknown version ' + version + ' of Node.js')
|
||||
}
|
||||
}
|
||||
return ['node ' + matched[matched.length - 1].version]
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^current\s+node$/i,
|
||||
select: function (context) {
|
||||
return [env.currentNode(resolve, context)]
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^maintained\s+node\s+versions$/i,
|
||||
select: function (context) {
|
||||
var now = Date.now()
|
||||
var queries = Object.keys(jsEOL).filter(function (key) {
|
||||
return now < Date.parse(jsEOL[key].end) &&
|
||||
now > Date.parse(jsEOL[key].start) &&
|
||||
isEolReleased(key)
|
||||
}).map(function (key) {
|
||||
return 'node ' + key.slice(1)
|
||||
})
|
||||
return resolve(queries, context)
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^(\w+)\s+(tp|[\d.]+)$/i,
|
||||
select: function (context, name, version) {
|
||||
@@ -612,12 +834,14 @@ var QUERIES = [
|
||||
} else {
|
||||
if (version.indexOf('.') === -1) {
|
||||
alias = version + '.0'
|
||||
} else if (/\.0$/.test(version)) {
|
||||
} else {
|
||||
alias = version.replace(/\.0$/, '')
|
||||
}
|
||||
alias = normalizeVersion(data, alias)
|
||||
if (alias) {
|
||||
version = alias
|
||||
} else if (context.ignoreUnknownVersions) {
|
||||
return []
|
||||
} else {
|
||||
throw new BrowserslistError(
|
||||
'Unknown version ' + version + ' of ' + name)
|
||||
@@ -637,6 +861,24 @@ var QUERIES = [
|
||||
select: function () {
|
||||
return browserslist(browserslist.defaults)
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^dead$/i,
|
||||
select: function (context) {
|
||||
var dead = ['ie <= 10', 'ie_mob <= 10', 'bb <= 10', 'op_mob <= 12.1']
|
||||
return resolve(dead, context)
|
||||
}
|
||||
},
|
||||
{
|
||||
regexp: /^(\w+)$/i,
|
||||
select: function (context, name) {
|
||||
if (byName(name)) {
|
||||
throw new BrowserslistError(
|
||||
'Specify versions in Browserslist query for browser ' + name)
|
||||
} else {
|
||||
throw unknownQuery(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
127
node_modules/browserslist/node.js
generated
vendored
127
node_modules/browserslist/node.js
generated
vendored
@@ -1,3 +1,4 @@
|
||||
var region = require('caniuse-lite/dist/unpacker/region').default
|
||||
var path = require('path')
|
||||
var fs = require('fs')
|
||||
|
||||
@@ -5,18 +6,21 @@ var BrowserslistError = require('./error')
|
||||
|
||||
var IS_SECTION = /^\s*\[(.+)\]\s*$/
|
||||
var CONFIG_PATTERN = /^browserslist-config-/
|
||||
var SCOPED_CONFIG__PATTERN = /@[^./]+\/browserslist-config(-|$)/
|
||||
var SCOPED_CONFIG__PATTERN = /@[^/]+\/browserslist-config(-|$|\/)/
|
||||
var TIME_TO_UPDATE_CANIUSE = 6 * 30 * 24 * 60 * 60 * 1000
|
||||
var FORMAT = 'Browserslist config should be a string or an array ' +
|
||||
'of strings with browser queries'
|
||||
|
||||
var dataTimeChecked = false
|
||||
var filenessCache = { }
|
||||
var configCache = { }
|
||||
|
||||
function checkExtend (name) {
|
||||
var use = ' Use `dangerousExtend` option to disable.'
|
||||
if (!CONFIG_PATTERN.test(name) && !SCOPED_CONFIG__PATTERN.test(name)) {
|
||||
throw new BrowserslistError(
|
||||
'Browserslist config needs `browserslist-config-` prefix. ' + use)
|
||||
}
|
||||
if (name.indexOf('.') !== -1) {
|
||||
if (name.replace(/^@[^/]+\//, '').indexOf('.') !== -1) {
|
||||
throw new BrowserslistError(
|
||||
'`.` not allowed in Browserslist config name. ' + use)
|
||||
}
|
||||
@@ -46,6 +50,18 @@ function eachParent (file, callback) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
function check (section) {
|
||||
if (Array.isArray(section)) {
|
||||
for (var i = 0; i < section.length; i++) {
|
||||
if (typeof section[i] !== 'string') {
|
||||
throw new BrowserslistError(FORMAT)
|
||||
}
|
||||
}
|
||||
} else if (typeof section !== 'string') {
|
||||
throw new BrowserslistError(FORMAT)
|
||||
}
|
||||
}
|
||||
|
||||
function pickEnv (config, opts) {
|
||||
if (typeof config !== 'object') return config
|
||||
|
||||
@@ -57,7 +73,7 @@ function pickEnv (config, opts) {
|
||||
} else if (process.env.NODE_ENV) {
|
||||
name = process.env.NODE_ENV
|
||||
} else {
|
||||
name = 'development'
|
||||
name = 'production'
|
||||
}
|
||||
|
||||
return config[name] || config.defaults
|
||||
@@ -70,17 +86,34 @@ function parsePackage (file) {
|
||||
'`browserlist` key instead of `browserslist` in ' + file)
|
||||
}
|
||||
var list = config.browserslist
|
||||
if (typeof list === 'object' && list.length) {
|
||||
if (Array.isArray(list) || typeof list === 'string') {
|
||||
list = { defaults: list }
|
||||
}
|
||||
for (var i in list) {
|
||||
check(list[i])
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
function latestReleaseTime (agents) {
|
||||
var latest = 0
|
||||
for (var name in agents) {
|
||||
var dates = agents[name].releaseDate || { }
|
||||
for (var key in dates) {
|
||||
if (latest < dates[key]) {
|
||||
latest = dates[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
return latest * 1000
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
loadQueries: function loadQueries (context, name) {
|
||||
if (!context.dangerousExtend) checkExtend(name)
|
||||
// eslint-disable-next-line security/detect-non-literal-require
|
||||
var queries = require(name)
|
||||
var queries = require(require.resolve(name, { paths: ['.'] }))
|
||||
if (!Array.isArray(queries)) {
|
||||
throw new BrowserslistError(
|
||||
'`' + name + '` config exports not an array of queries')
|
||||
@@ -88,7 +121,7 @@ module.exports = {
|
||||
return queries
|
||||
},
|
||||
|
||||
getStat: function getStat (opts) {
|
||||
getStat: function getStat (opts, data) {
|
||||
var stats
|
||||
if (opts.stats) {
|
||||
stats = opts.stats
|
||||
@@ -109,7 +142,25 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
return stats
|
||||
if (stats && 'dataByBrowser' in stats) {
|
||||
stats = stats.dataByBrowser
|
||||
}
|
||||
|
||||
if (typeof stats !== 'object') return undefined
|
||||
|
||||
var normalized = { }
|
||||
for (var i in stats) {
|
||||
var versions = Object.keys(stats[i])
|
||||
if (versions.length === 1 && data[i] && data[i].versions.length === 1) {
|
||||
var normal = Object.keys(data[i].versions)[0]
|
||||
normalized[i] = { }
|
||||
normalized[i][normal] = stats[i][versions[0]]
|
||||
} else {
|
||||
normalized[i] = stats[i]
|
||||
}
|
||||
}
|
||||
|
||||
return normalized
|
||||
},
|
||||
|
||||
loadConfig: function loadConfig (opts) {
|
||||
@@ -129,13 +180,28 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
loadCountry: function loadCountry (usage, country) {
|
||||
var code = country.replace(/[^\w-]/g, '')
|
||||
if (!usage[code]) {
|
||||
// eslint-disable-next-line security/detect-non-literal-require
|
||||
var compressed = require('caniuse-lite/data/regions/' + code + '.js')
|
||||
var data = region(compressed)
|
||||
usage[country] = { }
|
||||
for (var i in data) {
|
||||
for (var j in data[i]) {
|
||||
usage[country][i + ' ' + j] = data[i][j]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
parseConfig: function parseConfig (string) {
|
||||
var result = { defaults: [] }
|
||||
var section = 'defaults'
|
||||
var sections = ['defaults']
|
||||
|
||||
string.toString()
|
||||
.replace(/#[^\n]*/g, '')
|
||||
.split(/\n/)
|
||||
.split(/\n|,/)
|
||||
.map(function (line) {
|
||||
return line.trim()
|
||||
})
|
||||
@@ -144,10 +210,18 @@ module.exports = {
|
||||
})
|
||||
.forEach(function (line) {
|
||||
if (IS_SECTION.test(line)) {
|
||||
section = line.match(IS_SECTION)[1].trim()
|
||||
result[section] = result[section] || []
|
||||
sections = line.match(IS_SECTION)[1].trim().split(' ')
|
||||
sections.forEach(function (section) {
|
||||
if (result[section]) {
|
||||
throw new BrowserslistError(
|
||||
'Duplicate section ' + section + ' in Browserslist config')
|
||||
}
|
||||
result[section] = []
|
||||
})
|
||||
} else {
|
||||
result[section].push(line)
|
||||
sections.forEach(function (section) {
|
||||
result[section].push(line)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -209,7 +283,34 @@ module.exports = {
|
||||
},
|
||||
|
||||
clearCaches: function clearCaches () {
|
||||
dataTimeChecked = false
|
||||
filenessCache = { }
|
||||
configCache = { }
|
||||
},
|
||||
|
||||
oldDataWarning: function oldDataWarning (agentsObj) {
|
||||
if (dataTimeChecked) return
|
||||
dataTimeChecked = true
|
||||
|
||||
var latest = latestReleaseTime(agentsObj)
|
||||
var halfYearAgo = Date.now() - TIME_TO_UPDATE_CANIUSE
|
||||
|
||||
if (latest !== 0 && latest < halfYearAgo) {
|
||||
var command = 'npm update'
|
||||
eachParent(__filename, function (dir) {
|
||||
var pckg = path.join(dir, 'package.json')
|
||||
var yarnLock = path.join(dir, 'yarn.lock')
|
||||
if (isFile(pckg) && isFile(yarnLock)) {
|
||||
command = 'yarn upgrade'
|
||||
}
|
||||
})
|
||||
console.warn(
|
||||
'Browserslist: caniuse-lite is outdated. ' +
|
||||
'Please run next command `' + command + ' caniuse-lite browserslist`')
|
||||
}
|
||||
},
|
||||
|
||||
currentNode: function currentNode () {
|
||||
return 'node ' + process.versions.node
|
||||
}
|
||||
}
|
||||
|
||||
110
node_modules/browserslist/package.json
generated
vendored
110
node_modules/browserslist/package.json
generated
vendored
@@ -1,27 +1,35 @@
|
||||
{
|
||||
"_from": "browserslist@^2.11.3",
|
||||
"_id": "browserslist@2.11.3",
|
||||
"_from": "browserslist@^4.3.4",
|
||||
"_id": "browserslist@4.4.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==",
|
||||
"_integrity": "sha512-ISS/AIAiHERJ3d45Fz0AVYKkgcy+F/eJHzKEvv1j0wwKGKD9T3BrwKr/5g45L+Y4XIK5PlTqefHciRFcfE1Jxg==",
|
||||
"_location": "/browserslist",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "browserslist@^2.11.3",
|
||||
"raw": "browserslist@^4.3.4",
|
||||
"name": "browserslist",
|
||||
"escapedName": "browserslist",
|
||||
"rawSpec": "^2.11.3",
|
||||
"rawSpec": "^4.3.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.11.3"
|
||||
"fetchSpec": "^4.3.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/autoprefixer"
|
||||
"/@babel/preset-env",
|
||||
"/autoprefixer",
|
||||
"/caniuse-api",
|
||||
"/postcss-colormin",
|
||||
"/postcss-merge-rules",
|
||||
"/postcss-minify-params",
|
||||
"/postcss-normalize-unicode",
|
||||
"/postcss-reduce-initial",
|
||||
"/stylehacks"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz",
|
||||
"_shasum": "fe36167aed1bbcde4827ebfe71347a2cc70b99b2",
|
||||
"_spec": "browserslist@^2.11.3",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\autoprefixer",
|
||||
"_resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.4.2.tgz",
|
||||
"_shasum": "6ea8a74d6464bb0bd549105f659b41197d8f0ba2",
|
||||
"_spec": "browserslist@^4.3.4",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\@babel\\preset-env",
|
||||
"author": {
|
||||
"name": "Andrey Sitnik",
|
||||
"email": "andrey@sitnik.ru"
|
||||
@@ -34,90 +42,32 @@
|
||||
"path": false
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ai/browserslist/issues"
|
||||
"url": "https://github.com/browserslist/browserslist/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"caniuse-lite": "^1.0.30000792",
|
||||
"electron-to-chromium": "^1.3.30"
|
||||
"caniuse-lite": "^1.0.30000939",
|
||||
"electron-to-chromium": "^1.3.113",
|
||||
"node-releases": "^1.1.8"
|
||||
},
|
||||
"deprecated": "Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.",
|
||||
"deprecated": false,
|
||||
"description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
|
||||
"devDependencies": {
|
||||
"cross-spawn": "^5.1.0",
|
||||
"eslint": "^4.15.0",
|
||||
"eslint-ci": "^0.1.1",
|
||||
"eslint-config-logux": "^17.0.0",
|
||||
"eslint-config-standard": "^10.2.1",
|
||||
"eslint-plugin-es5": "^1.2.0",
|
||||
"eslint-plugin-import": "^2.8.0",
|
||||
"eslint-plugin-jest": "^21.6.2",
|
||||
"eslint-plugin-node": "^5.2.1",
|
||||
"eslint-plugin-promise": "^3.6.0",
|
||||
"eslint-plugin-security": "^1.4.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"jest": "^22.0.6",
|
||||
"lint-staged": "^6.0.0",
|
||||
"pre-commit": "^1.1.3",
|
||||
"size-limit": "^0.14.0",
|
||||
"yaspeller-ci": "^1.0.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "eslint-config-logux/browser",
|
||||
"rules": {
|
||||
"security/detect-unsafe-regex": "off",
|
||||
"global-require": "off"
|
||||
},
|
||||
"overrides": {
|
||||
"files": [
|
||||
"*.test.js"
|
||||
],
|
||||
"rules": {
|
||||
"es5/no-arrow-functions": "off"
|
||||
}
|
||||
"homepage": "https://github.com/browserslist/browserslist#readme",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/ai/browserslist#readme",
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"statements": 100
|
||||
}
|
||||
},
|
||||
"modulePathIgnorePatterns": [
|
||||
"<rootDir>/test/fixtures"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"caniuse",
|
||||
"browsers",
|
||||
"target"
|
||||
],
|
||||
"license": "MIT",
|
||||
"lint-staged": {
|
||||
"*.md": "yaspeller-ci",
|
||||
"*.js": "eslint"
|
||||
},
|
||||
"name": "browserslist",
|
||||
"pre-commit": [
|
||||
"lint-staged"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ai/browserslist.git"
|
||||
"url": "git+https://github.com/browserslist/browserslist.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint-ci *.js test/*.js __mocks__/*.js",
|
||||
"lint-staged": "lint-staged",
|
||||
"spellcheck": "yaspeller-ci README.md CHANGELOG.md",
|
||||
"test": "jest --coverage && yarn lint && yarn spellcheck && size-limit"
|
||||
},
|
||||
"size-limit": [
|
||||
{
|
||||
"path": "index.js",
|
||||
"limit": "160 KB"
|
||||
}
|
||||
],
|
||||
"version": "2.11.3"
|
||||
"version": "4.4.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user