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

205 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
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
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
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
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
Naor Peled
eb3f153def fix: attempt to resolve build issues (#604) 2026-02-09 00:03:04 +02:00
naorpeled
2bb8caee93 fix: remove prepublish hook 2026-02-07 19:48:42 +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
naorpeled
eef8480944 docs(package.json): add naorpeled as contributor 2025-11-23 00:08:32 +02:00
Naor Peled
327e6f5e51 ci: add release drafter (#545) 2024-04-20 14:35:56 +03:00
Naor Peled
efb8e612a5 ci: move to Github Actions (#530) 2023-11-13 11:11:28 +02:00
Denis Demchenko
1d64ecab12 chore: bump version, write changelog and docs 2020-09-12 11:22:31 +03:00
Denis Demchenko
cc546cfb44 chore(docs): regen docs 2020-07-09 22:11:59 +03:00
Denis Demchenko
77f394c8e7 chore(package): bump version, write changelog 2020-07-09 22:08:32 +03:00
Denis Demchenko
7adb0017dd Merge pull request #397 from lancedikson/greenkeeper/sinon-9.0.0
Update sinon to the latest version 🚀
2020-07-09 21:51:01 +03:00
Denis Demchenko
a7bc7110e2 Merge pull request #417 from lancedikson/greenkeeper/compression-webpack-plugin-4.0.0
Update compression-webpack-plugin to the latest version 🚀
2020-07-09 21:50:45 +03:00
greenkeeper[bot]
98f32dfbf5 chore(package): update gh-pages to version 3.0.0 2020-05-29 20:31:26 +00:00
greenkeeper[bot]
538ee8fe0e chore(package): update compression-webpack-plugin to version 4.0.0 2020-05-12 13:33:47 +00:00
greenkeeper[bot]
c83b241238 chore(package): update sinon to version 9.0.0 2020-02-19 11:44:43 +00:00
Denis Demchenko
6add52d49c chore(package): bump version, write changelog 2020-01-28 22:26:13 +02:00
Denis Demchenko
433955ac68 Merge branch 'master' into greenkeeper/monorepo.babel7-20200114033043 2020-01-28 21:53:59 +02:00
Denis Demchenko
9af50fd1c7 Merge pull request #393 from lancedikson/greenkeeper/ava-3.0.0
Update ava to the latest version 🚀
2020-01-28 21:52:16 +02:00
greenkeeper[bot]
be8860b731 chore(package): update ava to version 3.0.0 2020-01-19 15:21:06 +00:00
greenkeeper[bot]
db8e9d4417 chore(package): update eslint-plugin-ava to version 10.0.0 2020-01-19 15:14:38 +00:00
greenkeeper[bot]
2132446318 chore(package): update @babel/register to version 7.8.3 2020-01-15 17:07:01 +00:00
greenkeeper[bot]
50f5a73386 chore(package): update @babel/preset-env to version 7.8.2 2020-01-15 17:06:57 +00:00
greenkeeper[bot]
e575388f48 chore(package): update @babel/polyfill to version 7.8.3 2020-01-15 17:06:54 +00:00
greenkeeper[bot]
b0b505fbe2 chore(package): update @babel/core to version 7.8.0 2020-01-15 17:06:49 +00:00
greenkeeper[bot]
48866a119e chore(package): update @babel/cli to version 7.8.3 2020-01-15 17:06:46 +00:00
Denis Demchenko
01f5f2281e chore(package): bump version, write changelog 2019-12-26 23:28:09 +02:00
Denis Demchenko
ca7357338f chore(package): bump version 2019-12-26 16:45:29 +02:00
Denis Demchenko
15442b789b Merge branch 'master' into greenkeeper/nyc-15.0.0 2019-12-26 16:18:07 +02:00
Denis Demchenko
a62e610f36 Merge pull request #385 from lancedikson/greenkeeper/babel-plugin-istanbul-6.0.0
Update babel-plugin-istanbul to the latest version 🚀
2019-12-26 16:16:41 +02:00
greenkeeper[bot]
0353113434 chore(package): update nyc to version 15.0.0 2019-12-23 01:13:44 +00:00
greenkeeper[bot]
460858d826 chore(package): update babel-plugin-istanbul to version 6.0.0 2019-12-23 00:59:55 +00:00