mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 15:16:28 +08:00
chore(tools): add package selector to dev command (#9328)
This commit is contained in:
+21
-4
@@ -1,16 +1,33 @@
|
||||
import { PackageCommand } from './command';
|
||||
import type { PackageName } from '@affine-tools/utils/workspace';
|
||||
|
||||
export class DevCommand extends PackageCommand {
|
||||
import { Option, PackageSelectorCommand } from './command';
|
||||
|
||||
export class DevCommand extends PackageSelectorCommand {
|
||||
static override paths = [['dev'], ['d']];
|
||||
|
||||
protected override availablePackages: PackageName[] = [
|
||||
'@affine/web',
|
||||
'@affine/server',
|
||||
'@affine/electron',
|
||||
'@affine/electron-renderer',
|
||||
'@affine/mobile',
|
||||
'@affine/ios',
|
||||
'@affine/android',
|
||||
];
|
||||
|
||||
protected deps = Option.Boolean('--deps', {
|
||||
description: 'Run dev with dependencies',
|
||||
});
|
||||
|
||||
async execute() {
|
||||
const name = await this.getPackage();
|
||||
const args = [];
|
||||
|
||||
if (this.deps) {
|
||||
args.push('--deps', '--wait-deps');
|
||||
args.push('--deps');
|
||||
}
|
||||
|
||||
args.push(this.package, 'dev');
|
||||
args.push(name, 'dev');
|
||||
|
||||
await this.cli.run(args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user