From af26b0864241f609f2f6658cee313bec91a1b765 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 31 Jul 2018 07:59:28 +0200 Subject: [PATCH 1/4] Fix getParsers in README.md getParsers is not a function it is called getParser instead closes #238 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1547d79..0ac216b 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ You could want to filter some particular browsers to provide any special support It could look like this: ```javascript -const browser = bowser.getParsers(window.navigator.userAgent); +const browser = bowser.getParser(window.navigator.userAgent); const isValidBrowser = browser.satisfies({ // declare browsers per OS windows: { From 2b6a63d0889aaf4ebcdb99a4af944d4cd885d2ed Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 2 Aug 2018 21:24:08 +0300 Subject: [PATCH 2/4] Fix code style problem --- src/bowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bowser.js b/src/bowser.js index 57b8fd6..17a9f52 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -26,7 +26,7 @@ class Bowser { * const bowser = new Bowser(window.navigator.userAgent); * bowser.getResult() */ - static getParser(UA, skipParsing=false) { + static getParser(UA, skipParsing = false) { if (typeof UA !== 'string') { throw new Error('UserAgent should be a string'); } From 8e919efd4fd0bf8f67071329959cf18f311f885c Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 2 Aug 2018 21:36:41 +0300 Subject: [PATCH 3/4] Make es5.js the main file of the package fixes #239 --- README.md | 5 ++--- package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ac216b..ee53c41 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,14 @@ First of all, require the library: const bowser = require('bowser'); ``` -By default, `require('bowser')` requires the *ES6 version of files*, which +By default, `require('bowser')` requires the *ES5 version of files*, which **do not** include any polyfills. In case if you don't use your own `babel-polyfill` you may need to have pre-built bundle with all needed polyfills. So, for you it's suitable to require bowser like this: `require('bowser/bundled')`. As the result, you get a ES5 version of bowser with `babel-polyfill` bundled together. -If you use bowser for Node.js, you'd better use `require('bowser/es5')`, -since source files have `import` statements, which are not compatible with Node.js yet. +You may need to use the source files, so they will be available in the package as well. ## Browser props detection diff --git a/package.json b/package.json index e4a53d4..5cd4213 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "url": "http://twitter.com/lancedikson" } ], - "main": "src/bowser.js", + "main": "es5.js", "repository": { "type": "git", "url": "git+https://github.com/lancedikson/bowser.git" From 818040b41a9e7d69939fe8c142b5cc290cb4069e Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Thu, 2 Aug 2018 21:51:02 +0300 Subject: [PATCH 4/4] Bump version, write changelog --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e815424..846a71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Bowser Changelog +### 2.0.0-alpha.4 (August 2, 2018) +- [DOCS] Fix usage docs (#238) +- [CHANGE] Make `./es5.js` the main file of the package (#239) + ### 2.0.0-alpha.3 (July 22, 2018) - [CHANGE] Rename split and rename `compiled.js` to `es5.js` and `bundled.js` (#231, #236, #237) - [ADD] Add `Parser.some` (#235) diff --git a/package.json b/package.json index 5cd4213..fa2035c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bowser", - "version": "2.0.0-alpha.3", + "version": "2.0.0-alpha.4", "description": "Lightweight browser detector", "keywords": [ "browser",