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:
Shahed Nasser
2025-05-09 14:34:15 +03:00
committed by GitHub
parent 091041f2da
commit e09b2a4db5
24 changed files with 91 additions and 636 deletions

View File

@@ -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
}
}
}