From 0cc0cdc2b1d49f8aa261b635ae227f71ba51d76f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 11 May 2026 15:57:55 +0000 Subject: [PATCH] Version Packages --- .changeset/codegen-omit-token-references.md | 8 ---- .changeset/drop-readonly-string-cast.md | 7 --- .../file-rename-from-css-import-specifier.md | 10 ---- .../fix-aliased-reexport-in-export-record.md | 7 --- .changeset/keyframes-references.md | 17 ------- .changeset/named-exports-dts-as-module.md | 7 --- .changeset/rename-token-importer-types.md | 19 -------- packages/codegen/CHANGELOG.md | 11 +++++ packages/codegen/package.json | 2 +- packages/core/CHANGELOG.md | 47 +++++++++++++++++++ packages/core/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 17 +++++++ packages/eslint-plugin/package.json | 2 +- packages/stylelint-plugin/CHANGELOG.md | 17 +++++++ packages/stylelint-plugin/package.json | 2 +- packages/ts-plugin/CHANGELOG.md | 25 ++++++++++ packages/ts-plugin/package.json | 2 +- packages/vscode/CHANGELOG.md | 13 +++++ packages/vscode/package.json | 2 +- 19 files changed, 136 insertions(+), 81 deletions(-) delete mode 100644 .changeset/codegen-omit-token-references.md delete mode 100644 .changeset/drop-readonly-string-cast.md delete mode 100644 .changeset/file-rename-from-css-import-specifier.md delete mode 100644 .changeset/fix-aliased-reexport-in-export-record.md delete mode 100644 .changeset/keyframes-references.md delete mode 100644 .changeset/named-exports-dts-as-module.md delete mode 100644 .changeset/rename-token-importer-types.md diff --git a/.changeset/codegen-omit-token-references.md b/.changeset/codegen-omit-token-references.md deleted file mode 100644 index 01bcef3c..00000000 --- a/.changeset/codegen-omit-token-references.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@css-modules-kit/codegen': patch -'@css-modules-kit/core': patch ---- - -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. diff --git a/.changeset/drop-readonly-string-cast.md b/.changeset/drop-readonly-string-cast.md deleted file mode 100644 index 9685567c..00000000 --- a/.changeset/drop-readonly-string-cast.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@css-modules-kit/core': patch ---- - -fix(core): make default-export `styles` type-readonly via `as const` - -The default-export `.d.ts` previously emitted each token as `'': '' as readonly string,`. The `readonly` modifier is only valid on array/tuple types, so this was a TypeScript syntax error silently suppressed by `@ts-nocheck` — `styles` was not actually readonly and writes like `styles.foo = '...'` were accepted by `tsc`. The generator now emits `'': '' 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. diff --git a/.changeset/file-rename-from-css-import-specifier.md b/.changeset/file-rename-from-css-import-specifier.md deleted file mode 100644 index f8b8b5ff..00000000 --- a/.changeset/file-rename-from-css-import-specifier.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'css-modules-kit-vscode': patch -'@css-modules-kit/ts-plugin': patch ---- - -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`. diff --git a/.changeset/fix-aliased-reexport-in-export-record.md b/.changeset/fix-aliased-reexport-in-export-record.md deleted file mode 100644 index 6cdc02ee..00000000 --- a/.changeset/fix-aliased-reexport-in-export-record.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@css-modules-kit/core': patch ---- - -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. diff --git a/.changeset/keyframes-references.md b/.changeset/keyframes-references.md deleted file mode 100644 index 06a17209..00000000 --- a/.changeset/keyframes-references.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@css-modules-kit/core': minor -'@css-modules-kit/ts-plugin': minor -'@css-modules-kit/eslint-plugin': patch -'@css-modules-kit/stylelint-plugin': patch ---- - -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 ''.`. - -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. diff --git a/.changeset/named-exports-dts-as-module.md b/.changeset/named-exports-dts-as-module.md deleted file mode 100644 index e02f7556..00000000 --- a/.changeset/named-exports-dts-as-module.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@css-modules-kit/core': patch ---- - -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. diff --git a/.changeset/rename-token-importer-types.md b/.changeset/rename-token-importer-types.md deleted file mode 100644 index 44bb249c..00000000 --- a/.changeset/rename-token-importer-types.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -'@css-modules-kit/core': patch ---- - -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: - -- `AtImportTokenImporter` → `AllTokenImporter` (`type: 'all'`) -- `AtValueTokenImporter` → `NamedTokenImporter` (`type: 'named'`) -- `AtValueTokenImporterValue` → `NamedTokenImporterEntry` -- `NamedTokenImporter.values` → `NamedTokenImporter.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. diff --git a/packages/codegen/CHANGELOG.md b/packages/codegen/CHANGELOG.md index e3b891a2..723ae810 100644 --- a/packages/codegen/CHANGELOG.md +++ b/packages/codegen/CHANGELOG.md @@ -1,5 +1,16 @@ # @css-modules-kit/codegen +## 1.2.0 + +### Patch Changes + +- [#399](https://github.com/mizdra/css-modules-kit/pull/399) [`f758c23`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6) - 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`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6), [`2d672a6`](https://github.com/mizdra/css-modules-kit/commit/2d672a68296d88922d1294268cee2eddcb62115b), [`bf028b1`](https://github.com/mizdra/css-modules-kit/commit/bf028b15fd2503fa3596fb079755ea0138406e97), [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83), [`feff13f`](https://github.com/mizdra/css-modules-kit/commit/feff13f30419511dc736594269425d2924c189f4), [`d0c1750`](https://github.com/mizdra/css-modules-kit/commit/d0c17500bf51450a3d722b13b0159a96890c786d)]: + - @css-modules-kit/core@1.2.0 + ## 1.1.0 ### Patch Changes diff --git a/packages/codegen/package.json b/packages/codegen/package.json index 7a978e78..78d146b0 100644 --- a/packages/codegen/package.json +++ b/packages/codegen/package.json @@ -1,6 +1,6 @@ { "name": "@css-modules-kit/codegen", - "version": "1.1.0", + "version": "1.2.0", "private": false, "description": "A tool for generating `*.d.ts` files for `*.module.css`.", "keywords": [ diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 2c03945f..9169c247 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,52 @@ # @css-modules-kit/core +## 1.2.0 + +### Minor Changes + +- [#389](https://github.com/mizdra/css-modules-kit/pull/389) [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83) - 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 ''.`. + + 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](https://github.com/mizdra/css-modules-kit/pull/399) [`f758c23`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6) - 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](https://github.com/mizdra/css-modules-kit/pull/395) [`2d672a6`](https://github.com/mizdra/css-modules-kit/commit/2d672a68296d88922d1294268cee2eddcb62115b) - fix(core): make default-export `styles` type-readonly via `as const` + + The default-export `.d.ts` previously emitted each token as `'': '' as readonly string,`. The `readonly` modifier is only valid on array/tuple types, so this was a TypeScript syntax error silently suppressed by `@ts-nocheck` — `styles` was not actually readonly and writes like `styles.foo = '...'` were accepted by `tsc`. The generator now emits `'': '' 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](https://github.com/mizdra/css-modules-kit/pull/386) [`bf028b1`](https://github.com/mizdra/css-modules-kit/commit/bf028b15fd2503fa3596fb079755ea0138406e97) - 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](https://github.com/mizdra/css-modules-kit/pull/390) [`feff13f`](https://github.com/mizdra/css-modules-kit/commit/feff13f30419511dc736594269425d2924c189f4) - 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](https://github.com/mizdra/css-modules-kit/pull/384) [`d0c1750`](https://github.com/mizdra/css-modules-kit/commit/d0c17500bf51450a3d722b13b0159a96890c786d) - 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: + - `AtImportTokenImporter` → `AllTokenImporter` (`type: 'all'`) + - `AtValueTokenImporter` → `NamedTokenImporter` (`type: 'named'`) + - `AtValueTokenImporterValue` → `NamedTokenImporterEntry` + - `NamedTokenImporter.values` → `NamedTokenImporter.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. + ## 1.1.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index aea3d8e4..b5c0590a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@css-modules-kit/core", - "version": "1.1.0", + "version": "1.2.0", "private": false, "description": "The core of css-modules-kit", "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index fef25b41..2c8b85f9 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,5 +1,22 @@ # @css-modules-kit/eslint-plugin +## 1.2.0 + +### Patch Changes + +- [#389](https://github.com/mizdra/css-modules-kit/pull/389) [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83) - 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 ''.`. + + 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`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6), [`2d672a6`](https://github.com/mizdra/css-modules-kit/commit/2d672a68296d88922d1294268cee2eddcb62115b), [`bf028b1`](https://github.com/mizdra/css-modules-kit/commit/bf028b15fd2503fa3596fb079755ea0138406e97), [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83), [`feff13f`](https://github.com/mizdra/css-modules-kit/commit/feff13f30419511dc736594269425d2924c189f4), [`d0c1750`](https://github.com/mizdra/css-modules-kit/commit/d0c17500bf51450a3d722b13b0159a96890c786d)]: + - @css-modules-kit/core@1.2.0 + ## 1.1.0 ### Patch Changes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 006ac590..af875f69 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@css-modules-kit/eslint-plugin", - "version": "1.1.0", + "version": "1.2.0", "private": false, "description": "A eslint plugin for CSS Modules", "keywords": [ diff --git a/packages/stylelint-plugin/CHANGELOG.md b/packages/stylelint-plugin/CHANGELOG.md index 67d011c9..89209a10 100644 --- a/packages/stylelint-plugin/CHANGELOG.md +++ b/packages/stylelint-plugin/CHANGELOG.md @@ -1,5 +1,22 @@ # @css-modules-kit/stylelint-plugin +## 1.2.0 + +### Patch Changes + +- [#389](https://github.com/mizdra/css-modules-kit/pull/389) [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83) - 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 ''.`. + + 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`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6), [`2d672a6`](https://github.com/mizdra/css-modules-kit/commit/2d672a68296d88922d1294268cee2eddcb62115b), [`bf028b1`](https://github.com/mizdra/css-modules-kit/commit/bf028b15fd2503fa3596fb079755ea0138406e97), [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83), [`feff13f`](https://github.com/mizdra/css-modules-kit/commit/feff13f30419511dc736594269425d2924c189f4), [`d0c1750`](https://github.com/mizdra/css-modules-kit/commit/d0c17500bf51450a3d722b13b0159a96890c786d)]: + - @css-modules-kit/core@1.2.0 + ## 1.1.0 ### Patch Changes diff --git a/packages/stylelint-plugin/package.json b/packages/stylelint-plugin/package.json index de9f099c..2f8114a7 100644 --- a/packages/stylelint-plugin/package.json +++ b/packages/stylelint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@css-modules-kit/stylelint-plugin", - "version": "1.1.0", + "version": "1.2.0", "private": false, "description": "A stylelint plugin for CSS Modules", "keywords": [ diff --git a/packages/ts-plugin/CHANGELOG.md b/packages/ts-plugin/CHANGELOG.md index ac3b1145..8d853241 100644 --- a/packages/ts-plugin/CHANGELOG.md +++ b/packages/ts-plugin/CHANGELOG.md @@ -1,5 +1,30 @@ # @css-modules-kit/ts-plugin +## 1.2.0 + +### Minor Changes + +- [#389](https://github.com/mizdra/css-modules-kit/pull/389) [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83) - 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 ''.`. + + 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](https://github.com/mizdra/css-modules-kit/pull/397) [`53793dd`](https://github.com/mizdra/css-modules-kit/commit/53793dda894291224bc94f7b51c96a4cb2b749c4) - 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`](https://github.com/mizdra/css-modules-kit/commit/f758c23836878624553dcd44a920a76c5505b4d6), [`2d672a6`](https://github.com/mizdra/css-modules-kit/commit/2d672a68296d88922d1294268cee2eddcb62115b), [`bf028b1`](https://github.com/mizdra/css-modules-kit/commit/bf028b15fd2503fa3596fb079755ea0138406e97), [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83), [`feff13f`](https://github.com/mizdra/css-modules-kit/commit/feff13f30419511dc736594269425d2924c189f4), [`d0c1750`](https://github.com/mizdra/css-modules-kit/commit/d0c17500bf51450a3d722b13b0159a96890c786d)]: + - @css-modules-kit/core@1.2.0 + ## 1.1.0 ### Minor Changes diff --git a/packages/ts-plugin/package.json b/packages/ts-plugin/package.json index f35987f8..99b876bd 100644 --- a/packages/ts-plugin/package.json +++ b/packages/ts-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@css-modules-kit/ts-plugin", - "version": "1.1.0", + "version": "1.2.0", "private": false, "description": "A TypeScript Language Service Plugin for CSS Modules", "keywords": [ diff --git a/packages/vscode/CHANGELOG.md b/packages/vscode/CHANGELOG.md index cd6773f4..83fe87e8 100644 --- a/packages/vscode/CHANGELOG.md +++ b/packages/vscode/CHANGELOG.md @@ -1,5 +1,18 @@ # css-modules-kit-vscode +## 1.2.0 + +### Patch Changes + +- [#397](https://github.com/mizdra/css-modules-kit/pull/397) [`53793dd`](https://github.com/mizdra/css-modules-kit/commit/53793dda894291224bc94f7b51c96a4cb2b749c4) - 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`](https://github.com/mizdra/css-modules-kit/commit/53793dda894291224bc94f7b51c96a4cb2b749c4), [`ab602bf`](https://github.com/mizdra/css-modules-kit/commit/ab602bf9f4b8e82bcaf3d951b0cb7bb94719ee83)]: + - @css-modules-kit/ts-plugin@1.2.0 + ## 1.1.0 ### Patch Changes diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 800d9651..0784605c 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -1,7 +1,7 @@ { "name": "css-modules-kit-vscode", "displayName": "CSS Modules Kit", - "version": "1.1.0", + "version": "1.2.0", "private": true, "description": "The VS Code extension for CSS Modules", "categories": [