docs: refactor medusa workflows reference (#8692)

* docs: fix handling of namespaces in core flows under definitions directory

* change nested handling

* docs-util: expand workflows under definitions in workflows reference

* remove check for definitions
This commit is contained in:
Shahed Nasser
2024-08-22 13:39:52 +03:00
committed by GitHub
parent 4219674ead
commit 0acd94aac3
5 changed files with 126 additions and 67 deletions
@@ -39,10 +39,15 @@ const getGitEditDatesOfPaths = async (
// date doesn't accurately represent the publish date of the file.
const getOsLastEditDates = async (
paths: string[]
): Promise<Record<string, string>> => {
const editDates: Record<string, string> = {}
): Promise<Record<string, string | undefined>> => {
const editDates: Record<string, string | undefined> = {}
await Promise.all(
paths.map(async (filePath) => {
if (!existsSync(filePath)) {
// indicates that file was deleted
editDates[filePath] = undefined
return
}
const fileStat = await stat(filePath)
editDates[filePath] = fileStat.mtime.toISOString()
@@ -117,7 +122,7 @@ export const generateEditedDates = async () => {
const type = generatedFileExists ? "git" : "all"
let files: string[] = []
let editDates: Record<string, string> = {}
let editDates: Record<string, string | undefined> = {}
if (type === "all") {
// get all files in a project
@@ -144,6 +149,11 @@ export const generateEditedDates = async () => {
)
editDates = Object.assign(existingEditDates, editDates)
// delete items that don't exist anymore (their value is undefined)
Object.keys(editDates)
.filter((key) => editDates[key] === undefined)
.forEach((key) => delete editDates[key])
}
await writeFile(