import { defineConfig } from "dumi";
import { join } from "path";

export default defineConfig({
  history: {
    type: "hash",
  },
  title: "@dage/tools",
  favicon: "https://4dkk.4dage.com/FDKKIMG/icon/kankan_icon.ico",
  outputPath: "docs-dist",
  mode: "site",
  resolve: {
    includes: ["./docs"],
  },
  alias: {
    "@dage/utils": join(__dirname, "../utils/dist/"),
    "@dage/pc-components": join(__dirname, "../pc-components/dist/"),
  },
  navs: [
    {
      title: "组件",
      path: "/components",
    },
    {
      title: "工具",
      path: "/utils",
    },
    {
      title: "更新日志",
      path: "/log",
    },
    {
      title: "Gogs",
      path: "http://face3d.4dage.com:7005/chenlei/dage-web-tools",
    },
  ],
  menus: {
    "/components": [
      {
        title: "获取用户信息",
        path: "/components/login",
      },
      {
        title: "布局",
        children: ["/components/TableActions"],
      },
      {
        title: "表单组件",
        children: [
          "/components/Upload",
          "/components/FileCheckbox",
          "/components/Map",
        ],
      },
      {
        title: "工具",
        children: ["/components/utils/services", "/components/utils/storage"],
      },
    ],
    "/utils": [
      {
        title: "EventBus 事件",
        path: "/utils/eventbus",
      },
      {
        title: "日期格式化",
        path: "/utils/date",
      },
    ],
    "/log": [
      {
        title: "pc-components 更新日志",
        path: "/log/PC-COMPONENTS_CHANGELOG",
      },
      {
        title: "backend-cli 更新日志",
        path: "/log/BACKEND-CLI_CHANGELOG",
      },
    ],
  },
  // more config: https://d.umijs.org/config
});
