Index

Index

Namespaces

NamespaceDescription
gitUtilities for handling Git repositories.
loggingLogging utilities for Grit workflows.
stdlibExposes the standard library of Grit steps.
utilsMiscellaneous utilities for Grit workflows.
workflowGrit workflow management utilities.

Interfaces

FailedStepResult

A failed step result.

Extends

Properties

PropertyType
__typename?string
message?string
successfalse

LogOptions

Simple logger interface, modeled after Winston

Properties

PropertyType
level"error" | "info" | "warn" | "debug"
messagestring
meta?any
workflowId?string
workflowMetadata?WorkflowIndexedMetadata

RichFile

A file within the repository workspace, found at a specific relative path.

Properties

PropertyType
contentstring
pathstring

SimpleRewrite

A simplified Rewrite that contains less information. This is particularly useful for ensuring workflows don't run out of memory on large repositories.

Properties

PropertyType
__typename?"Rewrite"
ansiSummary?Maybe< string >
idstring
originalOmit< Match, "debug" | "variables" >
reason?Maybe< RewriteReason >
rewrittenOmit< EntireFile, "content" >
simplifiedtrue

SimpleRewriteWithContent

A version of Rewrite that includes the content of the original file.

Properties

PropertyTypeDescription
__typename?"Rewrite"-
ansiSummary?Maybe< string >-
idstring-
originalOmit< Match, "debug" | "variables" >-
originalContent?Maybe< string >Attach original content to rewrites
reason?Maybe< RewriteReason >-
rewrittenEntireFile-

SparseFile

A bare file object with only a file path

Properties

PropertyType
pathstring

StepInputOptions

Options for processing a step within a workflow.

Properties

PropertyTypeDescription
continueOnFailure?booleanIf true, the workflow will automatically continue even if this step fails. Conflicts with unrecoverable.<br /><br />Default<br /><br />false
name?stringThe name of the step. This is used to uniquely identify the step for future analysis. If unset, the name will be inferred from the function name.
paths?string[]The paths that this step will operate on. If unset, the step will operate on all paths passed to the workflow.
title?stringThe title of the step. This is used to display the step in the UI. If unset, the title will be inferred from the function name.
unrecoverable?booleanIf true, the workflow will always terminate if this step fails. Conflicts with continueOnFailure.<br /><br />Default<br /><br />false

StepResult

The result of executing a step. Most steps will return a more specific type than this.

Extended By

Properties

PropertyType
__typename?string
message?string
successboolean

StepResultWithTitle

A step result, that also includes the title of the step. Note: the title is not always available and is usually injected after it begins executing.

Extends

Properties

PropertyType
__typename?string
message?string
stepTitle?string
successboolean

WorkflowOptions

Base options for invoking a workflow. These are the options that are passed to the workflow function itself.

Extended By

Properties

PropertyTypeDescription
pathsstring[]The paths that this workflow will operate on.<br /><br />Todo<br /><br />This should be a list of glob patterns.

WorkflowResult

The final result of a executing workflow.

Extended By

Properties

PropertyType
message?string
successboolean

Type Aliases

FilePath

FilePath: string

Alias for a file path.


LogLevel

LogLevel: typeof LOG_LEVELS[number]

One of the predefined log levels: debug, info, error, warn


RewriteLike

RewriteLike: Rewrite | SimpleRewrite | SimpleRewriteWithContent

Functions

isApplyResult

isApplyResult(result): result is ApplyResult

Parameters

ParameterType
resultStepResult

Returns

result is ApplyResult


isConfigFileResult

isConfigFileResult(result): result is ConfigFileResult

Parameters

ParameterType
resultStepResult

Returns

result is ConfigFileResult


isCopyDirResult

isCopyDirResult(result): result is CopyDirResult

Parameters

ParameterType
resultStepResult

Returns

result is CopyDirResult


isHasPathsWithErrorsResult

isHasPathsWithErrorsResult(result): result is HasPathsWithErrorsResult

Parameters

ParameterType
resultStepResult

Returns

result is HasPathsWithErrorsResult


isPathExistsResult

isPathExistsResult(result): result is PathExistsResult

Parameters

ParameterType
resultStepResult

Returns

result is PathExistsResult


isPathStepResult

isPathStepResult(result): result is PathStepResult

Parameters

ParameterType
resultStepResult

Returns

result is PathStepResult


isReadFileResult

isReadFileResult(result): result is ReadFileResult

Parameters

ParameterType
resultStepResult

Returns

result is ReadFileResult


isRenameResult

isRenameResult(result): result is RenameResult

Parameters

ParameterType
resultStepResult

Returns

result is RenameResult


isResolverResult

isResolverResult(result): result is ResolverResult

Parameters

ParameterType
resultStepResult

Returns

result is ResolverResult


isRichFile

isRichFile(file): file is RichFile

Type guard for RichFile

Parameters

ParameterType
fileany

Returns

file is RichFile


isShResult

isShResult(res): res is ShResult

Parameters

ParameterType
resStepResult

Returns

res is ShResult


isSimpleGuessResult

isSimpleGuessResult(r): r is SimpleGuessResult

Parameters

ParameterType
rStepResult

Returns

r is SimpleGuessResult


isStepResult

isStepResult(result): result is StepResult

Type guard for StepResult

Parameters

ParameterType
resultany

Returns

result is StepResult


isWorkflowContextResult

isWorkflowContextResult(result): result is WorkflowContextResult

Parameters

ParameterType
resultStepResult

Returns

result is WorkflowContextResult


isWorkflowIndexedMetadata

isWorkflowIndexedMetadata(obj): obj is WorkflowIndexedMetadata

Parameters

ParameterType
objany

Returns

obj is WorkflowIndexedMetadata


isWorkflowResult

isWorkflowResult(result): result is WorkflowResult

Type guard for WorkflowResult

Parameters

ParameterType
resultany

Returns

result is WorkflowResult


Generated using TypeDoc and typedoc-plugin-markdown