-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5924 from mermaid-js/sidv/autoGenerateShapeDocs
Auto generate shape docs
- Loading branch information
Showing
9 changed files
with
223 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { fileURLToPath } from 'node:url'; | ||
/** @import import { LoadHook } from "node:module"; */ | ||
/** | ||
* @type {LoadHook} | ||
* | ||
* Load hook that short circuits the loading of `.schema.yaml` files with `export default {}`. | ||
* These would normally be loaded using ESBuild, but that doesn't work for these local scripts. | ||
* | ||
* @see https://nodejs.org/api/module.html#loadurl-context-nextload | ||
*/ | ||
export const load = async (url, context, nextLoad) => { | ||
const filePath = url.startsWith('file://') ? fileURLToPath(url) : url; | ||
if (filePath.endsWith('.schema.yaml')) { | ||
return { | ||
format: 'module', | ||
shortCircuit: true, | ||
source: `export default {}`, | ||
}; | ||
} else { | ||
return await nextLoad(url, context); | ||
} | ||
}; |
Oops, something went wrong.