Skip to content

Keep caniuse-lite up to date to prevent a stylelint error - #1720

Merged
oschwald merged 6 commits into
mainfrom
wstorey/fix-ci-stale-caniuse-lite
Aug 6, 2026
Merged

Keep caniuse-lite up to date to prevent a stylelint error#1720
oschwald merged 6 commits into
mainfrom
wstorey/fix-ci-stale-caniuse-lite

Conversation

@horgh

@horgh horgh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Problem

The Precious workflow started failing on main today without anything in the repo changing.

Browserslist prints a warning to stderr once its bundled caniuse-lite data is six months old. stylelint itself still exits 0, but precious treats unexpected stderr as a command failure, so the lint broke on a timer:

Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
  npx update-browserslist-db@latest

Why it recurred

9a55fd87 fixed this same class of bug in January by promoting baseline-browser-mapping to a direct devDependency so Dependabot keeps it fresh. That fix was correct and has worked — baseline-browser-mapping has been bumped 9 times since, and has never re-broken CI.

But browserslist carries two independent stale-data packages with separate warnings and separate clocks:

Package Threshold
baseline-browser-mapping 2 months
caniuse-lite (browserslist oldDataWarning) 6 months

Only the first was promoted. caniuse-lite stayed transitive, so Dependabot never targeted it — it was bumped just once, incidentally, on Feb 23 (bd02b870) riding along on an unrelated group bump. That version was published Feb 23; six months later is today.

Fix

Promote caniuse-lite to a direct devDependency so the weekly minor-and-patch group keeps it current, matching the approach already proven for baseline-browser-mapping.

Deliberately not silencing the warning. plugin/no-unsupported-browser-features is active in .stylelintrc.cjs with a hand-curated ignore list justified by specific IE11/Safari support notes, and that rule reads this data. Suppressing the warning would let it quietly check against outdated support tables with nobody finding out. The build failure is the signal that the data went stale.

Testing

  • update-browserslist-db reports "No target browser changes", so no lint results shift.
  • pnpm install --frozen-lockfile (what CI runs) from a clean node_modules, then precious lint --all: 425 passed, 0 failures, exit 0.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Improved development tooling configuration for more consistent formatting, linting, and validation workflows.
    • Updated TypeScript configuration to improve Node.js tooling compatibility.
    • Updated development tooling compatibility data.
  • Documentation

    • Clarified anonymizer confidence ratings and future value expansion.
    • Improved table formatting consistency across GeoIP database documentation.

Copilot AI lite review requested due to automatic review settings August 5, 2026 21:14
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@horgh, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c4c21477-a714-4c2f-a0ad-09079c30c53b

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca4ee6 and 30205a3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .precious.toml
  • content/geoip/docs/databases/anonymous-plus/_index.md
  • content/geoip/docs/databases/anonymous-plus/binary.md
  • content/geoip/docs/databases/city-and-country/city-binary.md
  • content/geoip/docs/databases/city-and-country/country-binary.md
  • content/geoip/docs/databases/enterprise/binary.md
  • package.json
  • tsconfig.format-rawhtml.json
  • tsconfig.json
📝 Walkthrough

Walkthrough

The pull request updates Precious command handling, TypeScript compiler settings, GeoIP documentation formatting, and development dependencies.

Changes

Tooling and documentation updates

Layer / File(s) Summary
Tooling command execution configuration
.precious.toml
Updates command invocation counts, path forwarding, script globs, and Prettier arguments.
TypeScript and dependency configuration
tsconfig.json, tsconfig.format-rawhtml.json, package.json
Adds Node type definitions, sets the formatter root directory, and adds caniuse-lite to devDependencies.
GeoIP documentation formatting
content/geoip/docs/databases/...
Clarifies anonymizer confidence wording and adjusts repeated table-header indentation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit tunes each script with care,
Aligns the tables row by row there.
TypeScript finds its Node types bright,
While confidence wording reads just right.
Hop, hop—the build paths take flight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: keeping caniuse-lite current to prevent Stylelint-related lint failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wstorey/fix-ci-stale-caniuse-lite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploying dev-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 30205a3
Status: ✅  Deploy successful!
Preview URL: https://a332b888.dev-site-4ua.pages.dev
Branch Preview URL: https://wstorey-fix-ci-stale-caniuse.dev-site-4ua.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a recurring CI lint failure caused by Browserslist emitting a stale-data warning to stderr when its bundled caniuse-lite data becomes older than six months, which precious treats as a failure. It promotes caniuse-lite to a direct devDependency so Dependabot will keep it updated and prevent timer-based workflow breakage.

Changes:

  • Add caniuse-lite as a direct devDependency so it is tracked by Dependabot.
  • Update the lockfile to a newer caniuse-lite version and refresh baseline-browser-mapping to the currently resolved version.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Adds caniuse-lite to devDependencies so Dependabot updates it directly.
pnpm-lock.yaml Records the new direct dependency and updates resolved versions for caniuse-lite (and baseline-browser-mapping).
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

horgh and others added 5 commits August 5, 2026 22:47
Browserslist prints a warning to stderr once its bundled caniuse-lite
data is six months old. stylelint itself still exits 0, but precious
treats unexpected stderr as a command failure, so the Precious workflow
started failing on main today without anything in the repo changing.

caniuse-lite was a transitive dependency, so Dependabot never bumped it
and it had not been refreshed since the npm to pnpm conversion in
January. Promote it to a direct devDependency so the weekly
minor-and-patch group keeps it current, matching what 9a55fd8 did for
baseline-browser-mapping for the same reason.

Deliberately not silencing the warning: plugin/no-unsupported-browser-
features reads this data, so stale data quietly degrades that rule. The
build failure is the signal that it went stale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
TypeScript 6 rejects the deprecated `baseUrl` option, so `tsc` exited 2
before checking anything. Removing it is safe: every import is either
relative or a bare package name, so nothing relied on it.

That unmasked two further errors. Node's globals were no longer resolving,
so `types` now names `node` explicitly. And `tsconfig.format-rawhtml.json`
needs an explicit `rootDir` under TypeScript 6; `bin` is the directory that
was previously inferred, so the output path is unchanged.

`pnpm run format:rawhtml` had been exiting 2 on every file, which meant
rawhtml content was silently going unformatted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pure `pnpm run format:rawhtml` output, now that it runs again. No content
changes, only rewrapping inside rawhtml blocks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`precious lint --all` took about 219s, nearly all of it process startup.
`invoke` defaults to per-file, and only three commands overrode it, so the
rest spawned a `pnpm` process for every matching file.

cspell was the worst of these. It ran 143 times, and because `lint:cspell`
hardcodes its own `**/*.md` glob, each run rechecked the whole repository:
143 full-repository spell checks, 143s.

Four commands find their own targets and ignore any path args they are
given, so they now pass none. For `lint:scripts` this is required rather
than merely tidy: path args are appended to the whole npm script, so they
land on the trailing `eslint .`, and ESLint reports an explicitly-named file
that it is configured to ignore as a warning, which --max-warnings=0 turns
fatal.

`lint-scripts` also matched no files at all, because its include patterns
were the only ones written with a leading `./`, which never matches. So
neither `tsc` nor eslint has actually been running under precious.

`precious lint --all` is now about 17s.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
prettier-scripts baked --write into cmd and appended --check via
lint-flags, so linting ran `prettier --write --check`. Prettier honors
--write regardless: it reformatted the file on disk and exited 0, and
precious only failed the command because of the unexpected stderr.

The pre-commit hook runs `precious lint --staged`, so a file could be
reformatted in the working tree without being restaged, letting a commit
record unformatted content while the tree looked clean.

tidy-flags already supplies --write, so dropping it from cmd leaves tidy
unchanged and makes lint read-only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@horgh
horgh force-pushed the wstorey/fix-ci-stale-caniuse-lite branch from 8874af2 to e168d40 Compare August 5, 2026 22:49
`types` is a project-wide option, so adding `node` to make `tsc` work on
bin/ also hands the Node globals to the browser code in assets/js/. There,
`process.env` now type checks clean but throws a ReferenceError in a
browser, and setTimeout returns Node's Timeout rather than number. `lib`
has always leaked the same way in reverse, letting bin/ reference
`document`.

Nothing is broken today — no file in assets/js/ touches a Node API. But
before TypeScript 6 stopped auto-loading @types/node, tsc would have caught
one, so this trades away a check that was incidentally working. Leaving it
as is for now and noting the cost, plus what fixing it would involve, so the
next reader doesn't take the line at face value.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@oschwald
oschwald merged commit 5e9235f into main Aug 6, 2026
11 checks passed
@oschwald
oschwald deleted the wstorey/fix-ci-stale-caniuse-lite branch August 6, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants