Index
Index
Namespaces
Namespace | Description |
---|---|
git | Utilities for handling Git repositories. |
logging | Logging utilities for Grit workflows. |
prompting | Prompting utilities for Grit workflows. |
stdlib | Exposes the standard library of Grit steps. |
utils | Miscellaneous utilities for Grit workflows. |
workflow | Grit workflow management utilities. |
Interfaces
FailedStepResult
A failed step result.
Extends
Properties
Property | Type |
---|---|
__typename ? | string |
message ? | string |
success | false |
LogOptions
Simple logger interface, modeled after Winston
Properties
Property | Type |
---|---|
level | "error" | "info" | "warn" | "debug" |
message | string |
meta ? | any |
workflowId ? | string |
workflowMetadata ? | WorkflowIndexedMetadata |
RichFile
A file within the repository workspace, found at a specific relative path.
Properties
Property | Type |
---|---|
content | string |
path | string |
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
Property | Type |
---|---|
__typename ? | "Rewrite" |
id | string |
original | Omit < EntireFile , "variables" > |
reason ? | Maybe < MatchReason > |
rewritten | Omit < EntireFile , "content" > |
simplified | true |
SimpleRewriteWithContent
A version of Rewrite that includes the content of the original file.
Properties
Property | Type | Description |
---|---|---|
__typename ? | "Rewrite" | - |
id | string | - |
original | Omit < EntireFile , "variables" | "debug" > | - |
originalContent ? | Maybe < string > | Attach original content to rewrites |
reason ? | Maybe < MatchReason > | - |
rewritten | EntireFile | - |
SparseFile
A bare file object with only a file path
Properties
Property | Type |
---|---|
path | string |
StepInputOptions
Options for processing a step within a workflow.
Properties
Property | Type | Description |
---|---|---|
continueOnFailure ? | boolean | If true, the workflow will automatically continue even if this step fails. Conflicts with unrecoverable .<br /><br />Default<br /><br />false |
name ? | string | The 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 ? | string | The 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 ? | boolean | If 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
Property | Type |
---|---|
__typename ? | string |
message ? | string |
success | boolean |
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
Property | Type |
---|---|
__typename ? | string |
message ? | string |
stepTitle ? | string |
success | boolean |
WorkflowOptions
Base options for invoking a workflow. These are the options that are passed to the workflow function itself.
Properties
Property | Type | Description |
---|---|---|
paths | string [] | 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
Property | Type | Description |
---|---|---|
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. |
success | boolean | Whether the workflow execution was successful. |
Type Aliases
EnforcementLevel
EnforcementLevel: typeof
EnforcementLevel
[keyof typeofEnforcementLevel
]
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
Member | Type |
---|---|
readonly Error | "error" |
readonly Info | "info" |
readonly None | "none" |
readonly Warn | "warn" |
Functions
isApplyResult
isApplyResult(
result
):result is ApplyResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is ApplyResult
isConfigFileResult
isConfigFileResult(
result
):result is ConfigFileResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is ConfigFileResult
isCopyDirResult
isCopyDirResult(
result
):result is CopyDirResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is CopyDirResult
isEnforcementLevel
isEnforcementLevel(
input
):input is EnforcementLevel
Parameters
Parameter | Type |
---|---|
input | any |
Returns
input is EnforcementLevel
isHasPathsWithErrorsResult
isHasPathsWithErrorsResult(
result
):result is HasPathsWithErrorsResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is HasPathsWithErrorsResult
isPathExistsResult
isPathExistsResult(
result
):result is PathExistsResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is PathExistsResult
isPathStepResult
isPathStepResult(
result
):result is PathStepResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is PathStepResult
isReadFileResult
isReadFileResult(
result
):result is ReadFileResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is ReadFileResult
isRenameResult
isRenameResult(
result
):result is RenameResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is RenameResult
isResolverResult
isResolverResult(
result
):result is ResolverResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is ResolverResult
isRichFile
isRichFile(
file
):file is RichFile
Type guard for RichFile
Parameters
Parameter | Type |
---|---|
file | any |
Returns
file is RichFile
isShResult
isShResult(
res
):res is ShResult
Parameters
Parameter | Type |
---|---|
res | StepResult |
Returns
res is ShResult
isSimpleGuessResult
isSimpleGuessResult(
r
):r is SimpleGuessResult
Parameters
Parameter | Type |
---|---|
r | StepResult |
Returns
r is SimpleGuessResult
isStepResult
isStepResult(
result
):result is StepResult
Type guard for StepResult
Parameters
Parameter | Type |
---|---|
result | any |
Returns
result is StepResult
isWorkflowContextResult
isWorkflowContextResult(
result
):result is WorkflowContextResult
Parameters
Parameter | Type |
---|---|
result | StepResult |
Returns
result is WorkflowContextResult
isWorkflowIndexedMetadata
isWorkflowIndexedMetadata(
obj
):obj is WorkflowIndexedMetadata
Parameters
Parameter | Type |
---|---|
obj | any |
Returns
obj is WorkflowIndexedMetadata
isWorkflowResult
isWorkflowResult(
result
):result is WorkflowResult
Type guard for WorkflowResult
Parameters
Parameter | Type |
---|---|
result | any |
Returns
result is WorkflowResult
Generated using TypeDoc and typedoc-plugin-markdown