@fluidframework/fluid-runner 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.3.1.0.125672

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.eslintrc.js +11 -13
  2. package/.mocharc.js +2 -2
  3. package/README.md +23 -10
  4. package/dist/codeLoaderBundle.d.ts.map +1 -1
  5. package/dist/codeLoaderBundle.js +4 -2
  6. package/dist/codeLoaderBundle.js.map +1 -1
  7. package/dist/exportFile.d.ts.map +1 -1
  8. package/dist/exportFile.js +6 -3
  9. package/dist/exportFile.js.map +1 -1
  10. package/dist/fakeUrlResolver.d.ts.map +1 -1
  11. package/dist/fakeUrlResolver.js.map +1 -1
  12. package/dist/fluidRunner.d.ts.map +1 -1
  13. package/dist/fluidRunner.js +5 -6
  14. package/dist/fluidRunner.js.map +1 -1
  15. package/dist/getArgsValidationError.d.ts.map +1 -1
  16. package/dist/getArgsValidationError.js.map +1 -1
  17. package/dist/logger/baseFileLogger.d.ts.map +1 -1
  18. package/dist/logger/baseFileLogger.js.map +1 -1
  19. package/dist/logger/csvFileLogger.d.ts.map +1 -1
  20. package/dist/logger/csvFileLogger.js.map +1 -1
  21. package/dist/logger/fileLogger.d.ts.map +1 -1
  22. package/dist/logger/fileLogger.js.map +1 -1
  23. package/dist/logger/jsonFileLogger.d.ts.map +1 -1
  24. package/dist/logger/jsonFileLogger.js.map +1 -1
  25. package/dist/logger/loggerUtils.d.ts.map +1 -1
  26. package/dist/logger/loggerUtils.js +11 -3
  27. package/dist/logger/loggerUtils.js.map +1 -1
  28. package/dist/parseBundleAndExportFile.d.ts.map +1 -1
  29. package/dist/parseBundleAndExportFile.js.map +1 -1
  30. package/dist/utils.d.ts.map +1 -1
  31. package/dist/utils.js +2 -3
  32. package/dist/utils.js.map +1 -1
  33. package/lib/codeLoaderBundle.d.ts.map +1 -1
  34. package/lib/codeLoaderBundle.js +4 -2
  35. package/lib/codeLoaderBundle.js.map +1 -1
  36. package/lib/exportFile.d.ts.map +1 -1
  37. package/lib/exportFile.js +6 -3
  38. package/lib/exportFile.js.map +1 -1
  39. package/lib/fakeUrlResolver.d.ts.map +1 -1
  40. package/lib/fakeUrlResolver.js.map +1 -1
  41. package/lib/fluidRunner.d.ts.map +1 -1
  42. package/lib/fluidRunner.js +5 -6
  43. package/lib/fluidRunner.js.map +1 -1
  44. package/lib/getArgsValidationError.d.ts.map +1 -1
  45. package/lib/getArgsValidationError.js.map +1 -1
  46. package/lib/logger/baseFileLogger.d.ts.map +1 -1
  47. package/lib/logger/baseFileLogger.js.map +1 -1
  48. package/lib/logger/csvFileLogger.d.ts.map +1 -1
  49. package/lib/logger/csvFileLogger.js.map +1 -1
  50. package/lib/logger/fileLogger.d.ts.map +1 -1
  51. package/lib/logger/fileLogger.js.map +1 -1
  52. package/lib/logger/jsonFileLogger.d.ts.map +1 -1
  53. package/lib/logger/jsonFileLogger.js.map +1 -1
  54. package/lib/logger/loggerUtils.d.ts.map +1 -1
  55. package/lib/logger/loggerUtils.js +11 -3
  56. package/lib/logger/loggerUtils.js.map +1 -1
  57. package/lib/parseBundleAndExportFile.d.ts.map +1 -1
  58. package/lib/parseBundleAndExportFile.js.map +1 -1
  59. package/lib/utils.d.ts.map +1 -1
  60. package/lib/utils.js +2 -3
  61. package/lib/utils.js.map +1 -1
  62. package/package.json +21 -19
  63. package/prettier.config.cjs +1 -1
  64. package/src/codeLoaderBundle.ts +28 -24
  65. package/src/exportFile.ts +69 -58
  66. package/src/fakeUrlResolver.ts +35 -31
  67. package/src/fluidRunner.ts +92 -85
  68. package/src/getArgsValidationError.ts +14 -17
  69. package/src/logger/baseFileLogger.ts +44 -44
  70. package/src/logger/csvFileLogger.ts +20 -20
  71. package/src/logger/fileLogger.ts +15 -15
  72. package/src/logger/jsonFileLogger.ts +12 -12
  73. package/src/logger/loggerUtils.ts +47 -39
  74. package/src/parseBundleAndExportFile.ts +58 -50
  75. package/src/utils.ts +14 -15
  76. package/tsconfig.esnext.json +6 -6
  77. package/tsconfig.json +10 -13
@@ -11,48 +11,48 @@ import { IFileLogger } from "./fileLogger";
11
11
  * @internal
12
12
  */
13
13
  export abstract class BaseFileLogger implements IFileLogger {
14
- public supportsTags?: true | undefined;
15
-
16
- /** Hold events in memory until flushed */
17
- protected events: any[] = [];
18
- protected hasWrittenToFile = false;
19
-
20
- /**
21
- * @param filePath - file path to write logs to
22
- * @param eventsPerFlush - number of events per flush
23
- * @param defaultProps - default properties to add to every telemetry event
24
- */
25
- public constructor(
26
- protected readonly filePath: string,
27
- protected readonly eventsPerFlush: number = 50,
28
- protected readonly defaultProps?: Record<string, string | number>,
29
- ) { }
30
-
31
- public send(event: ITelemetryBaseEvent): void {
32
- // eslint-disable-next-line no-param-reassign
33
- event = { ...event, ...this.defaultProps };
34
- this.events.push(event);
35
-
36
- if (this.events.length >= this.eventsPerFlush || event.category === "error") {
37
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
38
- this.flush();
39
- }
40
- }
41
-
42
- protected async flush(): Promise<void> {
43
- if (this.events.length > 0) {
44
- const contentToWrite = this.events.map((it) => JSON.stringify(it)).join(",");
45
- if (this.hasWrittenToFile) {
46
- fs.appendFileSync(this.filePath, `,${contentToWrite}`);
47
- } else {
48
- fs.appendFileSync(this.filePath, contentToWrite);
49
- }
50
- this.events = [];
51
- this.hasWrittenToFile = true;
52
- }
53
- }
54
-
55
- public async close(): Promise<void> {
56
- await this.flush();
57
- }
14
+ public supportsTags?: true | undefined;
15
+
16
+ /** Hold events in memory until flushed */
17
+ protected events: any[] = [];
18
+ protected hasWrittenToFile = false;
19
+
20
+ /**
21
+ * @param filePath - file path to write logs to
22
+ * @param eventsPerFlush - number of events per flush
23
+ * @param defaultProps - default properties to add to every telemetry event
24
+ */
25
+ public constructor(
26
+ protected readonly filePath: string,
27
+ protected readonly eventsPerFlush: number = 50,
28
+ protected readonly defaultProps?: Record<string, string | number>,
29
+ ) {}
30
+
31
+ public send(event: ITelemetryBaseEvent): void {
32
+ // eslint-disable-next-line no-param-reassign
33
+ event = { ...event, ...this.defaultProps };
34
+ this.events.push(event);
35
+
36
+ if (this.events.length >= this.eventsPerFlush || event.category === "error") {
37
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
38
+ this.flush();
39
+ }
40
+ }
41
+
42
+ protected async flush(): Promise<void> {
43
+ if (this.events.length > 0) {
44
+ const contentToWrite = this.events.map((it) => JSON.stringify(it)).join(",");
45
+ if (this.hasWrittenToFile) {
46
+ fs.appendFileSync(this.filePath, `,${contentToWrite}`);
47
+ } else {
48
+ fs.appendFileSync(this.filePath, contentToWrite);
49
+ }
50
+ this.events = [];
51
+ this.hasWrittenToFile = true;
52
+ }
53
+ }
54
+
55
+ public async close(): Promise<void> {
56
+ await this.flush();
57
+ }
58
58
  }
@@ -13,28 +13,28 @@ import { BaseFileLogger } from "./baseFileLogger";
13
13
  * @internal
14
14
  */
15
15
  export class CSVFileLogger extends BaseFileLogger {
16
- /** Store the column names to write as the CSV header */
17
- private readonly columns = new Set();
16
+ /** Store the column names to write as the CSV header */
17
+ private readonly columns = new Set();
18
18
 
19
- protected async flush(): Promise<void> {
20
- // No flushing is performed since we need all log entries to determine set of CSV columns
21
- }
19
+ protected async flush(): Promise<void> {
20
+ // No flushing is performed since we need all log entries to determine set of CSV columns
21
+ }
22
22
 
23
- public send(event: ITelemetryBaseEvent): void {
24
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
25
- for (const prop in event) {
26
- this.columns.add(prop);
27
- }
28
- super.send(event);
29
- }
23
+ public send(event: ITelemetryBaseEvent): void {
24
+ // eslint-disable-next-line guard-for-in, no-restricted-syntax
25
+ for (const prop in event) {
26
+ this.columns.add(prop);
27
+ }
28
+ super.send(event);
29
+ }
30
30
 
31
- public async close(): Promise<void> {
32
- await super.close();
33
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
34
- for (const field in this.defaultProps) {
35
- this.columns.add(field);
36
- }
31
+ public async close(): Promise<void> {
32
+ await super.close();
33
+ // eslint-disable-next-line guard-for-in, no-restricted-syntax
34
+ for (const field in this.defaultProps) {
35
+ this.columns.add(field);
36
+ }
37
37
 
38
- fs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));
39
- }
38
+ fs.writeFileSync(this.filePath, parse(this.events, Array.from(this.columns)));
39
+ }
40
40
  }
@@ -10,18 +10,18 @@ import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
10
10
  * @internal
11
11
  */
12
12
  export interface IFileLogger extends ITelemetryBaseLogger {
13
- /**
14
- * This method acts as a "dispose" and should be explicitly called at the end of execution
15
- */
16
- close(): Promise<void>;
13
+ /**
14
+ * This method acts as a "dispose" and should be explicitly called at the end of execution
15
+ */
16
+ close(): Promise<void>;
17
17
  }
18
18
 
19
19
  /**
20
20
  * Desired output format for the telemetry
21
21
  */
22
22
  export enum OutputFormat {
23
- JSON,
24
- CSV,
23
+ JSON,
24
+ CSV,
25
25
  }
26
26
 
27
27
  /* eslint-disable tsdoc/syntax */
@@ -30,16 +30,16 @@ export enum OutputFormat {
30
30
  * @internal
31
31
  */
32
32
  export interface ITelemetryOptions {
33
- /** Desired output format used to create a specific IFileLogger implementation */
34
- outputFormat?: OutputFormat;
33
+ /** Desired output format used to create a specific IFileLogger implementation */
34
+ outputFormat?: OutputFormat;
35
35
 
36
- /**
37
- * Properties that should be added to every telemetry event
38
- * Example: { "prop1": "value1", "prop2": 10.0 }
39
- */
40
- defaultProps?: Record<string, string | number>;
36
+ /**
37
+ * Properties that should be added to every telemetry event
38
+ * Example: { "prop1": "value1", "prop2": 10.0 }
39
+ */
40
+ defaultProps?: Record<string, string | number>;
41
41
 
42
- /** Number of telemetry events per flush to telemetry file */
43
- eventsPerFlush?: number;
42
+ /** Number of telemetry events per flush to telemetry file */
43
+ eventsPerFlush?: number;
44
44
  }
45
45
  /* eslint-enable tsdoc/syntax */
@@ -11,17 +11,17 @@ import { BaseFileLogger } from "./baseFileLogger";
11
11
  * @internal
12
12
  */
13
13
  export class JSONFileLogger extends BaseFileLogger {
14
- constructor(
15
- filePath: string,
16
- eventsPerFlush: number = 50,
17
- defaultProps?: Record<string, string | number>,
18
- ) {
19
- super(filePath, eventsPerFlush, defaultProps);
20
- fs.appendFileSync(this.filePath, "[");
21
- }
14
+ constructor(
15
+ filePath: string,
16
+ eventsPerFlush: number = 50,
17
+ defaultProps?: Record<string, string | number>,
18
+ ) {
19
+ super(filePath, eventsPerFlush, defaultProps);
20
+ fs.appendFileSync(this.filePath, "[");
21
+ }
22
22
 
23
- public async close(): Promise<void> {
24
- await super.close();
25
- fs.appendFileSync(this.filePath, "]");
26
- }
23
+ public async close(): Promise<void> {
24
+ await super.close();
25
+ fs.appendFileSync(this.filePath, "]");
26
+ }
27
27
  }
@@ -17,18 +17,20 @@ import { JSONFileLogger } from "./jsonFileLogger";
17
17
  * Note: if an output format is not supplied, default is JSON
18
18
  * @returns - both the IFileLogger implementation and ITelemetryLogger wrapper to be called
19
19
  */
20
- export function createLogger(
21
- filePath: string,
22
- options?: ITelemetryOptions,
23
- ): { logger: ITelemetryLogger; fileLogger: IFileLogger; } {
24
- const fileLogger = options?.outputFormat === OutputFormat.CSV
25
- ? new CSVFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps)
26
- : new JSONFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps);
20
+ export function createLogger(
21
+ filePath: string,
22
+ options?: ITelemetryOptions,
23
+ ): { logger: ITelemetryLogger; fileLogger: IFileLogger } {
24
+ const fileLogger =
25
+ options?.outputFormat === OutputFormat.CSV
26
+ ? new CSVFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps)
27
+ : new JSONFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps);
27
28
 
28
- const logger = ChildLogger.create(fileLogger, "LocalSnapshotRunnerApp",
29
- { all: { Event_Time: () => Date.now() } });
29
+ const logger = ChildLogger.create(fileLogger, "LocalSnapshotRunnerApp", {
30
+ all: { Event_Time: () => Date.now() },
31
+ });
30
32
 
31
- return { logger, fileLogger };
33
+ return { logger, fileLogger };
32
34
  }
33
35
 
34
36
  /**
@@ -36,13 +38,13 @@ import { JSONFileLogger } from "./jsonFileLogger";
36
38
  * @param telemetryFile - path where telemetry will be written
37
39
  */
38
40
  export function getTelemetryFileValidationError(telemetryFile: string): string | undefined {
39
- if (!telemetryFile) {
40
- return "Telemetry file argument is missing.";
41
- } else if (fs.existsSync(telemetryFile)) {
42
- return `Telemetry file already exists [${telemetryFile}].`;
43
- }
41
+ if (!telemetryFile) {
42
+ return "Telemetry file argument is missing.";
43
+ } else if (fs.existsSync(telemetryFile)) {
44
+ return `Telemetry file already exists [${telemetryFile}].`;
45
+ }
44
46
 
45
- return undefined;
47
+ return undefined;
46
48
  }
47
49
 
48
50
  /**
@@ -52,30 +54,36 @@ export function getTelemetryFileValidationError(telemetryFile: string): string |
52
54
  * @internal
53
55
  */
54
56
  export function validateAndParseTelemetryOptions(
55
- format?: string,
56
- props?: (string | number)[],
57
- ): { success: false; error: string; } | { success: true; telemetryOptions: ITelemetryOptions; } {
58
- let outputFormat: OutputFormat | undefined;
59
- const defaultProps: Record<string, string | number> = {};
57
+ format?: string,
58
+ props?: (string | number)[],
59
+ ): { success: false; error: string } | { success: true; telemetryOptions: ITelemetryOptions } {
60
+ let outputFormat: OutputFormat | undefined;
61
+ const defaultProps: Record<string, string | number> = {};
60
62
 
61
- if (format) {
62
- outputFormat = OutputFormat[format];
63
- if (outputFormat === undefined) {
64
- return { success: false, error: `Invalid telemetry format [${format}]` };
65
- }
66
- }
63
+ if (format) {
64
+ outputFormat = OutputFormat[format];
65
+ if (outputFormat === undefined) {
66
+ return { success: false, error: `Invalid telemetry format [${format}]` };
67
+ }
68
+ }
67
69
 
68
- if (props && props.length > 0) {
69
- if (props.length % 2 !== 0) {
70
- return { success: false, error: `Invalid number of telemetry properties to add [${props.length}]` };
71
- }
72
- for (let i = 0; i < props.length; i += 2) {
73
- if (typeof props[i] === "number") {
74
- return { success: false, error: `Property name cannot be number at index [${i}] -> [${props[i]}]` };
75
- }
76
- defaultProps[props[i]] = props[i + 1];
77
- }
78
- }
70
+ if (props && props.length > 0) {
71
+ if (props.length % 2 !== 0) {
72
+ return {
73
+ success: false,
74
+ error: `Invalid number of telemetry properties to add [${props.length}]`,
75
+ };
76
+ }
77
+ for (let i = 0; i < props.length; i += 2) {
78
+ if (typeof props[i] === "number") {
79
+ return {
80
+ success: false,
81
+ error: `Property name cannot be number at index [${i}] -> [${props[i]}]`,
82
+ };
83
+ }
84
+ defaultProps[props[i]] = props[i + 1];
85
+ }
86
+ }
79
87
 
80
- return { success: true, telemetryOptions: { outputFormat, defaultProps } };
88
+ return { success: true, telemetryOptions: { outputFormat, defaultProps } };
81
89
  }
@@ -21,60 +21,68 @@ const clientArgsValidationError = "Client_ArgsValidationError";
21
21
  * @param codeLoader - path to provided JS bundle that implements ICodeLoaderBundle (see codeLoaderBundle.ts)
22
22
  */
23
23
  export async function parseBundleAndExportFile(
24
- codeLoader: string,
25
- inputFile: string,
26
- outputFile: string,
27
- telemetryFile: string,
28
- options?: string,
29
- telemetryOptions?: ITelemetryOptions,
24
+ codeLoader: string,
25
+ inputFile: string,
26
+ outputFile: string,
27
+ telemetryFile: string,
28
+ options?: string,
29
+ telemetryOptions?: ITelemetryOptions,
30
30
  ): Promise<IExportFileResponse> {
31
- const telemetryArgError = getTelemetryFileValidationError(telemetryFile);
32
- if (telemetryArgError) {
33
- const eventName = clientArgsValidationError;
34
- return { success: false, eventName, errorMessage: telemetryArgError };
35
- }
36
- const { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);
31
+ const telemetryArgError = getTelemetryFileValidationError(telemetryFile);
32
+ if (telemetryArgError) {
33
+ const eventName = clientArgsValidationError;
34
+ return { success: false, eventName, errorMessage: telemetryArgError };
35
+ }
36
+ const { fileLogger, logger } = createLogger(telemetryFile, telemetryOptions);
37
37
 
38
- try {
39
- return await PerformanceEvent.timedExecAsync(logger, { eventName: "ParseBundleAndExportFile" }, async () => {
40
- // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
41
- const codeLoaderBundle = require(codeLoader);
42
- if (!isCodeLoaderBundle(codeLoaderBundle)) {
43
- const eventName = clientArgsValidationError;
44
- const errorMessage = "Code loader bundle is not of type ICodeLoaderBundle";
45
- logger.sendErrorEvent({ eventName, message: errorMessage });
46
- return { success: false, eventName, errorMessage };
47
- }
38
+ try {
39
+ return await PerformanceEvent.timedExecAsync(
40
+ logger,
41
+ { eventName: "ParseBundleAndExportFile" },
42
+ async () => {
43
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
44
+ const codeLoaderBundle = require(codeLoader);
45
+ if (!isCodeLoaderBundle(codeLoaderBundle)) {
46
+ const eventName = clientArgsValidationError;
47
+ const errorMessage = "Code loader bundle is not of type ICodeLoaderBundle";
48
+ logger.sendErrorEvent({ eventName, message: errorMessage });
49
+ return { success: false, eventName, errorMessage };
50
+ }
48
51
 
49
- const fluidExport = await codeLoaderBundle.fluidExport;
50
- if (!isFluidFileConverter(fluidExport)) {
51
- const eventName = clientArgsValidationError;
52
- const errorMessage = "Fluid export from CodeLoaderBundle is not of type IFluidFileConverter";
53
- logger.sendErrorEvent({ eventName, message: errorMessage });
54
- return { success: false, eventName, errorMessage };
55
- }
52
+ const fluidExport = await codeLoaderBundle.fluidExport;
53
+ if (!isFluidFileConverter(fluidExport)) {
54
+ const eventName = clientArgsValidationError;
55
+ const errorMessage =
56
+ "Fluid export from CodeLoaderBundle is not of type IFluidFileConverter";
57
+ logger.sendErrorEvent({ eventName, message: errorMessage });
58
+ return { success: false, eventName, errorMessage };
59
+ }
56
60
 
57
- const argsValidationError = getArgsValidationError(inputFile, outputFile);
58
- if (argsValidationError) {
59
- const eventName = clientArgsValidationError;
60
- logger.sendErrorEvent({ eventName, message: argsValidationError });
61
- return { success: false, eventName, errorMessage: argsValidationError };
62
- }
61
+ const argsValidationError = getArgsValidationError(inputFile, outputFile);
62
+ if (argsValidationError) {
63
+ const eventName = clientArgsValidationError;
64
+ logger.sendErrorEvent({ eventName, message: argsValidationError });
65
+ return { success: false, eventName, errorMessage: argsValidationError };
66
+ }
63
67
 
64
- fs.writeFileSync(outputFile, await createContainerAndExecute(
65
- getSnapshotFileContent(inputFile),
66
- fluidExport,
67
- logger,
68
- options,
69
- ));
68
+ fs.writeFileSync(
69
+ outputFile,
70
+ await createContainerAndExecute(
71
+ getSnapshotFileContent(inputFile),
72
+ fluidExport,
73
+ logger,
74
+ options,
75
+ ),
76
+ );
70
77
 
71
- return { success: true };
72
- });
73
- } catch (error) {
74
- const eventName = "Client_UnexpectedError";
75
- logger.sendErrorEvent({ eventName }, error);
76
- return { success: false, eventName, errorMessage: "Unexpected error", error };
77
- } finally {
78
- await fileLogger.close();
79
- }
78
+ return { success: true };
79
+ },
80
+ );
81
+ } catch (error) {
82
+ const eventName = "Client_UnexpectedError";
83
+ logger.sendErrorEvent({ eventName }, error);
84
+ return { success: false, eventName, errorMessage: "Unexpected error", error };
85
+ } finally {
86
+ await fileLogger.close();
87
+ }
80
88
  }
package/src/utils.ts CHANGED
@@ -12,7 +12,7 @@ import { IFluidFileConverter } from "./codeLoaderBundle";
12
12
  * @internal
13
13
  */
14
14
  export function isJsonSnapshot(content: Buffer): boolean {
15
- return content.toString(undefined, 0, 1) === "{";
15
+ return content.toString(undefined, 0, 1) === "{";
16
16
  }
17
17
 
18
18
  /**
@@ -21,25 +21,24 @@ export function isJsonSnapshot(content: Buffer): boolean {
21
21
  * @param filePath - path to the ODSP snapshot file
22
22
  */
23
23
  export function getSnapshotFileContent(filePath: string): string | Buffer {
24
- // TODO: read file stream
25
- const content = fs.readFileSync(filePath);
26
- return isJsonSnapshot(content) ? content.toString() : content;
24
+ // TODO: read file stream
25
+ const content = fs.readFileSync(filePath);
26
+ return isJsonSnapshot(content) ? content.toString() : content;
27
27
  }
28
28
 
29
29
  /**
30
30
  * Validate provided command line arguments
31
31
  * @internal
32
32
  */
33
- export function validateCommandLineArgs(
34
- codeLoader?: string,
35
- fluidFileConverter?: IFluidFileConverter,
33
+ export function validateCommandLineArgs(
34
+ codeLoader?: string,
35
+ fluidFileConverter?: IFluidFileConverter,
36
36
  ): string | undefined {
37
- if (codeLoader && fluidFileConverter !== undefined) {
38
- return "\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.";
39
- }
40
- if (!codeLoader && fluidFileConverter === undefined) {
41
- // eslint-disable-next-line max-len
42
- return "\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.";
43
- }
44
- return undefined;
37
+ if (codeLoader && fluidFileConverter !== undefined) {
38
+ return '"codeLoader" and "fluidFileConverter" cannot both be provided. See README for details.';
39
+ }
40
+ if (!codeLoader && fluidFileConverter === undefined) {
41
+ return '"codeLoader" must be provided if there is no explicit "fluidFileConverter". See README for details.';
42
+ }
43
+ return undefined;
45
44
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./lib",
5
- "module": "esnext"
6
- },
7
- }
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib",
5
+ "module": "esnext",
6
+ },
7
+ }
package/tsconfig.json CHANGED
@@ -1,14 +1,11 @@
1
1
  {
2
- "extends": "@fluidframework/build-common/ts-common-config.json",
3
- "exclude": [
4
- "src/test/**/*"
5
- ],
6
- "compilerOptions": {
7
- "rootDir": "./src",
8
- "outDir": "./dist",
9
- "composite": true
10
- },
11
- "include": [
12
- "src/**/*"
13
- ]
14
- }
2
+ "extends": "@fluidframework/build-common/ts-common-config.json",
3
+ "exclude": ["src/test/**/*"],
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "outDir": "./dist",
7
+ "types": ["node"],
8
+ "composite": true,
9
+ },
10
+ "include": ["src/**/*"],
11
+ }