Skip to content

Commit b765515

Browse files
committed
feat(mf): dev-server (run:all) accepts project names via command line args
Before, all apps were started. Now, if one calls the server (or run:all) with app names, only these apps are started. End-2-End tests are never started.
1 parent c57d87f commit b765515

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

libs/mf/src/server/mf-dev-server.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { exec } from 'child_process';
22
import { isWorkspace, ProjectInfo, readProjectInfos } from './workspace';
33
import { print } from './colors';
4+
import { argv } from 'process';
45

56
let padding;
67

@@ -18,7 +19,7 @@ function startCmd(name: string, cmd: string): void {
1819
function startApps(apps: ProjectInfo[]): void {
1920
for (const app of apps) {
2021
const cmd = `ng serve ${app.name} -o`;
21-
print('DEVSVR', padding, app.name + ' ' + app.port);
22+
print('DEVSVR', padding, app.name + ' ' + (app.port || '4200'));
2223
startCmd(app.name, cmd);
2324
}
2425
}
@@ -28,8 +29,15 @@ if (!isWorkspace()) {
2829
process.exit(0);
2930
}
3031

32+
const [,, ...filter] = argv;
33+
const startAll = filter.length === 0;
34+
3135
const projects = readProjectInfos();
32-
const apps = projects.filter(p => p.projectType === 'application');
36+
const apps = projects.filter(p =>
37+
p.projectType === 'application'
38+
&& !p.name.endsWith('-e2e')
39+
&& (startAll || filter.includes(p.name))
40+
);
3341
padding = apps.reduce((acc, p) => Math.max(acc, p.name.length), 0);
3442
padding = Math.max(6, padding)
3543
startApps(apps);

0 commit comments

Comments
 (0)