Skip to content

fix: @pwrs/lit-css type import#77

Merged
bennypowers merged 2 commits into
bennypowers:mainfrom
ryansuhartanto:main
Mar 5, 2026
Merged

fix: @pwrs/lit-css type import#77
bennypowers merged 2 commits into
bennypowers:mainfrom
ryansuhartanto:main

Conversation

@ryansuhartanto

@ryansuhartanto ryansuhartanto commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

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-css as it only export the default (.), making it lose type information.

Example:

import { litCSS } from "@pwrs/vite-plugin-lit-css";
//...

  plugins: [
    litCSS({
      cssnano: void, // this has no type information, no error reported by Typescript
      include: ["**/*.css"],
    }),
  ],

//...

After fix, it should properly display error as cssnano is of type boolean.

This is purely a Typescript fix, there's no difference in code logic.

Test run:

  total:     57
  passing:   57
  duration:  32.5s

Summary by CodeRabbit

  • Chores
    • Updated type import sources across several Lit CSS tooling packages to standardize internal module references. This is a non-functional change affecting only type-resolution; there are no runtime or public API changes and no impact on end-user behavior.

Copilot AI review requested due to automatic review settings March 5, 2026 00:58
@changeset-bot

changeset-bot Bot commented Mar 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 52b4f12

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
web-dev-server-plugin-lit-css Patch
typescript-transform-lit-css Patch
parcel-transformer-lit-css Patch
esbuild-plugin-lit-css Patch
rollup-plugin-lit-css Patch
@pwrs/vite-plugin-lit-css Patch
lit-css-loader Patch

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

@coderabbitai

coderabbitai Bot commented Mar 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR updates the import path for the Options type across seven plugin packages, changing from @pwrs/lit-css/lit-css to @pwrs/lit-css. These are purely type import path adjustments with no runtime behavior or public API signature modifications.

Changes

Cohort / File(s) Summary
Import Path Consolidation
packages/esbuild-plugin-lit-css/esbuild-plugin-lit-css.ts, packages/lit-css-loader/lit-css-loader.ts, packages/parcel-transformer-lit-css/parcel-transformer-lit-css.ts, packages/rollup-plugin-lit-css/rollup-plugin-lit-css.ts, packages/typescript-transform-lit-css/typescript-transform-lit-css.ts, packages/vite-plugin-lit-css/vite-plugin-lit-css.ts, packages/web-dev-server-plugin-lit-css/web-dev-server-plugin-lit-css.ts
Updated Options type import path from @pwrs/lit-css/lit-css to @pwrs/lit-css across all plugin packages. No behavioral or public interface changes.
Release Notes
.changeset/cozy-candles-learn.md
Added patch changeset summarizing the type-import fix for multiple packages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇✨ I hopped through files with nimble feet,
Shortened paths so types can meet,
No runtime fuss, no logic torn,
Just tidy hops at early morn. 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'fix: @pwrs/lit-css type import' directly and clearly summarizes the main change: fixing type imports from @pwrs/lit-css/lit-css to @pwrs/lit-css across multiple packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' with import type { Options } from '@pwrs/lit-css' across all plugin/loader packages.
  • Ensure published packages retain correct type information (e.g., cssnano option 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.

@bennypowers bennypowers changed the title Fix @pwrs/lit-css type import fix: @pwrs/lit-css type import Mar 5, 2026

@bennypowers bennypowers left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@bennypowers
bennypowers merged commit 2ced312 into bennypowers:main Mar 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants