fix: @pwrs/lit-css type import#77
Conversation
🦋 Changeset detectedLatest commit: 52b4f12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis PR updates the import path for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes TypeScript type resolution for downstream consumers by updating Options type-only imports to use the package root export of @pwrs/lit-css instead of an unexported subpath.
Changes:
- Replace
import type { Options } from '@pwrs/lit-css/lit-css'withimport type { Options } from '@pwrs/lit-css'across all plugin/loader packages. - Ensure published packages retain correct type information (e.g.,
cssnanooption typing) without changing runtime behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web-dev-server-plugin-lit-css/web-dev-server-plugin-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/vite-plugin-lit-css/vite-plugin-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/typescript-transform-lit-css/typescript-transform-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/rollup-plugin-lit-css/rollup-plugin-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/parcel-transformer-lit-css/parcel-transformer-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/lit-css-loader/lit-css-loader.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
| packages/esbuild-plugin-lit-css/esbuild-plugin-lit-css.ts | Fix Options type import to use supported @pwrs/lit-css entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@pwrs/lit-css type import@pwrs/lit-css type import
This PR fixes missing types on releases.
Before, the libraries try to import the
@pwrs/lit-css/lit-css, which is not exported by@pwrs/lit-cssas it only export the default (.), making it lose type information.Example:
After fix, it should properly display error as
cssnanois of type boolean.This is purely a Typescript fix, there's no difference in code logic.
Test run:
Summary by CodeRabbit