-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d147175
Showing
70 changed files
with
33,300 additions
and
0 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,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,3 @@ | ||
module.exports = { | ||
extends: require.resolve('@umijs/lint/dist/config/eslint'), | ||
}; |
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,5 @@ | ||
import { defineConfig } from 'father'; | ||
|
||
export default defineConfig({ | ||
plugins: ['father-plugin-dumi-theme'], | ||
}); |
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,7 @@ | ||
/node_modules | ||
/dist | ||
/example/node_modules | ||
/example/dist | ||
.dumi/tmp | ||
.dumi/tmp-production | ||
.DS_Store |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx commitlint --edit "${1}" |
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 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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,2 @@ | ||
/dist | ||
*.yaml |
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,14 @@ | ||
module.exports = { | ||
printWidth: 80, | ||
proseWrap: 'never', | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
overrides: [ | ||
{ | ||
files: '*.md', | ||
options: { | ||
proseWrap: 'preserve', | ||
}, | ||
}, | ||
], | ||
}; |
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,3 @@ | ||
{ | ||
"extends": "@umijs/lint/dist/config/stylelint" | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) KuangPF | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,22 @@ | ||
# dumi-theme-antd | ||
|
||
[![NPM version](https://img.shields.io/npm/v/dumi-theme-antd.svg?style=flat)](https://npmjs.org/package/dumi-theme-antd) | ||
[![NPM downloads](http://img.shields.io/npm/dm/dumi-theme-antd.svg?style=flat)](https://npmjs.org/package/dumi-theme-antd) | ||
|
||
A aantd site theme package for the [dumi](https://d.umijs.org) framework. | ||
|
||
## Status | ||
|
||
WIP | ||
|
||
## Usage | ||
|
||
Install this theme into `devDependencies`: | ||
|
||
```bash | ||
$ npm i dumi-theme-antd -D | ||
``` | ||
|
||
## LICENSE | ||
|
||
MIT |
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 @@ | ||
../../src |
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,9 @@ | ||
// @ts-nocheck | ||
// This file is generated by Umi automatically | ||
// DO NOT CHANGE IT MANUALLY! | ||
import React from 'react'; | ||
import { Outlet, useOutletContext } from 'umi'; | ||
export default function EmptyRoute() { | ||
const context = useOutletContext(); | ||
return <Outlet context={context} />; | ||
} |
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,16 @@ | ||
// @ts-nocheck | ||
// This file is generated by Umi automatically | ||
// DO NOT CHANGE IT MANUALLY! | ||
interface IDefaultRuntimeConfig { | ||
onRouteChange?: (props: { routes: any, clientRoutes: any, location: any, action:any }) => void; | ||
patchRoutes?: (props: { routes: any }) => void; | ||
patchClientRoutes?: (props: { routes: any }) => void; | ||
render?: (oldRender: () => void) => void; | ||
rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void; | ||
[key: string]: any; | ||
} | ||
export type RuntimeConfig = IDefaultRuntimeConfig | ||
|
||
export function defineApp(config: RuntimeConfig): RuntimeConfig { | ||
return config; | ||
} |
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,64 @@ | ||
// @ts-nocheck | ||
// This file is generated by Umi automatically | ||
// DO NOT CHANGE IT MANUALLY! | ||
import { createHashHistory, createMemoryHistory, createBrowserHistory, History } from '/Users/foreverw/dev-core/KuangPF_Github/dumi-theme-antd/node_modules/@umijs/renderer-react'; | ||
|
||
let history: History; | ||
let basename: string = '/'; | ||
export function createHistory(opts: any) { | ||
let h; | ||
if (opts.type === 'hash') { | ||
h = createHashHistory(); | ||
} else if (opts.type === 'memory') { | ||
h = createMemoryHistory(opts); | ||
} else { | ||
h = createBrowserHistory(); | ||
} | ||
if (opts.basename) { | ||
basename = opts.basename; | ||
} | ||
|
||
history = { | ||
...h, | ||
push(to, state) { | ||
h.push(patchTo(to, h), state); | ||
}, | ||
replace(to, state) { | ||
h.replace(patchTo(to, h), state); | ||
}, | ||
get location() { | ||
return h.location; | ||
}, | ||
get action() { | ||
return h.action; | ||
} | ||
} | ||
|
||
return h; | ||
} | ||
|
||
// Patch `to` to support basename | ||
// Refs: | ||
// https://github.com/remix-run/history/blob/3e9dab4/packages/history/index.ts#L484 | ||
// https://github.com/remix-run/history/blob/dev/docs/api-reference.md#to | ||
function patchTo(to: any, h: History) { | ||
if (typeof to === 'string') { | ||
return `${stripLastSlash(basename)}${to}`; | ||
} else if (typeof to === 'object') { | ||
|
||
const currentPathname = h.location.pathname; | ||
|
||
return { | ||
...to, | ||
pathname: to.pathname? `${stripLastSlash(basename)}${to.pathname}` : currentPathname, | ||
}; | ||
} else { | ||
throw new Error(`Unexpected to: ${to}`); | ||
} | ||
} | ||
|
||
function stripLastSlash(path) { | ||
return path.slice(-1) === '/' ? path.slice(0, -1) : path; | ||
} | ||
|
||
export { history }; |
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,42 @@ | ||
// @ts-nocheck | ||
// This file is generated by Umi automatically | ||
// DO NOT CHANGE IT MANUALLY! | ||
import * as Plugin_0 from '@@/dumi/meta/runtime.ts'; | ||
import * as Plugin_1 from '@@/dumi/locales/runtime.tsx'; | ||
import { PluginManager } from 'umi'; | ||
|
||
function __defaultExport (obj) { | ||
if (obj.default) { | ||
return typeof obj.default === 'function' ? obj.default() : obj.default | ||
} | ||
return obj; | ||
} | ||
export function getPlugins() { | ||
return [ | ||
{ | ||
apply: Plugin_0, | ||
path: process.env.NODE_ENV === 'production' ? void 0 : '@@/dumi/meta/runtime.ts', | ||
}, | ||
{ | ||
apply: Plugin_1, | ||
path: process.env.NODE_ENV === 'production' ? void 0 : '@@/dumi/locales/runtime.tsx', | ||
}, | ||
]; | ||
} | ||
|
||
export function getValidKeys() { | ||
return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange',]; | ||
} | ||
|
||
let pluginManager = null; | ||
export function createPluginManager() { | ||
pluginManager = PluginManager.create({ | ||
plugins: getPlugins(), | ||
validKeys: getValidKeys(), | ||
}); | ||
return pluginManager; | ||
} | ||
|
||
export function getPluginManager() { | ||
return pluginManager; | ||
} |
Oops, something went wrong.