Skip to content

feat(content-mapper): add an experimental content mapper for TypeScript 7 - #457

Merged
mizdra merged 8 commits into
claude/linters-without-core-stradafrom
claude/content-mapper-scaffold
Nov 10, 2026
Merged

mizdra merged 8 commits into
claude/linters-without-core-stradafrom
claude/content-mapper-scaffold

Conversation

@mizdra

@mizdra mizdra commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

ref: #377

This PR adds @css-modules-kit/content-mapper, an experimental package that provides the language features of css-modules-kit on TypeScript 7 through a content mapper. This is the first step of a gradual implementation, limited to local tokens to keep the review small.

What's supported

  • Go to Definition and Find All References for local tokens (class names, @value definitions, and @keyframes) in default export mode
  • Go to Definition from the styles binding of an import statement
  • Diagnostics for CSS syntax errors and invalid token names

See packages/content-mapper/README.md for the support status of each feature.

Main limitations of this step

  • namedExports and the other options are not available yet
  • Rename Symbol is not supported yet. You can rename a token in a TypeScript file, but it does not update *.module.css
  • The features that need LSP middleware, such as Definition Preview by Hover, are not available
  • @import <specifier> and @value <name> from <specifier> do not import tokens yet
  • Container names and <dashed-ident>s are not treated as tokens
  • Go to Definition and Find All References do not work on tokens used in animation-name and composes
  • Unknown token references and unresolved specifiers in *.module.css are not reported

Why this PR adds vscode-jsonrpc

A content mapper communicates with TypeScript over JSON-RPC 2.0 with LSP-style Content-Length framing. Implementing this by hand requires maintaining message framing, the matching of requests and responses, and error responses, in both the mapper and the language client of the e2e tests. Using vscode-jsonrpc removes this code, so this package can focus on transforming CSS Modules.

A new dependency brings the risk of supply chain attacks. I consider this risk very low and accept it for the following reasons:

🤖 Generated with Claude Code

@mizdra mizdra added the Type: Feature New Feature label Oct 8, 2026
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from a344507 to 9e3006f Compare November 1, 2026 11:58
@changeset-bot

changeset-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f74ac92

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

This PR includes changesets to release 1 package
Name Type
@css-modules-kit/content-mapper Minor

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

@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from 9e3006f to 79f449f Compare November 1, 2026 12:20
@mizdra
mizdra added this pull request to stack #464 November 1, 2026 12:20
@mizdra mizdra changed the title feat(content-mapper): add a content mapper package for TypeScript 7 that transforms every file into an empty module feat(content-mapper): add a template for the content-mapper package Nov 1, 2026
@mizdra
mizdra removed this pull request from stack #464 November 1, 2026 14:02
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from b6362ca to 490cacf Compare November 1, 2026 14:03
@mizdra
mizdra changed the base branch from main to claude/core-strada November 1, 2026 14:04
@mizdra
mizdra added this pull request to stack #467 November 1, 2026 14:04
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from 490cacf to f88bcd2 Compare November 1, 2026 15:35
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from f88bcd2 to c27c82d Compare November 1, 2026 16:09
@mizdra
mizdra removed this pull request from stack #467 November 1, 2026 16:10
@mizdra
mizdra changed the base branch from claude/core-strada to claude/linters-without-core-strada November 1, 2026 16:10
@mizdra
mizdra added this pull request to stack #471 November 1, 2026 16:10
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch 5 times, most recently from 6c5d44f to 8293cf2 Compare November 3, 2026 04:32
@mizdra mizdra changed the title feat(content-mapper): add a template for the content-mapper package feat(content-mapper): add a content mapper for TypeScript 7 that supports local tokens Nov 3, 2026
@mizdra mizdra changed the title feat(content-mapper): add a content mapper for TypeScript 7 that supports local tokens feat(content-mapper): add an experimental content mapper for TypeScript 7 Nov 3, 2026
@mizdra
mizdra marked this pull request as ready for review November 8, 2026 17:20
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch 3 times, most recently from 9eb5de0 to f3747cc Compare November 10, 2026 13:31
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch 2 times, most recently from be00e4b to b09413b Compare November 10, 2026 13:34
mizdra and others added 8 commits November 10, 2026 22:40
…of CSS modules into TypeScript

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ontent mapper protocol

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TypeScript 7 language server

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…upport status

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… packages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-mapper

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tent-mapper example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mizdra
mizdra force-pushed the claude/content-mapper-scaffold branch from b09413b to f74ac92 Compare November 10, 2026 13:40
@mizdra

mizdra commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

We're finally ready to release it :)

@mizdra
mizdra merged commit ad16e37 into main Nov 10, 2026
16 checks passed
@mizdra
mizdra deleted the claude/content-mapper-scaffold branch November 10, 2026 14:35
@github-actions github-actions Bot mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant