Version Packages#385
Merged
Merged
Conversation
6839ce4 to
bde78b1
Compare
bde78b1 to
0cc0cdc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 propertyanimation-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@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.Cannot find token '<name>'..The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom 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.tsfilesStatements like
styles['a_1'];and__self['a_1'];(emitted foranimation-namereferences to@keyframes) used to appear in the.d.tsfiles 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-exportstylestype-readonly viaas constThe default-export
.d.tspreviously emitted each token as'<name>': '' as readonly string,. Thereadonlymodifier is only valid on array/tuple types, so this was a TypeScript syntax error silently suppressed by@ts-nocheck—styleswas not actually readonly and writes likestyles.foo = '...'were accepted bytsc. The generator now emits'<name>': '' as string,per token and closes the object literal with} as const, sotypeof stylesisReadonly<{ ... }>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 ...createExportBuilderwas recording the source-side name (entry.name) into the importing module'sExportRecordinstead of the alias the importing module actually exposes (entry.localName). This caused downstream consumers to look up the wrong name, e.g.checkCSSModulewould emit a false "no exported token" diagnostic for an aliased token re-imported from another module.#390
feff13f- fix(core): ensure the.d.tsgenerated in named exports mode is always treated as a moduleWhen a CSS Module file had no exported tokens or importers (e.g. an empty file), the generated
.d.tsin named exports mode contained no top-levelexport/import, so TypeScript treated it as a global script and reportedTS2306onimport * as styles from './a.module.css'. The generator now appendsexport {};whenever it does not emit any other top-levelexport/import, so the generated.d.tsis always treated as a module.#384
d0c1750- refactor(core): rename TokenImporter variants to ESTree-style namesRename 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→NamedTokenImporterEntryNamedTokenImporter.values→NamedTokenImporter.entriesThe
corepackage is an internal building block — end users interactwith CSS Modules Kit through
ts-plugin,codegen,eslint-plugin,and
stylelint-plugin, none of which reference the renamed names. Thischange 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 propertyanimation-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@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.Cannot find token '<name>'..The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom 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 ... fromspecifierRenaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on
b.module.cssinside@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:getEditsForFileRenamethat wraps the standard tsservergetEditsForFileRenameso the request can be reached throughtypescript.tsserverRequest.Updated dependencies [
f758c23,2d672a6,bf028b1,ab602bf,feff13f,d0c1750]:@css-modules-kit/codegen@1.2.0
Patch Changes
#399
f758c23- refactor(core, codegen): do not emit token reference statements in generated.d.tsfilesStatements like
styles['a_1'];and__self['a_1'];(emitted foranimation-namereferences to@keyframes) used to appear in the.d.tsfiles 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/eslint-plugin@1.2.0
Patch Changes
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-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@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.Cannot find token '<name>'..The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom 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/stylelint-plugin@1.2.0
Patch Changes
#389
ab602bf- feat(core, ts-plugin, eslint-plugin, stylelint-plugin): support animation-name propertyanimation-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@keyframesdefined in another file via@importare resolved as well.Two diagnostics are also emitted for invalid usage:
local(...)calls (empty, multiple identifiers, or non-identifier nodes such as a nested function) are reported.Cannot find token '<name>'..The
no-unused-class-namesrule in eslint-plugin and stylelint-plugin now treats names referenced viaanimation-namefrom 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-vscode@1.2.0
Patch Changes
#397
53793dd- fix(vscode, ts-plugin): support file rename from a CSS module@import/@value ... fromspecifierRenaming a CSS module via the import specifier in VS Code (e.g. invoking Rename Symbol on
b.module.cssinside@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:getEditsForFileRenamethat wraps the standard tsservergetEditsForFileRenameso the request can be reached throughtypescript.tsserverRequest.Updated dependencies [
53793dd,ab602bf]: