Fix usage of ClientFlags in WebMasterClient
MODIFY
packages/@romejs/core/client/Client.ts
packages/@romejs/core/client/Client.ts
import {MasterQueryResponse} from '@romejs/core';
import {Event} from '@romejs/events';
-import {ClientFlags} from '../common/types/client';
+import {ClientFlags, ClientFlagsJSON} from '../common/types/client';
import {ClientRequestType} from './ClientRequest';
import {Reporter} from '@romejs/cli-reporter';
import {DEFAULT_CLIENT_FLAGS} from '../common/types/client';
@@ -21,10 +21,7 @@ import prettyFormat from '@romejs/pretty-format';
import {VERSION} from '../common/constants';
import {TarWriter} from '@romejs/codec-tar';
import {Trace, Profiler, Profile, TraceEvent} from '@romejs/v8';
-import {
- PartialMasterQueryRequest,
- MasterBridgeJSONFlags,
-} from '../common/bridges/MasterBridge';
+import {PartialMasterQueryRequest} from '../common/bridges/MasterBridge';
import {loadUserConfig, UserConfig} from '../common/userConfig';
import stream = require('stream');
@@ -119,7 +116,7 @@ export default class Client {
requestResponseEvent: Event<ClientRequestResponseResult, void>;
endEvent: Event<void, void>;
- getBridgeJSONFlags(): MasterBridgeJSONFlags {
+ getClientJSONFlags(): ClientFlagsJSON {
return {
...this.flags,
cwd: this.flags.cwd.join(),
@@ -305,7 +302,7 @@ export default class Client {
// Add client flags
writer.append({name: 'clientFlags.json'}, stringify(
- this.getBridgeJSONFlags(),
+ this.getClientJSONFlags(),
));
function stringify(val: JSONValue): string {
@@ -408,7 +405,7 @@ export default class Client {
hasClearScreen: this.reporter.hasClearScreen,
columns: stdout.columns,
useRemoteReporter: true,
- flags: this.getBridgeJSONFlags(),
+ flags: this.getClientJSONFlags(),
}),
bridge.handshake(),

MODIFY
packages/@romejs/core/common/bridges/MasterBridge.ts
packages/@romejs/core/common/bridges/MasterBridge.ts
import {Profile} from '@romejs/v8';
import {Diagnostics} from '@romejs/diagnostics';
-import {ClientFlags, ClientRequestFlags} from '../types/client';
+import {ClientRequestFlags, ClientFlagsJSON} from '../types/client';
import {Bridge} from '@romejs/events';
import {JSONPropertyValue} from '@romejs/codec-json';
import {
@@ -69,15 +69,13 @@ export type MasterQueryResponse =
export type ProfilingStartData = {samplingInterval: number};
-export type MasterBridgeJSONFlags = Omit<ClientFlags, 'cwd'> & {cwd: string};
-
export type MasterBridgeInfo = {
version: string;
columns: number;
hasClearScreen: boolean;
useRemoteReporter: boolean;
format: ReporterStream['format'];
- flags: MasterBridgeJSONFlags;
+ flags: ClientFlagsJSON;
};
export default class MasterBridge extends Bridge {

MODIFY
packages/@romejs/core/common/types/client.ts
packages/@romejs/core/common/types/client.ts
@@ -52,3 +52,5 @@ export type ClientFlags = {
silent: boolean;
verbose: boolean;
};
+
+export type ClientFlagsJSON = Omit<ClientFlags, 'cwd'> & {cwd: string};

MODIFY
packages/@romejs/core/master/web/index.ts
packages/@romejs/core/master/web/index.ts
@@ -19,7 +19,7 @@ import {
} from '../../common/bridges/MasterBridge';
import {ReporterStream} from '@romejs/cli-reporter';
import {MasterMarker} from '../Master';
-import {ClientFlags} from '../../common/types/client';
+import {ClientFlagsJSON} from '../../common/types/client';
import WebRequest, {stripBundleSuffix} from './WebRequest';
import {BundlerConfig} from '../../common/types/bundler';
import {AbsoluteFilePath} from '@romejs/path';
@@ -36,7 +36,7 @@ export type WebMasterClient =
& WebMasterTime
& {
id: number;
- flags: ClientFlags;
+ flags: ClientFlagsJSON;
stdoutAnsi: string;
stdoutHTML: string;
};
@@ -80,7 +80,10 @@ export class WebServer {
const data: WebMasterClient = {
id: client.id,
- flags: client.flags,
+ flags: {
+ ...client.flags,
+ cwd: client.flags.cwd.join(),
+ },
startTime: Date.now(),
endTime: undefined,
stdoutAnsi: '',

Fix usage of ClientFlags in WebMasterClient