string Version { get; }
Source
Gets the canonical stable Tailwind version.
Classifies Tailwind standard-error output for host-specific logging.
Builds process invocations for Tailwind CLI binaries and Windows shell shims.
npm-installed Tailwind commands on Windows may be .cmd
, .bat
, or .ps1
wrapper scripts instead of native executables. Use this builder after resolving a concrete Tailwind path so callers get the platform-specific launcher and argument order without duplicating shell rules. Pass unquoted paths and arguments; CliWrap performs process argument escaping when the invocation is executed.
TailwindProcessInvocation Build(string tailwindPath, IReadOnlyList<string> tailwindArgs, Func<OSPlatform, bool>? isOsPlatform = null)
Creates the process filename and argument list needed to launch Tailwind on the current platform.
tailwindPath
tailwindArgs
isOsPlatform
RuntimeInformation.IsOSPlatform
.
A TailwindProcessInvocation
that invokes binaries directly on Unix-like platforms and wraps .cmd
/ .bat
/ .ps1
scripts on Windows.
ArgumentException
tailwindPath
is blank.ArgumentNullException
tailwindPath
or tailwindArgs
is null
.Executes Tailwind CLI processes with bounded output capture.
Task<TailwindCommandResult> ExecuteAsync(string fileName, IReadOnlyList<string> args, string workingDirectory, Action<string>? stdoutLine, Action<string, TailwindOutputLevel>? stderrLine, int captureLimit, CancellationToken cancellationToken)
Executes a Tailwind process, streams complete stdout and stderr lines, and captures bounded output tails.
fileName
args
workingDirectory
stdoutLine
stderrLine
captureLimit
0
disables capture.cancellationToken
The process exit code plus captured stdout and stderr tails. Callbacks may receive more output than is retained in the result when the process writes more than captureLimit
characters.
OperationCanceledException
cancellationToken
is canceled.TailwindProcessStartException
Describes the executable and ordered argument list used to launch Tailwind.
FileName
Arguments
FileName
.Maps build hosts to Tailwind runtime identifiers and binary names.
string GetCurrentRid(Func<OSPlatform, bool>? isOsPlatform = null, Func<Architecture>? processArchitecture = null)
Resolves the Tailwind runtime identifier for the current build host.
isOsPlatform
RuntimeInformation.IsOSPlatform
.processArchitecture
RuntimeInformation.ProcessArchitecture
.
A supported Tailwind RID such as win-x64
, linux-arm64
, or osx-arm64
; otherwise unknown
when the platform or architecture is not mapped. This method does not throw for unsupported hosts.
string ResolveRid(OSPlatform osPlatform, Architecture architecture)
Maps an operating system and processor architecture pair to the Tailwind runtime package RID.
osPlatform
architecture
A supported Tailwind RID such as win-x64
, linux-x64
, linux-arm64
, osx-x64
, or osx-arm64
; otherwise unknown
for unsupported combinations.
Windows Arm64 intentionally maps to win-x64
because Tailwind does not publish a Windows Arm64 standalone binary for the pinned version. That relies on Windows x64 emulation; callers that cannot use emulation should provide an explicit CLI path instead of a packaged runtime.
string? GetRuntimeBinaryName(string rid)
Gets the packaged Tailwind binary file name for a supported runtime identifier.
rid
win-x64
, osx-arm64
, osx-x64
, linux-arm64
, or linux-x64
.
The runtime package binary file name for rid
, or null
when no mapping exists. Unknown RIDs do not throw so callers can emit stable diagnostics.
string GetLocalBinaryName(Func<OSPlatform, bool>? isOsPlatform = null)
Gets the conventional project-local Tailwind executable name for the current platform.
isOsPlatform
RuntimeInformation.IsOSPlatform
.
tailwindcss.exe
on Windows and tailwindcss
on non-Windows hosts.
This helper is used only for project-local fallback probing. Package runtime probing should use GetRuntimeBinaryName
because packaged binaries include platform-specific suffixes.
Describes one checked-in Tailwind standalone CLI release.
The manifest is packaged with the main Tailwind package and is the authenticity anchor for downloaded executables. The release-provided sha256sums.txt
is checked as an audit signal, but it cannot be the sole source of trust because it is downloaded from the same location as the executable.
TailwindReleaseManifest LoadFromFile(string path)
Reads and validates a manifest from a packed targets directory or source tree.
path
The validated release manifest.
TailwindReleaseManifest LoadEmbedded(Assembly assembly)
Reads the manifest embedded in the runtime web assembly for development watch mode.
assembly
tailwind.release.json
.The validated release manifest.
TailwindReleaseManifest Parse(Stream stream)
Parses and validates a release manifest stream.
stream
The validated release manifest.
TailwindReleaseAsset GetAsset(string rid)
Gets the pinned asset metadata for a mapped host RID.
rid
The release asset.
bool IsCanonicalStableVersion(string? version)
Determines whether a value is the allowed canonical Tailwind version form.
version
null
.
true
when version
is a stable major.minor.patch
value without leading zeroes, whitespace, or integer overflow; otherwise, false
.
string Version { get; }
Source
Gets the canonical stable Tailwind version.
Uri BaseUri { get; }
Source
Gets the official release directory containing the binary assets.
Represents one trusted Tailwind release asset.
Rid
BinaryName
Sha256
Describes a resolved executable and how it was obtained.
Path
Rid
explicit
for an override.Version
explicit
for an override.CacheState
Represents a resolver failure that callers can map to stable build or watch diagnostics.
TailwindCliResolutionFailure Failure { get; }
Source
Gets the stable failure classification.
string? Rid { get; }
Source
Gets the affected host RID, when known.
string? Version { get; }
Source
Gets the affected Tailwind version, when known.
Defines stable Tailwind build diagnostic codes and help text.
string GetAcquisitionFailureClassification(TailwindCliResolutionFailure failure)
Gets the documented stable, kebab-case classification for an acquisition failure.
failure
The finite classification documented for AcquisitionFailed
.
string Format(string code, string problem, string cause, string fix)
Formats a stable Tailwind diagnostic message.
code
ASTW###
diagnostic code.problem
cause
Cause:
label.fix
Fix:
label.
A single-line diagnostic containing the code, problem, cause, fix, and HelpUrl
reference. Inputs are expected to be non-empty caller-supplied message fragments.
Represents a Tailwind process startup failure.
string FileName { get; }
Source
Gets the Tailwind executable or shell launcher that failed to start.
Resolves the shared Tailwind standalone CLI download cache used by build and watch resolution.
string? GetDefaultRoot(Func<string, string?>? getEnvironmentVariable = null)
Gets the default shared cache root for the current user.
getEnvironmentVariable
A user-level cache directory when one can be derived from the environment; otherwise null
.
The main package stores one verified executable per Tailwind version and build-host RID in this user-level cache. Keeping it outside a repository avoids one full download per Git worktree while callers can still override the root through MSBuild's TailwindDownloadCacheRoot
property.
string GetRuntimeBinaryPath(string cacheRoot, string tailwindVersion, string rid, string runtimeBinaryName)
Gets the cached runtime binary path for a Tailwind version and host runtime identifier.
cacheRoot
tailwindVersion
rid
runtimeBinaryName
The expected cache path for the binary.
Resolves one verified Tailwind executable for the current build host.
This internal linked-source service is compiled into both the MSBuild task and the web assembly. It owns cache identity, manifest validation, acquisition, hash verification, and cancellation. Callers retain their distinct process policies: build never searches PATH
, while development watch may do so only after a no-override resolver failure.
Task<TailwindResolvedCli> ResolveAsync(TailwindCliResolverOptions options, CancellationToken cancellationToken)
Resolves an explicit override or a cache-backed executable for the current build host.
options
cancellationToken
The resolved executable path and provenance.
TailwindResolvedCli ResolveExplicitPath(string explicitCliPath, string baseDirectory)
Resolves one trusted explicit CLI path without loading a manifest or touching the host cache.
explicitCliPath
baseDirectory
The validated explicit CLI path.
Contains one build or watch resolver request.
ExplicitCliPath
ExplicitPathBaseDirectory
CacheRoot
TailwindVersion
RidOverride
Represents the completed result of a Tailwind CLI process.
ExitCode
Stdout
Stderr
Identifies the source of a resolved Tailwind executable.
Classifies a deterministic Tailwind CLI resolution failure.
Represents the host-neutral severity used for Tailwind CLI output.