-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
630 changed files
with
96,178 additions
and
10,950 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,97 @@ | ||
import { defineConfig } from 'dumi'; | ||
import sidebar from './sidebar'; | ||
// const { defaultAlgorithm, defaultSeed } = theme; | ||
// const mapToken = defaultAlgorithm(defaultSeed); | ||
// https://llq0802.github.io | ||
const isDev = process.env.NODE_ENV === 'development'; | ||
const version = 'latest'; | ||
export const publicPath = !isDev ? `/lighting-design/${version}/` : '/'; | ||
const logo = `${publicPath}logo.png`; | ||
const favicons = [`${publicPath}logo.png`]; | ||
// const outputPath = `docs-dist/${version}`; | ||
const outputPath = version; | ||
|
||
export default defineConfig({ | ||
publicPath, | ||
base: publicPath, | ||
themeConfig: { | ||
lastUpdated: false, | ||
name: 'Lighting Design', | ||
logo, | ||
footer: 'Open-source MIT Licensed | Copyright © 2020-present Powered by llq0802', | ||
socialLinks: { | ||
github: 'https://github.com/llq0802/lighting-design/tree/v2', | ||
}, | ||
rtl: true, | ||
nav: [ | ||
{ title: '指南', link: '/guide' }, | ||
{ title: '组件', link: '/components' }, | ||
{ title: '更多场景', link: '/scene' }, | ||
{ title: 'rc-use-hooks', link: 'https://llq0802.github.io/rc-use-hook/' }, | ||
{ title: 'V1.x', link: 'https://llq0802.github.io/lighting-design/v1/' }, | ||
{ | ||
title: 'GitHub', | ||
link: 'https://github.com/llq0802/lighting-design/tree/v2', | ||
}, | ||
{ | ||
title: '*更新日志 - V2.1.35', | ||
link: 'https://github.com/llq0802/lighting-design/releases', | ||
}, | ||
], | ||
sidebar, | ||
}, | ||
|
||
metas: [ | ||
{ | ||
name: 'keywords', | ||
content: 'Lighting-Design, lighting-design, lightd, antd, react组件库', | ||
}, | ||
{ | ||
name: 'description', | ||
content: '🍙 让中后台开发更简单', | ||
}, | ||
], | ||
// lessLoader: { | ||
// modifyVars: mapToken, | ||
// }, | ||
outputPath, | ||
favicons, | ||
|
||
styles: [ | ||
` | ||
.dumi-default-sidebar { | ||
min-width: 260px; | ||
} | ||
.dumi-default-previewer-demo { | ||
min-height: 60px; | ||
display: flex; | ||
overflow: auto; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
.dumi-default-content-tabs{ | ||
margin: -24px -48px 48px !important; | ||
} | ||
.dumi-default-header:not([data-static]){ | ||
border-bottom: 1px solid #ddd; | ||
} | ||
.dumi-default-header-left { | ||
min-width: 230px; | ||
margin-right: 32px; | ||
} | ||
.dumi-default-header-left .dumi-default-logo{ | ||
color: #5581a6 | ||
} | ||
.dumi-default-header .dumi-default-header-content{ | ||
max-width: initial; | ||
padding:0 50px; | ||
} | ||
#root .dumi-default-doc-layout > main{ | ||
max-width: initial; | ||
padding:0 50px; | ||
} | ||
`, | ||
], | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
extends: [require.resolve('@umijs/fabric/dist/eslint')], | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
sourceType: 'module', | ||
}, | ||
extends: require.resolve('@umijs/lint/dist/config/eslint'), | ||
rules: { | ||
'import/no-extraneous-dependencies': 0, | ||
'react-hooks/rules-of-hooks': 2, // react函数组件名必须大写 | ||
'@typescript-eslint/consistent-type-imports': 2, // ts类型引入 | ||
'spaced-comment': [2, 'always'], // 注释后面2个空格 | ||
'@typescript-eslint/ban-types': 0, | ||
'react-hooks/rules-of-hooks': 0, | ||
// 'react/react-in-jsx-scope': 2, | ||
'react-hooks/rules-of-hooks': 2, // React函数组件名必须大写 | ||
'@typescript-eslint/consistent-type-imports': 2, // TS类型单独引入 | ||
'spaced-comment': [2, 'always'], // 注释后面跟2个空格 | ||
'prefer-template': 2, // 强制使用模板字符串 | ||
'no-console': 1, // 警告允许console | ||
}, | ||
}; | ||
|
||
// 提交信息规范 (冒号后面有个空格) 例如(test: 增加单元测试) | ||
// feat: 新功能(featu修改业务re) | ||
// fix:修补bug | ||
// docs:文档(documentation) | ||
// style: 格式(不影响代码运行的变动,空格缩进等) | ||
// refactor:重构代码(即不是新增功能,也不是修改bug的代码变动) | ||
// test:增加测试 | ||
// chore:构建过程或辅助工具的变动(新增或者删除依赖包) | ||
// revert: 回退代码 | ||
// perf: 代码优化性能优化 |
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 |
---|---|---|
@@ -1,64 +1,11 @@ | ||
import { defineConfig } from 'father'; | ||
// more father 4 config: https://github.com/umijs/father-next/blob/master/docs/config.md | ||
|
||
// const tailPkgs = readdirSync(join(__dirname, 'packages')) | ||
// .filter((pkg) => pkg.charAt(0) !== '.') | ||
// .map((path) => `packages/${path}/src`); | ||
// console.log('tailPkgs', tailPkgs); | ||
|
||
const { BUILD_TYPE } = process.env; | ||
|
||
const config = | ||
BUILD_TYPE === 'hooks' | ||
? defineConfig({ | ||
esm: { | ||
input: 'packages/rc-use-hooks/src', | ||
output: 'packages/rc-use-hooks/es', | ||
transformer: 'babel', | ||
}, | ||
cjs: { | ||
input: 'packages/rc-use-hooks/src', | ||
output: 'packages/rc-use-hooks/lib', | ||
transformer: 'babel', | ||
}, | ||
}) | ||
: defineConfig({ | ||
extraBabelPlugins: [ | ||
[ | ||
'babel-plugin-import', | ||
{ libraryName: 'antd', libraryDirectory: 'es', style: true }, | ||
'antd', | ||
], | ||
|
||
[ | ||
'babel-plugin-import', | ||
{ | ||
libraryName: '@ant-design/icons', | ||
libraryDirectory: 'es/icons', | ||
camel2DashComponentName: false, | ||
}, | ||
'@ant-design/icons', | ||
], | ||
|
||
// [ | ||
// 'babel-plugin-import', | ||
// { libraryName: '@ant-design/icons', libraryDirectory: 'es', style: true }, | ||
// '@ant-design/icons', | ||
// ], | ||
], | ||
|
||
esm: { | ||
input: 'packages/l-design/src', | ||
output: 'packages/l-design/es', | ||
platform: 'browser', // 默认构建为 Browser 环境的产物 | ||
transformer: 'babel', // 默认使用 babel 以提供更好的兼容性 | ||
}, | ||
cjs: { | ||
input: 'packages/l-design/src', | ||
output: 'packages/l-design/lib', | ||
platform: 'node', // 默认构建为 Node.js 环境的产物 | ||
transformer: 'esbuild', // 默认使用 esbuild 以获得更快的构建速度 | ||
}, | ||
}); | ||
|
||
export default config; | ||
export default defineConfig({ | ||
// more father config: https://github.com/umijs/father/blob/master/docs/config.md | ||
cjs: { | ||
output: 'dist/lib', | ||
}, | ||
esm: { | ||
output: 'dist/es', | ||
}, | ||
}); |
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 |
---|---|---|
@@ -1,34 +1,9 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
**/node_modules | ||
/npm-debug.log* | ||
/yarn-error.log | ||
/package-lock.json | ||
|
||
# production | ||
dist | ||
docs-dist | ||
**/dist | ||
**/**/lib/** | ||
**/**/es/** | ||
/docs-dist | ||
|
||
# misc | ||
node_modules | ||
/dist | ||
.dumi/tmp | ||
.dumi/tmp-test | ||
.dumi/tmp-production | ||
.DS_Store | ||
/coverage | ||
|
||
# umi | ||
.umi | ||
.umi-production | ||
.umi-test | ||
.env.local | ||
|
||
# ide | ||
/.vscode | ||
/.idea | ||
|
||
# visual studio code | ||
.history | ||
*.log | ||
/latest | ||
/es | ||
.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,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 |
---|---|---|
@@ -1,8 +1,2 @@ | ||
**/*.svg | ||
**/*.ejs | ||
**/*.html | ||
package.json | ||
.umi | ||
.umi-production | ||
.umi-test | ||
node_modules | ||
/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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
const fabric = require('@umijs/fabric'); | ||
|
||
module.exports = { | ||
...fabric.prettier, | ||
pluginSearchDirs: false, | ||
plugins: [ | ||
require.resolve('prettier-plugin-organize-imports'), | ||
require.resolve('prettier-plugin-packagejson'), | ||
], | ||
printWidth: 120, | ||
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,4 @@ | ||
{ | ||
"commentTranslate.targetLanguage": "zh-CN", | ||
"commentTranslate.source": "Bing" | ||
} |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 llq0802 | ||
|
||
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. |
Oops, something went wrong.