Skip to content

Repository hygiene: minify the CDN bundle, remove stale config, fix contributor docs and templates #421

Description

@matthewhudson

Tracking ticket for the hygiene items found in the September 2026 project health audit (AUDIT.md). None of these change detection behaviour; together they are a few hours of work and can ship as one PR.

Build

  • Minify the <script> build. dist/index.global.js is shipped unminified: 10.98 KB (2.72 KB gzip) where a minified build is 5.9 KB (2.06 KB gzip). The 0.10.2 CDN file was a 5.7 KB .min.js. Every <script src="https://unpkg.com/current-device"> user pays for it. Set minify: true on the IIFE entry in tsup.config.ts (or emit index.global.min.js and point the unpkg/jsdelivr fields at it). Keep the source map. check:es2015 and test:dist must still pass. (Done in build: minify the <script> build #426.)

Stale configuration

Release pipeline

Contributor-facing files

Lint / format

  • There is no linter or formatter since ESLint and Prettier were removed in 2.0.0; src/ and tests/ already differ on trailing commas. A single Biome config (biome.json, one dev dependency, pnpm biome check in CI) covers both with near-zero maintenance. (Done in chore: add Biome for formatting and linting #437.)

Docs nits (small enough to ride along)

  • Demo page: add chromeos, linux and harmonyos to the OS badge list and the CSS that lights badges (docs/index.html ~lines 226-241 and 434-446); pin the script to https://unpkg.com/current-device@2. (Done in docs: rework the README around what UA sniffing can and cannot do #424.)
  • src/index.ts stale comments: line 86 ("more efficient indexOf(), instead of Regex" — three regexes are used now), line 191 ("Check if element exists" on a substring test), line 466 ("Run device.js in noConflict mode").
  • CHANGELOG.md: note that the "1.0.0" section describes a version that was never published (npm went 0.10.2 → 2.0.0), and that the 0.x /umd/current-device.min.js CDN path is gone in 2.x (Broken URL #385).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions