From c558290682852697637b71f3d52a49e58b605761 Mon Sep 17 00:00:00 2001 From: * <*> Date: Fri, 1 Sep 2023 09:11:54 +0800 Subject: [PATCH] Match-id-5ae8e357b37201f329c6f95c7d89b45208d7084f --- packages/horizon-router/.prettierrc.js | 32 + packages/horizon-router/README.md | 109 + packages/horizon-router/babel.config.js | 49 + packages/horizon-router/build.js | 100 + .../@types/connect-router/actions.d.ts | 25 + .../@types/connect-router/dispatch.d.ts | 3 + .../@types/connect-router/index.d.ts | 11 + .../@types/connect-router/reducer.d.ts | 16 + .../@types/history/baseHistory.d.ts | 10 + .../@types/history/browerHistory.d.ts | 8 + .../connectRouter/@types/history/dom.d.ts | 4 + .../@types/history/hashHistory.d.ts | 7 + .../@types/history/transitionManager.d.ts | 11 + .../connectRouter/@types/history/types.d.ts | 56 + .../connectRouter/@types/history/utils.d.ts | 14 + .../connectRouter/@types/history/waring.d.ts | 2 + .../@types/router/BrowserRouter.d.ts | 12 + .../@types/router/HashRouter.d.ts | 7 + .../connectRouter/@types/router/Link.d.ts | 18 + .../connectRouter/@types/router/NavLink.d.ts | 10 + .../connectRouter/@types/router/Prompt.d.ts | 8 + .../connectRouter/@types/router/Redirect.d.ts | 13 + .../connectRouter/@types/router/Route.d.ts | 23 + .../connectRouter/@types/router/Router.d.ts | 8 + .../connectRouter/@types/router/Switch.d.ts | 8 + .../@types/router/__tests__/router.test.d.ts | 1 + .../@types/router/__tests__/test_app.d.ts | 8 + .../connectRouter/@types/router/context.d.ts | 10 + .../connectRouter/@types/router/hooks.d.ts | 8 + .../connectRouter/@types/router/index.d.ts | 20 + .../connectRouter/@types/router/index2.d.ts | 23 + .../@types/router/lifeCycleHook.d.ts | 7 + .../router/matcher/__tests__/lexer.test.d.ts | 1 + .../router/matcher/__tests__/parser.test.d.ts | 1 + .../router/matcher/__tests__/utils.test.d.ts | 1 + .../@types/router/matcher/lexer.d.ts | 2 + .../@types/router/matcher/parser.d.ts | 18 + .../@types/router/matcher/types.d.ts | 36 + .../@types/router/matcher/utils.d.ts | 6 + .../@types/router/withRouter.d.ts | 3 + .../connectRouter/cjs/connectRouter.js | 1787 +++++++++++++++++ .../connectRouter/esm/connectRouter.js | 1742 ++++++++++++++++ .../horizon-router/connectRouter/package.json | 9 + packages/horizon-router/jest.config.js | 8 + packages/horizon-router/package.json | 93 + .../router/@types/connect-router/actions.d.ts | 25 + .../@types/connect-router/dispatch.d.ts | 3 + .../router/@types/connect-router/index.d.ts | 11 + .../router/@types/connect-router/reducer.d.ts | 16 + .../router/@types/history/baseHistory.d.ts | 10 + .../router/@types/history/browerHistory.d.ts | 8 + .../router/@types/history/dom.d.ts | 4 + .../router/@types/history/hashHistory.d.ts | 7 + .../@types/history/transitionManager.d.ts | 11 + .../router/@types/history/types.d.ts | 56 + .../router/@types/history/utils.d.ts | 14 + .../router/@types/history/waring.d.ts | 2 + .../router/@types/router/BrowserRouter.d.ts | 12 + .../router/@types/router/HashRouter.d.ts | 7 + .../router/@types/router/Link.d.ts | 18 + .../router/@types/router/NavLink.d.ts | 10 + .../router/@types/router/Prompt.d.ts | 8 + .../router/@types/router/Redirect.d.ts | 13 + .../router/@types/router/Route.d.ts | 23 + .../router/@types/router/Router.d.ts | 8 + .../router/@types/router/Switch.d.ts | 8 + .../@types/router/__tests__/router.test.d.ts | 1 + .../@types/router/__tests__/test_app.d.ts | 8 + .../router/@types/router/context.d.ts | 10 + .../router/@types/router/hooks.d.ts | 8 + .../router/@types/router/index.d.ts | 20 + .../router/@types/router/index2.d.ts | 23 + .../router/@types/router/lifeCycleHook.d.ts | 7 + .../router/matcher/__tests__/lexer.test.d.ts | 1 + .../router/matcher/__tests__/parser.test.d.ts | 1 + .../router/matcher/__tests__/utils.test.d.ts | 1 + .../router/@types/router/matcher/lexer.d.ts | 2 + .../router/@types/router/matcher/parser.d.ts | 18 + .../router/@types/router/matcher/types.d.ts | 36 + .../router/@types/router/matcher/utils.d.ts | 6 + .../router/@types/router/withRouter.d.ts | 3 + packages/horizon-router/router/cjs/router.js | 1531 ++++++++++++++ packages/horizon-router/router/esm/router.js | 1490 ++++++++++++++ .../horizon-router/src/configs/package.json | 9 + .../src/connect-router/actions.ts | 51 + .../src/connect-router/connectedRouter.tsx | 128 ++ .../src/connect-router/dispatch.ts | 19 + .../src/connect-router/index.ts | 5 + .../src/connect-router/reducer.ts | 62 + .../src/connect-router/reduxUtils.ts | 48 + .../src/history/__tests__/history.test.ts | 61 + .../horizon-router/src/history/baseHistory.ts | 60 + .../src/history/browerHistory.ts | 179 ++ packages/horizon-router/src/history/dom.ts | 17 + .../horizon-router/src/history/hashHistory.ts | 197 ++ .../src/history/transitionManager.ts | 64 + packages/horizon-router/src/history/types.ts | 92 + packages/horizon-router/src/history/utils.ts | 134 ++ packages/horizon-router/src/history/waring.ts | 9 + .../src/router/BrowserRouter.tsx | 32 + .../horizon-router/src/router/HashRouter.tsx | 25 + packages/horizon-router/src/router/Link.tsx | 73 + .../horizon-router/src/router/NavLink.tsx | 42 + packages/horizon-router/src/router/Prompt.tsx | 49 + .../horizon-router/src/router/Redirect.tsx | 61 + packages/horizon-router/src/router/Route.tsx | 85 + packages/horizon-router/src/router/Router.tsx | 58 + packages/horizon-router/src/router/Switch.tsx | 68 + .../src/router/__tests__/router.test.tsx | 163 ++ .../src/router/__tests__/test_app.tsx | 119 ++ .../horizon-router/src/router/context.tsx | 19 + packages/horizon-router/src/router/hooks.ts | 33 + packages/horizon-router/src/router/index.ts | 38 + packages/horizon-router/src/router/index2.ts | 45 + .../src/router/lifeCycleHook.ts | 43 + .../router/matcher/__tests__/lexer.test.ts | 65 + .../router/matcher/__tests__/parser.test.ts | 248 +++ .../router/matcher/__tests__/utils.test.ts | 19 + .../src/router/matcher/lexer.ts | 78 + .../src/router/matcher/parser.ts | 218 ++ .../src/router/matcher/types.ts | 55 + .../src/router/matcher/utils.ts | 27 + .../horizon-router/src/router/withRouter.tsx | 17 + packages/horizon-router/tsconfig.json | 38 + 124 files changed, 10641 insertions(+) create mode 100644 packages/horizon-router/.prettierrc.js create mode 100644 packages/horizon-router/README.md create mode 100644 packages/horizon-router/babel.config.js create mode 100644 packages/horizon-router/build.js create mode 100644 packages/horizon-router/connectRouter/@types/connect-router/actions.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/connect-router/dispatch.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/connect-router/index.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/connect-router/reducer.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/baseHistory.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/browerHistory.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/dom.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/hashHistory.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/transitionManager.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/types.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/utils.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/history/waring.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/BrowserRouter.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/HashRouter.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Link.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/NavLink.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Prompt.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Redirect.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Route.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Router.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/Switch.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/__tests__/router.test.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/__tests__/test_app.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/context.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/hooks.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/index.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/index2.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/lifeCycleHook.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/__tests__/lexer.test.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/__tests__/parser.test.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/__tests__/utils.test.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/lexer.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/parser.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/types.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/matcher/utils.d.ts create mode 100644 packages/horizon-router/connectRouter/@types/router/withRouter.d.ts create mode 100644 packages/horizon-router/connectRouter/cjs/connectRouter.js create mode 100644 packages/horizon-router/connectRouter/esm/connectRouter.js create mode 100644 packages/horizon-router/connectRouter/package.json create mode 100644 packages/horizon-router/jest.config.js create mode 100644 packages/horizon-router/package.json create mode 100644 packages/horizon-router/router/@types/connect-router/actions.d.ts create mode 100644 packages/horizon-router/router/@types/connect-router/dispatch.d.ts create mode 100644 packages/horizon-router/router/@types/connect-router/index.d.ts create mode 100644 packages/horizon-router/router/@types/connect-router/reducer.d.ts create mode 100644 packages/horizon-router/router/@types/history/baseHistory.d.ts create mode 100644 packages/horizon-router/router/@types/history/browerHistory.d.ts create mode 100644 packages/horizon-router/router/@types/history/dom.d.ts create mode 100644 packages/horizon-router/router/@types/history/hashHistory.d.ts create mode 100644 packages/horizon-router/router/@types/history/transitionManager.d.ts create mode 100644 packages/horizon-router/router/@types/history/types.d.ts create mode 100644 packages/horizon-router/router/@types/history/utils.d.ts create mode 100644 packages/horizon-router/router/@types/history/waring.d.ts create mode 100644 packages/horizon-router/router/@types/router/BrowserRouter.d.ts create mode 100644 packages/horizon-router/router/@types/router/HashRouter.d.ts create mode 100644 packages/horizon-router/router/@types/router/Link.d.ts create mode 100644 packages/horizon-router/router/@types/router/NavLink.d.ts create mode 100644 packages/horizon-router/router/@types/router/Prompt.d.ts create mode 100644 packages/horizon-router/router/@types/router/Redirect.d.ts create mode 100644 packages/horizon-router/router/@types/router/Route.d.ts create mode 100644 packages/horizon-router/router/@types/router/Router.d.ts create mode 100644 packages/horizon-router/router/@types/router/Switch.d.ts create mode 100644 packages/horizon-router/router/@types/router/__tests__/router.test.d.ts create mode 100644 packages/horizon-router/router/@types/router/__tests__/test_app.d.ts create mode 100644 packages/horizon-router/router/@types/router/context.d.ts create mode 100644 packages/horizon-router/router/@types/router/hooks.d.ts create mode 100644 packages/horizon-router/router/@types/router/index.d.ts create mode 100644 packages/horizon-router/router/@types/router/index2.d.ts create mode 100644 packages/horizon-router/router/@types/router/lifeCycleHook.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/__tests__/lexer.test.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/__tests__/parser.test.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/__tests__/utils.test.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/lexer.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/parser.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/types.d.ts create mode 100644 packages/horizon-router/router/@types/router/matcher/utils.d.ts create mode 100644 packages/horizon-router/router/@types/router/withRouter.d.ts create mode 100644 packages/horizon-router/router/cjs/router.js create mode 100644 packages/horizon-router/router/esm/router.js create mode 100644 packages/horizon-router/src/configs/package.json create mode 100644 packages/horizon-router/src/connect-router/actions.ts create mode 100644 packages/horizon-router/src/connect-router/connectedRouter.tsx create mode 100644 packages/horizon-router/src/connect-router/dispatch.ts create mode 100644 packages/horizon-router/src/connect-router/index.ts create mode 100644 packages/horizon-router/src/connect-router/reducer.ts create mode 100644 packages/horizon-router/src/connect-router/reduxUtils.ts create mode 100644 packages/horizon-router/src/history/__tests__/history.test.ts create mode 100644 packages/horizon-router/src/history/baseHistory.ts create mode 100644 packages/horizon-router/src/history/browerHistory.ts create mode 100644 packages/horizon-router/src/history/dom.ts create mode 100644 packages/horizon-router/src/history/hashHistory.ts create mode 100644 packages/horizon-router/src/history/transitionManager.ts create mode 100644 packages/horizon-router/src/history/types.ts create mode 100644 packages/horizon-router/src/history/utils.ts create mode 100644 packages/horizon-router/src/history/waring.ts create mode 100644 packages/horizon-router/src/router/BrowserRouter.tsx create mode 100644 packages/horizon-router/src/router/HashRouter.tsx create mode 100644 packages/horizon-router/src/router/Link.tsx create mode 100644 packages/horizon-router/src/router/NavLink.tsx create mode 100644 packages/horizon-router/src/router/Prompt.tsx create mode 100644 packages/horizon-router/src/router/Redirect.tsx create mode 100644 packages/horizon-router/src/router/Route.tsx create mode 100644 packages/horizon-router/src/router/Router.tsx create mode 100644 packages/horizon-router/src/router/Switch.tsx create mode 100644 packages/horizon-router/src/router/__tests__/router.test.tsx create mode 100644 packages/horizon-router/src/router/__tests__/test_app.tsx create mode 100644 packages/horizon-router/src/router/context.tsx create mode 100644 packages/horizon-router/src/router/hooks.ts create mode 100644 packages/horizon-router/src/router/index.ts create mode 100644 packages/horizon-router/src/router/index2.ts create mode 100644 packages/horizon-router/src/router/lifeCycleHook.ts create mode 100644 packages/horizon-router/src/router/matcher/__tests__/lexer.test.ts create mode 100644 packages/horizon-router/src/router/matcher/__tests__/parser.test.ts create mode 100644 packages/horizon-router/src/router/matcher/__tests__/utils.test.ts create mode 100644 packages/horizon-router/src/router/matcher/lexer.ts create mode 100644 packages/horizon-router/src/router/matcher/parser.ts create mode 100644 packages/horizon-router/src/router/matcher/types.ts create mode 100644 packages/horizon-router/src/router/matcher/utils.ts create mode 100644 packages/horizon-router/src/router/withRouter.tsx create mode 100644 packages/horizon-router/tsconfig.json diff --git a/packages/horizon-router/.prettierrc.js b/packages/horizon-router/.prettierrc.js new file mode 100644 index 00000000..73dd0047 --- /dev/null +++ b/packages/horizon-router/.prettierrc.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 Huawei Technologies Co.,Ltd. + * + * openGauss is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * + * http://license.coscl.org.cn/MulanPSL2 + * + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +'use strict'; + +module.exports = { + printWidth: 120, //一行120字符数,如果超过会进行换行 + tabWidth: 2, //tab等2个空格 + useTabs: false, //用空格缩进行 + semi: true, //行尾使用分号 + singleQuote: true, //字符串使用单引号 + quoteProps: 'as-needed', //仅在需要时在对象属性添加引号 + jsxSingleQuote: false, //在JSX中使用双引号 + trailingComma: 'es5', //使用尾逗号(对象、数组等) + bracketSpacing: true, //对象的括号间增加空格 + bracketSameLine: false, //将多行JSX元素的>放在最后一行的末尾 + arrowParens: 'avoid', //在唯一的arrow函数参数周围省略括号 + vueIndentScriptAndStyle: false, //不缩进Vue文件中的