docs: support version in events reference (#12422)
* docs: support version in events reference * remove changes in events output * remove events emitted in comments * remove customer updated event * check for emitEventStep usage * fixes
This commit is contained in:
@@ -124,8 +124,18 @@ class EventsKindGenerator extends DefaultKindGenerator<ts.VariableDeclaration> {
|
||||
}
|
||||
|
||||
this.workflows[workflowName] = workflowFile
|
||||
if (workflowFile.includes("emitEventStep")) {
|
||||
this.workflowsEmittingEvents[workflowName] = workflowFile
|
||||
// remove comments in case the emitEventStep is commented out
|
||||
const workflowWithoutComments = workflowFile.replace(
|
||||
/\/\*[\s\S]*?\*\/|\/\/.*/g,
|
||||
""
|
||||
)
|
||||
// the emitEventStep should be mentioned at least twice in the workflow
|
||||
// including the import statement
|
||||
const emitEventStepCount = (
|
||||
workflowWithoutComments.match(/emitEventStep/g) || []
|
||||
).length
|
||||
if (emitEventStepCount >= 2) {
|
||||
this.workflowsEmittingEvents[workflowName] = workflowWithoutComments
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user