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

1017 Commits

Author SHA1 Message Date
naorpeled
434016a1f9 fix(build): fail loudly when terser produces no output for a chunk 2026-08-29 23:50:17 +03:00
naorpeled
19c2d8d3a1 fix(test): replace rm -rf with Node fs cleanup in package smoke test
Shelling out to rm breaks on Windows. fs.rmSync covers Node 14.14+,
recursive fs.rmdirSync covers the bottom of the support matrix.
2026-08-29 23:50:17 +03:00
naorpeled
5cfd97ed08 fix(types): drop ESM named exports that bowser.mjs does not provide
BROWSER_MAP / ENGINE_MAP / OS_MAP / PLATFORMS_MAP and the named Bowser
binding were declared in index.d.mts but never exported by the runtime
module, so TypeScript accepted imports that throw at load time. They
remain reachable as static getters on the default export.
2026-08-29 23:50:17 +03:00
naorpeled
11a78f50b2 fix(ci): create the tarball directory before npm pack
npm pack --pack-destination does not create the target directory, so the
Pack step failed with ENOENT.
2026-08-01 21:28:56 +03:00
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
1944c3d05c chore: Update devDependency eslint to 10.8.0 2026-07-26 08:22:44 +09:00
Yasumasa Ashida
a9d17b8891 chore: Update devDependency tsdown to 0.22.14 2026-07-25 10:59:26 +09:00
Yasumasa Ashida
c48ede52dc chore: Update devDependency tsdown to 0.22.13 2026-07-23 20:12:02 +09:00
Yasumasa Ashida
d3b4ee75d5 chore: Update devDependency tsdown to 0.22.12 2026-07-22 14:10:28 +09:00
Yasumasa Ashida
552c183eb1 chore: Update devDependency tsdown to 0.22.9 2026-07-18 08:10:43 +09:00
Yasumasa Ashida
395e4da9a7 chore: Update devDependency tsdown to 0.22.8 2026-07-17 16:34:41 +09:00
Yasumasa Ashida
381def1620 chore: Update devDependency tsdown to 0.22.7 2026-07-15 06:12:31 +09:00
Yasumasa Ashida
a92bdc5ecb chore: Update pnpm-workspace.yaml 2026-07-13 09:52:06 +09:00
Yasumasa Ashida
e5829fe94d chore: Update devDependency tsdown to 0.22.5 2026-07-12 06:29:27 +09:00
Yasumasa Ashida
0d5ae62ea5 chore: Update devDependency eslint to 10.7.0 2026-07-11 07:26:53 +09:00
Yasumasa Ashida
8b2b1736cb chore: Update dependencies 2026-07-10 21:00:04 +09:00
Yasumasa Ashida
184eaa6f3e chore: Update eslint.config.mjs 2026-07-10 20:44:57 +09:00
Yasumasa Ashida
9d854f1c2c chore: Update pnpm-workspace.yaml 2026-06-18 06:20:37 +09:00
Yasumasa Ashida
3b1648b7a1 chore: Roll back the gh-pages version. 2026-06-17 20:17:46 +09:00
Yasumasa Ashida
825b409478 chore: Remove devDependency @babel/eslint-parser 2026-06-17 15:34:37 +09:00
Yasumasa Ashida
8ab044238a chore: Update tsdown to 0.22.3 2026-06-17 12:30:01 +09:00
Yasumasa Ashida
7c6fd2f463 chore: Update sinon to 22.0.0 2026-06-16 17:57:43 +09:00
Yasumasa Ashida
6edf9da595 chore: Update ESLint to 10.5.0 2026-06-16 16:58:53 +09:00
Yasumasa Ashida
4dcd3258b4 fix: Export the static methods of the Bowser class individually (#511) 2026-06-15 14:20:54 +09:00
Yasumasa Ashida
4ba3be2e46 chore: Install @rolldown/plugin-babel and update tsdown.config.ts 2026-06-15 10:26:34 +09:00
Yasumasa Ashida
b339e6215c chore: Install core-js 2026-06-15 08:10:44 +09:00
Yasumasa Ashida
479d002bc2 chore: Install tsdown and create a dual package for UMD and ESM 2026-06-15 08:10:44 +09:00
Yasumasa Ashida
6ff01f53db chore: Switch to pnpm, update dependencies, and remove webpack 2026-06-14 21:51:01 +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
Naor Peled
587196f211 feat: add copyright comment to bundle (#605) 2026-02-13 22:57:03 +02:00
naorpeled
507b205791 chore: remove github copilot instructions file 2026-02-13 22:31:33 +02:00
naorpeled
f11700291a Replace .github/copilot-instructions.md with AGENTS.md 2026-02-13 22:30:26 +02:00
Stas Tolpekin
8ddb4f5a0d feat: add the ability to use an array of versions in Parser.satisfies() (#466) 2026-02-13 22:15:55 +02:00
Naor Peled
eb3f153def fix: attempt to resolve build issues (#604) v2.14.1 2026-02-09 00:03:04 +02:00
Denis Demchenko
740d6c4844 Update npm to latest version before publishing to npm registry (#603)
Co-authored-by: Claude <noreply@anthropic.com>
v2.14.0
2026-02-08 23:37:11 +02:00
naorpeled
2bb8caee93 fix: remove prepublish hook 2026-02-07 19:48:42 +02:00
naorpeled
382bc22397 chore: update publish flow 2026-02-07 19:43:20 +02:00
naorpeled
e2318ef12d fix: attemp to resolve NPM publish issues 2026-02-07 19:12:34 +02:00
naorpeled
8f9badd27f chore: update publish flow 2026-02-07 19:05:32 +02:00
naorpeled
5032e0ee71 docs: resolve missing referenced links in index page 2026-02-07 18:50:07 +02:00
Copilot
a2d6ce81b1 feat: add Smart TV platform detection (#582) 2026-02-07 18:44:55 +02:00
Copilot
227f5ecd4b feat: add Brave browser support via clientHints (#597) 2026-02-07 18:29:20 +02:00
naorpeled
fa08e7c6f3 docs: fix badges 2026-02-07 18:05:05 +02: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
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
naorpeled
0c6fdd7248 Merge branch 'master' of github.com:bowser-js/bowser 2026-01-31 19:08:12 +02:00