feat(cli): using rslog (#12334)

This commit is contained in:
neverland
2023-10-02 21:34:03 +08:00
committed by GitHub
parent 53188a7093
commit 087ecda7b2
15 changed files with 48 additions and 60 deletions
+3
View File
@@ -1,9 +1,12 @@
// @ts-ignore
import fs from 'node:fs';
import { URL, fileURLToPath } from 'node:url';
import { logger } from 'rslog';
const packagePath = fileURLToPath(new URL('../package.json', import.meta.url));
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8'));
export const cliVersion: string = packageJson.version;
logger.greet(` Vant CLI v${cliVersion}\n`);
process.env.VANT_CLI_VERSION = cliVersion;