This commit is contained in:
xingyu4j
2026-03-14 11:34:06 +08:00
389 changed files with 8904 additions and 8239 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/turbo-run",
"version": "5.6.0",
"version": "5.7.0",
"private": true,
"license": "MIT",
"type": "module",

View File

@@ -1,4 +1,4 @@
import { colors, consola } from '@vben/node-utils';
import { consola } from '@vben/node-utils';
import { cac } from 'cac';
@@ -14,12 +14,6 @@ try {
run({ command });
});
// Invalid command
turboRun.on('command:*', () => {
consola.error(colors.red('Invalid command!'));
process.exit(1);
});
turboRun.usage('turbo-run');
turboRun.help();
turboRun.parse();

1
scripts/vsh/env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'circular-dependency-scanner';

View File

@@ -1,6 +1,6 @@
{
"name": "@vben/vsh",
"version": "5.6.0",
"version": "5.7.0",
"private": true,
"license": "MIT",
"type": "module",

View File

@@ -13,7 +13,6 @@ const DEFAULT_CONFIG = {
'unbuild',
'@vben/tsconfig',
'@vben/vite-config',
'@vben/tailwind-config',
'@types/*',
'@vben-core/design',
],
@@ -22,9 +21,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',

View File

@@ -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);
}

View File

@@ -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:'),

View File

@@ -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`, {

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/node.json",
"include": ["src"],
"include": ["src", "env.d.ts"],
"exclude": ["node_modules"]
}