docs: add support for ignoring hooks (#12599)
This commit is contained in:
+2
-58
File diff suppressed because one or more lines are too long
@@ -303,20 +303,39 @@ class WorkflowsPlugin {
|
|||||||
if (stepType === "hook" && "symbol" in initializer.arguments[1]) {
|
if (stepType === "hook" && "symbol" in initializer.arguments[1]) {
|
||||||
// get the hook's name from the first argument
|
// get the hook's name from the first argument
|
||||||
stepId = this.helper.normalizeName(initializer.arguments[0].getText())
|
stepId = this.helper.normalizeName(initializer.arguments[0].getText())
|
||||||
const hookArgumetSymbol = this.getHookArgumentSymbol({
|
const shouldIgnore = ts
|
||||||
argument: initializer.arguments[1],
|
.getJSDocCommentsAndTags(initializer.parent)
|
||||||
constructorFn,
|
.some((comment) => {
|
||||||
})
|
if (!("tags" in comment)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (hookArgumetSymbol) {
|
return comment.tags?.some(
|
||||||
stepReflection = this.assembleHookReflection({
|
(tag) => tag.tagName.getText() === "ignore"
|
||||||
stepId,
|
)
|
||||||
context,
|
|
||||||
inputSymbol: hookArgumetSymbol,
|
|
||||||
workflowName: workflowVarName,
|
|
||||||
workflowComments,
|
|
||||||
workflowReflection: workflowReflection.parent,
|
|
||||||
})
|
})
|
||||||
|
if (stepId === "beforePaymentAuthorization") {
|
||||||
|
console.log(
|
||||||
|
shouldIgnore,
|
||||||
|
ts.getJSDocCommentsAndTags(initializer.parent)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!shouldIgnore) {
|
||||||
|
const hookArgumetSymbol = this.getHookArgumentSymbol({
|
||||||
|
argument: initializer.arguments[1],
|
||||||
|
constructorFn,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (hookArgumetSymbol) {
|
||||||
|
stepReflection = this.assembleHookReflection({
|
||||||
|
stepId,
|
||||||
|
context,
|
||||||
|
inputSymbol: hookArgumetSymbol,
|
||||||
|
workflowName: workflowVarName,
|
||||||
|
workflowComments,
|
||||||
|
workflowReflection: workflowReflection.parent,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const initializerReflection = findReflectionInNamespaces(
|
const initializerReflection = findReflectionInNamespaces(
|
||||||
|
|||||||
Reference in New Issue
Block a user