-
Notifications
You must be signed in to change notification settings - Fork 13
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 7d09cad
Showing
189 changed files
with
9,980 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,12 @@ | ||
VITE_BASE_URL=/ | ||
|
||
VITE_APP_TITLE=SoybeanAdmin | ||
|
||
VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template | ||
|
||
# the prefix of the icon name | ||
VITE_ICON_PREFIX=icon | ||
|
||
# the prefix of the local svg icon component, must include VITE_ICON_PREFIX | ||
# format {VITE_ICON_PREFIX}-{local icon name} | ||
VITE_ICON_LOCAL_PREFIX=icon-local |
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 @@ | ||
VITE_HTTP_PROXY=Y | ||
|
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 @@ | ||
VITE_ROUTER_HISTORY_MODE=hash |
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,6 @@ | ||
{ | ||
"extends": "sa/vue", | ||
"settings": { | ||
"import/core-modules": ["uno.css", "~icons/*", "virtual:svg-icons-register"] | ||
} | ||
} |
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,34 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
!.vscode/settings.json | ||
!.vscode/launch.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
package-lock.json | ||
yarn.lock | ||
pnpm-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,2 @@ | ||
registry=https://registry.npmmirror.com/ | ||
shamefully-hoist=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,17 @@ | ||
{ | ||
"recommendations": [ | ||
"antfu.unocss", | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"formulahendry.auto-complete-tag", | ||
"formulahendry.auto-close-tag", | ||
"formulahendry.auto-rename-tag", | ||
"kisstkondoros.vscode-gutter-preview", | ||
"mariusalchimavicius.json-to-ts", | ||
"mhutchie.git-graph", | ||
"sdras.vue-vscode-snippets", | ||
"vue.volar", | ||
"vue.vscode-typescript-vue-plugin" | ||
] | ||
} |
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 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"name": "Vue debugger", | ||
"url": "http://localhost:9527", | ||
"webRoot": "${workspaceFolder}" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "TS debugger", | ||
"skipFiles": ["<node_internals>/**"], | ||
"runtimeArgs": ["--loader", "tsx"], | ||
"program": "${relativeFile}" | ||
} | ||
] | ||
} |
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,60 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Antd", | ||
"antv", | ||
"clsx", | ||
"colord", | ||
"consola", | ||
"EDITMSG", | ||
"espree", | ||
"execa", | ||
"heroicons", | ||
"hexcode", | ||
"iconify", | ||
"INDEXEDDB", | ||
"jiti", | ||
"kolorist", | ||
"Laba", | ||
"localforage", | ||
"LOCALSTORAGE", | ||
"nocheck", | ||
"nprogress", | ||
"ofetch", | ||
"preflights", | ||
"sider", | ||
"tada", | ||
"Uncapitalize", | ||
"unocss", | ||
"unplugin", | ||
"VITE", | ||
"vitepress", | ||
"vueuse", | ||
"WEBSQL", | ||
"wechat" | ||
], | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"editor.fontLigatures": true, | ||
"editor.formatOnSave": false, | ||
"editor.quickSuggestions": { | ||
"strings": true | ||
}, | ||
"editor.tabSize": 2, | ||
"files.associations": { | ||
"*.env.*": "dotenv", | ||
"*.svg": "html" | ||
}, | ||
"files.eol": "\n", | ||
"i18n-ally.displayLanguage": "zh-CN", | ||
"i18n-ally.enabledParsers": ["ts"], | ||
"i18n-ally.enabledFrameworks": ["vue"], | ||
"i18n-ally.editor.preferEditor": true, | ||
"i18n-ally.keystyle": "nested", | ||
"i18n-ally.localesPaths": ["src/locales/lang"], | ||
"unocss.root": ["./"], | ||
"[html][css][less][scss][sass][markdown][yaml][yml][json][jsonc]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": 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,3 @@ | ||
# @sa/antd | ||
|
||
SoybeanAdmin AntDesign |
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 @@ | ||
export * from './plugins'; |
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,26 @@ | ||
import type { PluginOption } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
import VueDevtools from 'vite-plugin-vue-devtools'; | ||
import progress from 'vite-plugin-progress'; | ||
import { setupElegantRouter } from './router'; | ||
import { setupUnocss } from './unocss'; | ||
import { setupUnplugin } from './unplugin'; | ||
|
||
export function setupVitePlugins(viteEnv: Env.ImportMeta) { | ||
const plugins: PluginOption = [ | ||
vue({ | ||
script: { | ||
defineModel: true | ||
} | ||
}), | ||
vueJsx(), | ||
VueDevtools(), | ||
setupElegantRouter(), | ||
setupUnocss(viteEnv), | ||
...setupUnplugin(viteEnv), | ||
progress() | ||
]; | ||
|
||
return plugins; | ||
} |
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,24 @@ | ||
import ElegantVueRouter from '@elegant-router/vue/vite'; | ||
import type { RouteKey } from '@elegant-router/types'; | ||
|
||
export function setupElegantRouter() { | ||
return ElegantVueRouter({ | ||
layouts: { | ||
base: 'src/layouts/base-layout/index.vue', | ||
blank: 'src/layouts/blank-layout/index.vue' | ||
}, | ||
routePathTransformer(routeName, routePath) { | ||
const key = routeName as RouteKey; | ||
|
||
if (key === 'login') { | ||
const modules: UnionKey.LoginModule[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat']; | ||
|
||
const moduleReg = modules.join('|'); | ||
|
||
return `/login/:module(${moduleReg})?`; | ||
} | ||
|
||
return routePath; | ||
} | ||
}); | ||
} |
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,33 @@ | ||
import path from 'node:path'; | ||
import unocss from '@unocss/vite'; | ||
import presetIcons from '@unocss/preset-icons'; | ||
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders'; | ||
|
||
export function setupUnocss(viteEnv: Env.ImportMeta) { | ||
const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv; | ||
|
||
const localIconPath = path.join(process.cwd(), 'src/assets/svg-icon'); | ||
|
||
/** | ||
* the name of the local icon collection | ||
*/ | ||
const collectionName = VITE_ICON_LOCAL_PREFIX.replace(`${VITE_ICON_PREFIX}-`, ''); | ||
|
||
return unocss({ | ||
presets: [ | ||
presetIcons({ | ||
prefix: `${VITE_ICON_PREFIX}-`, | ||
scale: 1, | ||
extraProperties: { | ||
display: 'inline-block' | ||
}, | ||
collections: { | ||
[collectionName]: FileSystemIconLoader(localIconPath, svg => | ||
svg.replace(/^<svg\s/, '<svg width="1em" height="1em" ') | ||
) | ||
}, | ||
warn: 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,48 @@ | ||
import path from 'node:path'; | ||
import type { PluginOption } from 'vite'; | ||
import Icons from 'unplugin-icons/vite'; | ||
import IconsResolver from 'unplugin-icons/resolver'; | ||
import Components from 'unplugin-vue-components/vite'; | ||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'; | ||
import { FileSystemIconLoader } from 'unplugin-icons/loaders'; | ||
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; | ||
|
||
export function setupUnplugin(viteEnv: Env.ImportMeta) { | ||
const { VITE_ICON_PREFIX, VITE_ICON_LOCAL_PREFIX } = viteEnv; | ||
|
||
const localIconPath = path.join(process.cwd(), 'src/assets/svg-icon'); | ||
|
||
/** | ||
* the name of the local icon collection | ||
*/ | ||
const collectionName = VITE_ICON_LOCAL_PREFIX.replace(`${VITE_ICON_PREFIX}-`, ''); | ||
|
||
const plugins: PluginOption[] = [ | ||
Icons({ | ||
compiler: 'vue3', | ||
customCollections: { | ||
[collectionName]: FileSystemIconLoader(localIconPath, svg => | ||
svg.replace(/^<svg\s/, '<svg width="1em" height="1em" ') | ||
) | ||
}, | ||
scale: 1, | ||
defaultClass: 'inline-block' | ||
}), | ||
Components({ | ||
dts: 'src/typings/components.d.ts', | ||
types: [{ from: 'vue-router', names: ['RouterLink', 'RouterView'] }], | ||
resolvers: [ | ||
ElementPlusResolver(), | ||
IconsResolver({ customCollections: [collectionName], componentPrefix: VITE_ICON_PREFIX }) | ||
] | ||
}), | ||
createSvgIconsPlugin({ | ||
iconDirs: [localIconPath], | ||
symbolId: `${VITE_ICON_LOCAL_PREFIX}-[dir]-[name]`, | ||
inject: 'body-last', | ||
customDomId: '__SVG_ICON_LOCAL__' | ||
}) | ||
]; | ||
|
||
return plugins; | ||
} |
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,15 @@ | ||
<!doctype html> | ||
<html lang="zh-cmn-Hans"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>%VITE_APP_TITLE%</title> | ||
</head> | ||
<body> | ||
<div id="app"> | ||
<div id="appLoading"></div> | ||
</div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.