-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update supported browsers, add npm script to list browsers (#7)
- Loading branch information
1 parent
1c557f0
commit 68a2324
Showing
5 changed files
with
102 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,57 @@ | ||
# `@edx/browserslist-config` | ||
|
||
[![license](https://img.shields.io/npm/l/@edx/browserslist-config)](LICENSE) | ||
[![license](https://img.shields.io/npm/l/@edx/browserslist-config)](LICENSE) [![npm](https://img.shields.io/npm/v/@edx/browserslist-config)](https://www.npmjs.com/package/@edx/browserslist-config) | ||
|
||
Shareable [browserslist](https://github.com/browserslist/browserslist) configuration for edX. See [documentation](https://github.com/browserslist/browserslist#shareable-configs) on shareable `browserslist` configurations for more details. | ||
Shareable [browserslist](https://github.com/browserslist/browserslist) configuration for Open edX. If our supported browsers changes in the future, this will be the primary place to update for all consumers (e.g., micro-frontends). | ||
|
||
## What is Browserslist? | ||
|
||
[Browserslist](https://github.com/browserslist/browserslist) is a tool to share target browsers and Node.js versions between different frontend tools (e.g., autoprefixer, babel, etc.). | ||
|
||
See [documentation](https://github.com/browserslist/browserslist#shareable-configs) on shareable `browserslist` configurations for more details. | ||
|
||
## Supported Browsers | ||
|
||
### Desktop | ||
|
||
| Browser | Version | | ||
| ----------------------------- | ------- | | ||
| Chrome | last 2 | | ||
| Chrome for Android | last 2 | | ||
| Safari | last 2 | | ||
| Safari for iOS | last 2 | | ||
| Edge | last 2 | | ||
| Firefox | last 2 | | ||
| Firefox for Android | last 2 | | ||
|
||
### Mobile | ||
|
||
| Browser | Version | | ||
| ----------------------------- | ------- | | ||
| Chrome for Android | last 3 | | ||
| Safari for iOS | last 3 | | ||
| Firefox for Android | last 3 | | ||
|
||
### List all supported browsers | ||
|
||
You can list all supported browsers by running: | ||
|
||
```shell | ||
$ npx browserslist "last 2 chrome versions, last 2 safari versions, last 2 edge versions, last 2 firefox versions, last 2 chromeandroid versions, last 2 firefoxandroid versions, last 2 ios versions" | ||
npm install | ||
npm run supported | ||
``` | ||
|
||
Learn more by visiting the [browser support page on the edX Support Portal](https://support.edx.org/hc/en-us/articles/206211848-What-are-the-system-requirements-and-supported-browsers-on-edX-). | ||
|
||
## Installation | ||
## Installation and usage | ||
|
||
Install the module. | ||
Install the package in your repository: | ||
|
||
```shell | ||
$ npm install -D @edx/browserslist-config | ||
``` | ||
|
||
## Usage | ||
|
||
### package.json | ||
In your `package.json` file: | ||
|
||
```json | ||
{ | ||
"browserslist": ["extends @edx/browserslist-config"] | ||
} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
module.exports = [ | ||
'last 2 chrome versions', | ||
'last 2 safari versions', | ||
'last 2 edge versions', | ||
'last 2 firefox versions', | ||
// Mobile | ||
'last 2 chromeandroid versions', | ||
'last 2 firefoxandroid versions', | ||
'last 2 ios versions', | ||
const desktop = [ | ||
'last 2 Chrome major versions', | ||
'last 2 Firefox major versions', | ||
'last 2 Safari major versions', | ||
'last 2 Edge major versions', | ||
]; | ||
|
||
const mobile = [ | ||
'last 3 ChromeAndroid major versions', | ||
'last 3 FirefoxAndroid major versions', | ||
'last 3 iOS major versions', | ||
]; | ||
|
||
const supportedBrowsers = desktop.concat(mobile); | ||
|
||
module.exports = supportedBrowsers; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters