docs-util: add script to generate events info (#12340)
* docs-util: add script to generate events info * add property and parent name to json
This commit is contained in:
@@ -6,6 +6,7 @@ import { CommonCliOptions } from "../types/index.js"
|
||||
import OasGenerator from "../classes/generators/oas.js"
|
||||
import DmlGenerator from "../classes/generators/dml.js"
|
||||
import RouteExamplesGenerator from "../classes/generators/route-examples.js"
|
||||
import EventsGenerator from "../classes/generators/events.js"
|
||||
|
||||
export default async function runGitChanges({
|
||||
type,
|
||||
@@ -63,5 +64,14 @@ export default async function runGitChanges({
|
||||
await routeExamplesGenerator.run()
|
||||
}
|
||||
|
||||
if (type === "all" || type === "events") {
|
||||
const eventsGenerator = new EventsGenerator({
|
||||
paths: files,
|
||||
...options,
|
||||
})
|
||||
|
||||
await eventsGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${files.length} files.`)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { CommonCliOptions } from "../types/index.js"
|
||||
import { GitManager } from "../classes/helpers/git-manager.js"
|
||||
import DmlGenerator from "../classes/generators/dml.js"
|
||||
import RouteExamplesGenerator from "../classes/generators/route-examples.js"
|
||||
import EventsGenerator from "../classes/generators/events.js"
|
||||
|
||||
export default async function (
|
||||
commitSha: string,
|
||||
@@ -71,5 +72,14 @@ export default async function (
|
||||
await routeExamplesGenerator.run()
|
||||
}
|
||||
|
||||
if (type === "all" || type === "events") {
|
||||
const eventsGenerator = new EventsGenerator({
|
||||
paths: filteredFiles,
|
||||
...options,
|
||||
})
|
||||
|
||||
await eventsGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${filteredFiles.length} files.`)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import OasGenerator from "../classes/generators/oas.js"
|
||||
import { CommonCliOptions } from "../types/index.js"
|
||||
import DmlGenerator from "../classes/generators/dml.js"
|
||||
import RouteExamplesGenerator from "../classes/generators/route-examples.js"
|
||||
import EventsGenerator from "../classes/generators/events.js"
|
||||
|
||||
export default async function ({ type, tag, ...options }: CommonCliOptions) {
|
||||
const gitManager = new GitManager()
|
||||
@@ -69,5 +70,14 @@ export default async function ({ type, tag, ...options }: CommonCliOptions) {
|
||||
await routeExamplesGenerator.run()
|
||||
}
|
||||
|
||||
if (type === "all" || type === "events") {
|
||||
const eventsGenerator = new EventsGenerator({
|
||||
paths: filteredFiles,
|
||||
...options,
|
||||
})
|
||||
|
||||
await eventsGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished generating docs for ${filteredFiles.length} files.`)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import DmlGenerator from "../classes/generators/dml.js"
|
||||
import DocblockGenerator from "../classes/generators/docblock.js"
|
||||
import EventsGenerator from "../classes/generators/events.js"
|
||||
import { Options } from "../classes/generators/index.js"
|
||||
import OasGenerator from "../classes/generators/oas.js"
|
||||
import RouteExamplesGenerator from "../classes/generators/route-examples.js"
|
||||
@@ -47,5 +48,14 @@ export default async function run(
|
||||
await routeExamplesGenerator.run()
|
||||
}
|
||||
|
||||
if (type === "all" || type === "events") {
|
||||
const eventsGenerator = new EventsGenerator({
|
||||
paths,
|
||||
...options,
|
||||
})
|
||||
|
||||
await eventsGenerator.run()
|
||||
}
|
||||
|
||||
console.log(`Finished running.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user