Index

Index

Namespaces

NamespaceDescription
gitUtilities for handling Git repositories.
loggingLogging utilities for Grit workflows.
promptingPrompting 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"
idstring
originalOmit< EntireFile, "variables" >
reason?Maybe< MatchReason >
rewrittenOmit< EntireFile, "content" >
simplifiedtrue

SimpleRewriteWithContent

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

Properties

PropertyTypeDescription
__typename?"Rewrite"-
idstring-
originalOmit< EntireFile, "variables" | "debug" >-
originalContent?Maybe< string >(DEPRECATED) Attach original content to rewrites
reason?Maybe< MatchReason >-
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.

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.

Properties

PropertyTypeDescription
data?Record< string, any >Arbitrary metadata that can be attached to the workflow result.
message?string-
outcome?"failure" | "success" | "skipped"The outcome of the workflow, which will be rendered in the UI.<br />This is a semantic outcome, which means a "failure" can be returned to block a PR from being merged,<br />even if the execution was successful.
successbooleanWhether the workflow execution was successful.

Type Aliases

EnforcementLevel

EnforcementLevel: typeof EnforcementLevel[keyof typeof EnforcementLevel]


FileDiff

FileDiff: {newPath: string; oldPath: undefined; ranges: {after: Range; before: Range;}[];} | {newPath: undefined; oldPath: string; ranges: {after: Range; before: Range;}[];} | {newPath: string; oldPath: string; ranges: {after: Range; before: Range;}[];}

A summary of a file with changed content


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

Variables

EnforcementLevel

const EnforcementLevel: object

Type declaration

MemberType
readonly Error"error"
readonly Info"info"
readonly None"none"
readonly Warn"warn"

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


isEnforcementLevel

isEnforcementLevel(input): input is EnforcementLevel

Parameters

ParameterType
inputany

Returns

input is EnforcementLevel


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