AppSurface Search
API Reference

Internal

Type

TailwindProcessInvocation

Source

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

Parameters

  • FileNameThe executable or launcher to start.
  • ArgumentsThe 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) Source

Resolves the Tailwind runtime identifier for the current build host.

Parameters

  • isOsPlatformOptional platform predicate for tests; defaults to RuntimeInformation.IsOSPlatform.
  • processArchitectureOptional 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) Source

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

Parameters

  • osPlatformThe detected or test-supplied operating system platform.
  • architectureThe 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) Source

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

Parameters

  • ridThe 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) Source

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

Parameters

  • isOsPlatformOptional 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

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) Source

Creates the process filename and argument list needed to launch Tailwind on the current platform.

Parameters

  • tailwindPathThe resolved Tailwind executable or known Windows shim path. The value must be non-empty and should not be quoted.
  • tailwindArgsThe ordered Tailwind arguments to append after any shell-wrapper arguments.
  • isOsPlatformOptional 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

  • ArgumentExceptionThrown when tailwindPath is blank.
  • ArgumentNullExceptionThrown when tailwindPath or tailwindArgs is null.
Type

TailwindStderrClassifier

Source

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

Type

TailwindDiagnostics

Source

Defines stable Tailwind build diagnostic codes and help text.

Method

Format

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

Formats a stable Tailwind diagnostic message.

Parameters

  • codeThe ASTW### diagnostic code.
  • problemA short description of what failed.
  • causeThe likely cause to show after the Cause: label.
  • fixThe 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

TailwindCommandResult

Source

Represents the completed result of a Tailwind CLI process.

Parameters

  • ExitCodeThe process exit code returned by the Tailwind CLI.
  • StdoutThe captured standard-output tail, bounded by the caller's capture limit.
  • StderrThe captured standard-error tail, bounded by the caller's capture limit.
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

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) Source

Executes a Tailwind process, streams complete stdout and stderr lines, and captures bounded output tails.

Parameters

  • fileNameThe executable or shell launcher to start.
  • argsThe ordered process arguments. Values should be unquoted; CliWrap handles escaping.
  • workingDirectoryThe process working directory used for relative Tailwind paths.
  • stdoutLineOptional callback invoked for each complete stdout line.
  • stderrLineOptional callback invoked for each complete stderr line with its classified severity.
  • captureLimitMaximum characters retained from stdout and stderr independently; 0 disables capture.
  • cancellationTokenCancellation 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

  • OperationCanceledExceptionThrown when cancellationToken is canceled.
  • TailwindProcessStartExceptionThrown when the operating system or CliWrap cannot start the process.
Enum

TailwindOutputLevel

Source

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

Type

TailwindDownloadCache

Source

Resolves the shared Tailwind standalone CLI download cache used by source-tree runtime builds.

Method

GetDefaultRoot

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

Gets the default shared cache root for the current user.

Parameters

  • getEnvironmentVariableOptional environment lookup used by tests.

Returns

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

Remarks

Source-tree runtime projects download Tailwind executables before they are packed into runtime packages. Keeping that cache under a user-level location avoids one full copy per Git worktree while still allowing callers to override the root through MSBuild's TailwindDownloadCacheRoot property.

Method

GetRuntimeBinaryPath

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

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

Parameters

  • cacheRootThe configured or default cache root.
  • tailwindVersionThe Tailwind standalone CLI version.
  • ridThe Tailwind runtime identifier.
  • runtimeBinaryNameThe RID-specific standalone binary file name.

Returns

The expected cache path for the binary.