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,6 +303,24 @@ 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 shouldIgnore = ts
|
||||||
|
.getJSDocCommentsAndTags(initializer.parent)
|
||||||
|
.some((comment) => {
|
||||||
|
if (!("tags" in comment)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return comment.tags?.some(
|
||||||
|
(tag) => tag.tagName.getText() === "ignore"
|
||||||
|
)
|
||||||
|
})
|
||||||
|
if (stepId === "beforePaymentAuthorization") {
|
||||||
|
console.log(
|
||||||
|
shouldIgnore,
|
||||||
|
ts.getJSDocCommentsAndTags(initializer.parent)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (!shouldIgnore) {
|
||||||
const hookArgumetSymbol = this.getHookArgumentSymbol({
|
const hookArgumetSymbol = this.getHookArgumentSymbol({
|
||||||
argument: initializer.arguments[1],
|
argument: initializer.arguments[1],
|
||||||
constructorFn,
|
constructorFn,
|
||||||
@@ -318,6 +336,7 @@ class WorkflowsPlugin {
|
|||||||
workflowReflection: workflowReflection.parent,
|
workflowReflection: workflowReflection.parent,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const initializerReflection = findReflectionInNamespaces(
|
const initializerReflection = findReflectionInNamespaces(
|
||||||
context.project,
|
context.project,
|
||||||
|
|||||||
Reference in New Issue
Block a user