1
0
mirror of https://github.com/lancedikson/bowser synced 2026-09-23 20:44:24 +00:00
Commit Graph

64 Commits

Author SHA1 Message Date
naorpeled
a78d9d35a2 fix: make dual packaging non-breaking for existing consumers
Keeps the published surface of bowser@2.14.1 intact while adding a real
ESM build, and rewrites CI so it can actually run the new toolchain.

Packaging

- Restore the flat artifact layout. es5.js and bundled.js stay at the
  tarball root next to src/, so unpkg.com/bowser/es5.js and
  require('bowser/bundled') keep working. bowser.mjs is added alongside.
- Build the UMD bundles from dedicated single-default-export entries in
  build/entries/. src/bowser.js gained named exports (parse, getParser)
  to fix #511, but a UMD bundle with named exports makes require('bowser')
  a namespace object instead of the class: typeof flips from 'function' to
  'object' and BROWSER_MAP / ENGINE_MAP / OS_MAP / PLATFORMS_MAP disappear,
  since they are static getters rather than exports.
- globalName back to lowercase 'bowser', matching the shipped es5.js.
  Renaming it to 'Bowser' would break every script-tag consumer.
- Enumerate every legacy subpath in the exports map. Conditional exports
  are honoured from Node 12.16.0 onward, so a "."-only map turns paths
  that resolve today into ERR_PACKAGE_PATH_NOT_EXPORTED. Subpath patterns
  ("./src/*") need Node 12.20.0+ and the trailing-slash folder form was
  removed in Node 17, so explicit per-file keys are the only spelling that
  works across the whole supported range. Extension-less aliases included:
  the README documents require('bowser/bundled').
- main, browser and module keep their existing values. No engines field
  (npm warns EBADENGINE, pnpm fails under engine-strict) and no type
  field (it would reclassify es5.js as ESM).

Build

- Minify the UMD bundles with terser instead of rolldown's built-in oxc
  minifier. oxc prints every string literal as a template literal and
  rejects any compress.target below es2015, so it cannot emit ES5 and was
  silently undoing babel's lowering. terser is what webpack 4 used.
- Wire up the copyright banner, which was declared but never passed to a
  config, and restore bundled.js as the polyfilled build via core-js/stable.
- Add index.d.mts so the import condition has ESM types. Reusing the
  export = declarations for both conditions describes an ES module with
  CommonJS types.

CI

- Replace npm ci with pnpm across all workflows. This is what was failing:
  the lockfile was swapped for pnpm-lock.yaml but the workflows still ran
  npm ci, pinned to Node 12.16.3 and 16. Build now runs on Node 24, which
  tsdown requires.
- Add a pack-smoke job that installs the packed tarball on Node 12.16.3,
  14, 18, 20 and 24 and exercises every documented entry point, plus
  publint and attw on the tarball. This is what makes "non-breaking" a
  tested claim rather than an argument; it catches all of the above.
- Restore test-list-of-ua.js to asserting src against the built es5.js.
  It had been collapsed to comparing Bowser.parse with itself.
2026-08-01 14:40:56 +03:00
Yasumasa Ashida
479d002bc2 chore: Install tsdown and create a dual package for UMD and ESM 2026-06-15 08:10:44 +09:00
Swapnil Sahu
92b5639733 feat: add support for HeyTap Browser and Vivo Browser identification (#621) 2026-04-10 23:18:44 +07:00
Naor Peled
2c253c3ad2 fix: prevent Motorola Edge devices from being misidentified as Microsoft Edge (#612) 2026-03-14 16:17:53 +02:00
naorpeled
cf397a4b50 feat: add Vivaldi client hints support 2026-02-13 23:09:48 +02:00
Copilot
a2d6ce81b1 feat: add Smart TV platform detection (#582) 2026-02-07 18:44:55 +02:00
Jam Hsu
c09ff24ae1 feat: Add Line sipder detection (#600)
Co-authored-by: Jam <jam.hsu@lativ.com.tw>
2026-02-06 23:08:55 +02:00
Jonathan Kingston
aaa67db25e feat: add clientHints support + DuckDuckGo detection (#595) 2026-02-01 23:50:33 +02:00
Jam Hsu
74463f6b23 feat: Add Slack bot detection (#596)
Co-authored-by: Jam <jam.hsu@lativ.com.tw>
2026-01-31 18:54:09 +02:00
Naor Peled
514510d847 feat: add support for latest MacOS (#580)
Co-authored-by: Seiji Kohara <9543980+seijikohara@users.noreply.github.com>
2025-11-22 23:50:54 +02:00
Naor Peled
4a6dacca08 feat: add Sogou browser support (#579)
Co-authored-by: 猫猫 <49067249+NotEvenANeko@users.noreply.github.com>
2025-11-22 23:31:31 +02:00
Copilot
be90a00e37 feat: add LibreWolf browser detection (#578)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
2025-11-22 19:01:03 +02:00
Naor Peled
f7d2c0693c feat: add support for AI crawl bots (#577) 2025-11-22 18:05:08 +02:00
Lucio Martinez
771dfb2dfe feat: add more bot platforms (#542)
Co-authored-by: naorpeled <me@naor.dev>
2025-11-22 16:44:08 +02:00
Copilot
2b5ee5de8c feat: add Support for HarmonyOS User-Agent Detection (#567)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
2025-11-22 14:27:00 +02:00
daniol
4481f5aab3 feat: add Nokia Vendor (#448) 2023-11-17 20:54:44 +02:00
Mehmet Akif Yücel
bb8f94efcd feat: add Pale Moon browser support (#495) 2023-11-17 20:47:16 +02:00
Will Soares
53d18c8994 increase test coverage 2020-08-23 14:42:33 -03:00
Will Soares
d5fe5657d1 feat(browser): add detection for Miui Browser 2020-08-23 13:58:07 -03:00
Denis Demchenko
ba8f7d8a54 chore(tests): fix tests 2020-07-09 21:23:20 +03:00
Denis Demchenko
725de76e14 Revert "chore(tests): fix tests for Firefox iOS"
This reverts commit 9edfabf9
2020-07-09 21:23:10 +03:00
Denis Demchenko
9edfabf98a chore(tests): fix tests for Firefox iOS
relevant to #401
2020-06-02 00:32:35 +03:00
Denis Demchenko
3813d92a55 feat(browser): add detection of Opera Touch
fixes #414
2020-06-02 00:16:43 +03:00
acailly
cb242c0242 handle Firefox on iPad on iOS 13 2020-04-28 11:37:01 +02:00
Denis Demchenko
366a9c47e9 Merge pull request #381 from Tindtily/feature/add-wechat-ua
add windowswechat ua
2019-12-26 15:50:21 +02:00
Denis Demchenko
de5b4e02fe Merge pull request #379 from neckro/production
Correctly detect Firefox on iPad
2019-12-26 15:48:46 +02:00
zhaoxiaohai
adde31f807 add windowswechat ua 2019-12-17 16:24:04 +08:00
Joseph Culbert
b213e4c8a6 Correctly detect Firefox on iPad 2019-12-13 16:40:59 -06:00
Farfurix
648daa5f9f Add Electron 2019-12-04 15:55:36 +03:00
Denis Demchenko
0ce5a8173a Merge pull request #363 from navarroaxel/feat/gsa
feat(browsers): Add Google Search App detection
2019-10-02 21:26:25 +03:00
Axel Navarro
e29357793a feat(browsers): Add Google Search App detection 2019-09-25 08:58:27 -03:00
Mathias Kahl
e57c3d99d5 support QQ Browser 2019-09-18 10:34:14 +02:00
Denis Demchenko
d9885c9de3 fix(platform): fix Tablet PC detection as tablets
fixes #334
2019-09-06 14:33:14 +03:00
Jörg Leis
496136fd83 Fixes, refactor, new test cases 2019-07-17 17:33:48 +02:00
Jörg Leis
b298e8d866 Add detection of macOS version names 2019-07-17 13:53:31 +02:00
Oz Weiss
82cd6a82de adding detection for Roku OS: https://en.wikipedia.org/wiki/Roku#Software
examples: http://www.webapps-online.com/online-tools/user-agent-strings/dv/brand798903/roku-dvp

note: The reason I added the test for Roku before all other tests is that Roku user agents might contain other tokens (like Windows), but Roku is still Roku.
2019-07-07 12:55:53 +03:00
Denis Demchenko
e1a37ef4fa Merge pull request #310 from ricardorauber/master
Update the regexp for generic browsers
2019-04-24 21:28:27 +03:00
Denis Demchenko
d596a43f6b Add support of the new Blink-based MS Edge
fixes #311
2019-04-14 13:39:35 +03:00
Denis Demchenko
428dadc503 Fix Yandex Browser version detection
fixes #308
2019-04-07 11:28:03 +03:00
Ricardo Rauber Pereira
42b0f185e2 Change test os and platform 2019-04-05 18:39:25 +01:00
Ricardo Rauber Pereira
3bfb24c8cb Updated the check for generic browsers 2019-04-05 18:18:39 +01:00
Ricardo Rauber Pereira
f1bdd50116 Update test for Generic browser 2019-04-05 17:58:30 +01:00
rcohen-unext
383c627fc0 Add PlayStation 4 browser support 2019-03-06 14:19:34 +02:00
Frank Faubert
65988ac79c Add operating system detection for Chrome OS 2019-01-24 08:37:59 -05:00
Denis Demchenko
9d2d93ebd4 Upgrade ava to 1.1.0 and fix tests 2019-01-19 12:07:15 +02:00
Robert Sandell
1535c62b74 Added support for Googlebot recognition 2019-01-16 13:30:38 +02:00
Denis Demchenko
1085ae62ad Fix failing tests 2019-01-07 00:23:01 +02:00
Denis Demchenko
cd72625e2c Merge pull request #276 from rcsandell/master
Support Android version names, Recognise Huawei devices
2019-01-06 22:40:40 +02:00
Robert Sandell
d9693088cc Fix tests 2018-12-30 10:10:33 +02:00
Robert Sandell
f338045df7 Support Android version names, Recognise Huawei devices 2018-12-30 09:03:08 +02:00