dumi
- Version 2.4.13
- Published
- 2.95 MB
- 68 dependencies
- MIT license
Install
npm i dumi
yarn add dumi
pnpm add dumi
Overview
📖 Documentation Generator of React Component
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Namespaces
Variables
variable unistUtilVisit
let unistUtilVisit: any;
Functions
function defineConfig
defineConfig: (config: IDumiUserConfig) => IDumiUserConfig;
function getProjectRoot
getProjectRoot: (cwd: string) => string;
get root dir for monorepo project
Classes
class IDumiTechStack
abstract class IDumiTechStack {}
property name
abstract name: string;
tech stack name, such as 'react'
property runtimeOpts
abstract runtimeOpts?: IDumiTechStackRuntimeOpts;
runtime options
method generateMetadata
abstract generateMetadata: ( asset: ExampleBlockAsset, opts: { type: Parameters<IDumiTechStack['transformCode']>[1]['type']; mdAbsPath: string; fileAbsPath?: string; entryPointCode?: string; }) => Promise<ExampleBlockAsset> | ExampleBlockAsset;
generator for return asset metadata
method generatePreviewerProps
abstract generatePreviewerProps: ( props: IDumiDemoProps['previewerProps'], opts: Parameters<NonNullable<IDumiTechStack['generateMetadata']>>[1]) => | Promise<IDumiDemoProps['previewerProps']> | IDumiDemoProps['previewerProps'];
generator for return previewer props
method generateSources
abstract generateSources: ( source: IParsedBlockAsset['resolveMap'], opts: Parameters<NonNullable<IDumiTechStack['generateMetadata']>>[1]) => Promise<IParsedBlockAsset['resolveMap']> | IParsedBlockAsset['resolveMap'];
generator for return file path of demo source
method isSupported
abstract isSupported: (node: Element, lang: string) => boolean;
Is the lang supported by the current tech stack?
Parameter lang
Parameter node
hast Element https://github.com/syntax-tree/hast?tab=readme-ov-file#element
method onBlockLoad
abstract onBlockLoad: ( args: IDumiTechStackOnBlockLoadArgs) => IDumiTechStackOnBlockLoadResult | null;
Use current function as onLoad CallBack(https://esbuild.github.io/plugins/#on-load) Why use this method? By default, dumi can only support the parsing of js/ts related code blocks, but many front-end frameworks have custom extensions, so this method is provided to facilitate developers to convert codes.
method transformCode
abstract transformCode: ( raw: string, opts: { type: 'external' | 'code-block'; fileAbsPath: string }) => string;
transform for parse demo source to expression/function/class
Interfaces
interface IDumiTechStackRuntimeOpts
interface IDumiTechStackRuntimeOpts {}
property compilePath
compilePath?: string;
path to runtime compile function module
property pluginPath
pluginPath?: string;
path to runtime plugin for this tech stack
property preflightPath
preflightPath?: string;
Component detection function path, used to detect errors that occur from application creation to component mounting.
property rendererPath
rendererPath?: string;
path of the cancelableIDemoCancelableFn function that manipulate(mount/unmount) third-party framework component
Type Aliases
type IApi
type IApi = IUmiApi & { config: IDumiConfig & { [key: string]: any; }; userConfig: IDumiUserConfig; service: IUmiApi['service'] & { themeData: IThemeLoadResult; atomParser: IAtomAssetsParser; }; /** * register a new tech stack */ registerTechStack: (fn: () => IDumiTechStack) => void; /** * modify original theme data */ modifyTheme: IModify<IThemeLoadResult, null>; /** * add content tab */ addContentTab: (fn: () => IContentTab) => void; /** * modify assets metadata */ modifyAssetsMetadata: IModify<AssetsPackage, null>; /** * get assets metadata */ getAssetsMetadata?: () => Promise<AssetsPackage>;};
Namespaces
namespace *.svg
module '*.svg' {}
variable ReactComponent
const ReactComponent: React.FunctionComponent<any>;
variable src
const src: string;
Package Files (5)
Dependencies (68)
- @ant-design/icons-svg
- @makotot/ghostui
- @stackblitz/sdk
- @swc/core
- @types/hast
- @types/mdast
- @umijs/bundler-utils
- @umijs/core
- @umijs/utils
- animated-scroll-to
- classnames
- codesandbox
- comlink
- copy-to-clipboard
- deepmerge
- dumi-afx-deps
- dumi-assets-types
- enhanced-resolve
- estree-util-to-js
- estree-util-visit
- file-system-cache
- github-slugger
- hast-util-is-element
- hast-util-raw
- hast-util-to-estree
- hast-util-to-string
- heti
- hosted-git-info
- html-to-text
- html2sketch
- js-yaml
- lodash.throttle
- mdast-util-find-and-replace
- mdast-util-to-string
- nprogress
- pluralize
- prism-react-renderer
- prism-themes
- prismjs
- raw-loader
- rc-motion
- rc-tabs
- rc-tooltip
- rc-tree
- rc-util
- react-copy-to-clipboard
- react-error-boundary
- react-intl
- react-loading-skeleton
- react-simple-code-editor
- rehype-autolink-headings
- rehype-remove-comments
- rehype-stringify
- remark-directive
- remark-frontmatter
- remark-gfm
- remark-parse
- remark-rehype
- sass
- sitemap
- sucrase
- umi
- unified
- unist-util-visit
- unist-util-visit-parents
- url
- v8-compile-cache
- vfile
Dev Dependencies (35)
- @commitlint/cli
- @commitlint/config-conventional
- @types/github-slugger
- @types/highlight-words-core
- @types/hosted-git-info
- @types/js-yaml
- @types/lodash.throttle
- @types/node
- @types/pluralize
- @types/prismjs
- @types/react
- @types/react-copy-to-clipboard
- @types/react-dom
- @umijs/lint
- @umijs/plugins
- codesandbox-import-utils
- dumi-theme-mobile
- eslint
- esno
- fast-glob
- father
- git-repo-info
- highlight-words-core
- husky
- lint-staged
- prettier
- prettier-plugin-organize-imports
- prettier-plugin-packagejson
- react
- react-dom
- stylelint
- ts-node
- typescript
- vitest
- zx
Peer Dependencies (2)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/dumi
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/dumi)
- HTML<a href="https://www.jsdocs.io/package/dumi"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4616 ms. - Missing or incorrect documentation? Open an issue for this package.