@rsdoctor/components 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/asset.mjs","sources":["../../../../src/pages/BundleSize/components/asset.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n ColumnHeightOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n Popover,\n Row,\n Space,\n Tag,\n Tooltip,\n Tree,\n Typography,\n} from 'antd';\nimport { DataNode as AntdDataNode } from 'antd/es/tree';\nimport { omitBy, sumBy } from 'es-toolkit/compat';\nimport { dirname, relative } from 'path';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { CodeViewer } from 'src/components/base';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { TextDrawer } from '../../../components/TextDrawer';\nimport { Size } from '../../../constants';\nimport {\n DataNode,\n createFileStructures,\n formatSize,\n isJsDataUrl,\n useI18n,\n} from '../../../utils';\nimport { ModuleAnalyzeComponent } from '../../ModuleAnalyze';\nimport { ModuleGraphListContext } from '../config';\nimport styles from './index.module.scss';\n\nconst { DirectoryTree } = Tree;\n\nlet expandedModulesKeys: React.Key[] = [];\nconst TAB_MAP = {\n source: 'source code',\n transformed: 'Transformed Code (After compile)',\n parsedSource: 'Bundled Code (After bundle and tree-shaking)',\n};\n\nconst tagStyle = {\n margin: 'none',\n marginInlineEnd: 0,\n};\n\nconst EmptyCodeItem = () => (\n <Empty\n description={`Do not have the module code.\n (1) If you use the brief mode, there will not have any codes to show.\n (2) If you use lite mode, there will not have source codes.`}\n />\n);\n\nexport const ModuleCodeViewer: React.FC<{ data: SDK.ModuleData }> = ({\n data,\n}) => {\n const [tab, setTab] = useState('');\n const { t } = useI18n();\n\n const TAB_LAB_MAP: Record<string, string> = {\n source: 'Source Code',\n transformed: `Transformed Code(${t('After Compile')})`,\n parsedSource: `Bundled Code(${t('After Bundled')})`,\n };\n if (!data) return null;\n\n const { path } = data;\n\n return (\n <TextDrawer\n text=\"\"\n buttonProps={{\n size: 'small',\n icon: (\n <Popover content=\"Open the Codes Box\">\n <CodepenCircleOutlined />\n </Popover>\n ),\n type: 'default',\n }}\n buttonStyle={{ padding: `0 4px` }}\n drawerProps={{\n destroyOnClose: true,\n title: `Code of \"${path}\"`,\n }}\n >\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetModuleCodeByModuleId}\n body={{ moduleId: data.id }}\n >\n {(source) => {\n return (\n <>\n {!source['source'] &&\n !source['parsedSource'] &&\n !source['transformed'] ? (\n <EmptyCodeItem />\n ) : (\n <Card\n className=\"code-size-card\"\n style={{ width: '100%' }}\n tabList={Object.keys(omitBy(source, (s) => !s))\n .map((k) => ({ tab: k }))\n .map((e) => ({\n ...e,\n tab: TAB_LAB_MAP[e.tab],\n key: e.tab,\n }))}\n defaultActiveTabKey={\n source['parsedSource'] ? 'parsedSource' : 'source'\n }\n onTabChange={(v) => setTab(v)}\n tabBarExtraContent={\n <Popover\n placement=\"bottom\"\n title={\n <Typography.Title level={5}>Explain</Typography.Title>\n }\n content={\n <>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n marginBottom: 30,\n }}\n >\n <div>\n <Typography.Text strong>Source: </Typography.Text>\n <Typography.Text>\n {TAB_MAP.source}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Transformed:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.transformed}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Bundled Source:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.parsedSource}\n </Typography.Text>\n </div>\n <br />\n <Typography.Text strong>{'More'}</Typography.Text>\n <Typography.Text>\n {t('CodeModeExplain')}\n </Typography.Text>\n </div>\n </>\n }\n trigger={'hover'}\n >\n <a href=\"#\">Explain</a>\n </Popover>\n }\n styles={{ body: { padding: 0, overflow: 'hidden' } }}\n >\n {source['parsedSource'] ||\n source['source'] ||\n source['transformed'] ? (\n <CodeViewer\n isEmbed\n code={\n tab\n ? source[tab as keyof SDK.ModuleSource]\n : source['parsedSource']\n ? source['parsedSource']\n : source['source']\n }\n filePath={path}\n />\n ) : (\n <EmptyCodeItem />\n )}\n </Card>\n )}\n </>\n );\n }}\n </ServerAPIProvider>\n </TextDrawer>\n );\n};\n\nexport const ModuleGraphViewer: React.FC<{\n id: number | string;\n show: boolean;\n setShow: (_show: boolean) => void;\n cwd: string;\n}> = ({ id, show, setShow, cwd }) => {\n if (!id) return null;\n\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetAllModuleGraph} body={{}}>\n {(modules) => (\n <ModuleAnalyzeComponent\n cwd={cwd}\n moduleId={id}\n modules={modules}\n show={show}\n setShow={setShow}\n />\n )}\n </ServerAPIProvider>\n );\n};\n\nconst inlinedResourcePathKey = '__RESOURCEPATH__';\n\nexport function getChildrenModule(node: DataNode, mods: string[]) {\n node.children &&\n node.children.forEach((n: DataNode) => {\n if (n.isLeaf) {\n mods.push(n[inlinedResourcePathKey]);\n } else {\n getChildrenModule(n, mods);\n }\n });\n\n return mods;\n}\n\nexport const ModulesStatistics: React.FC<{\n modules: SDK.ModuleData[];\n chunks: SDK.ChunkData[];\n filteredModules: SDK.ModuleData[];\n}> = ({ modules, chunks, filteredModules }) => {\n const { sourceSize, parsedSize, filteredParsedSize, filteredSourceSize } =\n useMemo(() => {\n return {\n sourceSize: sumBy(modules, (e) => e.size.sourceSize),\n parsedSize: sumBy(modules, (e) => e.size.parsedSize),\n filteredSourceSize: sumBy(filteredModules, (e) => e.size.sourceSize),\n filteredParsedSize: sumBy(filteredModules, (e) => e.size.parsedSize),\n };\n }, [modules, filteredModules]);\n\n return (\n <Space>\n <Tooltip\n title={`total modules count is ${modules.length}, the filtered modules count is ${filteredModules.length}`}\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules: {filteredModules.length} / {modules.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules bundled size: {formatSize(parsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules source size: {formatSize(sourceSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules bundled size: {formatSize(filteredParsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules source size: {formatSize(filteredSourceSize)}\n </Typography.Text>\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules Size:\n {filteredParsedSize === parsedSize\n ? formatSize(parsedSize)\n : `${formatSize(filteredParsedSize)} / ${formatSize(parsedSize)}`}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n this asset includes {chunks.length} chunks:\n </Typography.Text>\n {chunks.map((e) => (\n <Bdg label=\"chunk\" value={e.name} key={e.name} />\n ))}\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Chunks: {chunks.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n </Space>\n );\n};\n\nconst ConcatenatedTag = ({ moduleCount }: { moduleCount: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n This is a concatenated container module that includes {moduleCount}{' '}\n modules\n </Typography.Text>\n </Space>\n }\n >\n <Tag color=\"blue\" style={tagStyle}>\n concatenated container\n </Tag>\n </Tooltip>\n );\n};\n\nconst TotalBundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total output size of all the files in this folder. If you\n enabled minification, this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag style={tagStyle} color={'geekblue'}>\n {`bundled size: ${formatSize(size)}`}\n </Tag>\n </Tooltip>\n );\n};\n\nconst BundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The final output size of this file. If you enabled minification,\n this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'geekblue'}>{`bundled size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst GzippedSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The compressed file size that users actually download, as most web\n servers use gzip compression.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'orange'}>{`gzipped: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst TotalSourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total original size of all the files in this folder, before any\n transformations and minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag\n style={tagStyle}\n color={'cyan'}\n >{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst SourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The original size of this file, before any transformations and\n minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'cyan'}>{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nexport const AssetDetail: React.FC<{\n asset: SDK.AssetData;\n chunks: SDK.ChunkData[];\n modules: SDK.ModuleData[];\n moduleSizeLimit?: number;\n height?: number;\n root: string;\n}> = ({\n asset,\n chunks: includeChunks,\n modules: includeModules,\n moduleSizeLimit,\n height,\n root,\n}) => {\n const [moduleKeyword, setModuleKeyword] = useState('');\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [moduleJumpList, setModuleJumpList] = useState([] as number[]);\n const [show, setShow] = useState(false);\n\n const filteredModules = useMemo(() => {\n let res = includeModules.slice();\n if (moduleKeyword) {\n const regexp = new RegExp(moduleKeyword, 'i');\n res = res.filter((e) => regexp.test(e.path));\n }\n\n if (moduleSizeLimit) {\n res = res.filter((e) => e.size.parsedSize >= moduleSizeLimit);\n }\n\n return res;\n }, [includeModules, moduleKeyword, moduleSizeLimit]);\n\n const fileStructures = useMemo(() => {\n const res = createFileStructures({\n files: filteredModules.map((e) => e.path).filter(Boolean),\n inlinedResourcePathKey,\n fileTitle(file, basename) {\n const mod = filteredModules.find((e) => e.path === file)!;\n\n if (!mod) return basename;\n\n const { parsedSize = 0, sourceSize = 0, gzipSize = 0 } = mod.size;\n const isConcatenation = mod.kind === SDK.ModuleKind.Concatenation;\n\n const containedOtherModules =\n !isConcatenation &&\n parsedSize === 0 &&\n includeModules.filter(\n (e) => e !== mod && e.modules && e.modules.indexOf(mod.id) > -1,\n );\n\n return (\n <div className={styles['bundle-tree']}>\n <Popover\n content={`Open the ${basename}’s module reasons tree.`}\n placement=\"bottom\"\n >\n <div\n className={styles.box}\n onClick={() => {\n setModuleJumpList([mod.id]);\n setShow(true);\n }}\n >\n <div className={styles.keywords}>\n <Keyword ellipsis text={basename} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n </Popover>\n <Space>\n {parsedSize !== 0 ? (\n <>\n {typeof gzipSize === 'number' ? (\n <Popover\n placement=\"bottom\"\n content={<SourceSizeTag size={sourceSize} />}\n >\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <GzippedSizeTag size={gzipSize} />\n </Space>\n </Popover>\n ) : (\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <SourceSizeTag size={sourceSize} />\n </Space>\n )}\n </>\n ) : sourceSize !== 0 ? (\n // fallback to display tag for source size\n <SourceSizeTag size={sourceSize} />\n ) : null}\n {isConcatenation ? (\n <ConcatenatedTag moduleCount={mod.modules?.length || 0} />\n ) : null}\n {containedOtherModules && containedOtherModules.length ? (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n This module is concatenated into another container\n module:\n </Typography.Text>\n {containedOtherModules.map(({ id, path }) => {\n if (isJsDataUrl(path)) {\n return (\n <Typography.Paragraph\n ellipsis={{ rows: 4 }}\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {path}\n </Typography.Paragraph>\n );\n }\n\n const p = relative(dirname(mod.path), path);\n if (p.startsWith('javascript;charset=utf-8;base64,')) {\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n }\n\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n })}\n </Space>\n }\n >\n <Tag color=\"green\">concatenated</Tag>\n </Tooltip>\n ) : null}\n\n <ModuleCodeViewer data={mod} />\n </Space>\n </div>\n );\n },\n dirTitle(dir, defaultTitle) {\n const mods: string[] = [];\n const paths = getChildrenModule(dir, mods);\n if (paths.length) {\n const mods = paths.map(\n (e) => includeModules.find((m) => m.path === e)!,\n );\n\n const parsedSize = sumBy(mods, (e) => e.size?.parsedSize || 0);\n const sourceSize = sumBy(mods, (e) => e.size?.sourceSize || 0);\n return (\n <div className={styles['bundle-tree']}>\n <div className={styles.box}>\n <div className={styles.keywords}>\n <Keyword ellipsis text={defaultTitle} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n <Space>\n {parsedSize > 0 ? (\n <>\n <TotalBundledSizeTag size={parsedSize} />\n <TotalSourceSizeTag size={sourceSize} />\n </>\n ) : (\n <TotalSourceSizeTag size={sourceSize} />\n )}\n </Space>\n </div>\n );\n }\n\n return defaultTitle;\n },\n page: 'bundle',\n });\n return res;\n }, [filteredModules]);\n\n const onSearch = (value: string) => setModuleKeyword(value);\n\n useEffect(() => {\n setModuleKeyword('');\n setDefaultExpandAll(false);\n }, [asset]);\n\n useEffect(() => {\n setDefaultExpandAll(false);\n }, [moduleKeyword]);\n\n return (\n <ModuleGraphListContext.Provider\n value={{ moduleJumpList, setModuleJumpList }}\n >\n <Card\n className={styles.bundle}\n title={`Modules of \"${asset.path}\"`}\n bodyStyle={{ minHeight: height }}\n size=\"small\"\n >\n {includeModules.length ? (\n <Row>\n <Col span={24}>\n <ModulesStatistics\n modules={includeModules}\n chunks={includeChunks}\n filteredModules={filteredModules}\n />\n </Col>\n <Col span={24}>\n <Space>\n <KeywordInput\n placeholder=\"search module by keyword\"\n onChange={onSearch}\n key={asset.path}\n />\n <Button\n onClick={() => setDefaultExpandAll(true)}\n size=\"small\"\n icon={<ColumnHeightOutlined />}\n />\n </Space>\n </Col>\n <Col span={24} style={{ marginTop: Size.BasePadding }}>\n {filteredModules.length ? (\n <DirectoryTree\n key={`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`}\n selectable={false}\n defaultExpandAll={\n defaultExpandAll || filteredModules.length <= 20\n }\n onExpand={(expandedKeys) => {\n expandedModulesKeys = expandedKeys;\n }}\n defaultExpandParent\n // @ts-ignore\n defaultExpandedKeys={\n expandedModulesKeys?.length\n ? expandedModulesKeys\n : fileStructures.length === 1\n ? [fileStructures[0].key]\n : []\n }\n treeData={fileStructures as AntdDataNode[]}\n rootStyle={{\n maxHeight: '500px',\n overflow: 'auto',\n border: '1px solid rgba(235, 237, 241)',\n padding: '14px 20px',\n }}\n />\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${moduleKeyword}\" can't match any modules`}</Typography.Text>\n }\n />\n )}\n </Col>\n </Row>\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${asset.path}\" doesn't have any modules`}</Typography.Text>\n }\n />\n )}\n\n <ModuleGraphViewer\n id={\n moduleJumpList?.length\n ? moduleJumpList[moduleJumpList.length - 1]\n : ''\n }\n show={show}\n setShow={setShow}\n cwd={root}\n />\n </Card>\n </ModuleGraphListContext.Provider>\n );\n};\n"],"names":["DirectoryTree","Tree","expandedModulesKeys","TAB_MAP","tagStyle","EmptyCodeItem","Empty","ModuleCodeViewer","data","tab","setTab","useState","t","useI18n","TAB_LAB_MAP","path","TextDrawer","Popover","CodepenCircleOutlined","ServerAPIProvider","SDK","source","Card","Object","omitBy","s","k","e","v","Typography","CodeViewer","ModuleGraphViewer","id","show","setShow","cwd","modules","ModuleAnalyzeComponent","inlinedResourcePathKey","getChildrenModule","node","mods","n","ModulesStatistics","chunks","filteredModules","sourceSize","parsedSize","filteredParsedSize","filteredSourceSize","useMemo","sumBy","Space","Tooltip","InfoCircleOutlined","Divider","formatSize","Bdg","ConcatenatedTag","moduleCount","Tag","TotalBundledSizeTag","size","BundledSizeTag","GzippedSizeTag","TotalSourceSizeTag","SourceSizeTag","AssetDetail","asset","includeChunks","includeModules","moduleSizeLimit","height","root","moduleKeyword","setModuleKeyword","defaultExpandAll","setDefaultExpandAll","moduleJumpList","setModuleJumpList","res","regexp","RegExp","fileStructures","createFileStructures","Boolean","file","basename","mod","gzipSize","isConcatenation","containedOtherModules","styles","Keyword","isJsDataUrl","p","relative","dirname","dir","defaultTitle","paths","m","onSearch","value","useEffect","ModuleGraphListContext","Row","Col","KeywordInput","Button","ColumnHeightOutlined","Size","expandedKeys"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,EAAEA,aAAa,EAAE,GAAGC;AAE1B,IAAIC,sBAAmC,EAAE;AACzC,MAAMC,UAAU;IACd,QAAQ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T,WAAW;oCACX,UAAU;oCACV,QAAQ;oCACR,SAAS;gCACX;+BAvBK,CAAC,KAAK,EAAET,cAAc,CAAC,EAAEE,iBAAiB,CAAC,EAAER,MAAM,IAAI,EAAE,kBA0BhE,IAAC9D,OAAKA;gCACJ,2BACE,IAACuB,WAAW,IAAI;oCACd,QAAM;8CACN,CAAC,CAAC,EAAE6C,cAAc,yBAAyB,CAAC;;;;;mCAOxD,IAACpE,OAAKA;oBACJ,2BACE,IAACuB,WAAW,IAAI;wBACd,QAAM;kCACN,CAAC,CAAC,EAAEuC,MAAM,IAAI,CAAC,0BAA0B,CAAC;;;8BAKlD,IAACrC,mBAAAA;oBACC,IACE+C,gBAAgB,SACZA,cAAc,CAACA,eAAe,MAAM,GAAG,EAAE,GACzC;oBAEN,MAAM7C;oBACN,SAASC;oBACT,KAAKuC;;;;;AAKf"}
1
+ {"version":3,"file":"pages/BundleSize/components/asset.mjs","sources":["../../../../src/pages/BundleSize/components/asset.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n ColumnHeightOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n Popover,\n Row,\n Space,\n Tag,\n Tooltip,\n Tree,\n Typography,\n} from 'antd';\nimport { DataNode as AntdDataNode } from 'antd/es/tree';\nimport { omitBy, sumBy } from 'es-toolkit/compat';\nimport { dirname, relative } from 'path';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { CodeViewer } from 'src/components/base';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { TextDrawer } from '../../../components/TextDrawer';\nimport { Size } from '../../../constants';\nimport {\n DataNode,\n createFileStructures,\n formatSize,\n isJsDataUrl,\n useI18n,\n} from '../../../utils';\nimport { ModuleAnalyzeComponent } from '../../ModuleAnalyze';\nimport { ModuleGraphListContext } from '../config';\nimport styles from './index.module.scss';\n\nconst { DirectoryTree } = Tree;\n\nlet expandedModulesKeys: React.Key[] = [];\nconst TAB_MAP = {\n source: 'source code',\n transformed: 'Transformed Code (After compile)',\n parsedSource: 'Bundled Code (After bundle and tree-shaking)',\n};\n\nconst tagStyle = {\n margin: 'none',\n marginInlineEnd: 0,\n};\n\nconst EmptyCodeItem = () => (\n <Empty\n description={`Do not have the module code.\n (1) If you use the brief mode, there will not have any codes to show.\n (2) If you use lite mode, there will not have source codes.`}\n />\n);\n\nexport const ModuleCodeViewer: React.FC<{ data: SDK.ModuleData }> = ({\n data,\n}) => {\n const [tab, setTab] = useState('');\n const { t } = useI18n();\n\n const TAB_LAB_MAP: Record<string, string> = {\n source: 'Source Code',\n transformed: `Transformed Code(${t('After Compile')})`,\n parsedSource: `Bundled Code(${t('After Bundled')})`,\n };\n if (!data) return null;\n\n const { path } = data;\n\n return (\n <TextDrawer\n text=\"\"\n buttonProps={{\n size: 'small',\n icon: (\n <Popover content=\"Open the Codes Box\">\n <CodepenCircleOutlined />\n </Popover>\n ),\n type: 'default',\n }}\n buttonStyle={{ padding: `0 4px` }}\n drawerProps={{\n destroyOnClose: true,\n title: `Code of \"${path}\"`,\n }}\n >\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetModuleCodeByModuleId}\n body={{ moduleId: data.id }}\n >\n {(source) => {\n return (\n <>\n {!source['source'] &&\n !source['parsedSource'] &&\n !source['transformed'] ? (\n <EmptyCodeItem />\n ) : (\n <Card\n className=\"code-size-card\"\n style={{ width: '100%' }}\n tabList={Object.keys(omitBy(source, (s) => !s))\n .map((k) => ({ tab: k }))\n .map((e) => ({\n ...e,\n tab: TAB_LAB_MAP[e.tab],\n key: e.tab,\n }))}\n defaultActiveTabKey={\n source['parsedSource'] ? 'parsedSource' : 'source'\n }\n onTabChange={(v) => setTab(v)}\n tabBarExtraContent={\n <Popover\n placement=\"bottom\"\n title={\n <Typography.Title level={5}>Explain</Typography.Title>\n }\n content={\n <>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n marginBottom: 30,\n }}\n >\n <div>\n <Typography.Text strong>Source: </Typography.Text>\n <Typography.Text>\n {TAB_MAP.source}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Transformed:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.transformed}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Bundled Source:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.parsedSource}\n </Typography.Text>\n </div>\n <br />\n <Typography.Text strong>{'More'}</Typography.Text>\n <Typography.Text>\n {t('CodeModeExplain')}\n </Typography.Text>\n </div>\n </>\n }\n trigger={'hover'}\n >\n <a href=\"#\">Explain</a>\n </Popover>\n }\n styles={{ body: { padding: 0, overflow: 'hidden' } }}\n >\n {source['parsedSource'] ||\n source['source'] ||\n source['transformed'] ? (\n <CodeViewer\n isEmbed\n code={\n tab\n ? source[tab as keyof SDK.ModuleSource]\n : source['parsedSource']\n ? source['parsedSource']\n : source['source']\n }\n filePath={path}\n />\n ) : (\n <EmptyCodeItem />\n )}\n </Card>\n )}\n </>\n );\n }}\n </ServerAPIProvider>\n </TextDrawer>\n );\n};\n\nexport const ModuleGraphViewer: React.FC<{\n id: number | string;\n show: boolean;\n setShow: (_show: boolean) => void;\n cwd: string;\n}> = ({ id, show, setShow, cwd }) => {\n if (!id) return null;\n\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetAllModuleGraph} body={{}}>\n {(modules) => (\n <ModuleAnalyzeComponent\n cwd={cwd}\n moduleId={id}\n modules={modules}\n show={show}\n setShow={setShow}\n />\n )}\n </ServerAPIProvider>\n );\n};\n\nconst inlinedResourcePathKey = '__RESOURCEPATH__';\n\nexport function getChildrenModule(node: DataNode, mods: string[]) {\n node.children &&\n node.children.forEach((n: DataNode) => {\n if (n.isLeaf) {\n mods.push(n[inlinedResourcePathKey]);\n } else {\n getChildrenModule(n, mods);\n }\n });\n\n return mods;\n}\n\nexport const ModulesStatistics: React.FC<{\n modules: SDK.ModuleData[];\n chunks: SDK.ChunkData[];\n filteredModules: SDK.ModuleData[];\n}> = ({ modules, chunks, filteredModules }) => {\n const { sourceSize, parsedSize, filteredParsedSize, filteredSourceSize } =\n useMemo(() => {\n return {\n sourceSize: sumBy(modules, (e) => e.size.sourceSize),\n parsedSize: sumBy(modules, (e) => e.size.parsedSize),\n filteredSourceSize: sumBy(filteredModules, (e) => e.size.sourceSize),\n filteredParsedSize: sumBy(filteredModules, (e) => e.size.parsedSize),\n };\n }, [modules, filteredModules]);\n\n return (\n <Space>\n <Tooltip\n title={`total modules count is ${modules.length}, the filtered modules count is ${filteredModules.length}`}\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules: {filteredModules.length} / {modules.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules bundled size: {formatSize(parsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules source size: {formatSize(sourceSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules bundled size: {formatSize(filteredParsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules source size: {formatSize(filteredSourceSize)}\n </Typography.Text>\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules Size:\n {filteredParsedSize === parsedSize\n ? formatSize(parsedSize)\n : `${formatSize(filteredParsedSize)} / ${formatSize(parsedSize)}`}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n this asset includes {chunks.length} chunks:\n </Typography.Text>\n {chunks.map((e) => (\n <Bdg label=\"chunk\" value={e.name} key={e.name} />\n ))}\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Chunks: {chunks.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n </Space>\n );\n};\n\nconst ConcatenatedTag = ({ moduleCount }: { moduleCount: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n This is a concatenated container module that includes {moduleCount}{' '}\n modules\n </Typography.Text>\n </Space>\n }\n >\n <Tag color=\"blue\" style={tagStyle}>\n concatenated container\n </Tag>\n </Tooltip>\n );\n};\n\nconst TotalBundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total output size of all the files in this folder. If you\n enabled minification, this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag style={tagStyle} color={'geekblue'}>\n {`bundled size: ${formatSize(size)}`}\n </Tag>\n </Tooltip>\n );\n};\n\nconst BundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The final output size of this file. If you enabled minification,\n this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'geekblue'}>{`bundled size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst GzippedSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The compressed file size that users actually download, as most web\n servers use gzip compression.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'orange'}>{`gzipped: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst TotalSourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total original size of all the files in this folder, before any\n transformations and minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag\n style={tagStyle}\n color={'cyan'}\n >{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst SourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The original size of this file, before any transformations and\n minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'cyan'}>{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nexport const AssetDetail: React.FC<{\n asset: SDK.AssetData;\n chunks: SDK.ChunkData[];\n modules: SDK.ModuleData[];\n moduleSizeLimit?: number;\n height?: number;\n root: string;\n}> = ({\n asset,\n chunks: includeChunks,\n modules: includeModules,\n moduleSizeLimit,\n height,\n root,\n}) => {\n const [moduleKeyword, setModuleKeyword] = useState('');\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [moduleJumpList, setModuleJumpList] = useState([] as number[]);\n const [show, setShow] = useState(false);\n\n const filteredModules = useMemo(() => {\n let res = includeModules.slice();\n if (moduleKeyword) {\n const regexp = new RegExp(moduleKeyword, 'i');\n res = res.filter((e) => regexp.test(e.path));\n }\n\n if (moduleSizeLimit) {\n res = res.filter((e) => e.size.parsedSize >= moduleSizeLimit);\n }\n\n return res;\n }, [includeModules, moduleKeyword, moduleSizeLimit]);\n\n const fileStructures = useMemo(() => {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const res = createFileStructures({\n files: filteredModules.map((e) => e.path).filter(Boolean),\n inlinedResourcePathKey,\n fileTitle(file, basename) {\n const mod = filteredModules.find(\n (e) => normalizePath(e.path) === normalizePath(file),\n )!;\n\n if (!mod) return basename;\n\n const { parsedSize = 0, sourceSize = 0, gzipSize = 0 } = mod.size;\n const isConcatenation = mod.kind === SDK.ModuleKind.Concatenation;\n\n const containedOtherModules =\n !isConcatenation &&\n parsedSize === 0 &&\n includeModules.filter(\n (e) => e !== mod && e.modules && e.modules.indexOf(mod.id) > -1,\n );\n\n return (\n <div className={styles['bundle-tree']}>\n <Popover\n content={`Open the ${basename}’s module reasons tree.`}\n placement=\"bottom\"\n >\n <div\n className={styles.box}\n onClick={() => {\n setModuleJumpList([mod.id]);\n setShow(true);\n }}\n >\n <div className={styles.keywords}>\n <Keyword ellipsis text={basename} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n </Popover>\n <Space>\n {parsedSize !== 0 ? (\n <>\n {typeof gzipSize === 'number' ? (\n <Popover\n placement=\"bottom\"\n content={<SourceSizeTag size={sourceSize} />}\n >\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <GzippedSizeTag size={gzipSize} />\n </Space>\n </Popover>\n ) : (\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <SourceSizeTag size={sourceSize} />\n </Space>\n )}\n </>\n ) : sourceSize !== 0 ? (\n // fallback to display tag for source size\n <SourceSizeTag size={sourceSize} />\n ) : null}\n {isConcatenation ? (\n <ConcatenatedTag moduleCount={mod.modules?.length || 0} />\n ) : null}\n {containedOtherModules && containedOtherModules.length ? (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n This module is concatenated into another container\n module:\n </Typography.Text>\n {containedOtherModules.map(({ id, path }) => {\n if (isJsDataUrl(path)) {\n return (\n <Typography.Paragraph\n ellipsis={{ rows: 4 }}\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {path}\n </Typography.Paragraph>\n );\n }\n\n const p = relative(dirname(mod.path), path);\n if (p.startsWith('javascript;charset=utf-8;base64,')) {\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n }\n\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n })}\n </Space>\n }\n >\n <Tag color=\"green\">concatenated</Tag>\n </Tooltip>\n ) : null}\n\n <ModuleCodeViewer data={mod} />\n </Space>\n </div>\n );\n },\n dirTitle(dir, defaultTitle) {\n const mods: string[] = [];\n const paths = getChildrenModule(dir, mods);\n if (paths.length) {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const mods = paths.map(\n (e) =>\n includeModules.find(\n (m) => normalizePath(m.path) === normalizePath(e),\n )!,\n );\n\n const parsedSize = sumBy(mods, (e) => e?.size?.parsedSize || 0);\n const sourceSize = sumBy(mods, (e) => e?.size?.sourceSize || 0);\n return (\n <div className={styles['bundle-tree']}>\n <div className={styles.box}>\n <div className={styles.keywords}>\n <Keyword ellipsis text={defaultTitle} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n <Space>\n {parsedSize > 0 ? (\n <>\n <TotalBundledSizeTag size={parsedSize} />\n <TotalSourceSizeTag size={sourceSize} />\n </>\n ) : (\n <TotalSourceSizeTag size={sourceSize} />\n )}\n </Space>\n </div>\n );\n }\n\n return defaultTitle;\n },\n page: 'bundle',\n });\n return res;\n }, [filteredModules]);\n\n const onSearch = (value: string) => setModuleKeyword(value);\n\n useEffect(() => {\n setModuleKeyword('');\n setDefaultExpandAll(false);\n }, [asset]);\n\n useEffect(() => {\n setDefaultExpandAll(false);\n }, [moduleKeyword]);\n\n return (\n <ModuleGraphListContext.Provider\n value={{ moduleJumpList, setModuleJumpList }}\n >\n <Card\n className={styles.bundle}\n title={`Modules of \"${asset.path}\"`}\n bodyStyle={{ minHeight: height }}\n size=\"small\"\n >\n {includeModules.length ? (\n <Row>\n <Col span={24}>\n <ModulesStatistics\n modules={includeModules}\n chunks={includeChunks}\n filteredModules={filteredModules}\n />\n </Col>\n <Col span={24}>\n <Space>\n <KeywordInput\n placeholder=\"search module by keyword\"\n onChange={onSearch}\n key={asset.path}\n />\n <Button\n onClick={() => setDefaultExpandAll(true)}\n size=\"small\"\n icon={<ColumnHeightOutlined />}\n />\n </Space>\n </Col>\n <Col span={24} style={{ marginTop: Size.BasePadding }}>\n {filteredModules.length ? (\n <DirectoryTree\n key={`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`}\n selectable={false}\n defaultExpandAll={\n defaultExpandAll || filteredModules.length <= 20\n }\n onExpand={(expandedKeys) => {\n expandedModulesKeys = expandedKeys;\n }}\n defaultExpandParent\n // @ts-ignore\n defaultExpandedKeys={\n expandedModulesKeys?.length\n ? expandedModulesKeys\n : fileStructures.length === 1\n ? [fileStructures[0].key]\n : []\n }\n treeData={fileStructures as AntdDataNode[]}\n rootStyle={{\n maxHeight: '500px',\n overflow: 'auto',\n border: '1px solid rgba(235, 237, 241)',\n padding: '14px 20px',\n }}\n />\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${moduleKeyword}\" can't match any modules`}</Typography.Text>\n }\n />\n )}\n </Col>\n </Row>\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${asset.path}\" doesn't have any modules`}</Typography.Text>\n }\n />\n )}\n\n <ModuleGraphViewer\n id={\n moduleJumpList?.length\n ? moduleJumpList[moduleJumpList.length - 1]\n : ''\n }\n show={show}\n setShow={setShow}\n cwd={root}\n />\n </Card>\n </ModuleGraphListContext.Provider>\n );\n};\n"],"names":["DirectoryTree","Tree","expandedModulesKeys","TAB_MAP","tagStyle","EmptyCodeItem","Empty","ModuleCodeViewer","data","tab","setTab","useState","t","useI18n","TAB_LAB_MAP","path","TextDrawer","Popover","CodepenCircleOutlined","ServerAPIProvider","SDK","source","Card","Object","omitBy","s","k","e","v","Typography","CodeViewer","ModuleGraphViewer","id","show","setShow","cwd","modules","ModuleAnalyzeComponent","inlinedResourcePathKey","getChildrenModule","node","mods","n","ModulesStatistics","chunks","filteredModules","sourceSize","parsedSize","filteredParsedSize","filteredSourceSize","useMemo","sumBy","Space","Tooltip","InfoCircleOutlined","Divider","formatSize","Bdg","ConcatenatedTag","moduleCount","Tag","TotalBundledSizeTag","size","BundledSizeTag","GzippedSizeTag","TotalSourceSizeTag","SourceSizeTag","AssetDetail","asset","includeChunks","includeModules","moduleSizeLimit","height","root","moduleKeyword","setModuleKeyword","defaultExpandAll","setDefaultExpandAll","moduleJumpList","setModuleJumpList","res","regexp","RegExp","fileStructures","normalizePath","createFileStructures","Boolean","file","basename","mod","gzipSize","isConcatenation","containedOtherModules","styles","Keyword","isJsDataUrl","p","relative","dirname","dir","defaultTitle","paths","m","onSearch","value","useEffect","ModuleGraphListContext","Row","Col","KeywordInput","Button","ColumnHeightOutlined","Size","expandedKeys"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,EAAEA,aAAa,EAAE,GAAGC;AAE1B,IAAIC,sBAAmC,EAAE;AACzC,MAAMC,UAAU;IACd,QAAQ;IACR,aAAa;IACb,cAAc;AAChB;AAEA,MAAMC,WAAW;IACf,QAAQ;IACR,iBAAiB;AACnB;AAEA,MAAMC,gBAAgB,kBACpB,IAACC,OAAKA;QACJ,aAAa,CAAC;;6DAE2C,CAAC;;AAIvD,MAAMC,mBAAuD,CAAC,EACnEC,IAAI,EACL;IACC,MAAM,CAACC,KAAKC,OAAO,GAAGC,SAAS;IAC/B,MAAM,EAAEC,CAAC,EAAE,GAAGC;IAEd,MAAMC,cAAsC;QAC1C,QAAQ;QACR,aAAa,CAAC,iBAAiB,EAAEF,EAAE,iBAAiB,CAAC,CAAC;QACtD,cAAc,CAAC,aAAa,EAAEA,EAAE,iBAAiB,CAAC,CAAC;IACrD;IACA,IAAI,CAACJ,MAAM,OAAO;IAElB,MAAM,EAAEO,IAAI,EAAE,GAAGP;IAEjB,OAAO,WAAP,GACE,IAACQ,YAAUA;QACT,MAAK;QACL,aAAa;YACX,MAAM;YACN,MAAM,WAAN,GACE,IAACC,SAAOA;gBAAC,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GACzC;oBAEN,MAAM7C;oBACN,SAASC;oBACT,KAAKuC;;;;;AAKf"}
@@ -8,9 +8,5 @@ interface WebpackModulesOverallProps {
8
8
  entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;
9
9
  }
10
10
  export declare const WebpackModulesOverallBase: React.FC<WebpackModulesOverallProps>;
11
- export declare const WebpackModulesOverall: React.FC<Omit<{
12
- project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
13
- }, "project"> & Partial<{
14
- body?: any;
15
- }>>;
11
+ export declare const WebpackModulesOverall: React.FC;
16
12
  export {};
@@ -9,8 +9,9 @@ import { Badge } from "../../../components/Badge/index.mjs";
9
9
  import { FileTree } from "../../../components/FileTree/index.mjs";
10
10
  import { KeywordInput } from "../../../components/Form/keyword.mjs";
11
11
  import { Keyword } from "../../../components/Keyword/index.mjs";
12
- import { ServerAPIProvider, withServerAPI } from "../../../components/Manifest/index.mjs";
12
+ import { ServerAPIProvider } from "../../../components/Manifest/index.mjs";
13
13
  import { Size } from "../../../constants.mjs";
14
+ import { useProjectInfo } from "../../../components/Layout/project-info-context.mjs";
14
15
  import { createFileStructures, flattenTreemapData, formatSize, useI18n } from "../../../utils/index.mjs";
15
16
  import { AssetDetail } from "./asset.mjs";
16
17
  import { BundleCards } from "./cards.mjs";
@@ -594,28 +595,26 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
594
595
  ]
595
596
  });
596
597
  };
597
- const WebpackModulesOverall = withServerAPI({
598
- api: SDK.ServerAPI.API.GetProjectInfo,
599
- responsePropName: 'project',
600
- Component: (props)=>{
601
- const { root, errors } = props.project;
602
- return /*#__PURE__*/ jsx(ServerAPIProvider, {
603
- api: SDK.ServerAPI.API.GetAssetsSummary,
604
- body: {
605
- withFileContent: true
606
- },
607
- children: (summary)=>/*#__PURE__*/ jsx(ServerAPIProvider, {
608
- api: SDK.ServerAPI.API.GetEntryPoints,
609
- children: (entryPoints)=>/*#__PURE__*/ jsx(WebpackModulesOverallBase, {
610
- cwd: root,
611
- errors: errors,
612
- summary: summary,
613
- entryPoints: entryPoints
614
- })
615
- })
616
- });
617
- }
618
- });
598
+ const WebpackModulesOverall = ()=>{
599
+ const { project } = useProjectInfo();
600
+ if (!project) return null;
601
+ const { root, errors } = project;
602
+ return /*#__PURE__*/ jsx(ServerAPIProvider, {
603
+ api: SDK.ServerAPI.API.GetAssetsSummary,
604
+ body: {
605
+ withFileContent: true
606
+ },
607
+ children: (summary)=>/*#__PURE__*/ jsx(ServerAPIProvider, {
608
+ api: SDK.ServerAPI.API.GetEntryPoints,
609
+ children: (entryPoints)=>/*#__PURE__*/ jsx(WebpackModulesOverallBase, {
610
+ cwd: root,
611
+ errors: errors,
612
+ summary: summary,
613
+ entryPoints: entryPoints
614
+ })
615
+ })
616
+ });
617
+ };
619
618
  export { WebpackModulesOverall, WebpackModulesOverallBase };
620
619
 
621
620
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodeOutlined,\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n InputNumber,\n Row,\n Select,\n Space,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { debounce, sumBy } from 'es-toolkit/compat';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useCodeDrawer } from 'src/components/base/CodeViewer/useCodeDrawer';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { FileTree } from '../../../components/FileTree';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider, withServerAPI } from '../../../components/Manifest';\nimport { Size } from '../../../constants';\nimport {\n createFileStructures,\n flattenTreemapData,\n formatSize,\n useI18n,\n} from '../../../utils';\nimport { GraphType } from '../constants';\nimport { AssetDetail } from './asset';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport { SearchModal } from './search-modal';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\n\nconst { Option } = Select;\n\nconst cardBodyHeight = 600;\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\nconst tabList = [\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>{'Tree Graph'}</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\" size=\"middle\">\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated module\n </Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where multiple\n modules are merged (or \"hoisted\") into a single\n scope instead of wrapping each module in separate\n function closures. This reduces the bundle size\n and improves runtime performance by minimizing\n function call overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)', marginLeft: 4 }}\n />\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<CodepenCircleOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<DeploymentUnitOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module reasons in\n stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after processing,\n bundling, and optimization. This is what is delivered to the\n browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before any\n processing or transformations. This is the raw size of your\n code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />\n </Tooltip>\n </Space>\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n },\n];\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [selectedEntryPoints, setEntryPoints] = useState<SDK.EntryPointData[]>(\n [],\n );\n const [inputModule, setModuleValue] = useState(0);\n const [inputAssetName, setAssetName] = useState('');\n const [inputAssetSize, setAssetSize] = useState(0);\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [inputModuleUnit, setModuleUnit] = useState('');\n const [inputChunkUnit, setChunkUnit] = useState('');\n const [assetPath, setAssetPath] = useState<string | null>(null);\n const [graphType, setGraphType] = useState('tree' as GraphType);\n const { showCode, codeDrawerComponent } = useCodeDrawer(\n 'Do not have the codes of assets. If you use the lite or brief mode, there will have codes.',\n );\n\n const { t } = useI18n();\n\n const assets = summary.all.total.files;\n\n const handleChange = useCallback(\n (type: string) => (value: string) => {\n if (type === 'module') {\n setModuleUnit(value);\n } else if (type === 'chunk') {\n setChunkUnit(value);\n }\n },\n [],\n );\n\n const selectAfter = (type: string) => (\n <Select defaultValue=\"kb\" onChange={handleChange(type)}>\n <Option value=\"kb\">KB</Option>\n <Option value=\"mb\">MB</Option>\n </Select>\n );\n const onChangeModule = useCallback(\n debounce((newValue: number) => {\n const count =\n inputModuleUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setModuleValue(count);\n }, 300),\n [],\n );\n\n const onChangeAsset = useCallback(\n debounce((newValue: number) => {\n const count =\n inputChunkUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setAssetSize(count);\n }, 300),\n [],\n );\n\n const filteredAssets = useMemo(() => {\n let res = assets.slice();\n\n if (inputAssetName) {\n res = res.filter((e) => e.path.indexOf(inputAssetName) > -1);\n }\n\n if (inputAssetSize > 0) {\n res = res.filter((e) => e.size >= inputAssetSize);\n }\n\n if (selectedEntryPoints.length) {\n res = res.filter((e) => {\n if (selectedEntryPoints.some((ep) => ep.assets.includes(e.path))) {\n return true;\n }\n return false;\n });\n }\n\n return res.sort((a, b) => {\n const _a = a.path.indexOf('/') > -1 ? 1 : 0;\n const _b = b.path.indexOf('/') > -1 ? 1 : 0;\n // return _a - _b;\n return _b - _a;\n });\n }, [assets, selectedEntryPoints, inputAssetName, inputAssetSize]);\n\n useEffect(() => {\n function getFileExtension(filePath: string) {\n const parts = filePath.split('.');\n return parts.length > 1 ? parts.pop() : '';\n }\n\n summary.all.total.files.forEach((f) => {\n const ext = getFileExtension(f.path);\n if (ext === 'js') {\n setAssetPath(f.path);\n }\n });\n }, [summary.all.total.files]);\n\n const assetsStructures = useMemo(() => {\n const res = createFileStructures({\n files: filteredAssets.map((e) => e.path).filter(Boolean),\n fileTitle(file, basename) {\n const target = filteredAssets.find((e) => e.path === file)!;\n const { size, initial, path, content } = target;\n\n return (\n <div\n className={styles.assetBox}\n onClick={() => {\n setAssetPath(path);\n }}\n >\n <Keyword text={basename} keyword={''} className={styles.fileText} />\n <Space size=\"small\" className={styles.assetsTag}>\n <Divider type=\"vertical\" />\n <Typography.Text style={{ color: '#4FD233' }}>\n {formatSize(size)}\n </Typography.Text>\n <Divider type=\"vertical\" />\n {initial ? (\n <Typography.Text style={{ color: '#009A9E' }}>\n initial\n </Typography.Text>\n ) : null}\n <CodeOutlined\n style={{ fontSize: 14, padding: 0 }}\n onClick={() => showCode({ code: content!, filePath: path })}\n />\n </Space>\n </div>\n );\n },\n });\n return res;\n }, [filteredAssets]);\n\n const onSearch = (value: string) => {\n setAssetName(value);\n setDefaultExpandAll(false);\n };\n\n return (\n <>\n <div className=\"bundle-size-card\">\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n <Card\n className=\"bundle-size=card\"\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n hidden={graphType === 'tree'}\n tabProps={{\n size: 'middle',\n }}\n >\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } = Rspack.checkSourceMapSupport(\n data.configs,\n );\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetSummaryBundles}>\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), CSS, and HTML files\n const isTargetFileType = (filePath: string): boolean => {\n const ext = filePath.toLowerCase().split('.').pop() || '';\n return (\n ext === 'js' ||\n ext === 'cjs' ||\n ext === 'mjs' ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) => isTargetFileType(item.asset.path))\n .map((item) => ({\n name: item.asset.path,\n value: item.asset.size,\n children: flattenTreemapData(item.modules).children,\n }));\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n </Card>\n\n <Card\n hidden={graphType === 'treemap'}\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n tabProps={{\n size: 'middle',\n }}\n >\n <Space direction=\"vertical\">\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n {entryPoints && entryPoints.length ? (\n <Col>\n <Select\n mode=\"multiple\"\n value={selectedEntryPoints.map((e) => e.name)}\n style={{ minWidth: 230, width: 'auto', maxWidth: 300 }}\n placeholder={'filter assets by entry point'}\n onChange={(name: string[]) => {\n setEntryPoints(\n name\n .map((e) => entryPoints.find((ep) => ep.name === e)!)\n .filter(Boolean),\n );\n }}\n allowClear\n onClear={() => {\n setEntryPoints([]);\n }}\n >\n {entryPoints.map((e) => {\n return (\n <Select.Option key={e.name} value={e.name}>\n <Space>\n <Bdg\n label={e.name}\n value={formatSize(e.size)}\n tooltip={e.name}\n />\n </Space>\n </Select.Option>\n );\n })}\n </Select>\n </Col>\n ) : null}\n <Col>\n <KeywordInput\n placeholder=\"search asset by keyword\"\n onChange={onSearch}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Asset Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the output assets which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => onChangeAsset(Number(value))}\n addonAfter={selectAfter('chunk')}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Module Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the modules which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => {\n onChangeModule(Number(value));\n }}\n addonAfter={selectAfter('module')}\n />\n </Col>\n </Row>\n <Row>\n <SearchModal />\n </Row>\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n {filteredAssets.length ? (\n <Row gutter={Size.BasePadding}>\n <Col span={6}>\n <Card\n title={\n <Space>\n <Typography.Text>\n {t('Output Assets List')}\n </Typography.Text>\n <Divider type=\"vertical\" />\n <Tooltip\n title={`total assets count is ${assets.length}, the filtered assets count is ${filteredAssets.length}`}\n >\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {filteredAssets.length} / {assets.length}\n </Typography.Text>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {formatSize(sumBy(filteredAssets, (e) => e.size))}\n </Typography.Text>\n </Space>\n }\n size=\"small\"\n bodyStyle={{\n overflow: 'scroll',\n height: cardBodyHeight,\n }}\n >\n <FileTree\n className={styles.assets}\n treeData={assetsStructures}\n autoExpandParent\n defaultExpandAll={\n defaultExpandAll || filteredAssets.length <= 20\n }\n key={`tree_${inputAssetName}_${defaultExpandAll}`}\n />\n </Card>\n </Col>\n <Col span={18}>\n {assetPath ? (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetDetails}\n body={{ assetPath }}\n >\n {(details) => (\n <AssetDetail\n asset={details.asset}\n chunks={details.chunks}\n modules={details.modules}\n height={cardBodyHeight}\n moduleSizeLimit={inputModule}\n root={cwd}\n />\n )}\n </ServerAPIProvider>\n ) : (\n <Card\n bodyStyle={{\n height: cardBodyHeight,\n }}\n >\n <Empty\n description={\n <Typography.Text strong>\n Click the file path on the left to show the\n modules of the asset\n </Typography.Text>\n }\n />\n </Card>\n )}\n </Col>\n </Row>\n ) : (\n <Empty />\n )}\n </Col>\n </Row>\n </Space>\n </Card>\n </div>\n {codeDrawerComponent}\n </>\n );\n};\n\nexport const WebpackModulesOverall = withServerAPI({\n api: SDK.ServerAPI.API.GetProjectInfo,\n responsePropName: 'project',\n Component: (props: {\n project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;\n }) => {\n const { root, errors } = props.project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n },\n});\n"],"names":["Option","Select","cardBodyHeight","tabList","Space","Typography","Tooltip","Row","Col","Tag","InfoCircleOutlined","Button","CodepenCircleOutlined","DeploymentUnitOutlined","WebpackModulesOverallBase","errors","cwd","summary","entryPoints","selectedEntryPoints","setEntryPoints","useState","inputModule","setModuleValue","inputAssetName","setAssetName","inputAssetSize","setAssetSize","defaultExpandAll","setDefaultExpandAll","inputModuleUnit","setModuleUnit","inputChunkUnit","setChunkUnit","assetPath","setAssetPath","graphType","setGraphType","showCode","codeDrawerComponent","useCodeDrawer","t","useI18n","assets","handleChange","useCallback","type","value","selectAfter","onChangeModule","debounce","newValue","count","onChangeAsset","filteredAssets","useMemo","res","e","ep","a","b","_a","_b","useEffect","getFileExtension","filePath","parts","f","ext","assetsStructures","createFileStructures","Boolean","file","basename","target","size","initial","path","content","styles","Keyword","Divider","formatSize","CodeOutlined","onSearch","BundleCards","Card","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isTargetFileType","computedTreeData","item","flattenTreemapData","AssetTreemapWithFilter","Size","name","Bdg","KeywordInput","InputNumber","Number","SearchModal","sumBy","FileTree","details","AssetDetail","Empty","WebpackModulesOverall","withServerAPI","props","root"],"mappings":";;;;;;;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pF;wDACV;kEAEA,kBAAC2G,OAAKA;4DACJ,2BACE,IAACxG,WAAW,IAAI;gEAAC,QAAM;0EAAC;;;;;;2DAWpC,IAACwG,OAAKA,CAAAA;;;;;;;;YAOjBtE;;;AAGP;AAEO,MAAMuE,wBAAwBC,cAAc;IACjD,KAAKvB,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;IACrC,kBAAkB;IAClB,WAAW,CAACwB;QAGV,MAAM,EAAEC,IAAI,EAAElG,MAAM,EAAE,GAAGiG,MAAM,OAAO;QACtC,OAAO,WAAP,GACE,IAACzB,mBAAiBA;YAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB;YACvC,MAAM;gBAAE,iBAAiB;YAAK;sBAE7B,CAACvE,UACO,WAAP,GACE,IAACsE,mBAAiBA;oBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;8BACrD,CAACtE,cAAAA,WAAAA,GACA,IAACJ,2BAAAA;4BACC,KAAKmG;4BACL,QAAQlG;4BACR,SAASE;4BACT,aAAaC;;;;IAQ7B;AACF"}
1
+ {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodeOutlined,\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n InputNumber,\n Row,\n Select,\n Space,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { debounce, sumBy } from 'es-toolkit/compat';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useCodeDrawer } from 'src/components/base/CodeViewer/useCodeDrawer';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { FileTree } from '../../../components/FileTree';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { Size } from '../../../constants';\nimport { useProjectInfo } from '../../../components/Layout/project-info-context';\nimport {\n createFileStructures,\n flattenTreemapData,\n formatSize,\n useI18n,\n} from '../../../utils';\nimport { GraphType } from '../constants';\nimport { AssetDetail } from './asset';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport { SearchModal } from './search-modal';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\n\nconst { Option } = Select;\n\nconst cardBodyHeight = 600;\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\nconst tabList = [\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>{'Tree Graph'}</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\" size=\"middle\">\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated module\n </Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where multiple\n modules are merged (or \"hoisted\") into a single\n scope instead of wrapping each module in separate\n function closures. This reduces the bundle size\n and improves runtime performance by minimizing\n function call overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)', marginLeft: 4 }}\n />\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<CodepenCircleOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button size=\"small\" icon={<DeploymentUnitOutlined />} />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module reasons in\n stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after processing,\n bundling, and optimization. This is what is delivered to the\n browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before any\n processing or transformations. This is the raw size of your\n code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />\n </Tooltip>\n </Space>\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n },\n];\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [selectedEntryPoints, setEntryPoints] = useState<SDK.EntryPointData[]>(\n [],\n );\n const [inputModule, setModuleValue] = useState(0);\n const [inputAssetName, setAssetName] = useState('');\n const [inputAssetSize, setAssetSize] = useState(0);\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [inputModuleUnit, setModuleUnit] = useState('');\n const [inputChunkUnit, setChunkUnit] = useState('');\n const [assetPath, setAssetPath] = useState<string | null>(null);\n const [graphType, setGraphType] = useState('tree' as GraphType);\n const { showCode, codeDrawerComponent } = useCodeDrawer(\n 'Do not have the codes of assets. If you use the lite or brief mode, there will have codes.',\n );\n\n const { t } = useI18n();\n\n const assets = summary.all.total.files;\n\n const handleChange = useCallback(\n (type: string) => (value: string) => {\n if (type === 'module') {\n setModuleUnit(value);\n } else if (type === 'chunk') {\n setChunkUnit(value);\n }\n },\n [],\n );\n\n const selectAfter = (type: string) => (\n <Select defaultValue=\"kb\" onChange={handleChange(type)}>\n <Option value=\"kb\">KB</Option>\n <Option value=\"mb\">MB</Option>\n </Select>\n );\n const onChangeModule = useCallback(\n debounce((newValue: number) => {\n const count =\n inputModuleUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setModuleValue(count);\n }, 300),\n [],\n );\n\n const onChangeAsset = useCallback(\n debounce((newValue: number) => {\n const count =\n inputChunkUnit === 'mb' ? newValue * 1024 * 1024 : newValue * 1024;\n setAssetSize(count);\n }, 300),\n [],\n );\n\n const filteredAssets = useMemo(() => {\n let res = assets.slice();\n\n if (inputAssetName) {\n res = res.filter((e) => e.path.indexOf(inputAssetName) > -1);\n }\n\n if (inputAssetSize > 0) {\n res = res.filter((e) => e.size >= inputAssetSize);\n }\n\n if (selectedEntryPoints.length) {\n res = res.filter((e) => {\n if (selectedEntryPoints.some((ep) => ep.assets.includes(e.path))) {\n return true;\n }\n return false;\n });\n }\n\n return res.sort((a, b) => {\n const _a = a.path.indexOf('/') > -1 ? 1 : 0;\n const _b = b.path.indexOf('/') > -1 ? 1 : 0;\n // return _a - _b;\n return _b - _a;\n });\n }, [assets, selectedEntryPoints, inputAssetName, inputAssetSize]);\n\n useEffect(() => {\n function getFileExtension(filePath: string) {\n const parts = filePath.split('.');\n return parts.length > 1 ? parts.pop() : '';\n }\n\n summary.all.total.files.forEach((f) => {\n const ext = getFileExtension(f.path);\n if (ext === 'js') {\n setAssetPath(f.path);\n }\n });\n }, [summary.all.total.files]);\n\n const assetsStructures = useMemo(() => {\n const res = createFileStructures({\n files: filteredAssets.map((e) => e.path).filter(Boolean),\n fileTitle(file, basename) {\n const target = filteredAssets.find((e) => e.path === file)!;\n const { size, initial, path, content } = target;\n\n return (\n <div\n className={styles.assetBox}\n onClick={() => {\n setAssetPath(path);\n }}\n >\n <Keyword text={basename} keyword={''} className={styles.fileText} />\n <Space size=\"small\" className={styles.assetsTag}>\n <Divider type=\"vertical\" />\n <Typography.Text style={{ color: '#4FD233' }}>\n {formatSize(size)}\n </Typography.Text>\n <Divider type=\"vertical\" />\n {initial ? (\n <Typography.Text style={{ color: '#009A9E' }}>\n initial\n </Typography.Text>\n ) : null}\n <CodeOutlined\n style={{ fontSize: 14, padding: 0 }}\n onClick={() => showCode({ code: content!, filePath: path })}\n />\n </Space>\n </div>\n );\n },\n });\n return res;\n }, [filteredAssets]);\n\n const onSearch = (value: string) => {\n setAssetName(value);\n setDefaultExpandAll(false);\n };\n\n return (\n <>\n <div className=\"bundle-size-card\">\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n <Card\n className=\"bundle-size=card\"\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n hidden={graphType === 'tree'}\n tabProps={{\n size: 'middle',\n }}\n >\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } = Rspack.checkSourceMapSupport(\n data.configs,\n );\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetSummaryBundles}>\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), CSS, and HTML files\n const isTargetFileType = (filePath: string): boolean => {\n const ext = filePath.toLowerCase().split('.').pop() || '';\n return (\n ext === 'js' ||\n ext === 'cjs' ||\n ext === 'mjs' ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) => isTargetFileType(item.asset.path))\n .map((item) => ({\n name: item.asset.path,\n value: item.asset.size,\n children: flattenTreemapData(item.modules).children,\n }));\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n </Card>\n\n <Card\n hidden={graphType === 'treemap'}\n tabList={tabList}\n activeTabKey={graphType as 'tree' | 'treemap'}\n onTabChange={(e) => setGraphType(e as 'tree' | 'treemap')}\n tabProps={{\n size: 'middle',\n }}\n >\n <Space direction=\"vertical\">\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n {entryPoints && entryPoints.length ? (\n <Col>\n <Select\n mode=\"multiple\"\n value={selectedEntryPoints.map((e) => e.name)}\n style={{ minWidth: 230, width: 'auto', maxWidth: 300 }}\n placeholder={'filter assets by entry point'}\n onChange={(name: string[]) => {\n setEntryPoints(\n name\n .map((e) => entryPoints.find((ep) => ep.name === e)!)\n .filter(Boolean),\n );\n }}\n allowClear\n onClear={() => {\n setEntryPoints([]);\n }}\n >\n {entryPoints.map((e) => {\n return (\n <Select.Option key={e.name} value={e.name}>\n <Space>\n <Bdg\n label={e.name}\n value={formatSize(e.size)}\n tooltip={e.name}\n />\n </Space>\n </Select.Option>\n );\n })}\n </Select>\n </Col>\n ) : null}\n <Col>\n <KeywordInput\n placeholder=\"search asset by keyword\"\n onChange={onSearch}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Asset Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the output assets which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => onChangeAsset(Number(value))}\n addonAfter={selectAfter('chunk')}\n />\n </Col>\n <Col span={6}>\n <InputNumber\n min={0}\n style={{ width: '95%' }}\n addonBefore={\n <Space>\n <Typography.Text\n style={{ fontSize: 14, color: 'inherit' }}\n >\n Module Size\n </Typography.Text>\n <Tooltip\n title={t(\n 'filter the modules which size is greater than the input value',\n )}\n style={{ marginLeft: 3 }}\n >\n <InfoCircleOutlined\n style={{ color: 'rgba(0,0,0,.45)' }}\n />\n </Tooltip>\n </Space>\n }\n onChange={(value) => {\n onChangeModule(Number(value));\n }}\n addonAfter={selectAfter('module')}\n />\n </Col>\n </Row>\n <Row>\n <SearchModal />\n </Row>\n <Row align=\"middle\" gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n {filteredAssets.length ? (\n <Row gutter={Size.BasePadding}>\n <Col span={6}>\n <Card\n title={\n <Space>\n <Typography.Text>\n {t('Output Assets List')}\n </Typography.Text>\n <Divider type=\"vertical\" />\n <Tooltip\n title={`total assets count is ${assets.length}, the filtered assets count is ${filteredAssets.length}`}\n >\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {filteredAssets.length} / {assets.length}\n </Typography.Text>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n {formatSize(sumBy(filteredAssets, (e) => e.size))}\n </Typography.Text>\n </Space>\n }\n size=\"small\"\n bodyStyle={{\n overflow: 'scroll',\n height: cardBodyHeight,\n }}\n >\n <FileTree\n className={styles.assets}\n treeData={assetsStructures}\n autoExpandParent\n defaultExpandAll={\n defaultExpandAll || filteredAssets.length <= 20\n }\n key={`tree_${inputAssetName}_${defaultExpandAll}`}\n />\n </Card>\n </Col>\n <Col span={18}>\n {assetPath ? (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetDetails}\n body={{ assetPath }}\n >\n {(details) => (\n <AssetDetail\n asset={details.asset}\n chunks={details.chunks}\n modules={details.modules}\n height={cardBodyHeight}\n moduleSizeLimit={inputModule}\n root={cwd}\n />\n )}\n </ServerAPIProvider>\n ) : (\n <Card\n bodyStyle={{\n height: cardBodyHeight,\n }}\n >\n <Empty\n description={\n <Typography.Text strong>\n Click the file path on the left to show the\n modules of the asset\n </Typography.Text>\n }\n />\n </Card>\n )}\n </Col>\n </Row>\n ) : (\n <Empty />\n )}\n </Col>\n </Row>\n </Space>\n </Card>\n </div>\n {codeDrawerComponent}\n </>\n );\n};\n\nexport const WebpackModulesOverall: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { root, errors } = project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["Option","Select","cardBodyHeight","tabList","Space","Typography","Tooltip","Row","Col","Tag","InfoCircleOutlined","Button","CodepenCircleOutlined","DeploymentUnitOutlined","WebpackModulesOverallBase","errors","cwd","summary","entryPoints","selectedEntryPoints","setEntryPoints","useState","inputModule","setModuleValue","inputAssetName","setAssetName","inputAssetSize","setAssetSize","defaultExpandAll","setDefaultExpandAll","inputModuleUnit","setModuleUnit","inputChunkUnit","setChunkUnit","assetPath","setAssetPath","graphType","setGraphType","showCode","codeDrawerComponent","useCodeDrawer","t","useI18n","assets","handleChange","useCallback","type","value","selectAfter","onChangeModule","debounce","newValue","count","onChangeAsset","filteredAssets","useMemo","res","e","ep","a","b","_a","_b","useEffect","getFileExtension","filePath","parts","f","ext","assetsStructures","createFileStructures","Boolean","file","basename","target","size","initial","path","content","styles","Keyword","Divider","formatSize","CodeOutlined","onSearch","BundleCards","Card","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isTargetFileType","computedTreeData","item","flattenTreemapData","AssetTreemapWithFilter","Size","name","Bdg","KeywordInput","InputNumber","Number","SearchModal","sumBy","FileTree","details","AssetDetail","Empty","WebpackModulesOverall","project","useProjectInfo","root"],"mappings":";;;;;;;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QpF;wDACV;kEAEA,kBAAC2G,OAAKA;4DACJ,2BACE,IAACxG,WAAW,IAAI;gEAAC,QAAM;0EAAC;;;;;;2DAWpC,IAACwG,OAAKA,CAAAA;;;;;;;;YAOjBtE;;;AAGP;AAEO,MAAMuE,wBAAkC;IAC7C,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,SACH,OAAO;IAGT,MAAM,EAAEE,IAAI,EAAElG,MAAM,EAAE,GAAGgG;IACzB,OAAO,WAAP,GACE,IAACxB,mBAAiBA;QAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB;QACvC,MAAM;YAAE,iBAAiB;QAAK;kBAE7B,CAACvE,UACO,WAAP,GACE,IAACsE,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAACtE,cAAAA,WAAAA,GACA,IAACJ,2BAAAA;wBACC,KAAKmG;wBACL,QAAQlG;wBACR,SAASE;wBACT,aAAaC;;;;AAQ7B"}
@@ -1,9 +1,3 @@
1
- import { SDK } from '@rsdoctor/types';
2
1
  import React from 'react';
3
- interface Props {
4
- project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;
5
- }
6
- export declare const Page: React.FC<Omit<Props, "project"> & Partial<{
7
- body?: any;
8
- }>>;
2
+ export declare const Page: React.FC<{}>;
9
3
  export * from './constants.js';
@@ -1,16 +1,17 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { SDK } from "@rsdoctor/types";
3
2
  import "react";
4
3
  import { Flex } from "antd";
5
4
  import { HelpCenter } from "../../components/Overall/help-center.mjs";
6
5
  import { BundleAlerts } from "../../components/Alerts/index.mjs";
7
- import { withServerAPI } from "../../components/Manifest/index.mjs";
8
6
  import { BundleOverall, CompileOverall, ProjectOverall } from "../../components/Overall/index.mjs";
9
7
  import { ResponsiveLayout } from "./responsiveLayout.mjs";
8
+ import { useProjectInfo } from "../../components/Layout/project-info-context.mjs";
10
9
  import index_module from "./index.module.mjs";
11
10
  export * from "./constants.mjs";
12
- const Component = ({ project })=>{
13
- const { summary, configs, root: cwd, envinfo, errors } = project;
11
+ const Component = ()=>{
12
+ const { project } = useProjectInfo();
13
+ if (!project) return null;
14
+ const { summary, configs, root: cwd, envinfo, errors, name } = project;
14
15
  return /*#__PURE__*/ jsx("div", {
15
16
  className: index_module.overall,
16
17
  children: /*#__PURE__*/ jsxs(Flex, {
@@ -30,7 +31,8 @@ const Component = ({ project })=>{
30
31
  configs: configs,
31
32
  cwd: cwd,
32
33
  envinfo: envinfo,
33
- alerts: errors
34
+ alerts: errors,
35
+ name: name
34
36
  }),
35
37
  /*#__PURE__*/ jsx(BundleAlerts, {})
36
38
  ]
@@ -57,11 +59,7 @@ const Component = ({ project })=>{
57
59
  })
58
60
  });
59
61
  };
60
- const Page = withServerAPI({
61
- api: SDK.ServerAPI.API.GetProjectInfo,
62
- responsePropName: 'project',
63
- Component
64
- });
62
+ const Page = Component;
65
63
  export { Page };
66
64
 
67
65
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pages/Overall/index.mjs","sources":["../../../src/pages/Overall/index.tsx"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport React from 'react';\nimport { Flex } from 'antd';\n\nimport { HelpCenter } from '../../components/Overall/help-center';\nimport { BundleAlerts } from '../../components/Alerts';\nimport { withServerAPI } from '../../components/Manifest';\nimport {\n BundleOverall,\n CompileOverall,\n ProjectOverall,\n} from '../../components/Overall';\nimport { ResponsiveLayout } from './responsiveLayout';\n\nimport style from './index.module.scss';\n\ninterface Props {\n project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;\n}\n\nconst Component: React.FC<Props> = ({ project }) => {\n const { summary, configs, root: cwd, envinfo, errors } = project;\n\n return (\n <div className={style.overall}>\n <Flex style={{ width: '100%' }}>\n <div style={{ flex: 3, marginRight: '16px', maxWidth: '75%' }}>\n <ResponsiveLayout>\n <ProjectOverall\n configs={configs}\n cwd={cwd}\n envinfo={envinfo}\n alerts={errors}\n />\n <BundleAlerts />\n </ResponsiveLayout>\n </div>\n\n <div style={{ flex: 1 }}>\n <ResponsiveLayout>\n <BundleOverall errors={errors} cwd={cwd} />\n <CompileOverall summary={summary} />\n <HelpCenter />\n </ResponsiveLayout>\n </div>\n </Flex>\n </div>\n );\n};\n\nexport const Page = withServerAPI({\n api: SDK.ServerAPI.API.GetProjectInfo,\n responsePropName: 'project',\n Component,\n});\n\nexport * from './constants';\n"],"names":["Component","project","summary","configs","cwd","envinfo","errors","style","Flex","ResponsiveLayout","ProjectOverall","BundleAlerts","BundleOverall","CompileOverall","HelpCenter","Page","withServerAPI","SDK"],"mappings":";;;;;;;;;;;AAoBA,MAAMA,YAA6B,CAAC,EAAEC,OAAO,EAAE;IAC7C,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,MAAMC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGL;IAEzD,OAAO,WAAP,GACE,IAAC;QAAI,WAAWM,aAAAA,OAAa;kBAC3B,mBAACC,MAAIA;YAAC,OAAO;gBAAE,OAAO;YAAO;;8BAC3B,IAAC;oBAAI,OAAO;wBAAE,MAAM;wBAAG,aAAa;wBAAQ,UAAU;oBAAM;8BAC1D,mBAACC,kBAAgBA;;0CACf,IAACC,gBAAcA;gCACb,SAASP;gCACT,KAAKC;gCACL,SAASC;gCACT,QAAQC;;0CAEV,IAACK,cAAYA,CAAAA;;;;8BAIjB,IAAC;oBAAI,OAAO;wBAAE,MAAM;oBAAE;8BACpB,mBAACF,kBAAgBA;;0CACf,IAACG,eAAaA;gCAAC,QAAQN;gCAAQ,KAAKF;;0CACpC,IAACS,gBAAcA;gCAAC,SAASX;;0CACzB,IAACY,YAAUA,CAAAA;;;;;;;AAMvB;AAEO,MAAMC,OAAOC,cAAc;IAChC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;IACrC,kBAAkB;IAClBjB;AACF"}
1
+ {"version":3,"file":"pages/Overall/index.mjs","sources":["../../../src/pages/Overall/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex } from 'antd';\n\nimport { HelpCenter } from '../../components/Overall/help-center';\nimport { BundleAlerts } from '../../components/Alerts';\nimport {\n BundleOverall,\n CompileOverall,\n ProjectOverall,\n} from '../../components/Overall';\nimport { ResponsiveLayout } from './responsiveLayout';\nimport { useProjectInfo } from '../../components/Layout/project-info-context';\n\nimport style from './index.module.scss';\n\nconst Component: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { summary, configs, root: cwd, envinfo, errors, name } = project;\n\n return (\n <div className={style.overall}>\n <Flex style={{ width: '100%' }}>\n <div style={{ flex: 3, marginRight: '16px', maxWidth: '75%' }}>\n <ResponsiveLayout>\n <ProjectOverall\n configs={configs}\n cwd={cwd}\n envinfo={envinfo}\n alerts={errors}\n name={name}\n />\n <BundleAlerts />\n </ResponsiveLayout>\n </div>\n\n <div style={{ flex: 1 }}>\n <ResponsiveLayout>\n <BundleOverall errors={errors} cwd={cwd} />\n <CompileOverall summary={summary} />\n <HelpCenter />\n </ResponsiveLayout>\n </div>\n </Flex>\n </div>\n );\n};\n\nexport const Page = Component;\n\nexport * from './constants';\n"],"names":["Component","project","useProjectInfo","summary","configs","cwd","envinfo","errors","name","style","Flex","ResponsiveLayout","ProjectOverall","BundleAlerts","BundleOverall","CompileOverall","HelpCenter","Page"],"mappings":";;;;;;;;;;AAeA,MAAMA,YAAsB;IAC1B,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,SACH,OAAO;IAGT,MAAM,EAAEE,OAAO,EAAEC,OAAO,EAAE,MAAMC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGP;IAE/D,OAAO,WAAP,GACE,IAAC;QAAI,WAAWQ,aAAAA,OAAa;kBAC3B,mBAACC,MAAIA;YAAC,OAAO;gBAAE,OAAO;YAAO;;8BAC3B,IAAC;oBAAI,OAAO;wBAAE,MAAM;wBAAG,aAAa;wBAAQ,UAAU;oBAAM;8BAC1D,mBAACC,kBAAgBA;;0CACf,IAACC,gBAAcA;gCACb,SAASR;gCACT,KAAKC;gCACL,SAASC;gCACT,QAAQC;gCACR,MAAMC;;0CAER,IAACK,cAAYA,CAAAA;;;;8BAIjB,IAAC;oBAAI,OAAO;wBAAE,MAAM;oBAAE;8BACpB,mBAACF,kBAAgBA;;0CACf,IAACG,eAAaA;gCAAC,QAAQP;gCAAQ,KAAKF;;0CACpC,IAACU,gBAAcA;gCAAC,SAASZ;;0CACzB,IAACa,YAAUA,CAAAA;;;;;;;AAMvB;AAEO,MAAMC,OAAOjB"}
@@ -12,10 +12,9 @@ export type DataNode = FieldDataNode<{
12
12
  export declare const rootDirname: (file: string, sep?: string) => string | null;
13
13
  export declare function mapFileKey(arr: DataNode[], depth?: number, filter?: (node: DataNode) => boolean): DataNode['key'][];
14
14
  export declare function flattenDirectory(n: DataNode, parent: DataNode, sep: string | undefined, inlinedResourcePathKey: keyof DataNode, dirTitle?: (_dir: DataNode, defaultTitle: string) => JSX.Element | string): void;
15
- export declare function createFileStructures({ files, sep, inlinedResourcePathKey, fileTitle, dirTitle, page, }: {
15
+ export declare function createFileStructures({ files, inlinedResourcePathKey, fileTitle, dirTitle, page, }: {
16
16
  files: string[];
17
17
  cwd?: string;
18
- sep?: string;
19
18
  inlinedResourcePathKey?: keyof DataNode;
20
19
  dirTitle?(dir: DataNode, defaultTitle: string): JSX.Element | string;
21
20
  fileTitle?(file: string, basename: string): JSX.Element | string;
@@ -6,7 +6,7 @@ import { getFileCom } from "../components/FileTree/index.mjs";
6
6
  const rootDirname = (file, sep = '/')=>{
7
7
  const idx = file?.indexOf(sep);
8
8
  if (-1 === idx) return null;
9
- if (0 === idx) return sep + (rootDirname(file?.slice(1)) || '');
9
+ if (0 === idx) return sep + (rootDirname(file?.slice(1), sep) || '');
10
10
  return file?.slice(0, idx);
11
11
  };
12
12
  function mapFileKey(arr, depth = 2, filter = ()=>true) {
@@ -49,10 +49,12 @@ function flattenDirectory(n, parent, sep = '/', inlinedResourcePathKey, dirTitle
49
49
  });
50
50
  }
51
51
  }
52
- function createFileStructures({ files, sep = '/', inlinedResourcePathKey = '__RESOURCEPATH__', fileTitle = (_file, basename)=>basename, dirTitle = (_dir, defaultTitle)=>defaultTitle, page = 'other' }) {
53
- const sepRegexp = new RegExp(sep);
54
- const res = files.reduce((t, file)=>{
55
- let dir = rootDirname(file, sep);
52
+ function createFileStructures({ files, inlinedResourcePathKey = '__RESOURCEPATH__', fileTitle = (_file, basename)=>basename, dirTitle = (_dir, defaultTitle)=>defaultTitle, page = 'other' }) {
53
+ const normalizedFiles = files.map((file)=>file.replace(/\\/g, '/'));
54
+ const internalSep = '/';
55
+ const sepRegexp = new RegExp(internalSep);
56
+ const res = normalizedFiles.reduce((t, file)=>{
57
+ let dir = rootDirname(file, internalSep);
56
58
  let basename = dir ? file?.slice(dir.length + 1) : file;
57
59
  let parent = t;
58
60
  while(dir){
@@ -61,7 +63,7 @@ function createFileStructures({ files, sep = '/', inlinedResourcePathKey = '__RE
61
63
  const p = [
62
64
  parent[inlinedResourcePathKey],
63
65
  dir
64
- ].filter(Boolean).join(sep);
66
+ ].filter(Boolean).join(internalSep);
65
67
  exist = {
66
68
  title: dir,
67
69
  icon: 'bundle' === page ? (props)=>getFileIcon(props, false) : null,
@@ -73,7 +75,7 @@ function createFileStructures({ files, sep = '/', inlinedResourcePathKey = '__RE
73
75
  parent.children.push(exist);
74
76
  }
75
77
  parent = exist;
76
- dir = rootDirname(basename);
78
+ dir = rootDirname(basename, internalSep);
77
79
  basename = dir ? basename.slice(dir.length).replace(sepRegexp, '') : basename;
78
80
  }
79
81
  if (parent.children.some((e)=>get(e, inlinedResourcePathKey) === file)) return t;
@@ -93,7 +95,7 @@ function createFileStructures({ files, sep = '/', inlinedResourcePathKey = '__RE
93
95
  children: []
94
96
  }).children;
95
97
  res.forEach((e)=>{
96
- e.children && e.children.forEach((item)=>flattenDirectory(item, e, sep, inlinedResourcePathKey, dirTitle));
98
+ e.children && e.children.forEach((item)=>flattenDirectory(item, e, internalSep, inlinedResourcePathKey, dirTitle));
97
99
  });
98
100
  return res;
99
101
  }