AppSurface Search
API Reference

Internal

Type

TailwindStderrClassifier

Source

Classifies Tailwind standard-error output for host-specific logging.

Type

TailwindInvocationBuilder

Source

Builds process invocations for Tailwind CLI binaries and Windows shell shims.

Remarks

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.

Method

Build

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.

Parameters

  • tailwindPath
    The resolved Tailwind executable or known Windows shim path. The value must be non-empty and should not be quoted.
  • tailwindArgs
    The ordered Tailwind arguments to append after any shell-wrapper arguments.
  • isOsPlatform
    Optional platform predicate used by tests; defaults to RuntimeInformation.IsOSPlatform .

Returns

A TailwindProcessInvocation that invokes binaries directly on Unix-like platforms and wraps .cmd / .bat / .ps1 scripts on Windows.

Exceptions

  • ArgumentException
    Thrown when tailwindPath is blank.
  • ArgumentNullException
    Thrown when tailwindPath or tailwindArgs is null .
Type

TailwindProcessRunner

Source

Executes Tailwind CLI processes with bounded output capture.

Method

ExecuteAsync

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.

Parameters

  • fileName
    The executable or shell launcher to start.
  • args
    The ordered process arguments. Values should be unquoted; CliWrap handles escaping.
  • workingDirectory
    The process working directory used for relative Tailwind paths.
  • stdoutLine
    Optional callback invoked for each complete stdout line.
  • stderrLine
    Optional callback invoked for each complete stderr line with its classified severity.
  • captureLimit
    Maximum characters retained from stdout and stderr independently; 0 disables capture.
  • cancellationToken
    Cancellation token that terminates the child process when canceled.

Returns

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.

Exceptions

  • OperationCanceledException
    Thrown when cancellationToken is canceled.
  • TailwindProcessStartException
    Thrown when the operating system or CliWrap cannot start the process.
Type

TailwindProcessInvocation

Source

Describes the executable and ordered argument list used to launch Tailwind.

Parameters

  • FileName
    The executable or launcher to start.
  • Arguments
    The complete ordered argument list passed to FileName .
Type

TailwindRuntimeMap

Source

Maps build hosts to Tailwind runtime identifiers and binary names.

Method

GetCurrentRid

string GetCurrentRid(Func<OSPlatform, bool>? isOsPlatform = null, Func<Architecture>? processArchitecture = null)

Resolves the Tailwind runtime identifier for the current build host.

Parameters

  • isOsPlatform
    Optional platform predicate for tests; defaults to RuntimeInformation.IsOSPlatform .
  • processArchitecture
    Optional architecture provider for tests; defaults to RuntimeInformation.ProcessArchitecture .

Returns

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.

Method

ResolveRid

string ResolveRid(OSPlatform osPlatform, Architecture architecture)

Maps an operating system and processor architecture pair to the Tailwind runtime package RID.

Parameters

  • osPlatform
    The detected or test-supplied operating system platform.
  • architecture
    The detected or test-supplied process architecture.

Returns

A supported Tailwind RID such as win-x64 , linux-x64 , linux-arm64 , osx-x64 , or osx-arm64 ; otherwise unknown for unsupported combinations.

Remarks

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.

Method

GetRuntimeBinaryName

string? GetRuntimeBinaryName(string rid)

Gets the packaged Tailwind binary file name for a supported runtime identifier.

Parameters

  • rid
    The Tailwind runtime identifier, such as win-x64 , osx-arm64 , osx-x64 , linux-arm64 , or linux-x64 .

Returns

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.

Method

GetLocalBinaryName

string GetLocalBinaryName(Func<OSPlatform, bool>? isOsPlatform = null)

Gets the conventional project-local Tailwind executable name for the current platform.

Parameters

  • isOsPlatform
    Optional platform predicate for tests; defaults to RuntimeInformation.IsOSPlatform .

Returns

tailwindcss.exe on Windows and tailwindcss on non-Windows hosts.

Remarks

This helper is used only for project-local fallback probing. Package runtime probing should use GetRuntimeBinaryName because packaged binaries include platform-specific suffixes.

Type

TailwindReleaseManifest

Source

Describes one checked-in Tailwind standalone CLI release.

Remarks

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.

Method

LoadFromFile

TailwindReleaseManifest LoadFromFile(string path)

Reads and validates a manifest from a packed targets directory or source tree.

Parameters

  • path
    The manifest file path.

Returns

The validated release manifest.

Method

LoadEmbedded

TailwindReleaseManifest LoadEmbedded(Assembly assembly)

Reads the manifest embedded in the runtime web assembly for development watch mode.

Parameters

  • assembly
    The assembly that embeds tailwind.release.json .

Returns

The validated release manifest.

Method

Parse

TailwindReleaseManifest Parse(Stream stream)

Parses and validates a release manifest stream.

Parameters

  • stream
    The JSON stream to parse.

Returns

The validated release manifest.

Method

GetAsset

TailwindReleaseAsset GetAsset(string rid)

Gets the pinned asset metadata for a mapped host RID.

Parameters

  • rid
    The current build host RID.

Returns

The release asset.

Method

IsCanonicalStableVersion

bool IsCanonicalStableVersion(string? version)

Determines whether a value is the allowed canonical Tailwind version form.

Parameters

  • version
    The candidate version, or null .

Returns

true when version is a stable major.minor.patch value without leading zeroes, whitespace, or integer overflow; otherwise, false .

Property

Version

string Version { get; } Source

Gets the canonical stable Tailwind version.

Property

BaseUri

Uri BaseUri { get; } Source

Gets the official release directory containing the binary assets.

Type

TailwindReleaseAsset

Source

Represents one trusted Tailwind release asset.

Parameters

  • Rid
    The build-host runtime identifier.
  • BinaryName
    The standalone executable file name.
  • Sha256
    The package-pinned lowercase SHA-256 digest.
Type

TailwindResolvedCli

Source

Describes a resolved executable and how it was obtained.

Parameters

  • Path
    The absolute executable path.
  • Rid
    The selected host RID, or explicit for an override.
  • Version
    The selected Tailwind version, or explicit for an override.
  • CacheState
    Whether the executable was explicit, reused, or acquired.
Type

TailwindCliResolutionException

Source

Represents a resolver failure that callers can map to stable build or watch diagnostics.

Property

Failure

TailwindCliResolutionFailure Failure { get; } Source

Gets the stable failure classification.

Property

Rid

string? Rid { get; } Source

Gets the affected host RID, when known.

Property

Version

string? Version { get; } Source

Gets the affected Tailwind version, when known.

Type

TailwindDiagnostics

Source

Defines stable Tailwind build diagnostic codes and help text.

Method

GetAcquisitionFailureClassification

string GetAcquisitionFailureClassification(TailwindCliResolutionFailure failure)

Gets the documented stable, kebab-case classification for an acquisition failure.

Parameters

  • failure
    The resolver failure to render.

Returns

The finite classification documented for AcquisitionFailed .

Method

Format

string Format(string code, string problem, string cause, string fix)

Formats a stable Tailwind diagnostic message.

Parameters

  • code
    The ASTW### diagnostic code.
  • problem
    A short description of what failed.
  • cause
    The likely cause to show after the Cause: label.
  • fix
    The recommended action to show after the Fix: label.

Returns

A single-line diagnostic containing the code, problem, cause, fix, and HelpUrl reference. Inputs are expected to be non-empty caller-supplied message fragments.

Type

TailwindProcessStartException

Source

Represents a Tailwind process startup failure.

Property

FileName

string FileName { get; } Source

Gets the Tailwind executable or shell launcher that failed to start.

Type

TailwindDownloadCache

Source

Resolves the shared Tailwind standalone CLI download cache used by build and watch resolution.

Method

GetDefaultRoot

string? GetDefaultRoot(Func<string, string?>? getEnvironmentVariable = null)

Gets the default shared cache root for the current user.

Parameters

  • getEnvironmentVariable
    Optional environment lookup used by tests.

Returns

A user-level cache directory when one can be derived from the environment; otherwise null .

Remarks

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.

Method

GetRuntimeBinaryPath

string GetRuntimeBinaryPath(string cacheRoot, string tailwindVersion, string rid, string runtimeBinaryName)

Gets the cached runtime binary path for a Tailwind version and host runtime identifier.

Parameters

  • cacheRoot
    The configured or default cache root.
  • tailwindVersion
    The Tailwind standalone CLI version.
  • rid
    The Tailwind runtime identifier.
  • runtimeBinaryName
    The RID-specific standalone binary file name.

Returns

The expected cache path for the binary.

Type

TailwindCliResolver

Source

Resolves one verified Tailwind executable for the current build host.

Remarks

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.

Method

ResolveAsync

Task<TailwindResolvedCli> ResolveAsync(TailwindCliResolverOptions options, CancellationToken cancellationToken)

Resolves an explicit override or a cache-backed executable for the current build host.

Parameters

  • options
    Resolution inputs from build or watch policy.
  • cancellationToken
    Cancellation for lock waiting, downloads, and writes.

Returns

The resolved executable path and provenance.

Method

ResolveExplicitPath

TailwindResolvedCli ResolveExplicitPath(string explicitCliPath, string baseDirectory)

Resolves one trusted explicit CLI path without loading a manifest or touching the host cache.

Parameters

  • explicitCliPath
    The configured absolute or base-directory-relative CLI path.
  • baseDirectory
    The base directory for a relative explicit path.

Returns

The validated explicit CLI path.

Type

TailwindCliResolverOptions

Source

Contains one build or watch resolver request.

Parameters

  • ExplicitCliPath
    An optional explicit executable path.
  • ExplicitPathBaseDirectory
    The directory used to resolve relative explicit paths.
  • CacheRoot
    An optional configured cache root.
  • TailwindVersion
    The version supplied by the package targets.
  • RidOverride
    An internal test-only host RID override.
Type

TailwindCommandResult

Source

Represents the completed result of a Tailwind CLI process.

Parameters

  • ExitCode
    The process exit code returned by the Tailwind CLI.
  • Stdout
    The captured standard-output tail, bounded by the caller's capture limit.
  • Stderr
    The captured standard-error tail, bounded by the caller's capture limit.
Enum

TailwindCliCacheState

Source

Identifies the source of a resolved Tailwind executable.

Enum

TailwindCliResolutionFailure

Source

Classifies a deterministic Tailwind CLI resolution failure.

Enum

TailwindOutputLevel

Source

Represents the host-neutral severity used for Tailwind CLI output.