Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/block-position-interpolations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Mixin interpolations that share a line with other CSS, such as `color: red; ${mixin}`, and values split across lines no longer report false `colon expected` or `semi-colon expected` errors.
5 changes: 5 additions & 0 deletions .changeset/completions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Completions now follow plugin configuration changes without a restart. A completion or code fix whose edit would land outside the template is dropped instead of producing a broken edit.
23 changes: 23 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"../scripts/changelog.cjs",
{
"maintainers": [
"570070+quantizor@users.noreply.github.com",
"Evan Jacobs",
"ej@quantizor.dev",
"probablyup@gmail.com",
"quantizor"
]
}
],
"commit": false,
"fixed": [],
"format": "oxfmt",
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
5 changes: 5 additions & 0 deletions .changeset/configuration-feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Invalid or misspelled plugin settings are now reported in the TypeScript server log, naming the setting, what it accepts, and the closest match, instead of being ignored silently. Common spellings such as `"off"`, `"warn"`, and `"Error"` for lint levels are now accepted.
14 changes: 14 additions & 0 deletions .changeset/diagnostics-and-mapping-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@styled/typescript-styled-plugin': patch
---

Errors are placed more accurately and appear in more cases:

- Errors at the end of a template, such as an unclosed block, point inside the template instead of past its closing backtick, and an unclosed block can be folded.
- A stray `}` or `;` is always reported, underlined where it is written.
- Diagnostics work for files not open in the editor.
- Templates containing U+2028 or U+2029 line separators map positions correctly.
- A `;` or `}` inside a comment or an unquoted `url()` no longer causes a false `colon expected`.
- `styled.keyframes` templates are checked as keyframes.
- Code-fix requests for other error codes no longer return the plugin's fixes.
- `getTemplateSettings().getSubstitutions` from `./api` keeps its output the same length as its input for any spans.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Diagnostics and hover are faster in large files and in templates with many interpolations. Results for unchanged templates are reused across requests, using at most 4 MB of memory per project.
5 changes: 5 additions & 0 deletions .changeset/emmet-and-completion-placement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Emmet no longer offers whole declarations where none fit, such as inside a value: typing `display: fl` used to offer `float: left;`. Completions no longer appear inside CSS comments and strings, and an empty template now offers property suggestions.
5 changes: 5 additions & 0 deletions .changeset/interpolated-names-and-conditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Interpolations in property names (`padding-${side}: 4px;`), at-rule conditions (`@media screen and ${query} {`), selectors (`&.${className}:hover {`), and keyframe percentages (`${step}% {`) no longer report false errors, including when a nearby comment or string holds a `;` or `{`, or a comment sits before the `{` or `:`. 1.0.1 reported these errors as well.
5 changes: 5 additions & 0 deletions .changeset/javascript-escapes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Templates are checked as the CSS styled-components actually receives, with JavaScript escapes such as `\"`, `\n`, and `\x41` read as the characters they stand for. Escapes in strings, names, and `url()` no longer report false errors, and an error on an escaped name underlines the whole escape. 1.0.1 reported these errors as well.
5 changes: 5 additions & 0 deletions .changeset/nested-at-rule-completions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

Typing `@` inside a component now suggests the at-rules that work there, such as `@media`, `@container`, `@layer`, and `@keyframes`, with their documentation.
5 changes: 5 additions & 0 deletions .changeset/nested-layer-declarations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

A `@layer` block with declarations directly inside a component, such as `@layer utilities { color: red; }`, no longer reports a false `{ expected`. A component and a global style with the same text no longer share results.
7 changes: 7 additions & 0 deletions .changeset/package-entry-points-and-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@styled/typescript-styled-plugin': minor
---

`@styled/typescript-styled-plugin/api` is now a public export for both `require()` and `import()`, and the deep `lib/api` imports keep working. It adds types for building configuration by hand and for injecting custom language services. Lint settings accept `unknownAtRules`, and `globalCss` (Pigment CSS) is a default tag. 1.0.1's private underscore-prefixed modules are not included.

Thanks to @usercao for the modernization work most of this release builds on.
5 changes: 5 additions & 0 deletions .changeset/plugin-resilience.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

An unexpected error inside the plugin, or malformed plugin configuration, is logged instead of failing the editor's whole response for the file, so TypeScript's own diagnostics and completions keep working.
5 changes: 5 additions & 0 deletions .changeset/supported-hosts-and-typescript-floor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': minor
---

On TypeScript older than 5.0, the plugin now logs a clear message and leaves the editor's TypeScript features working, instead of crashing on activation.
5 changes: 5 additions & 0 deletions .changeset/value-css-fragments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@styled/typescript-styled-plugin': patch
---

A `css` fragment holding a single value, such as `` css`1px solid red` ``, is checked as a value instead of reporting a false `} expected`, and offers value completions.
11 changes: 7 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
indent_size = 2
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true

[{npm-shrinkwrap.json,package.json}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

17 changes: 0 additions & 17 deletions .eslintrc.js

This file was deleted.

8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# LF in every checkout, whatever core.autocrlf says: the formatter check expects LF, and e2e
# fixtures such as test/e2e/closed-file-project-fixture/unclosed.ts assert exact line and offset
# positions against their bytes.
* text=auto eol=lf

*.gif binary
*.jpg binary
*.png binary
1 change: 1 addition & 0 deletions .github/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24.21.0
35 changes: 35 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Set up Node.js and dependencies
description: Installs Node.js, enables Corepack, restores the Yarn cache, and installs the locked dependencies. Runs after actions/checkout, which has to fetch this file first.

inputs:
node-version:
description: Node.js version to install. Empty reads .github/.node-version, the development version.
required: false
default: ''

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: ${{ inputs.node-version }}
node-version-file: ${{ inputs.node-version == '' && '.github/.node-version' || '' }}
package-manager-cache: false
- name: Enable Corepack
shell: bash
run: corepack enable
- name: Find Yarn cache
id: yarn-cache-dir
shell: bash
run: echo "dir=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Cache Yarn packages
uses: actions/cache@v6
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
shell: bash
run: yarn install --immutable
36 changes: 36 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
# .github/workflows/pullfrog.yml is maintained by the Pullfrog installer, which asks for no
# edits, and pullfrog/pullfrog appears nowhere else. Its actions/checkout pin cannot be
# excluded the same way without also ignoring the checkout the other workflows use.
ignore:
- dependency-name: pullfrog/pullfrog
# Covers the yarn.lock at the root and, through the Yarn workspace it declares, test/e2e's
# own package.json (docs/maintenance.md, project layout).
# No cooldown key: Dependabot's default cooldown for version updates (3 days) already exceeds
# .yarnrc.yml's npmMinimalAgeGate (1440 minutes, one day), so a version Yarn would still hold
# back never gets a Dependabot pull request.
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
groups:
minor-and-patch:
patterns:
- '*'
update-types:
- minor
- patch
# TypeScript versions move only as a deliberate, reviewed change. The plain `typescript`
# dependency (package.json and test/e2e/package.json) compiles the package and runs the
# default e2e pass, so every update to it is ignored here. The e2e matrix's
# `npm:typescript@<version>` aliases in test/e2e/package.json need no entry: Dependabot's
# npm and Yarn parser skips `npm:` alias requirements, so it never proposes updates for them.
ignore:
- dependency-name: typescript
6 changes: 0 additions & 6 deletions .github/needs_more_info.yml

This file was deleted.

Loading