Skip to content

chore: migrate to @ec-ts/twoslash for ESM-only functionality#87

Merged
Adammatthiesen merged 5 commits into
mainfrom
adam/migrate-twoslash
Feb 24, 2026
Merged

chore: migrate to @ec-ts/twoslash for ESM-only functionality#87
Adammatthiesen merged 5 commits into
mainfrom
adam/migrate-twoslash

Conversation

@Adammatthiesen

@Adammatthiesen Adammatthiesen commented Feb 24, 2026

Copy link
Copy Markdown
Member

This pull request migrates the expressive-code-twoslash package and related code to use the new @ec-ts/twoslash and @ec-ts/twoslash-vue packages, replacing the previous twoslash and twoslash-vue dependencies. This migration ensures ESM-only compatibility, which is required for Astro and Vite environments. The update also includes minor bug fixes, dependency updates, and TypeScript type improvements.

Migration to new Twoslash packages:

  • Replaced all imports and dependencies on twoslash and twoslash-vue with @ec-ts/twoslash and @ec-ts/twoslash-vue in both source code and package.json, ensuring ESM-only support and compatibility with Astro/Vite.

Type and API improvements:

  • Updated the showEmittedFile option in HandbookOptions to explicitly allow undefined values, fixing a minor bug where a key could be missing.
  • Updated various type imports throughout the codebase to use types from @ec-ts/twoslash instead of twoslash, improving type safety and consistency.

Dependency and lockfile updates:

  • Updated the pnpm-lock.yaml file to remove old twoslash/twoslash-vue dependencies and add the new @ec-ts/twoslash packages, as well as update @types/node to version 22.19.11 and set TypeScript peer dependency to ^5.5.0.

Bug fixes:

  • Fixed a bug where a key could be missing due to an undefined value in the options object.

General code cleanup:

  • Removed all references to the old twoslash and twoslash-vue packages from the codebase and lockfile.

These changes collectively modernize the codebase for future compatibility and improve overall type safety and reliability.

- Updated imports in annotations and helpers to use @ec-ts/twoslash instead of twoslash.
- Removed references to twoslash and twoslash-vue from pnpm workspace and lock files.
- Updated @types/node version from 20.17.1 to 22.19.11 in pnpm-lock.yaml and pnpm-workspace.yaml.
- Fixed minor bug that caused a key to not exist due to missing undefined value.
@htg-1-studiocms-cloud

htg-1-studiocms-cloud Bot commented Feb 24, 2026

Copy link
Copy Markdown

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
Expressive-Code-Twoslash Docs ✅ Done Preview URL 2026-02-24T09:23:36.311Z

@changeset-bot

changeset-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 829245e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@ec-ts/twoslash Patch
expressive-code-twoslash Minor
@ec-ts/twoslash-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the twoslash expressive-code-twoslash label Feb 24, 2026
@pkg-pr-new

pkg-pr-new Bot commented Feb 24, 2026

Copy link
Copy Markdown
css-js-gen

npm i https://pkg.pr.new/withstudiocms/expressive-code-twoslash/css-js-gen@87

expressive-code-twoslash

npm i https://pkg.pr.new/withstudiocms/expressive-code-twoslash@87

@ec-ts/twoslash

npm i https://pkg.pr.new/withstudiocms/expressive-code-twoslash/@ec-ts/twoslash@87

@ec-ts/twoslash-vue

npm i https://pkg.pr.new/withstudiocms/expressive-code-twoslash/@ec-ts/twoslash-vue@87

@ec-ts/vfs

npm i https://pkg.pr.new/withstudiocms/expressive-code-twoslash/@ec-ts/vfs@87

commit: 829245e

@apollo-git-bot

apollo-git-bot Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Allure Report Summary

Name Duration Stats New Flaky Retry Report
css-js-gen Tests 26ms Passed tests 37 37 0 0
@ec-ts/twoslash Tests 31s 306ms Passed tests 29 29 0 0
@ec-ts/twoslash-vue Tests 6s 496ms Passed tests 7 7 0 0
@ec-ts/vfs Tests 9s 586ms Passed tests 21 21 0 0

@Adammatthiesen Adammatthiesen marked this pull request as ready for review February 24, 2026 09:25
@Adammatthiesen Adammatthiesen requested a review from a team as a code owner February 24, 2026 09:25
@Adammatthiesen Adammatthiesen merged commit 88ba6b2 into main Feb 24, 2026
11 checks passed
@Adammatthiesen Adammatthiesen deleted the adam/migrate-twoslash branch February 24, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants