add yargs bun and pm2
This commit is contained in:
@@ -18,8 +18,6 @@ export async function start(
|
||||
config: CLIConfig,
|
||||
): Promise<void> {
|
||||
console.log('command start...');
|
||||
console.log(args);
|
||||
console.log(config);
|
||||
const script = args.typescript ? config.paths.ts : config.paths.js;
|
||||
const params = [config.paths.bun, 'run'];
|
||||
if (args.watch) {
|
||||
@@ -66,6 +64,7 @@ export async function startPM2(
|
||||
args: Arguments<StartCommandArguments>,
|
||||
config: CLIConfig,
|
||||
): Promise<void> {
|
||||
console.log('command startPM2...');
|
||||
const { name } = await configure.get<AppConfig>('app');
|
||||
const script = args.typescript ? config.paths.ts : config.paths.js;
|
||||
const pm2config = await getPm2Config(
|
||||
|
||||
@@ -61,10 +61,8 @@ export const createStartCommand: CommandItem<any, StartCommandArguments> = async
|
||||
},
|
||||
handler: async (args: Arguments<StartCommandArguments>) => {
|
||||
console.log('createStartCommand handler start');
|
||||
console.log(app);
|
||||
const { configure } = app;
|
||||
const config = getCLIConfig(args.tsConfig, args.nestConfig, args.entry);
|
||||
console.log(config);
|
||||
if (args.prod || args.restart) {
|
||||
await startPM2(configure, args, config);
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { Min, IsNumber, IsOptional } from 'class-validator';
|
||||
import { IsNumber, IsOptional, Min } from 'class-validator';
|
||||
import { toNumber } from 'lodash';
|
||||
|
||||
import { DtoValidation } from '@/modules/core/decorator/dto.validation.decorator';
|
||||
@@ -14,7 +14,7 @@ export class PaginateDto implements PaginateOptions {
|
||||
* 当前页
|
||||
*/
|
||||
@Transform(({ value }) => toNumber(value))
|
||||
@Min(1, { message: '当前页必须大于1' })
|
||||
@Min(1, { message: 'The current page must be greater than 1.' })
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
page?: number = 1;
|
||||
@@ -23,7 +23,7 @@ export class PaginateDto implements PaginateOptions {
|
||||
* 每页数据量
|
||||
*/
|
||||
@Transform(({ value }) => toNumber(value))
|
||||
@Min(1, { message: '每页显示数据必须大于1' })
|
||||
@Min(1, { message: 'The number of data displayed per page must be greater than 1.' })
|
||||
@IsNumber()
|
||||
@IsOptional()
|
||||
limit?: number = 10;
|
||||
|
||||
Reference in New Issue
Block a user