mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-07 02:31:58 +08:00
Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin into antdv-next
This commit is contained in:
@@ -13,7 +13,6 @@ const DEFAULT_CONFIG = {
|
||||
'unbuild',
|
||||
'@vben/tsconfig',
|
||||
'@vben/vite-config',
|
||||
'@vben/tailwind-config',
|
||||
'@types/*',
|
||||
'@vben-core/design',
|
||||
],
|
||||
@@ -23,9 +22,9 @@ const DEFAULT_CONFIG = {
|
||||
'@vben/commitlint-config',
|
||||
'@vben/eslint-config',
|
||||
'@vben/node-utils',
|
||||
'@vben/prettier-config',
|
||||
'@vben/oxfmt-config',
|
||||
'@vben/oxlint-config',
|
||||
'@vben/stylelint-config',
|
||||
'@vben/tailwind-config',
|
||||
'@vben/tsconfig',
|
||||
'@vben/vite-config',
|
||||
'@vben/vsh',
|
||||
|
||||
@@ -6,10 +6,10 @@ import {
|
||||
colors,
|
||||
consola,
|
||||
findMonorepoRoot,
|
||||
formatFile,
|
||||
getPackages,
|
||||
gitAdd,
|
||||
outputJSON,
|
||||
prettierFormat,
|
||||
toPosixPath,
|
||||
} from '@vben/node-utils';
|
||||
|
||||
@@ -40,7 +40,7 @@ async function createCodeWorkspace({
|
||||
const outputPath = join(monorepoRoot, CODE_WORKSPACE_FILE);
|
||||
await outputJSON(outputPath, { folders }, spaces);
|
||||
|
||||
await prettierFormat(outputPath);
|
||||
await formatFile(outputPath);
|
||||
if (autoCommit) {
|
||||
await gitAdd(CODE_WORKSPACE_FILE, monorepoRoot);
|
||||
}
|
||||
|
||||
@@ -32,27 +32,30 @@ async function main(): Promise<void> {
|
||||
defineCheckCircularCommand(vsh);
|
||||
defineDepcheckCommand(vsh);
|
||||
|
||||
// Handle invalid commands
|
||||
vsh.on('command:*', ([cmd]) => {
|
||||
consola.error(
|
||||
colors.red(`Invalid command: ${cmd}`),
|
||||
'\n',
|
||||
colors.yellow('Available commands:'),
|
||||
'\n',
|
||||
Object.entries(COMMAND_DESCRIPTIONS)
|
||||
.map(([cmd, desc]) => ` ${colors.cyan(cmd)} - ${desc}`)
|
||||
.join('\n'),
|
||||
);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// Set up CLI
|
||||
vsh.usage('vsh <command> [options]');
|
||||
vsh.help();
|
||||
vsh.version(version);
|
||||
|
||||
// Parse arguments
|
||||
vsh.parse();
|
||||
// Parse arguments without auto-running to detect unknown commands
|
||||
// Note: cac v7 removed EventEmitter; use matchedCommand after parse instead
|
||||
vsh.parse(undefined, { run: false });
|
||||
|
||||
if (!vsh.matchedCommand && vsh.args.length > 0) {
|
||||
const unknownCmd = String(vsh.args[0]);
|
||||
consola.error(
|
||||
colors.red(`Invalid command: ${unknownCmd}`),
|
||||
'\n',
|
||||
colors.yellow('Available commands:'),
|
||||
'\n',
|
||||
Object.entries(COMMAND_DESCRIPTIONS)
|
||||
.map(([name, desc]) => ` ${colors.cyan(name)} - ${desc}`)
|
||||
.join('\n'),
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await vsh.runMatchedCommand();
|
||||
} catch (error) {
|
||||
consola.error(
|
||||
colors.red('An unexpected error occurred:'),
|
||||
|
||||
@@ -16,19 +16,25 @@ async function runLint({ format }: LintCommandOptions) {
|
||||
await execaCommand(`stylelint "**/*.{vue,css,less,scss}" --cache --fix`, {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
await execaCommand(`eslint . --cache --fix`, {
|
||||
await execaCommand(`oxfmt`, {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
await execaCommand(`prettier . --write --cache --log-level warn`, {
|
||||
await execaCommand(`oxlint --fix`, {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
await execaCommand(`eslint . --cache --fix`, {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
return;
|
||||
}
|
||||
await Promise.all([
|
||||
execaCommand(`eslint . --cache`, {
|
||||
execaCommand(`oxfmt --check`, {
|
||||
stdio: 'inherit',
|
||||
}),
|
||||
execaCommand(`prettier . --ignore-unknown --check --cache`, {
|
||||
execaCommand(`oxlint`, {
|
||||
stdio: 'inherit',
|
||||
}),
|
||||
execaCommand(`eslint . --cache`, {
|
||||
stdio: 'inherit',
|
||||
}),
|
||||
execaCommand(`stylelint "**/*.{vue,css,less,scss}" --cache`, {
|
||||
|
||||
Reference in New Issue
Block a user