-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore(deps): upgrade dumi from ^1.1.48 to ^2.1.13 * chore: modify prepare command * chore: modify gitignore * chore(ts): add new paths * docs: change single-tag to double-tag * chore: 调整 dumi 配置 * docs: demo 中的注释字段升级 * docs: 文档 FrontMatter 完善 * docs: 补充 en 文档的 FrontMatter * chore: rename dir * chore: 调整配置 * refactor: 调整样式 * docs: 调整 Hooks nav 的顺序 * docs: close tag * style: format * chore: use dumi contract routing * chore: remove comment & update i18n * chore: format & lint * chore: update eslint config & ts alias * chore: use dumi-theme-antd * chore: update * chore: update home page * docs: update i18n of useRequest * docs: update title * chore: update * chore: update dumi theme * docs: update * chore: update theme deps & config * chore: update lock * chore: update theme * docs: change demo to 2 cols * chore: change theme pkg name * chore: update dumi config * docs: request docs update * docs: update * chore: update dumi and dumi theme to latest * chore: demo - space wrap * docs: update * docs: remove h1 title * docs: update * docs: update
- Loading branch information
Showing
385 changed files
with
13,400 additions
and
7,637 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* sidebar: false | ||
*/ | ||
|
||
import React from 'react'; | ||
import { HomeBaseLayout } from '@ahooks.js/dumi-theme-antd'; | ||
|
||
const Index = () => { | ||
return <HomeBaseLayout></HomeBaseLayout>; | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* sidebar: false | ||
*/ | ||
|
||
import React from 'react'; | ||
import { HomeBaseLayout } from '@ahooks.js/dumi-theme-antd'; | ||
|
||
const Index = () => { | ||
return <HomeBaseLayout></HomeBaseLayout>; | ||
}; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"include": ["**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
import { defineConfig } from 'dumi'; | ||
|
||
const packages = require('./packages/hooks/package.json'); | ||
|
||
export default defineConfig({ | ||
mfsu: false, | ||
ssr: process.env.NODE_ENV === 'development' ? false : {}, | ||
manifest: {}, | ||
alias: { | ||
ahooks: process.cwd() + '/packages/hooks/src/index.ts', | ||
'@ahooksjs/use-url-state': process.cwd() + '/packages/use-url-state/src/index.ts', | ||
}, | ||
resolve: { | ||
docDirs: ['docs'], | ||
atomDirs: [ | ||
{ type: 'hook', dir: 'packages/hooks/src' }, | ||
{ type: 'hook', dir: 'packages/hooks/src/useRequest/docs' }, | ||
{ type: 'hook', dir: 'packages/use-url-state' }, | ||
], | ||
}, | ||
sitemap: { | ||
hostname: 'https://ahooks.js.org/', | ||
}, | ||
favicons: ['/simple-logo.svg'], | ||
locales: [ | ||
{ id: 'en-US', name: 'English' }, | ||
{ id: 'zh-CN', name: '中文' }, | ||
], | ||
themeConfig: { | ||
logo: '/logo.svg', | ||
title: 'ahooks', | ||
bannerConfig: { | ||
showBanner: false, | ||
}, | ||
description: { | ||
'en-US': 'A high-quality & reliable React Hooks library', | ||
'zh-CN': '一套高质量可靠的 React Hooks 库', | ||
}, | ||
actions: { | ||
'en-US': [ | ||
{ text: 'Getting Started', link: '/guide', type: 'primary' }, | ||
{ text: 'Hooks List', link: '/hooks/index' }, | ||
], | ||
'zh-CN': [ | ||
{ text: '开始使用', link: '/zh-CN/guide', type: 'primary' }, | ||
{ text: 'Hooks 列表', link: '/zh-CN/hooks/index' }, | ||
], | ||
}, | ||
features: { | ||
'en-US': [ | ||
{ title: 'Easy to learn and use' }, | ||
{ title: 'Supports SSR' }, | ||
{ title: 'Special treatment for functions, avoid closure problems' }, | ||
{ | ||
title: | ||
'Contains a large number of advanced Hooks that are refined from business scenarios', | ||
}, | ||
{ title: 'Contains a comprehensive collection of basic Hooks' }, | ||
{ title: 'Written in TypeScript with predictable static types' }, | ||
], | ||
'zh-CN': [ | ||
{ title: '易学易用' }, | ||
{ title: '支持 SSR' }, | ||
{ title: '对输入输出函数做了特殊处理,避免闭包问题' }, | ||
{ title: '包含大量提炼自业务的高级 Hooks' }, | ||
{ title: '包含丰富的基础 Hooks' }, | ||
{ title: '使用 TypeScript 构建,提供完整的类型定义文件' }, | ||
], | ||
}, | ||
rtl: true, | ||
socialLinks: { | ||
github: 'https://github.com/alibaba/hooks', | ||
}, | ||
docVersions: { | ||
[packages.version]: '', | ||
'v2.x': 'https://ahooks-v2.js.org/', | ||
'v1.x': 'http://hooks.umijs.org/', | ||
}, | ||
localesEnhance: [ | ||
{ id: 'en-US', switchPrefix: 'En' }, | ||
{ id: 'zh-CN', switchPrefix: '中' }, | ||
], | ||
sidebarGroupModePath: ['/guide', '/hooks', '/blog'], | ||
nav: { | ||
'en-US': [ | ||
{ title: 'Guide', link: '/guide' }, | ||
{ title: 'Hooks', link: '/hooks/index' }, | ||
{ title: 'Blog', link: '/blog/function' }, | ||
{ title: 'Releases', link: 'https://github.com/alibaba/hooks/releases' }, | ||
{ title: 'Mirror', link: 'https://ahooks.gitee.io' }, | ||
], | ||
'zh-CN': [ | ||
{ title: '指南', link: '/zh-CN/guide' }, | ||
{ title: 'Hooks', link: '/zh-CN/hooks/index' }, | ||
{ title: '博客', link: '/zh-CN/blog/function' }, | ||
{ title: '更新日志', link: 'https://github.com/alibaba/hooks/releases' }, | ||
{ title: '国内镜像', link: 'https://ahooks.gitee.io/zh-CN' }, | ||
], | ||
}, | ||
footer: | ||
'Open-source MIT Licensed | Copyright © 2019-present<br />Powered by <a href="https://d.umijs.org" target="_blank">dumi</a>', | ||
}, | ||
links: [ | ||
// Used by the `useFusionTable` demo | ||
{ | ||
rel: 'stylesheet', | ||
href: 'https://unpkg.com/@alifd/[email protected]/dist/next-noreset.min.css', | ||
}, | ||
{ rel: 'stylesheet', href: '/style.css' }, | ||
], | ||
scripts: [ | ||
`const insertVersion = function() { | ||
const logo = document.querySelector('.__dumi-default-navbar-logo'); | ||
if (!logo) return; | ||
const dom = document.createElement('span'); | ||
dom.id = 'logo-version'; | ||
dom.innerHTML = '${packages.version}'; | ||
logo.parentNode.insertBefore(dom, logo.nextSibling); | ||
}; | ||
const observer = new MutationObserver((mutationsList, observer) => { | ||
for (const mutation of mutationsList) { | ||
if (mutation.type === 'childList') { | ||
const logoVersion = document.querySelector('#logo-version'); | ||
if (logoVersion) { | ||
observer.disconnect(); | ||
} else { | ||
insertVersion(); | ||
} | ||
} | ||
} | ||
}); | ||
observer.observe(document.body, { childList: true, subtree: true });`, | ||
], | ||
extraBabelPlugins: [ | ||
[ | ||
'babel-plugin-import', | ||
{ | ||
libraryName: 'antd', | ||
libraryDirectory: 'es', | ||
style: true, | ||
}, | ||
'antd', | ||
], | ||
[ | ||
'babel-plugin-import', | ||
{ | ||
libraryName: '@alifd/next', | ||
style: false, | ||
}, | ||
'fusion', | ||
], | ||
], | ||
// https://github.com/alibaba/hooks/issues/2155 | ||
extraBabelIncludes: ['filter-obj'], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.