diff --git a/.changeset/bright-ravens-escape.md b/.changeset/bright-ravens-escape.md deleted file mode 100644 index 3561282b5..000000000 --- a/.changeset/bright-ravens-escape.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Preserve source escapes within fields changed by fixers - -When a fixer changes part of a selector or declaration value, the stringifier now compares the original and changed CSS escape tokens. Retained source backslashes remain unchanged, while backslashes added by the fixer are still escaped for the surrounding JavaScript template (#1508). diff --git a/.changeset/calm-comments-stay.md b/.changeset/calm-comments-stay.md deleted file mode 100644 index 76c372132..000000000 --- a/.changeset/calm-comments-stay.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Keep comment indentation stable through `stylelint --fix` - -Indented templates no longer add their base indentation before trailing comments or remove it from continuation lines inside multi-line comments. Repeated parse/stringify passes now preserve both forms byte-for-byte (#1502). diff --git a/.changeset/olive-crabs-smile.md b/.changeset/olive-crabs-smile.md deleted file mode 100644 index 383f9fb3d..000000000 --- a/.changeset/olive-crabs-smile.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Fix interpolations and comments being dropped from multi-line selectors and at-rule params - -An interpolation that continues a selector onto the next line looks like a ruleset, so it gets a comment placeholder. PostCSS keeps that comment only in `raws.selector.raw`, and the re-indented selector was read from `selector`, so `~ .${styles.parent}` came out as `~ .` on any `stylelint --fix`. Multi-line at-rule params had the same problem via `raws.params.raw`. - -The same defect was fixed for `decl.value` in the previous release (#1494); the selector and params paths were missed. All three now read the raw form through `computeCorrectedRawValue`. - -Hand-written comments were dropped by the same code path, so a comment inside a multi-line selector or multi-line at-rule params now survives too, interpolations or not. diff --git a/.changeset/olive-moons-repeat.md b/.changeset/olive-moons-repeat.md deleted file mode 100644 index 96f51d509..000000000 --- a/.changeset/olive-moons-repeat.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Stop `stylelint --fix` from rewriting templates it should leave alone - -Backslashes inside a template were doubled on the way out and doubled again on every later run (#1497). Restored `${...}` expressions were passed through the same CSS escaping, so a backtick inside an expression was escaped and could leave the JavaScript unparseable. - -The parser now records each source-derived field before Stylelint rules run. The stringifier leaves backslashes in unchanged fields alone, retains the existing escaping for fields written by fixers, and restores interpolation placeholders only after escaping. The complete JavaScript expression source therefore stays unchanged, and repeated parse/stringify passes are idempotent. - -Fixers can continue to write CSS values with their normal escaping; the stringifier still translates those values into safe JavaScript template source. diff --git a/.changeset/quiet-bags-remember.md b/.changeset/quiet-bags-remember.md deleted file mode 100644 index 8dc884cac..000000000 --- a/.changeset/quiet-bags-remember.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Preserve source prefixes before interpolations - -The parser now records whether it added a synthetic `.` or `--` to keep an interpolation parseable. The stringifier removes only that recorded marker, so `stylelint --fix` no longer drops a real leading dot from selectors such as `.\${className}` (#1501). diff --git a/.changeset/tame-lions-jump.md b/.changeset/tame-lions-jump.md deleted file mode 100644 index b5066e37f..000000000 --- a/.changeset/tame-lions-jump.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Fix adjacent interpolations being mangled by `stylelint --fix` - -`substitutePlaceholders` split each whitespace-separated token on the placeholder marker and only read the first two parts, so a token holding more than one interpolation — an attribute selector like `&[${a}][${b}]`, or a value like `margin: ${a}${b}` — silently lost everything from the second interpolation onward, corrupting the output into invalid CSS (#1498). diff --git a/.changeset/tidy-pugs-repeat.md b/.changeset/tidy-pugs-repeat.md deleted file mode 100644 index bcafb39af..000000000 --- a/.changeset/tidy-pugs-repeat.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@linaria/postcss-linaria': patch ---- - -Fix interpolations and indentation being mangled by `stylelint --fix` - -An interpolation alone on its own line gets a comment placeholder. Inside a parenthesised value PostCSS keeps that comment only in `raws.value.raw`, and the re-indented value was read from `value`, so the placeholder was gone by the time the stringifier ran, and the interpolation with it (#1494). - -Multi-line at-rule params were corrupted rather than dropped: `super.atrule` re-reads params through `rawValue`, so substituting into `node.params` was discarded and `@media screen and ${query}` came out as `@media screen and .pcss-lin0`. An interpolation on the line after the at-rule name lands in the `afterName` raw and was emitted verbatim for the same reason. - -A newline inside `afterName` also never had its base indentation restored, so a wrapped at-rule prelude lost its leading whitespace on any fix, templates with no interpolations at all included. diff --git a/packages/atomic/CHANGELOG.md b/packages/atomic/CHANGELOG.md index e0af94bdf..0dc4ade2d 100644 --- a/packages/atomic/CHANGELOG.md +++ b/packages/atomic/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 8.1.2 + +### Patch Changes + +- @linaria/core@8.1.2 +- @linaria/react@8.1.2 + ## 8.1.1 ### Patch Changes diff --git a/packages/atomic/package.json b/packages/atomic/package.json index 8f748b2a4..3557fc228 100644 --- a/packages/atomic/package.json +++ b/packages/atomic/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/atomic", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9272b7613..bc0c058d3 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 8.1.2 + ## 8.1.1 ## 8.1.0 diff --git a/packages/core/package.json b/packages/core/package.json index bc1ccb3fe..e8c990c16 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/core", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/interop/CHANGELOG.md b/packages/interop/CHANGELOG.md index 97b4e2538..63f26bc09 100644 --- a/packages/interop/CHANGELOG.md +++ b/packages/interop/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 8.1.2 + ## 8.1.1 ## 8.1.0 diff --git a/packages/interop/package.json b/packages/interop/package.json index 534d6d055..0ec69e4b6 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/babel-plugin-interop", - "version": "8.1.1", + "version": "8.1.2", "homepage": "https://github.com/callstack/linaria/tree/master/packages/interop#readme", "repository": "git@github.com:callstack/linaria.git", "license": "MIT", diff --git a/packages/linaria/CHANGELOG.md b/packages/linaria/CHANGELOG.md index dc50bdc66..ff2f787a8 100644 --- a/packages/linaria/CHANGELOG.md +++ b/packages/linaria/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 8.1.2 + +### Patch Changes + +- @linaria/core@8.1.2 +- @linaria/react@8.1.2 +- @linaria/server@8.1.2 + ## 8.1.1 ### Patch Changes diff --git a/packages/linaria/package.json b/packages/linaria/package.json index 900b21ed4..a73aeda5b 100644 --- a/packages/linaria/package.json +++ b/packages/linaria/package.json @@ -1,6 +1,6 @@ { "name": "linaria", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "babel", diff --git a/packages/postcss-linaria/CHANGELOG.md b/packages/postcss-linaria/CHANGELOG.md index 2da31a1b8..3cb9e82ff 100644 --- a/packages/postcss-linaria/CHANGELOG.md +++ b/packages/postcss-linaria/CHANGELOG.md @@ -1,5 +1,49 @@ # Change Log +## 8.1.2 + +### Patch Changes + +- d3b131dc: Preserve source escapes within fields changed by fixers + + When a fixer changes part of a selector or declaration value, the stringifier now compares the original and changed CSS escape tokens. Retained source backslashes remain unchanged, while backslashes added by the fixer are still escaped for the surrounding JavaScript template (#1508). + +- c7b0360e: Keep comment indentation stable through `stylelint --fix` + + Indented templates no longer add their base indentation before trailing comments or remove it from continuation lines inside multi-line comments. Repeated parse/stringify passes now preserve both forms byte-for-byte (#1502). + +- cc438354: Fix interpolations and comments being dropped from multi-line selectors and at-rule params + + An interpolation that continues a selector onto the next line looks like a ruleset, so it gets a comment placeholder. PostCSS keeps that comment only in `raws.selector.raw`, and the re-indented selector was read from `selector`, so `~ .${styles.parent}` came out as `~ .` on any `stylelint --fix`. Multi-line at-rule params had the same problem via `raws.params.raw`. + + The same defect was fixed for `decl.value` in the previous release (#1494); the selector and params paths were missed. All three now read the raw form through `computeCorrectedRawValue`. + + Hand-written comments were dropped by the same code path, so a comment inside a multi-line selector or multi-line at-rule params now survives too, interpolations or not. + +- ee377a44: Stop `stylelint --fix` from rewriting templates it should leave alone + + Backslashes inside a template were doubled on the way out and doubled again on every later run (#1497). Restored `${...}` expressions were passed through the same CSS escaping, so a backtick inside an expression was escaped and could leave the JavaScript unparseable. + + The parser now records each source-derived field before Stylelint rules run. The stringifier leaves backslashes in unchanged fields alone, retains the existing escaping for fields written by fixers, and restores interpolation placeholders only after escaping. The complete JavaScript expression source therefore stays unchanged, and repeated parse/stringify passes are idempotent. + + Fixers can continue to write CSS values with their normal escaping; the stringifier still translates those values into safe JavaScript template source. + +- 832c1f88: Preserve source prefixes before interpolations + + The parser now records whether it added a synthetic `.` or `--` to keep an interpolation parseable. The stringifier removes only that recorded marker, so `stylelint --fix` no longer drops a real leading dot from selectors such as `.\${className}` (#1501). + +- f3871e64: Fix adjacent interpolations being mangled by `stylelint --fix` + + `substitutePlaceholders` split each whitespace-separated token on the placeholder marker and only read the first two parts, so a token holding more than one interpolation — an attribute selector like `&[${a}][${b}]`, or a value like `margin: ${a}${b}` — silently lost everything from the second interpolation onward, corrupting the output into invalid CSS (#1498). + +- d28a5a88: Fix interpolations and indentation being mangled by `stylelint --fix` + + An interpolation alone on its own line gets a comment placeholder. Inside a parenthesised value PostCSS keeps that comment only in `raws.value.raw`, and the re-indented value was read from `value`, so the placeholder was gone by the time the stringifier ran, and the interpolation with it (#1494). + + Multi-line at-rule params were corrupted rather than dropped: `super.atrule` re-reads params through `rawValue`, so substituting into `node.params` was discarded and `@media screen and ${query}` came out as `@media screen and .pcss-lin0`. An interpolation on the line after the at-rule name lands in the `afterName` raw and was emitted verbatim for the same reason. + + A newline inside `afterName` also never had its base indentation restored, so a wrapped at-rule prelude lost its leading whitespace on any fix, templates with no interpolations at all included. + ## 8.1.1 ## 8.1.0 diff --git a/packages/postcss-linaria/package.json b/packages/postcss-linaria/package.json index 4a858fb09..8254e4be3 100644 --- a/packages/postcss-linaria/package.json +++ b/packages/postcss-linaria/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/postcss-linaria", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index dac0a1cc4..0f90033bc 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 8.1.2 + +### Patch Changes + +- @linaria/core@8.1.2 + ## 8.1.1 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 166471c46..4e5e81a8a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/react", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index 9d0f00120..b430ea4e9 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 8.1.2 + ## 8.1.1 ## 8.1.0 diff --git a/packages/server/package.json b/packages/server/package.json index d4c936576..4f5df2bc9 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/server", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/stylelint-config-standard-linaria/CHANGELOG.md b/packages/stylelint-config-standard-linaria/CHANGELOG.md index 0f813207d..ed2df6af5 100644 --- a/packages/stylelint-config-standard-linaria/CHANGELOG.md +++ b/packages/stylelint-config-standard-linaria/CHANGELOG.md @@ -1,5 +1,18 @@ # Change Log +## 8.1.2 + +### Patch Changes + +- Updated dependencies [d3b131dc] +- Updated dependencies [c7b0360e] +- Updated dependencies [cc438354] +- Updated dependencies [ee377a44] +- Updated dependencies [832c1f88] +- Updated dependencies [f3871e64] +- Updated dependencies [d28a5a88] + - @linaria/postcss-linaria@8.1.2 + ## 8.1.1 ### Patch Changes diff --git a/packages/stylelint-config-standard-linaria/package.json b/packages/stylelint-config-standard-linaria/package.json index ea8a88234..b810befd3 100644 --- a/packages/stylelint-config-standard-linaria/package.json +++ b/packages/stylelint-config-standard-linaria/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/stylelint-config-standard-linaria", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css", diff --git a/packages/stylelint/CHANGELOG.md b/packages/stylelint/CHANGELOG.md index a017a1e13..1fac209b0 100644 --- a/packages/stylelint/CHANGELOG.md +++ b/packages/stylelint/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 8.1.2 + ## 8.1.1 ## 8.1.0 diff --git a/packages/stylelint/package.json b/packages/stylelint/package.json index af3192463..ac282a7e7 100644 --- a/packages/stylelint/package.json +++ b/packages/stylelint/package.json @@ -1,6 +1,6 @@ { "name": "@linaria/stylelint", - "version": "8.1.1", + "version": "8.1.2", "description": "Blazing fast zero-runtime CSS in JS library", "keywords": [ "css",