Skip to content

Ignore the standalone CLI#20139

Merged
RobinMalfait merged 4 commits into
mainfrom
fix/issue-20134
Jun 2, 2026
Merged

Ignore the standalone CLI#20139
RobinMalfait merged 4 commits into
mainfrom
fix/issue-20134

Conversation

@RobinMalfait

Copy link
Copy Markdown
Member

This PR fixes an issue where if you use the standalone CLI, and you move the standalone CLI into the current project, then we would scan that standalone CLI as-if it contains Tailwind CSS classes. Since the CLI contains actual Tailwind CSS classes, and is in fact readable text, this binary would've been used as a source.

There are a few ways of fixing this, we could hardcode all the known names, but that would result in an issue if you rename the CLI. We could check whether it's a binary format and look for magic numbers at the top. We could also check for a shebang at the top of the file and skip it that way.

While some of these solutions might still be useful for the future. For now I fixed it by essentially always ignoring process.execPath. That way we never ever scan the actual executable regardless of whether you renamed it or not.

Fixes: #20134

Test plan

  • Added an integration tests
  • Works on every OS [ci-all]

@RobinMalfait RobinMalfait requested a review from a team as a code owner June 2, 2026 10:17
@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The change is a small, well-scoped fix that adds a single negated exclusion entry; the integration test directly validates the targeted behavior.

The fix is minimal and correct: process.execPath reliably identifies the running binary on all platforms, the negated entry is applied in every code path that constructs a Scanner, and the new integration test exercises the exact failure scenario being addressed. No existing behavior is altered for users of the Node.js-based CLI.

No files require special attention.

Reviews (3): Last reviewed commit: "use windows binary directly" | Re-trigger Greptile

Comment thread packages/@tailwindcss-cli/src/commands/build/index.ts Outdated
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2ee8e3bb-5f37-44d7-b2f9-a826285d2d74

📥 Commits

Reviewing files that changed from the base of the PR and between 53000f4 and 2d1e160.

📒 Files selected for processing (1)
  • integrations/cli/standalone.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • integrations/cli/standalone.test.ts

Walkthrough

The change excludes the running executable (process.execPath) from the scanner's source patterns by adding a negated source entry. A test copies the standalone CLI binary into the test workspace, runs it to produce CSS, and asserts the output contains no candidate utilities. CHANGELOG.md documents the fix.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Ignore the standalone CLI' directly and specifically describes the main change—excluding the standalone Tailwind CLI executable from being scanned for class candidates.
Description check ✅ Passed The description explains the problem, solution approach, and testing added; it relates directly to the changeset addressing the issue of the CLI scanning itself.
Linked Issues check ✅ Passed The changes in this PR directly address issue #20134 by excluding process.execPath from scanning and adding integration tests to validate that the executable is not scanned.
Out of Scope Changes check ✅ Passed All changes are focused on resolving the linked issue: excluding the executable from scanning, updating the CHANGELOG, and adding integration tests.

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


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

@RobinMalfait RobinMalfait merged commit 0c5f8bf into main Jun 2, 2026
23 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-20134 branch June 2, 2026 10:49
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.

Prevent Tailwind CSS executables from detecting themselves as sources

1 participant