1
0
mirror of https://github.com/lancedikson/bowser synced 2026-09-23 12:34:58 +00:00
Commit Graph

106 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
naorpeled
6cf163cfef docs: cleanup README badges 2026-02-07 18:00:30 +02:00
Copilot
fdcc87319b docs: document user agent client hints addition 2026-02-07 17:57:02 +02:00
Copilot
0f51d8bce8 Replace lancedikson with bowser-js in GitHub URLs (#592)
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-30 18:58:23 +02:00
Meir Roth
5bab4ee97d docs: remove non-existing links in README 2024-04-28 23:42:58 +03:00
pastak
0626bf8c8c Fix link to doc page on README.md (#543) 2023-12-11 10:37:33 +02:00
Naor Peled
94ab87ec0e feat(constants): add bot as a platform (#540) (#541)
Co-authored-by: Lucio Martinez <martinezlucio.com@gmail.com>
2023-11-27 16:21:18 +02:00
Denis Demchenko
d3d710d158 Add bowser-online to README.md
closes #419
2020-06-01 23:39:46 +03:00
Jess
16778c720d Added financial contributors to the README 2019-09-14 13:24:48 -07:00
Denis Demchenko
642fd6164f Update README.md 2019-08-06 14:19:35 +03:00
NetPanther
c1edead81e Update README.md
Fixed syntax errors in example
2019-07-17 17:18:17 +02:00
Denis Demchenko
f5c939518e fix(docs): fix mistypo in README.md 2019-07-16 23:49:15 +03:00
Denis Demchenko
ec7aeac08c Add information about funding to Readme 2019-07-16 21:39:38 +03:00
Denis Demchenko
2c5d1282d7 Update the header of README.md 2019-07-16 21:39:38 +03:00
Denis Demchenko
09b73d7897 Update changelog and readme 2019-04-07 11:43:06 +03:00
Nicolas Girault
3fdde501d4 Clarify use case in doc
close #300
2019-03-05 22:06:02 +01:00
Aaron Melocik
b576932d0e Update README. Add gh-pages docs link. 2019-02-13 19:54:35 -08:00
Denis Demchenko
c5d18a4db9 Merge pull request #284 from JBallin/readme-import-instructions
Update instructions to use default import
2019-01-22 21:07:07 +02:00
Denis Demchenko
3b2fa910d0 Merge pull request #283 from JBallin/readme-to-contrib
Move contribution instructions from README to CONTRIBUTING
2019-01-22 21:06:23 +02:00
Denis Demchenko
2949f37127 Merge pull request #282 from JBallin/readme-capitalize-bowser
Capitalize imported Bowser object
2019-01-22 21:05:03 +02:00
JBallin
73be17508d Add ES6 import example 2019-01-22 09:09:48 -08:00
JBallin
fed702a148 Fix 'TypeScript' capitalization and add missing semicolon 2019-01-22 09:08:50 -08:00
JBallin
e87ce75599 Move contribution instructions from README to CONTRIBUTING 2019-01-21 14:21:46 -08:00
JBallin
7fcca781f0 Capitalize imported Bowser object 2019-01-21 11:14:22 -08:00
Alexander Cerutti
b804285d5c Removed alpha version reference in the readme 2019-01-19 16:39:05 +01:00
Denis Demchenko
df6183ff8e Fix readme 2019-01-19 16:01:30 +02:00
Denis Demchenko
a87ccad88a Fix the docs 2019-01-19 15:44:08 +02:00
Alexander Cerutti
35814130fd Updated Readme upon the changes to typings 2019-01-15 09:43:08 +01:00
Alexander Cerutti
e17180a6a8 Updated Readme to include typescript import 2019-01-11 23:41:59 +01:00
Robert Sandell
cce6430647 Mention running lint rules, conform commit to lint rules 2018-12-30 10:31:13 +02:00
Robert Sandell
f338045df7 Support Android version names, Recognise Huawei devices 2018-12-30 09:03:08 +02:00
Arve Knudsen
316399d6e9 Improve documentation language, fix an example 2018-10-19 19:32:59 +02:00
greenkeeper[bot]
f720e539f3 docs(readme): add Greenkeeper badge 2018-08-24 22:06:25 +00:00
udivankin
6204d9f417 Adds loose comparison support 2018-08-16 19:04:10 +03:00
Denis Demchenko
8e919efd4f Make es5.js the main file of the package
fixes #239
2018-08-02 21:47:44 +03:00
Patrick
af26b08642 Fix getParsers in README.md
getParsers is not a function it is called getParser instead
closes #238
2018-08-02 21:26:47 +03:00
Denis Demchenko
ab299af55f Write a bit about usage of bowser 2018-07-22 19:38:45 +03:00
Denis Demchenko
718bea0016 Update README.md 2018-07-17 19:27:21 +03:00
James Ross
b94587fdbc Improve code formatting in README
closes #230
2018-07-17 19:15:34 +03:00
Denis Demchenko
72c5fd6980 Merge branch 'v2' into develop 2018-07-09 21:04:20 +03:00
Denis Demchenko
b9db96b1b5 Add changelog and a bit of readme.md 2018-07-09 19:14:22 +03:00
Denis Demchenko
44e6a21dde Add a note about alpha stage to README.md 2018-07-09 19:03:11 +03:00
Denis Demchenko
b75dff2b57 Change main file to the building one 2018-07-08 13:25:32 +03:00
Denis Demchenko
b536c424d0 Update README.md 2018-07-08 12:45:33 +03:00
Denis Demchenko
31b9240aec Fix docs 2018-07-08 12:31:23 +03:00
Denis Demchenko
3a9c4b3a3d Rebuild documentation 2018-07-08 12:09:27 +03:00
Denis Demchenko
1f572ed8f4 Add a bit of docs 2018-07-05 22:44:43 +03:00
Denis Demchenko
15b431562b Add use cases to the docs 2018-07-05 21:18:04 +03:00
Chanhyun,Roh
d4558db0ff fix property-name 'Whale' to 'whale' in README 2018-06-28 20:37:27 +03:00
Chanhyun,Roh
645f3a95a4 add NAVER Whale browser (based on blink engine) 2018-06-28 20:37:27 +03:00