forked from sanxin-lin/react-sunshine-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
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 cc38bce
Showing
724 changed files
with
45,771 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,107 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
const scopes = fs | ||
.readdirSync(path.resolve(__dirname, 'src'), { withFileTypes: true }) | ||
.filter((dirent) => dirent.isDirectory()) | ||
.map((dirent) => dirent.name.replace(/s$/, '')); | ||
|
||
// precomputed scope | ||
const scopeComplete = execSync('git status --porcelain || true') | ||
.toString() | ||
.trim() | ||
.split('\n') | ||
.find((r) => ~r.indexOf('M src')) | ||
?.replace(/(\/)/g, '%%') | ||
?.match(/src%%((\w|-)*)/)?.[1] | ||
?.replace(/s$/, ''); | ||
|
||
/** @type {import('cz-git').UserConfig} */ | ||
module.exports = { | ||
ignores: [(commit) => commit.includes('init')], | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'body-leading-blank': [2, 'always'], | ||
'footer-leading-blank': [1, 'always'], | ||
'header-max-length': [2, 'always', 108], | ||
'subject-empty': [2, 'never'], | ||
'type-empty': [2, 'never'], | ||
'subject-case': [0], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'feat', | ||
'fix', | ||
'perf', | ||
'style', | ||
'docs', | ||
'test', | ||
'refactor', | ||
'build', | ||
'ci', | ||
'chore', | ||
'revert', | ||
'wip', | ||
'workflow', | ||
'types', | ||
'release', | ||
], | ||
], | ||
}, | ||
prompt: { | ||
/** @use `pnpm commit :f` */ | ||
alias: { | ||
f: 'docs: fix typos', | ||
r: 'docs: update README', | ||
s: 'style: update code format', | ||
b: 'build: bump dependencies', | ||
c: 'chore: update config', | ||
}, | ||
customScopesAlign: !scopeComplete ? 'top' : 'bottom', | ||
defaultScope: scopeComplete, | ||
scopes: [...scopes, 'mock'], | ||
allowEmptyIssuePrefixs: false, | ||
allowCustomIssuePrefixs: false, | ||
|
||
// English | ||
typesAppend: [ | ||
{ value: 'wip', name: 'wip: work in process' }, | ||
{ value: 'workflow', name: 'workflow: workflow improvements' }, | ||
{ value: 'types', name: 'types: type definition file changes' }, | ||
], | ||
|
||
// 中英文对照版 | ||
// messages: { | ||
// type: '选择你要提交的类型 :', | ||
// scope: '选择一个提交范围 (可选):', | ||
// customScope: '请输入自定义的提交范围 :', | ||
// subject: '填写简短精炼的变更描述 :\n', | ||
// body: '填写更加详细的变更描述 (可选)。使用 "|" 换行 :\n', | ||
// breaking: '列举非兼容性重大的变更 (可选)。使用 "|" 换行 :\n', | ||
// footerPrefixsSelect: '选择关联issue前缀 (可选):', | ||
// customFooterPrefixs: '输入自定义issue前缀 :', | ||
// footer: '列举关联issue (可选) 例如: #31, #I3244 :\n', | ||
// confirmCommit: '是否提交或修改commit ?', | ||
// }, | ||
// types: [ | ||
// { value: 'feat', name: 'feat: 新增功能' }, | ||
// { value: 'fix', name: 'fix: 修复缺陷' }, | ||
// { value: 'docs', name: 'docs: 文档变更' }, | ||
// { value: 'style', name: 'style: 代码格式' }, | ||
// { value: 'refactor', name: 'refactor: 代码重构' }, | ||
// { value: 'perf', name: 'perf: 性能优化' }, | ||
// { value: 'test', name: 'test: 添加疏漏测试或已有测试改动' }, | ||
// { value: 'build', name: 'build: 构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)' }, | ||
// { value: 'ci', name: 'ci: 修改 CI 配置、脚本' }, | ||
// { value: 'revert', name: 'revert: 回滚 commit' }, | ||
// { value: 'chore', name: 'chore: 对构建过程或辅助工具和库的更改 (不影响源文件、测试用例)' }, | ||
// { value: 'wip', name: 'wip: 正在开发中' }, | ||
// { value: 'workflow', name: 'workflow: 工作流程改进' }, | ||
// { value: 'types', name: 'types: 类型定义文件修改' }, | ||
// ], | ||
// emptyScopesAlias: 'empty: 不填写', | ||
// customScopesAlias: 'custom: 自定义', | ||
}, | ||
}; |
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 @@ | ||
|
||
*.sh | ||
node_modules | ||
*.md | ||
*.woff | ||
*.ttf | ||
.vscode | ||
.idea | ||
dist | ||
/public | ||
/docs | ||
.husky | ||
.local | ||
/bin | ||
Dockerfile | ||
package.json |
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 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@sunshine'], | ||
rules: { | ||
'no-undef': 'off', | ||
}, | ||
}; |
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,36 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
.cache | ||
.turbo | ||
|
||
tests/server/static | ||
tests/server/static/upload | ||
|
||
.local | ||
# local env files | ||
.env.local | ||
.env.*.local | ||
.eslintcache | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
# .vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
package-lock.json | ||
pnpm-lock.yaml | ||
|
||
.history | ||
|
||
.VSCodeCounter |
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,8 @@ | ||
#!/bin/sh | ||
|
||
# shellcheck source=./_/husky.sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
PATH="/usr/local/bin:$PATH" | ||
|
||
# npx --no-install 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,9 @@ | ||
#!/bin/sh | ||
command_exists () { | ||
command -v "$1" >/dev/null 2>&1 | ||
} | ||
|
||
# Workaround for Windows 10, Git Bash and Yarn | ||
if command_exists winpty && test -t 1; then | ||
exec < /dev/tty | ||
fi |
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,10 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
. "$(dirname "$0")/common.sh" | ||
|
||
[ -n "$CI" ] && exit 0 | ||
|
||
PATH="/usr/local/bin:$PATH" | ||
|
||
# Format and submit code according to lintstagedrc.js configuration | ||
# pnpm exec 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,12 @@ | ||
dist | ||
.local | ||
.output.js | ||
node_modules | ||
|
||
**/*.svg | ||
**/*.sh | ||
|
||
public | ||
.npmrc | ||
|
||
*-lock.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,18 @@ | ||
module.exports = { | ||
printWidth: 100, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
proseWrap: 'never', | ||
htmlWhitespaceSensitivity: 'strict', | ||
endOfLine: 'auto', | ||
plugins: ['prettier-plugin-packagejson'], | ||
overrides: [ | ||
{ | ||
files: '.*rc', | ||
options: { | ||
parser: 'json', | ||
}, | ||
}, | ||
], | ||
}; |
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 | ||
public |
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 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@sunshine/stylelint-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,16 @@ | ||
{ | ||
// 使用 IntelliSense 了解相关属性。 | ||
// 悬停以查看现有属性的描述。 | ||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "启动程序", | ||
"skipFiles": ["<node_internals>/**"], | ||
"program": "${workspaceFolder}/packages/server/src/main.ts", | ||
"outFiles": ["${workspaceFolder}/**/*.js"] | ||
} | ||
] | ||
} |
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,41 @@ | ||
{ | ||
// 光标的动画样式 | ||
"editor.cursorBlinking": "phase", | ||
// 光标是否启用平滑插入的动画 | ||
"editor.cursorSmoothCaretAnimation": "on", | ||
// 使用当前项目的prettier配置文件,如果没有则使用默认的配置 | ||
"prettier.requireConfig": true, | ||
"editor.formatOnSave": true, | ||
// 以下程序使用prettier默认进行格式化 | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[css]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[less]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[scss]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[markdown]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
// 保存文件的时候的配置 | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.stylelint": "explicit" | ||
}, | ||
"css.lint.unknownAtRules": "ignore", | ||
"i18n-ally.localesPaths": ["src/locales", "src/locales/lang"] | ||
} |
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,20 @@ | ||
## 项目介绍 | ||
|
||
本项目是使用 React 复刻 Vue-Vben-Admin,**还没复刻完**,供大家学习,大家有意见可以提出来 | ||
|
||
技术栈:`React18 + Zustand + Typescript + Pnpm + TailWindcss + Vite` | ||
|
||
```bash | ||
# 安装依赖 | ||
pnpm i | ||
# 运行项目 | ||
pnpm run sunshine:dev | ||
# 构建项目 | ||
pnpm run sunshine:build | ||
``` | ||
|
||
## 学习群 & 公众号 | ||
|
||
我建立了一个此项目的学习群,感兴趣的兄弟们可以关注下面公众号,回复 “sunshine-admin” ,我会拉你进群 | ||
|
||
![Alt text](qrcode_for_gh_086869a8f05b_258.jpg) |
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 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@sunshine/eslint-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,10 @@ | ||
import { defineBuildConfig } from 'unbuild'; | ||
|
||
export default defineBuildConfig({ | ||
clean: true, | ||
entries: ['src/index', 'src/strict'], | ||
declaration: true, | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
}); |
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,43 @@ | ||
{ | ||
"name": "@sunshine/eslint-config", | ||
"version": "1.0.0", | ||
"keywords": [], | ||
"license": "ISC", | ||
"author": "", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs" | ||
}, | ||
"./strict": { | ||
"types": "./dist/strict.d.ts", | ||
"import": "./dist/strict.mjs", | ||
"require": "./dist/strict.cjs" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "pnpm rimraf .turbo node_modules dist", | ||
"lint": "pnpm eslint .", | ||
"stub": "pnpm unbuild --stub" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^7.0.1", | ||
"@typescript-eslint/parser": "^7.0.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.6", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"unbuild": "^2.0.0" | ||
} | ||
} |
Oops, something went wrong.