增加运行时信息

This commit is contained in:
Hooray Hu
2024-01-14 00:06:09 +08:00
parent fb540ebef9
commit 738c74d1c4
4 changed files with 77 additions and 0 deletions
+2
View File
@@ -74,6 +74,7 @@
"@vitejs/plugin-vue": "^5.0.3",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"autoprefixer": "^10.4.16",
"boxen": "^7.1.1",
"eslint": "^8.56.0",
"esno": "^4.0.0",
"fs-extra": "^11.2.0",
@@ -81,6 +82,7 @@
"inquirer": "^9.2.12",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"picocolors": "^1.0.0",
"plop": "^4.0.1",
"sass": "^1.69.7",
"simple-git-hooks": "^2.9.0",
+48
View File
@@ -178,6 +178,9 @@ devDependencies:
autoprefixer:
specifier: ^10.4.16
version: 10.4.16(postcss@8.4.33)
boxen:
specifier: ^7.1.1
version: 7.1.1
eslint:
specifier: ^8.56.0
version: 8.56.0
@@ -199,6 +202,9 @@ devDependencies:
npm-run-all:
specifier: ^4.1.5
version: 4.1.5
picocolors:
specifier: ^1.0.0
version: 1.0.0
plop:
specifier: ^4.0.1
version: 4.0.1
@@ -4321,6 +4327,12 @@ packages:
resolution: {integrity: sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ==}
dev: false
/ansi-align@3.0.1:
resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==}
dependencies:
string-width: 4.2.3
dev: true
/ansi-escapes@4.3.2:
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
engines: {node: '>=8'}
@@ -4595,6 +4607,20 @@ packages:
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
dev: true
/boxen@7.1.1:
resolution: {integrity: sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==}
engines: {node: '>=14.16'}
dependencies:
ansi-align: 3.0.1
camelcase: 7.0.1
chalk: 5.3.0
cli-boxes: 3.0.0
string-width: 5.1.2
type-fest: 2.19.0
widest-line: 4.0.1
wrap-ansi: 8.1.0
dev: true
/brace-expansion@1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
dependencies:
@@ -4781,6 +4807,11 @@ packages:
engines: {node: '>=10'}
dev: true
/camelcase@7.0.1:
resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==}
engines: {node: '>=14.16'}
dev: true
/caniuse-lite@1.0.30001538:
resolution: {integrity: sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==}
dev: true
@@ -4934,6 +4965,11 @@ packages:
escape-string-regexp: 5.0.0
dev: true
/cli-boxes@3.0.0:
resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
engines: {node: '>=10'}
dev: true
/cli-cursor@3.1.0:
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
engines: {node: '>=8'}
@@ -11138,6 +11174,11 @@ packages:
engines: {node: '>=8'}
dev: true
/type-fest@2.19.0:
resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
engines: {node: '>=12.20'}
dev: true
/type-fest@3.13.1:
resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==}
engines: {node: '>=14.16'}
@@ -11991,6 +12032,13 @@ packages:
isexe: 2.0.0
dev: true
/widest-line@4.0.1:
resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==}
engines: {node: '>=12'}
dependencies:
string-width: 5.1.2
dev: true
/window-size@0.1.0:
resolution: {integrity: sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==}
engines: {node: '>= 0.8.0'}
+25
View File
@@ -0,0 +1,25 @@
import boxen from 'boxen'
import picocolors from 'picocolors'
import type { Plugin } from 'vite'
export default function appInfo(): Plugin {
return {
name: 'appInfo',
apply: 'serve',
async buildStart() {
const { bold, green, cyan, bgGreen, underline } = picocolors
// eslint-disable-next-line no-console
console.log(
boxen(
`${bold(green(`由 ${bgGreen('Fantastic-admin')} 驱动`))}\n\n${underline('https://fantastic-admin.gitee.io')}\n\n当前使用:${cyan('基础版')}`,
{
padding: 1,
margin: 1,
borderStyle: 'double',
textAlignment: 'center',
},
),
)
},
}
}
+2
View File
@@ -2,6 +2,7 @@ import type { PluginOption } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueLegacy from '@vitejs/plugin-legacy'
import appInfo from './app-info'
import createInspector from './inspector'
import createAutoImport from './auto-import'
@@ -17,6 +18,7 @@ import createBanner from './banner'
export default function createVitePlugins(viteEnv, isBuild = false) {
const vitePlugins: (PluginOption | PluginOption[])[] = [
appInfo(),
vue(),
vueJsx(),
vueLegacy({