From ba9870ef5d9aedcb76d58f983cdd6df1bf877b7c Mon Sep 17 00:00:00 2001 From: Wuxh Date: Mon, 6 Feb 2023 13:03:14 +0800 Subject: [PATCH 1/2] chore: upgrade site && update pr-template (#40563) * docs: update pr-template * chore: update Previewer onlineUrl show logic --- .dumi/theme/builtins/Previewer/index.tsx | 7 +++++-- .github/PULL_REQUEST_TEMPLATE/pr_cn.md | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.dumi/theme/builtins/Previewer/index.tsx b/.dumi/theme/builtins/Previewer/index.tsx index 0f82807af7..a898e98bb4 100644 --- a/.dumi/theme/builtins/Previewer/index.tsx +++ b/.dumi/theme/builtins/Previewer/index.tsx @@ -87,9 +87,12 @@ const Demo: React.FC = (props) => { const { theme } = useContext(SiteContext); const { hash, pathname, search } = location; - const isDev = process.env.NODE_ENV === 'development'; const docsOnlineUrl = `https://ant.design${pathname}${search}#${meta.id}`; + const regexp = /preview-(\d+)-ant-design/; // matching PR preview addresses + const showOnlineUrl = + process.env.NODE_ENV === 'development' || regexp.test(window.location.hostname); + const handleCodeExpand = (demo: string) => { setCodeExpand((prev) => !prev); track({ type: 'expand', demo }); @@ -347,7 +350,7 @@ const Demo: React.FC = (props) => {
{introChildren}
- {isDev && ( + {showOnlineUrl && ( }> ### 💡 需求背景和解决方案 From 3fdedacf3823a7e1ae84519ad841dbf5102c35d8 Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 6 Feb 2023 14:19:05 +0800 Subject: [PATCH 2/2] chore: lock eslint-plugin-compat (#40558) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a58bd03c4b..2bb492c145 100644 --- a/package.json +++ b/package.json @@ -208,7 +208,7 @@ "eslint-config-airbnb": "^19.0.0", "eslint-config-prettier": "^8.0.0", "eslint-import-resolver-typescript": "^3.5.2", - "eslint-plugin-compat": "^4.0.0", + "eslint-plugin-compat": "~4.0.0", "eslint-plugin-import": "^2.21.1", "eslint-plugin-jest": "^27.0.1", "eslint-plugin-jsx-a11y": "^6.2.1",