chore: Resolve merge conflicts
							parent
							
								
									4074a88c13
								
							
						
					
					
						commit
						082847c441
					
				|  | @ -3,3 +3,5 @@ | |||
| 
 | ||||
| # vben core onwer | ||||
| /packages/@core/ anncwb@126.com | ||||
| /internal/ anncwb@126.com | ||||
| /scripts/ anncwb@126.com | ||||
|  |  | |||
|  | @ -49,6 +49,14 @@ jobs: | |||
|           password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }} | ||||
|           local-dir: ./apps/web-antd/dist/ | ||||
| 
 | ||||
|       - name: Sync Web Naive files | ||||
|         uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | ||||
|         with: | ||||
|           server: ${{ secrets.PRO_FTP_HOST }} | ||||
|           username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }} | ||||
|           password: ${{ secrets.WEB_NAIVE_FTP_PASSWORD }} | ||||
|           local-dir: ./apps/web-naive/dist/ | ||||
| 
 | ||||
|       - name: Sync Website files | ||||
|         uses: SamKirkland/FTP-Deploy-Action@v4.3.5 | ||||
|         with: | ||||
|  |  | |||
|  | @ -44,7 +44,7 @@ | |||
|     "ant-design-vue": "^4.2.3", | ||||
|     "dayjs": "^1.11.12", | ||||
|     "pinia": "2.1.7", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ | |||
|         (function () { | ||||
|           var hm = document.createElement('script'); | ||||
|           hm.src = | ||||
|             'https://hm.baidu.com/hm.js?d20a01273820422b6aa2ee41b6c9414d'; | ||||
|             'https://hm.baidu.com/hm.js?24bb3eb91dfe4ebfcbcee6952a107cb6'; | ||||
|           var s = document.getElementsByTagName('script')[0]; | ||||
|           s.parentNode.insertBefore(hm, s); | ||||
|         })(); | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ | |||
|     "@vueuse/core": "^10.11.0", | ||||
|     "naive-ui": "^2.39.0", | ||||
|     "pinia": "2.1.7", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -14,6 +14,7 @@ | |||
|     "lucide", | ||||
|     "brotli", | ||||
|     "defu", | ||||
|     "execa", | ||||
|     "iconify", | ||||
|     "intlify", | ||||
|     "mkdist", | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ | |||
|     } | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "eslint-config-turbo": "^2.0.9", | ||||
|     "eslint-config-turbo": "^2.0.10", | ||||
|     "eslint-plugin-command": "^0.2.3", | ||||
|     "eslint-plugin-import-x": "^3.1.0" | ||||
|   }, | ||||
|  | @ -39,7 +39,7 @@ | |||
|     "eslint": "^9.8.0", | ||||
|     "eslint-config-prettier": "^9.1.0", | ||||
|     "eslint-plugin-eslint-comments": "^3.2.0", | ||||
|     "eslint-plugin-jsdoc": "^48.10.1", | ||||
|     "eslint-plugin-jsdoc": "^48.10.2", | ||||
|     "eslint-plugin-jsonc": "^2.16.0", | ||||
|     "eslint-plugin-n": "^17.10.1", | ||||
|     "eslint-plugin-no-only-tests": "^3.1.0", | ||||
|  |  | |||
|  | @ -30,13 +30,20 @@ | |||
|   "dependencies": { | ||||
|     "@changesets/git": "^3.0.0", | ||||
|     "@manypkg/get-packages": "^2.2.2", | ||||
|     "chalk": "^5.3.0", | ||||
|     "consola": "^3.2.3", | ||||
|     "dayjs": "^1.11.12", | ||||
|     "execa": "^9.3.0", | ||||
|     "find-up": "^7.0.0", | ||||
|     "fs-extra": "^11.2.0", | ||||
|     "nanoid": "^5.0.7", | ||||
|     "ora": "^8.0.1", | ||||
|     "pkg-types": "^1.1.3", | ||||
|     "prettier": "^3.3.3", | ||||
|     "rimraf": "^6.0.1", | ||||
|     "zx": "^8.1.4" | ||||
|     "rimraf": "^6.0.1" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@types/chalk": "^2.2.0", | ||||
|     "@types/fs-extra": "^11.0.4" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,24 +1,32 @@ | |||
| import path from 'node:path'; | ||||
| 
 | ||||
| import { $ } from 'zx'; | ||||
| import { execa } from 'execa'; | ||||
| 
 | ||||
| export * from '@changesets/git'; | ||||
| 
 | ||||
| /** | ||||
|  * 获取暂存区文件 | ||||
|  */ | ||||
| async function getStagedFiles() { | ||||
| async function getStagedFiles(): Promise<string[]> { | ||||
|   try { | ||||
|     $.verbose = false; | ||||
|     const { stdout: lines } = | ||||
|       await $`git -c submodule.recurse=false diff --staged --diff-filter=ACMR --name-only --ignore-submodules -z`; | ||||
|     const { stdout } = await execa('git', [ | ||||
|       '-c', | ||||
|       'submodule.recurse=false', | ||||
|       'diff', | ||||
|       '--staged', | ||||
|       '--diff-filter=ACMR', | ||||
|       '--name-only', | ||||
|       '--ignore-submodules', | ||||
|       '-z', | ||||
|     ]); | ||||
| 
 | ||||
|     let changedList = lines ? lines.replace(/\0$/, '').split('\0') : []; | ||||
|     let changedList = stdout ? stdout.replace(/\0$/, '').split('\0') : []; | ||||
|     changedList = changedList.map((item) => path.resolve(process.cwd(), item)); | ||||
|     const changedSet = new Set(changedList); | ||||
|     changedSet.delete(''); | ||||
|     return [...changedSet]; | ||||
|   } catch { | ||||
|   } catch (error) { | ||||
|     console.error('Failed to get staged files:', error); | ||||
|     return []; | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -6,9 +6,12 @@ export { generatorContentHash } from './hash'; | |||
| export * from './monorepo'; | ||||
| export { toPosixPath } from './path'; | ||||
| export { prettierFormat } from './prettier'; | ||||
| export * from './spinner'; | ||||
| export type { Package } from '@manypkg/get-packages'; | ||||
| export { default as colors } from 'chalk'; | ||||
| export { consola } from 'consola'; | ||||
| export * from 'execa'; | ||||
| export { default as fs } from 'fs-extra'; | ||||
| export { nanoid } from 'nanoid'; | ||||
| export { type PackageJson, readPackageJSON } from 'pkg-types'; | ||||
| export { rimraf } from 'rimraf'; | ||||
| export { $, chalk as colors, fs, spinner } from 'zx'; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| import fs from 'fs-extra'; | ||||
| import { format, getFileInfo, resolveConfig } from 'prettier'; | ||||
| import { fs } from 'zx'; | ||||
| 
 | ||||
| async function prettierFormat(filepath: string) { | ||||
|   const prettierOptions = await resolveConfig(filepath, {}); | ||||
|  |  | |||
|  | @ -0,0 +1,24 @@ | |||
| import ora, { Ora } from 'ora'; | ||||
| 
 | ||||
| interface SpinnerOptions { | ||||
|   failedText?: string; | ||||
|   successText?: string; | ||||
|   title: string; | ||||
| } | ||||
| export async function spinner<T>( | ||||
|   { failedText, successText, title }: SpinnerOptions, | ||||
|   callback: () => Promise<T>, | ||||
| ): Promise<T> { | ||||
|   const loading: Ora = ora(title).start(); | ||||
| 
 | ||||
|   try { | ||||
|     const result = await callback(); | ||||
|     loading.succeed(successText || 'Success!'); | ||||
|     return result; | ||||
|   } catch (error) { | ||||
|     loading.fail(failedText || 'Failed!'); | ||||
|     throw error; | ||||
|   } finally { | ||||
|     loading.stop(); | ||||
|   } | ||||
| } | ||||
|  | @ -32,7 +32,6 @@ | |||
|     "cheerio": "1.0.0-rc.12", | ||||
|     "html-minifier-terser": "^7.2.0", | ||||
|     "nitropack": "^2.9.7", | ||||
|     "portfinder": "^1.0.32", | ||||
|     "resolve.exports": "^2.0.2", | ||||
|     "vite-plugin-lib-inject-css": "^2.1.1", | ||||
|     "vite-plugin-pwa": "^0.20.1", | ||||
|  |  | |||
|  | @ -5,7 +5,6 @@ import type { NitroMockPluginOptions } from '../typing'; | |||
| import { colors, consola, getPackage } from '@vben/node-utils'; | ||||
| 
 | ||||
| import { build, createDevServer, createNitro, prepare } from 'nitropack'; | ||||
| import portfinder from 'portfinder'; | ||||
| 
 | ||||
| const hmrKeyRe = /^runtimeConfig\.|routeRules\./; | ||||
| 
 | ||||
|  | @ -78,11 +77,6 @@ async function runNitroServer(rootDir: string, port: number, verbose: boolean) { | |||
|     nitro.hooks.hookOnce('restart', reload); | ||||
| 
 | ||||
|     const server = createDevServer(nitro); | ||||
|     // 端口已经存在
 | ||||
|     const availablePort = await portfinder.getPortPromise({ port }); | ||||
|     if (availablePort !== port) { | ||||
|       return; | ||||
|     } | ||||
|     await server.listen(port, { showURL: false }); | ||||
|     await prepare(nitro); | ||||
|     await build(nitro); | ||||
|  | @ -92,5 +86,5 @@ async function runNitroServer(rootDir: string, port: number, verbose: boolean) { | |||
|       consola.success(colors.bold(colors.green('Nitro Mock Server started.'))); | ||||
|     } | ||||
|   }; | ||||
|   await reload(); | ||||
|   return await reload(); | ||||
| } | ||||
|  |  | |||
							
								
								
									
										30
									
								
								package.json
								
								
								
								
							
							
						
						
									
										30
									
								
								package.json
								
								
								
								
							|  | @ -6,12 +6,12 @@ | |||
|     "monorepo", | ||||
|     "turbo", | ||||
|     "vben", | ||||
|     "vue vben admin", | ||||
|     "vue vben admin pro", | ||||
|     "vben admin", | ||||
|     "vben pro", | ||||
|     "vue", | ||||
|     "vue admin", | ||||
|     "vue vben admin", | ||||
|     "vue vben admin pro", | ||||
|     "vue3" | ||||
|   ], | ||||
|   "homepage": "https://github.com/vbenjs/vue-vben-admin", | ||||
|  | @ -27,30 +27,30 @@ | |||
|   "scripts": { | ||||
|     "bootstrap": "pnpm install", | ||||
|     "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build", | ||||
|     "preview": "turbo preview", | ||||
|     "build:analyze": "turbo build:analyze", | ||||
|     "build:docker": "./build-local-docker-image.sh", | ||||
|     "changeset": "pnpm exec changeset", | ||||
|     "check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type", | ||||
|     "check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell", | ||||
|     "check:circular": "vsh check-circular", | ||||
|     "check:cspell": "cspell lint **/*.ts **/README.md .changeset/*.md --no-progress", | ||||
|     "check:dep": "vsh check-dep", | ||||
|     "check:type": "turbo run typecheck", | ||||
|     "clean": "vsh clean", | ||||
|     "commit": "czg", | ||||
|     "dev": "turbo-run dev", | ||||
|     "dev:antd": "pnpm -F @vben/web-antd", | ||||
|     "dev:ele": "pnpm -F @vben/web-ele", | ||||
|     "dev:naive": "pnpm -F @vben/web-naive", | ||||
|     "dev:docs": "pnpm -F @vben/website run docs:dev", | ||||
|     "dev:antd": "pnpm -F @vben/web-antd run dev", | ||||
|     "dev:docs": "pnpm -F @vben/website run dev", | ||||
|     "dev:ele": "pnpm -F @vben/web-ele run dev", | ||||
|     "dev:naive": "pnpm -F @vben/web-naive run dev", | ||||
|     "format": "vsh lint --format", | ||||
|     "lint": "vsh lint", | ||||
|     "postinstall": "turbo run stub", | ||||
|     "preinstall": "npx only-allow pnpm", | ||||
|     "prepare": "is-ci || husky", | ||||
|     "preview": "turbo-run preview", | ||||
|     "publint": "vsh publint", | ||||
|     "reinstall": "pnpm clean --del-lock && pnpm bootstrap", | ||||
|     "test:unit": "vitest", | ||||
|     "turbo-run": "turbo-run", | ||||
|     "update:deps": " pnpm update --latest --recursive", | ||||
|     "version": "pnpm exec changeset version && pnpm install --no-frozen-lockfile" | ||||
|   }, | ||||
|  | @ -78,11 +78,11 @@ | |||
|     "is-ci": "^3.0.1", | ||||
|     "jsdom": "^24.1.1", | ||||
|     "rimraf": "^6.0.1", | ||||
|     "turbo": "^2.0.9", | ||||
|     "turbo": "^2.0.10", | ||||
|     "typescript": "^5.5.4", | ||||
|     "unbuild": "^2.0.0", | ||||
|     "vite": "^5.3.5", | ||||
|     "vitest": "^2.0.4", | ||||
|     "vitest": "^2.0.5", | ||||
|     "vue-tsc": "^2.0.29" | ||||
|   }, | ||||
|   "engines": { | ||||
|  | @ -91,10 +91,16 @@ | |||
|   }, | ||||
|   "packageManager": "pnpm@9.6.0", | ||||
|   "pnpm": { | ||||
|     "peerDependencyRules": { | ||||
|       "allowedVersions": { | ||||
|         "eslint": "*", | ||||
|         "@typescript-eslint/eslint-plugin": "*" | ||||
|       } | ||||
|     }, | ||||
|     "overrides": { | ||||
|       "@ctrl/tinycolor": "^4.1.0", | ||||
|       "clsx": "^2.1.1", | ||||
|       "vue": "^3.4.34" | ||||
|       "vue": "^3.4.35" | ||||
|     }, | ||||
|     "neverBuiltDependencies": [ | ||||
|       "canvas", | ||||
|  |  | |||
|  | @ -36,6 +36,6 @@ | |||
|   "dependencies": { | ||||
|     "@iconify/vue": "^4.1.2", | ||||
|     "lucide-vue-next": "^0.417.0", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -56,7 +56,7 @@ | |||
|   }, | ||||
|   "dependencies": { | ||||
|     "@ctrl/tinycolor": "^4.1.0", | ||||
|     "@vue/shared": "^3.4.34", | ||||
|     "@vue/shared": "^3.4.35", | ||||
|     "clsx": "^2.1.1", | ||||
|     "defu": "^6.1.4", | ||||
|     "lodash.clonedeep": "^4.5.0", | ||||
|  |  | |||
|  | @ -38,7 +38,7 @@ | |||
|     } | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ | |||
|     "@vueuse/core": "^10.11.0", | ||||
|     "radix-vue": "^1.9.2", | ||||
|     "sortablejs": "^1.15.2", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@types/sortablejs": "^1.15.8" | ||||
|  |  | |||
|  | @ -32,6 +32,6 @@ | |||
|     "@vben-core/shared": "workspace:*", | ||||
|     "@vben-core/typings": "workspace:*", | ||||
|     "@vueuse/core": "^10.11.0", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -42,6 +42,6 @@ | |||
|     "@vben-core/shadcn-ui": "workspace:*", | ||||
|     "@vben-core/typings": "workspace:*", | ||||
|     "@vueuse/core": "^10.11.0", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -43,6 +43,6 @@ | |||
|     "@vben-core/shared": "workspace:*", | ||||
|     "@vben-core/typings": "workspace:*", | ||||
|     "@vueuse/core": "^10.11.0", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -50,6 +50,6 @@ | |||
|     "class-variance-authority": "^0.7.0", | ||||
|     "lucide-vue-next": "^0.417.0", | ||||
|     "radix-vue": "^1.9.2", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -41,6 +41,6 @@ | |||
|     "@vben-core/icons": "workspace:*", | ||||
|     "@vben-core/shadcn-ui": "workspace:*", | ||||
|     "@vben-core/typings": "workspace:*", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -24,6 +24,6 @@ | |||
|     "@vben/stores": "workspace:*", | ||||
|     "@vben/types": "workspace:*", | ||||
|     "@vben/utils": "workspace:*", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -23,6 +23,6 @@ | |||
|     "@vben/preferences": "workspace:*", | ||||
|     "@vueuse/core": "^10.11.0", | ||||
|     "echarts": "^5.5.1", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -28,7 +28,7 @@ | |||
|     "@vben/types": "workspace:*", | ||||
|     "@vueuse/integrations": "^10.11.0", | ||||
|     "qrcode": "^1.5.3", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ | |||
|     "@vben/preferences": "workspace:*", | ||||
|     "@vben/stores": "workspace:*", | ||||
|     "@vben/types": "workspace:*", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0", | ||||
|     "watermark-js-plus": "^1.5.2" | ||||
|   } | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ | |||
|     "@vben/types": "workspace:*", | ||||
|     "@vben/utils": "workspace:*", | ||||
|     "@vueuse/core": "^10.11.0", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -22,8 +22,7 @@ | |||
|   "dependencies": { | ||||
|     "@vben/locales": "workspace:*", | ||||
|     "@vben/utils": "workspace:*", | ||||
|     "axios": "^1.7.2", | ||||
|     "vue-request": "^2.0.4" | ||||
|     "axios": "^1.7.2" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "axios-mock-adapter": "^1.22.0" | ||||
|  |  | |||
|  | @ -1,3 +1,2 @@ | |||
| export * from './request-client'; | ||||
| export * from './use-request'; | ||||
| export * from 'axios'; | ||||
|  |  | |||
|  | @ -1,11 +0,0 @@ | |||
| // import { setGlobalOptions, } from 'vue-request';
 | ||||
| 
 | ||||
| // setGlobalOptions({
 | ||||
| //   manual: true,
 | ||||
| //   // ...
 | ||||
| // });
 | ||||
| 
 | ||||
| /** | ||||
|  * @see https://www.attojs.com/guide/documentation/globalOptions.html
 | ||||
|  */ | ||||
| export * from 'vue-request'; | ||||
|  | @ -21,7 +21,7 @@ | |||
|   }, | ||||
|   "dependencies": { | ||||
|     "@intlify/core-base": "^9.13.1", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-i18n": "^9.13.1" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ | |||
|     "@vben-core/typings": "workspace:*", | ||||
|     "pinia": "2.1.7", | ||||
|     "pinia-plugin-persistedstate": "^3.2.1", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ | |||
|   }, | ||||
|   "dependencies": { | ||||
|     "@vben-core/typings": "workspace:*", | ||||
|     "vue": "^3.4.34", | ||||
|     "vue": "^3.4.35", | ||||
|     "vue-router": "^4.4.0" | ||||
|   } | ||||
| } | ||||
|  |  | |||
							
								
								
									
										858
									
								
								pnpm-lock.yaml
								
								
								
								
							
							
						
						
									
										858
									
								
								pnpm-lock.yaml
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -1,3 +1,3 @@ | |||
| # @vben/vsh | ||||
| # @vben/turbo-run | ||||
| 
 | ||||
| shell 脚本工具集合 | ||||
| turbo-run is a command line tool that allows you to run multiple commands in parallel. | ||||
|  |  | |||
|  | @ -1,10 +1,6 @@ | |||
| import type { Package } from '@vben/node-utils'; | ||||
| import { execaCommand, getPackages } from '@vben/node-utils'; | ||||
| 
 | ||||
| import { join } from 'node:path'; | ||||
| 
 | ||||
| import { $, fs, getPackages } from '@vben/node-utils'; | ||||
| 
 | ||||
| import { cancel, isCancel, multiselect } from '@clack/prompts'; | ||||
| import { cancel, isCancel, select } from '@clack/prompts'; | ||||
| 
 | ||||
| interface RunOptions { | ||||
|   command?: string; | ||||
|  | @ -12,35 +8,45 @@ interface RunOptions { | |||
| 
 | ||||
| export async function run(options: RunOptions) { | ||||
|   const { command } = options; | ||||
|   if (!command) { | ||||
|     console.error('Please enter the command to run'); | ||||
|     process.exit(1); | ||||
|   } | ||||
|   const { packages } = await getPackages(); | ||||
|   const appPkgs = await findApps(process.cwd(), packages); | ||||
|   // const appPkgs = await findApps(process.cwd(), packages);
 | ||||
|   // const websitePkg = packages.find(
 | ||||
|   //   (item) => item.packageJson.name === '@vben/website',
 | ||||
|   // );
 | ||||
| 
 | ||||
|   const selectApps = await multiselect<any, string>({ | ||||
|     message: `Select the app you need to run [${command}]:`, | ||||
|     options: appPkgs.map((item) => ({ label: item, value: item })), | ||||
|     required: true, | ||||
|   // 只显示有对应命令的包
 | ||||
|   const selectPkgs = packages.filter((pkg) => { | ||||
|     return (pkg?.packageJson as Record<string, any>).scripts?.[command]; | ||||
|   }); | ||||
| 
 | ||||
|   if (isCancel(selectApps)) { | ||||
|   const selectPkg = await select<any, string>({ | ||||
|     message: `Select the app you need to run [${command}]:`, | ||||
|     options: selectPkgs.map((item) => ({ | ||||
|       label: item?.packageJson.name, | ||||
|       value: item?.packageJson.name, | ||||
|     })), | ||||
|   }); | ||||
| 
 | ||||
|   if (isCancel(selectPkg) || !selectPkg) { | ||||
|     cancel('👋 Has cancelled'); | ||||
|     process.exit(0); | ||||
|   } | ||||
| 
 | ||||
|   if (selectApps.length === 1) { | ||||
|     $.verbose = true; | ||||
|     // 让控制台显示颜色
 | ||||
|     process.env.FORCE_COLOR = '1'; | ||||
|     await $`pnpm --filter=${selectApps[0]} run ${command} `; | ||||
|     return; | ||||
|   } | ||||
|   const filters = []; | ||||
|   for (const app of selectApps) { | ||||
|     filters.push(`--filter=${app}`); | ||||
|   } | ||||
|   $.verbose = true; | ||||
|   // 让控制台显示颜色
 | ||||
|   process.env.FORCE_COLOR = '1'; | ||||
|   await $`turbo run ${command} ${filters}`; | ||||
|   execaCommand(`pnpm --filter=${selectPkg} run ${command}`, { | ||||
|     stdio: 'inherit', | ||||
|   }); | ||||
|   // const filters = [];
 | ||||
|   // for (const app of selectApps) {
 | ||||
|   //   filters.push(`--filter=${app}`);
 | ||||
|   // }
 | ||||
|   // $.verbose = true;
 | ||||
|   // execaCommand(`turbo run ${command} ${filters}`, {
 | ||||
|   //   stdio: 'inherit',
 | ||||
|   // });
 | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  | @ -48,16 +54,12 @@ export async function run(options: RunOptions) { | |||
|  * @param root | ||||
|  * @param packages | ||||
|  */ | ||||
| async function findApps(root: string, packages: Package[]) { | ||||
|   // apps内的
 | ||||
|   const appPackages = packages | ||||
|     .filter((pkg) => { | ||||
|       const viteConfigExists = fs.existsSync(join(pkg.dir, 'vite.config.mts')); | ||||
|       return pkg.dir.startsWith(join(root, 'apps')) && viteConfigExists; | ||||
|     }) | ||||
|     .map((pkg) => { | ||||
|       return pkg.packageJson.name; | ||||
|     }); | ||||
| // async function findApps(root: string, packages: Package[]) {
 | ||||
| //   // apps内的
 | ||||
| //   const appPackages = packages.filter((pkg) => {
 | ||||
| //     const viteConfigExists = fs.existsSync(join(pkg.dir, 'vite.config.mts'));
 | ||||
| //     return pkg.dir.startsWith(join(root, 'apps')) && viteConfigExists;
 | ||||
| //   });
 | ||||
| 
 | ||||
|   return appPackages; | ||||
| } | ||||
| //   return appPackages;
 | ||||
| // }
 | ||||
|  |  | |||
|  | @ -2,13 +2,7 @@ import type { CAC } from 'cac'; | |||
| 
 | ||||
| import { join } from 'node:path'; | ||||
| 
 | ||||
| import { | ||||
|   colors, | ||||
|   consola, | ||||
|   getPackages, | ||||
|   rimraf, | ||||
|   spinner, | ||||
| } from '@vben/node-utils'; | ||||
| import { colors, getPackages, rimraf, spinner } from '@vben/node-utils'; | ||||
| 
 | ||||
| const CLEAN_DIRS = ['dist', 'node_modules', '.turbo']; | ||||
| 
 | ||||
|  | @ -38,10 +32,15 @@ async function runClean({ | |||
| 
 | ||||
|   const cleanDirsText = JSON.stringify(cleanDirs); | ||||
| 
 | ||||
|   spinner(`${colors.dim(cleanDirsText)} cleaning in progress...`, async () => { | ||||
|     await clean({ delLock, dirs: cleanDirs, recursive }); | ||||
|     consola.success(colors.green(`clean up all \`${cleanDirsText}\` success.`)); | ||||
|   }); | ||||
|   spinner( | ||||
|     { | ||||
|       successText: colors.green(`clean up all \`${cleanDirsText}\` success.`), | ||||
|       title: `${colors.dim(cleanDirsText)} cleaning in progress...`, | ||||
|     }, | ||||
|     async () => { | ||||
|       await clean({ delLock, dirs: cleanDirs, recursive }); | ||||
|     }, | ||||
|   ); | ||||
| } | ||||
| 
 | ||||
| async function clean({ delLock, dirs = [], recursive }: CleanCommandOptions) { | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| import type { CAC } from 'cac'; | ||||
| 
 | ||||
| import { $ } from '@vben/node-utils'; | ||||
| import { execaCommand } from '@vben/node-utils'; | ||||
| 
 | ||||
| interface LintCommandOptions { | ||||
|   /** | ||||
|  | @ -10,21 +10,31 @@ interface LintCommandOptions { | |||
| } | ||||
| 
 | ||||
| async function runLint({ format }: LintCommandOptions) { | ||||
|   process.env.FORCE_COLOR = '3'; | ||||
|   // process.env.FORCE_COLOR = '3';
 | ||||
| 
 | ||||
|   if (format) { | ||||
|     await $`stylelint "**/*.{vue,css,less.scss}" --cache --fix`; | ||||
|     await $`eslint . --cache --fix`; | ||||
|     await $`prettier . --write --cache --log-level warn`; | ||||
|     await execaCommand(`stylelint "**/*.{vue,css,less.scss}" --cache --fix`, { | ||||
|       stdio: 'inherit', | ||||
|     }); | ||||
|     await execaCommand(`eslint . --cache --fix`, { | ||||
|       stdio: 'inherit', | ||||
|     }); | ||||
|     await execaCommand(`prettier . --write --cache --log-level warn`, { | ||||
|       stdio: 'inherit', | ||||
|     }); | ||||
|     return; | ||||
|   } | ||||
|   $.verbose = true; | ||||
|   await Promise.all([ | ||||
|     $`cspell lint "**/*.ts"  "**/README.md" ".changeset/*.md" --no-progress`, | ||||
|     $`eslint . --cache`, | ||||
|     execaCommand(`eslint . --cache`, { | ||||
|       stdio: 'inherit', | ||||
|     }), | ||||
|     // $`ls-lint`,
 | ||||
|     $`prettier . --ignore-unknown --check --cache`, | ||||
|     $`stylelint "**/*.{vue,css,less.scss}" --cache`, | ||||
|     execaCommand(`prettier . --ignore-unknown --check --cache`, { | ||||
|       stdio: 'inherit', | ||||
|     }), | ||||
|     execaCommand(`stylelint "**/*.{vue,css,less.scss}" --cache`, { | ||||
|       stdio: 'inherit', | ||||
|     }), | ||||
|   ]); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -162,7 +162,15 @@ function nav(): DefaultTheme.NavItem[] { | |||
|           items: [ | ||||
|             { | ||||
|               link: 'https://www.vben.pro', | ||||
|               text: '完整版(Ant Design Vue)', | ||||
|               text: 'Ant Design Vue 版本(默认)', | ||||
|             }, | ||||
|             { | ||||
|               link: 'https://naive.vben.pro', | ||||
|               text: 'Naive 版本', | ||||
|             }, | ||||
|             { | ||||
|               link: 'https://ele.vben.pro', | ||||
|               text: 'Element Plus版本', | ||||
|             }, | ||||
|           ], | ||||
|         }, | ||||
|  | @ -184,6 +192,10 @@ function nav(): DefaultTheme.NavItem[] { | |||
|           link: 'https://github.com/vbenjs/vue-vben-admin/releases', | ||||
|           text: '更新日志', | ||||
|         }, | ||||
|         { | ||||
|           link: 'https://github.com/orgs/vbenjs/projects/5', | ||||
|           text: '路线图', | ||||
|         }, | ||||
|         { | ||||
|           link: 'https://github.com/vbenjs/vue-vben-admin/blob/main/.github/contributing.md', | ||||
|           text: '贡献', | ||||
|  | @ -220,11 +232,6 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] { | |||
|           text: '为什么选择我们?', | ||||
|         }, | ||||
|         { link: 'introduction/quick-start', text: '快速开始' }, | ||||
|         { | ||||
|           link: 'https://github.com/vbenjs/vue-vben-admin/releases', | ||||
|           text: '更新日志', | ||||
|         }, | ||||
|         { link: 'https://github.com/orgs/vbenjs/projects/5', text: '路线图' }, | ||||
|       ], | ||||
|     }, | ||||
|     { | ||||
|  | @ -251,6 +258,7 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] { | |||
|         { link: 'in-depth/features', text: '常用功能' }, | ||||
|         { link: 'in-depth/check-updates', text: '检查更新' }, | ||||
|         { link: 'in-depth/loading', text: '全局loading' }, | ||||
|         { link: 'in-depth/ui-framework', text: '组件库切换' }, | ||||
|       ], | ||||
|     }, | ||||
|     { | ||||
|  |  | |||
|  | @ -4,7 +4,7 @@ | |||
|   "private": true, | ||||
|   "scripts": { | ||||
|     "build": "vitepress build", | ||||
|     "docs:dev": "vitepress dev", | ||||
|     "dev": "vitepress dev", | ||||
|     "docs:preview": "vitepress preview" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|  | @ -13,6 +13,6 @@ | |||
|   "devDependencies": { | ||||
|     "@vite-pwa/vitepress": "^0.5.0", | ||||
|     "vitepress": "^1.3.1", | ||||
|     "vue": "^3.4.34" | ||||
|     "vue": "^3.4.35" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -50,14 +50,18 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如 | |||
|     "bootstrap": "pnpm install", | ||||
|     // 构建项目 | ||||
|     "build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build", | ||||
|     // 构建项目并分析 | ||||
|     "build:analyze": "turbo build:analyze", | ||||
|     // 构建docker镜像 | ||||
|     "build:docker": "./build-local-docker-image.sh", | ||||
|     // changeset 版本管理 | ||||
|     "changeset": "pnpm exec changeset", | ||||
|     // 检查项目各种问题 | ||||
|     "check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type",, | ||||
|     "check": "pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell", | ||||
|     // 检查循环引用 | ||||
|     "check:circular": "vsh check-circular", | ||||
|     // 检查拼写 | ||||
|     "check:cspell": "cspell lint **/*.ts **/README.md .changeset/*.md --no-progress" | ||||
|     // 检查依赖 | ||||
|     "check:dep": "vsh check-dep", | ||||
|     // 检查类型 | ||||
|  | @ -67,9 +71,15 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如 | |||
|     // 提交代码 | ||||
|     "commit": "czg", | ||||
|     // 启动项目(默认会运行整个仓库所有包的dev脚本) | ||||
|     "dev": "cross-env TURBO_UI=1 turbo run dev", | ||||
|     "dev": "turbo-run dev", | ||||
|     // 启动web-antd应用 | ||||
|     "dev:antd": "pnpm -F @vben/web-antd run dev", | ||||
|     // 启动文档 | ||||
|     "dev:docs": "pnpm -F @vben/website run docs:dev", | ||||
|     "dev:docs": "pnpm -F @vben/website run dev", | ||||
|     // 启动 element plus应用 | ||||
|     "dev:ele": "pnpm -F @vben/web-ele run dev", | ||||
|     // 启动web-naive应用 | ||||
|     "dev:naive": "pnpm -F @vben/web-naive run dev", | ||||
|     // 格式化代码 | ||||
|     "format": "vsh lint --format", | ||||
|     // lint 代码 | ||||
|  | @ -80,6 +90,8 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如 | |||
|     "preinstall": "npx only-allow pnpm", | ||||
|     // husky的安装 | ||||
|     "prepare": "is-ci || husky", | ||||
|     // 预览应用 | ||||
|     "preview": "turbo-run preview", | ||||
|     // 包规范检查 | ||||
|     "publint": "vsh publint", | ||||
|     // 删除所有的node_modules、yarn.lock、package.lock.json,重新安装依赖 | ||||
|  | @ -96,12 +108,33 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如 | |||
| 
 | ||||
| ## 本地运行项目 | ||||
| 
 | ||||
| 如需本地运行文档,并进行调整,可以执行以下命令: | ||||
| 如需本地运行文档,并进行调整,可以执行以下命令,执行该命令,你可以选择需要的应用进行开发: | ||||
| 
 | ||||
| ```bash | ||||
| pnpm dev | ||||
| ``` | ||||
| 
 | ||||
| 如果你想直接运行某个应用,可以执行以下命令: | ||||
| 
 | ||||
| 运行 `web-antd` 应用: | ||||
| 
 | ||||
| ```bash | ||||
| pnpm dev:antd | ||||
| 
 | ||||
| ``` | ||||
| 
 | ||||
| 运行 `web-naive` 应用: | ||||
| 
 | ||||
| ```bash | ||||
| pnpm dev:naive | ||||
| ``` | ||||
| 
 | ||||
| 运行 `website` 应用: | ||||
| 
 | ||||
| ```bash | ||||
| pnpm dev:docs | ||||
| ``` | ||||
| 
 | ||||
| ## DevTools | ||||
| 
 | ||||
| 项目内置了 [Vue DevTools](https://github.com/vuejs/devtools-next) 插件,可以在开发过程中使用。默认关闭,可在`.env.development` 内开启,并重新运行项目即可: | ||||
|  |  | |||
|  | @ -0,0 +1,16 @@ | |||
| # 组件库切换 | ||||
| 
 | ||||
| `Vue Admin` 支持你自由选择组件库,目前演示站点的默认组件库是 `Ant Design Vue`,与旧版本保持一致。同时框架还内置了 `Element Plus` 版本和 `Naive UI` 版本,你可以根据自己的喜好选择。 | ||||
| 
 | ||||
| ## 新增组件库应用 | ||||
| 
 | ||||
| 如果你想用其他别的组件库,你只需要按一下步骤进行操作: | ||||
| 
 | ||||
| 1. 在`apps`内创建一个新的文件夹,例如`apps/web-xxx`。 | ||||
| 2. 更改`apps/web-xxx/package.json`的`name`字段为`web-xxx`。 | ||||
| 3. 移除其他组件库依赖及代码,并用你的组件库进行替换相应逻辑,需要改动的地方不多。 | ||||
| 4. 调整`locales`内的语言文件。 | ||||
| 5. 调整 `app.vue` 内的组件。 | ||||
| 6. 自行适配组件库的主题,与 `Vben Admin` 契合。 | ||||
| 7. 调整 `.env` 内的应用名 | ||||
| 8. 在大仓根目录增加 `dev:xxx` 脚本 | ||||
		Loading…
	
		Reference in New Issue
	
	 vben
						vben