Skip to content

Version Packages#385

Merged
mizdra merged 1 commit into
mainfrom
changeset-release/main
May 11, 2026
Merged

Version Packages#385
mizdra merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 6, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@css-modules-kit/core@1.2.0

Minor Changes

  • #389 ab602bf - feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name property

    animation-name: foo; is now linked back to the @keyframes foo {...} declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;), local() / global() notation, and vendor prefixes (-webkit-animation-name) are all supported. References to @keyframes defined in another file via @import are resolved as well.

    Two diagnostics are also emitted for invalid usage:

    • Parse phase: malformed local(...) calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.
    • Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as Cannot find token '<name>'..

    The no-unused-class-names rule in eslint-plugin and stylelint-plugin now treats names referenced via animation-name from within the same CSS as used, so they are no longer reported as unused.

Patch Changes

  • #399 f758c23 - refactor(core, codegen): do not emit token reference statements in generated .d.ts files

    Statements like styles['a_1']; and __self['a_1']; (emitted for animation-name references to @keyframes) used to appear in the .d.ts files written by codegen. These statements exist solely to wire up editor language features such as Go to Definition, Find All References, and Rename, and are not needed at compile time. The visible types exported by these files are unchanged, but codegen output is no longer cluttered with statements that look meaningless to a reader of the type definition file. The statements are still emitted by the TS plugin, where the language features are actually served.

  • #395 2d672a6 - fix(core): make default-export styles type-readonly via as const

    The default-export .d.ts previously emitted each token as '<name>': '' as readonly string,. The readonly modifier is only valid on array/tuple types, so this was a TypeScript syntax error silently suppressed by @ts-nocheckstyles was not actually readonly and writes like styles.foo = '...' were accepted by tsc. The generator now emits '<name>': '' as string, per token and closes the object literal with } as const, so typeof styles is Readonly<{ ... }> and writes to it are now correctly reported as type errors.

  • #386 bf028b1 - fix(core): use the alias name when collecting re-exported tokens via @value ... as ... from ...

    createExportBuilder was recording the source-side name (entry.name) into the importing module's ExportRecord instead of the alias the importing module actually exposes (entry.localName). This caused downstream consumers to look up the wrong name, e.g. checkCSSModule would emit a false "no exported token" diagnostic for an aliased token re-imported from another module.

  • #390 feff13f - fix(core): ensure the .d.ts generated in named exports mode is always treated as a module

    When a CSS Module file had no exported tokens or importers (e.g. an empty file), the generated .d.ts in named exports mode contained no top-level export/import, so TypeScript treated it as a global script and reported TS2306 on import * as styles from './a.module.css'. The generator now appends export {}; whenever it does not emit any other top-level export / import, so the generated .d.ts is always treated as a module.

  • #384 d0c1750 - refactor(core): rename TokenImporter variants to ESTree-style names

    Rename the public types so they describe the abstract shape of the import
    (matching ESTree's ExportAllDeclaration / ExportNamedDeclaration)
    rather than the CSS syntax that produced them:

    • AtImportTokenImporterAllTokenImporter (type: 'all')
    • AtValueTokenImporterNamedTokenImporter (type: 'named')
    • AtValueTokenImporterValueNamedTokenImporterEntry
    • NamedTokenImporter.valuesNamedTokenImporter.entries

    The core package is an internal building block — end users interact
    with CSS Modules Kit through ts-plugin, codegen, eslint-plugin,
    and stylelint-plugin, none of which reference the renamed names. This
    change is therefore released as a patch.

@css-modules-kit/ts-plugin@1.2.0

Minor Changes

  • #389 ab602bf - feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name property

    animation-name: foo; is now linked back to the @keyframes foo {...} declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;), local() / global() notation, and vendor prefixes (-webkit-animation-name) are all supported. References to @keyframes defined in another file via @import are resolved as well.

    Two diagnostics are also emitted for invalid usage:

    • Parse phase: malformed local(...) calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.
    • Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as Cannot find token '<name>'..

    The no-unused-class-names rule in eslint-plugin and stylelint-plugin now treats names referenced via animation-name from within the same CSS as used, so they are no longer reported as unused.

Patch Changes

  • #397 53793dd - fix(vscode, ts-plugin): support file rename from a CSS module @import / @value ... from specifier

    Renaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on b.module.css inside @import './b.module.css';) now performs a real file rename and updates every importer of the renamed file. Previously the located text span was blindly replaced with the user's input, which dropped the path prefix ('./b.module.css' became 'bb.module.css') and left the file on disk unchanged.

    ts-plugin exposes a new internal protocol handler _css-modules-kit:getEditsForFileRename that wraps the standard tsserver getEditsForFileRename so the request can be reached through typescript.tsserverRequest.

  • Updated dependencies [f758c23, 2d672a6, bf028b1, ab602bf, feff13f, d0c1750]:

    • @css-modules-kit/core@1.2.0

@css-modules-kit/codegen@1.2.0

Patch Changes

  • #399 f758c23 - refactor(core, codegen): do not emit token reference statements in generated .d.ts files

    Statements like styles['a_1']; and __self['a_1']; (emitted for animation-name references to @keyframes) used to appear in the .d.ts files written by codegen. These statements exist solely to wire up editor language features such as Go to Definition, Find All References, and Rename, and are not needed at compile time. The visible types exported by these files are unchanged, but codegen output is no longer cluttered with statements that look meaningless to a reader of the type definition file. The statements are still emitted by the TS plugin, where the language features are actually served.

  • Updated dependencies [f758c23, 2d672a6, bf028b1, ab602bf, feff13f, d0c1750]:

    • @css-modules-kit/core@1.2.0

@css-modules-kit/eslint-plugin@1.2.0

Patch Changes

  • #389 ab602bf - feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name property

    animation-name: foo; is now linked back to the @keyframes foo {...} declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;), local() / global() notation, and vendor prefixes (-webkit-animation-name) are all supported. References to @keyframes defined in another file via @import are resolved as well.

    Two diagnostics are also emitted for invalid usage:

    • Parse phase: malformed local(...) calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.
    • Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as Cannot find token '<name>'..

    The no-unused-class-names rule in eslint-plugin and stylelint-plugin now treats names referenced via animation-name from within the same CSS as used, so they are no longer reported as unused.

  • Updated dependencies [f758c23, 2d672a6, bf028b1, ab602bf, feff13f, d0c1750]:

    • @css-modules-kit/core@1.2.0

@css-modules-kit/stylelint-plugin@1.2.0

Patch Changes

  • #389 ab602bf - feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name property

    animation-name: foo; is now linked back to the @keyframes foo {...} declaration. Go to Definition jumps from a reference to the declaration, Find All References lists every reference site, and Rename updates the declaration and every reference together. Comma-separated names (animation-name: foo, bar;), local() / global() notation, and vendor prefixes (-webkit-animation-name) are all supported. References to @keyframes defined in another file via @import are resolved as well.

    Two diagnostics are also emitted for invalid usage:

    • Parse phase: malformed local(...) calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.
    • Check phase: token references that resolve to neither a locally defined token nor an imported token are reported as Cannot find token '<name>'..

    The no-unused-class-names rule in eslint-plugin and stylelint-plugin now treats names referenced via animation-name from within the same CSS as used, so they are no longer reported as unused.

  • Updated dependencies [f758c23, 2d672a6, bf028b1, ab602bf, feff13f, d0c1750]:

    • @css-modules-kit/core@1.2.0

css-modules-kit-vscode@1.2.0

Patch Changes

  • #397 53793dd - fix(vscode, ts-plugin): support file rename from a CSS module @import / @value ... from specifier

    Renaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on b.module.css inside @import './b.module.css';) now performs a real file rename and updates every importer of the renamed file. Previously the located text span was blindly replaced with the user's input, which dropped the path prefix ('./b.module.css' became 'bb.module.css') and left the file on disk unchanged.

    ts-plugin exposes a new internal protocol handler _css-modules-kit:getEditsForFileRename that wraps the standard tsserver getEditsForFileRename so the request can be reached through typescript.tsserverRequest.

  • Updated dependencies [53793dd, ab602bf]:

    • @css-modules-kit/ts-plugin@1.2.0

@github-actions github-actions Bot force-pushed the changeset-release/main branch 11 times, most recently from 6839ce4 to bde78b1 Compare May 11, 2026 15:51
@github-actions github-actions Bot force-pushed the changeset-release/main branch from bde78b1 to 0cc0cdc Compare May 11, 2026 15:58
@mizdra mizdra marked this pull request as draft May 11, 2026 15:58
@mizdra mizdra marked this pull request as ready for review May 11, 2026 15:58
@mizdra mizdra closed this May 11, 2026
@mizdra mizdra reopened this May 11, 2026
@mizdra mizdra merged commit bf1881c into main May 11, 2026
20 checks passed
@mizdra mizdra deleted the changeset-release/main branch May 11, 2026 16:02
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.

1 participant