Skip to content

fix: unbreak CI after vite 8 bump and grammar/deps updates - #1300

Merged
antfu merged 1 commit into
mainfrom
fix/vite8-wasm-import-and-rollup-typecheck
Jul 31, 2026
Merged

antfu merged 1 commit into
mainfrom
fix/vite8-wasm-import-and-rollup-typecheck

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator
  • <- Keep this line and put an x between the brackts.

Description

main's CI is currently red (see the test/typecheck jobs on the v4.4.1 release push). This PR fixes it:

  1. Vite 8 broke wasm loading under Vitest. Vite 8 added a built-in plugin that now intercepts any bare .wasm import (previously only .wasm?init) and tries to instantiate it as a real WebAssembly ESM module. That clashes with this repo's own wasmPlugin() in packages/engine-oniguruma/rollup.config.mjs, which inlines onig.wasm as a base64 ArrayBuffer for tests. Because Oniguruma's wasm declares imports from a synthetic env module, Vite's built-in handling failed with Cannot find package 'env', breaking most of the test matrix. Fix: mark the plugin enforce: 'pre' so it wins over Vite's core plugin (Rollup ignores the unknown field, so the real build is unaffected).
  2. Stale inline snapshots. The tm-grammars/tm-themes update legitimately changed the bundled language counts/list (e.g. sql is now a dependency of cpp/cpp-macro), but the snapshot tests weren't refreshed. Updated them to match.
  3. Duplicate rollup versions broke typecheck. The rollup catalog was bumped to ^4.62.3, but unbuild (used by magic-move/stream) still resolved a nested rollup@4.62.2, so TS saw two nominally different Plugin types and failed on packages/magic-move/build.config.ts. Added a pnpm.overrides entry to force a single deduped rollup version.
  4. Stale @ts-expect-error directives. Vite 8's client.d.ts now declares an ambient *.wasm module, making two existing @ts-expect-error comments (in wasm-inlined.ts and packages/shiki/test/cf.ts) unused, which itself is a type error under noUnusedLocals-style checks. Removed/replaced with a proper cast.

Verified locally: pnpm lint, pnpm typecheck, and pnpm build && vitest run (615/615 tests) all pass.

Linked Issues

fixes none (found via CI inspection, no existing issue)

Additional context

This PR was authored with the help of an AI coding agent (OpenCode), used to diagnose the failing CI run and prepare this fix.

- wasm-inlined: force our wasm-inlining plugin to run with enforce: 'pre'
  so it wins over vite 8's new built-in bare .wasm ESM handling, which
  tried to instantiate onig.wasm's synthetic env imports and broke most
  of the test suite (Cannot find package 'env')
- core/bundle tests: refresh inline snapshots for the loaded-language
  counts/list that changed with the tm-grammars/tm-themes update
- pnpm overrides: pin rollup to a single deduped version so unbuild's
  nested rollup@4.62.2 doesn't clash in types with the catalog's 4.62.3
  during typecheck
- wasm-inlined/cf.ts: drop now-stale @ts-expect-error directives that
  vite 8's new '*.wasm' ambient module declaration makes unnecessary
@netlify

netlify Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 530ef5d
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/6a6c7aae45db170008fbf653
😎 Deploy Preview https://deploy-preview-1300--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 530ef5d
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/6a6c7aae637a4d0008bf1d6b
😎 Deploy Preview https://deploy-preview-1300--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.71%. Comparing base (1b8b6e4) to head (530ef5d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
+ Coverage   89.64%   89.71%   +0.07%     
==========================================
  Files          79       79              
  Lines        3524     3539      +15     
  Branches     1002     1004       +2     
==========================================
+ Hits         3159     3175      +16     
+ Misses        328      327       -1     
  Partials       37       37              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@antfu
antfu merged commit c5d310b into main Jul 31, 2026
15 checks passed
antfu pushed a commit to SHUBHI-KUMARI/shiki that referenced this pull request Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants