Skip to content

Conversation

@clickCA
Copy link
Contributor

@clickCA clickCA commented Sep 6, 2025

Resolve #1213

  • Move config playwright/index into playwright-ct entry
  • Add new testcase to have css

Copilot AI review requested due to automatic review settings September 6, 2025 05:43
Copy link

Copilot AI left a comment

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 resolves #1213 by restructuring the Playwright Component Testing (CT) plugin configuration to properly handle entry patterns and adds CSS file support.

  • Moves playwright/index.{ts,js} from config patterns to entry patterns in playwright-ct plugin
  • Adds CSS fixture support with a new test case demonstrating CSS file usage
  • Updates test expectations to reflect the additional file being processed

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/knip/src/plugins/playwright-ct/index.ts Moves playwright/index files from config to entry patterns and removes shared entry import
packages/knip/src/plugins/playwright/index.ts Makes entry pattern internal to prevent shared usage
packages/knip/test/plugins/playwright-ct.test.ts Updates test counter to account for additional processed file
packages/knip/fixtures/plugins/playwright-ct/playwright/index.tsx Enables CSS import to test new functionality
packages/knip/fixtures/plugins/playwright-ct/playwright/common.css Adds CSS fixture for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 6, 2025

Open in StackBlitz

npm i https://pkg.pr.new/knip@1252

commit: 3ac4822

Co-authored-by: Copilot <[email protected]>
Copy link
Member

@webpro webpro left a comment

Choose a reason for hiding this comment

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

Thanks, Chanakorn! Let's make this happen.

@@ -1,2 +1,2 @@
// Import styles, initialize component theme here.
// import '../src/common.css';
import './common.css';
Copy link
Member

Choose a reason for hiding this comment

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

Oh interesting this was already here 😅

@@ -1,6 +1,6 @@
import type { IsPluginEnabled, Plugin } from '../../types/config.js';
import { hasDependency } from '../../util/plugin.js';
import { entry, resolveConfig } from '../playwright/index.js';
Copy link
Member

Choose a reason for hiding this comment

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

We could still re-use this entry I guess?


assert.deepEqual(counters, {
...baseCounters,
files: 1,
Copy link
Member

Choose a reason for hiding this comment

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

I would not expect this change. Maybe it's because this fixture does not have a .css compiler installed? What's the file being flagged as unused here?

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.

🐛 knip wont working with playwright-ct plugin

2 participants