@fluidframework/fluid-runner 2.81.0 → 2.82.0
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.
- package/CHANGELOG.md +4 -0
- package/dist/fluidRunner.d.ts +2 -0
- package/dist/fluidRunner.d.ts.map +1 -1
- package/dist/fluidRunner.js +2 -0
- package/dist/fluidRunner.js.map +1 -1
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/eslint.config.mts +4 -0
- package/lib/fluidRunner.d.ts +2 -0
- package/lib/fluidRunner.d.ts.map +1 -1
- package/lib/fluidRunner.js +2 -0
- package/lib/fluidRunner.js.map +1 -1
- package/lib/utils.d.ts +4 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +4 -0
- package/lib/utils.js.map +1 -1
- package/package.json +13 -13
- package/src/fluidRunner.ts +2 -0
- package/src/utils.ts +4 -0
- package/biome.jsonc +0 -7
package/CHANGELOG.md
CHANGED
package/dist/fluidRunner.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidFileConverter } from "./codeLoaderBundle.js";
|
|
6
6
|
/**
|
|
7
|
+
* Entry point for the Fluid runner CLI tool that exports ODSP snapshots.
|
|
8
|
+
*
|
|
7
9
|
* @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
|
|
8
10
|
* @internal
|
|
9
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAOjE
|
|
1
|
+
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAOjE;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiHzF"}
|
package/dist/fluidRunner.js
CHANGED
|
@@ -17,6 +17,8 @@ const loggerUtils_js_1 = require("./logger/loggerUtils.js");
|
|
|
17
17
|
const parseBundleAndExportFile_js_1 = require("./parseBundleAndExportFile.js");
|
|
18
18
|
const utils_js_1 = require("./utils.js");
|
|
19
19
|
/**
|
|
20
|
+
* Entry point for the Fluid runner CLI tool that exports ODSP snapshots.
|
|
21
|
+
*
|
|
20
22
|
* @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
|
|
21
23
|
* @internal
|
|
22
24
|
*/
|
package/dist/fluidRunner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAC1B,wDAAwD;AACxD,2CAAwC;AAGxC,mDAA6C;AAC7C,wDAAwD;AACxD,4DAA2E;AAC3E,+EAAyE;AACzE,yCAAqD;AAErD
|
|
1
|
+
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA0B;AAC1B,wDAAwD;AACxD,2CAAwC;AAGxC,mDAA6C;AAC7C,wDAAwD;AACxD,4DAA2E;AAC3E,+EAAyE;AACzE,yCAAqD;AAErD;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAAC,kBAAwC;IACzE,MAAM,IAAA,eAAK,EAAC,IAAA,iBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChC,OAAO,CACP,YAAY,EACZ,8CAA8C,EAC9C,CAAC,IAAI,EAAE,EAAE,CACR,IAAI;SACF,MAAM,CAA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AC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CACD;SACA,IAAI,EAAE;SACN,aAAa,CAAC,CAAC,CAAC;SAChB,KAAK,EAAE,CAAC;AACX,CAAC;AAjHD,kCAiHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport yargs from \"yargs\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { hideBin } from \"yargs/helpers\";\n\nimport type { IFluidFileConverter } from \"./codeLoaderBundle.js\";\nimport { exportFile } from \"./exportFile.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { validateAndParseTelemetryOptions } from \"./logger/loggerUtils.js\";\nimport { parseBundleAndExportFile } from \"./parseBundleAndExportFile.js\";\nimport { validateCommandLineArgs } from \"./utils.js\";\n\n/**\n * Entry point for the Fluid runner CLI tool that exports ODSP snapshots.\n *\n * @param fluidFileConverter - needs to be provided if \"codeLoaderBundle\" is not and vice versa\n * @internal\n */\nexport async function fluidRunner(fluidFileConverter?: IFluidFileConverter): Promise<void> {\n\tawait yargs(hideBin(process.argv))\n\t\t.command(\n\t\t\t\"exportFile\",\n\t\t\t\"Generate an output for a local ODSP snapshot\",\n\t\t\t(argv) =>\n\t\t\t\targv\n\t\t\t\t\t.option(\"codeLoader\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Path to code loader bundle. Required if this application is being called without modification.\\nSee \"README.md\" for more details.',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"inputFile\", {\n\t\t\t\t\t\tdescribe: \"Path to local ODSP snapshot\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"outputFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of output file (cannot already exist).\\nExecution result will be written here\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of telemetry file for config and session data (cannot already exist)\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"options\", {\n\t\t\t\t\t\tdescribe: \"Additional options passed to container on execution\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFormat\", {\n\t\t\t\t\t\tdescribe: 'Output format for telemetry. Current options are: [\"JSON\", \"CSV\"]',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: \"JSON\",\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryProp\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Property to add to every telemetry entry. Formatted like \"--telemetryProp prop1 value1 --telemetryProp prop2 \\\\\"value 2\\\\\"\".',\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"eventsPerFlush\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Number of telemetry events per flush to telemetryFile (only applicable for JSON format)\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"timeout\", {\n\t\t\t\t\t\tdescribe: \"Allowed timeout in ms before process is automatically cancelled\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"disableNetworkFetch\", {\n\t\t\t\t\t\tdescribe: \"Should network fetch calls be explicitly disabled?\",\n\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t}),\n\n\t\t\tasync (argv) => {\n\t\t\t\tconst argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);\n\t\t\t\tif (argsError) {\n\t\t\t\t\tconsole.error(argsError);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tconst telemetryOptionsResult = validateAndParseTelemetryOptions(\n\t\t\t\t\targv.telemetryFormat,\n\t\t\t\t\targv.telemetryProp,\n\t\t\t\t\targv.eventsPerFlush,\n\t\t\t\t);\n\t\t\t\tif (!telemetryOptionsResult.success) {\n\t\t\t\t\tconsole.error(telemetryOptionsResult.error);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\n\t\t\t\tconst result = await (argv.codeLoader\n\t\t\t\t\t? parseBundleAndExportFile(\n\t\t\t\t\t\t\targv.codeLoader,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t\t)\n\t\t\t\t\t: exportFile(\n\t\t\t\t\t\t\tfluidFileConverter!,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t\t));\n\n\t\t\t\tif (!result.success) {\n\t\t\t\t\tconsole.error(`${result.eventName}: ${result.errorMessage}`);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tprocess.exit(0);\n\t\t\t},\n\t\t)\n\t\t.help()\n\t\t.demandCommand(1)\n\t\t.parse();\n}\n"]}
|
package/dist/utils.d.ts
CHANGED
|
@@ -24,10 +24,14 @@ export declare function getSnapshotFileContent(filePath: string): string | Buffe
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function validateCommandLineArgs(codeLoader?: string, fluidFileConverter?: IFluidFileConverter): string | undefined;
|
|
26
26
|
/**
|
|
27
|
+
* Verifies that the specified input file exists, the output file does not exist.
|
|
28
|
+
*
|
|
27
29
|
* @internal
|
|
28
30
|
*/
|
|
29
31
|
export declare function getArgsValidationError(inputFile: string, outputFile: string, timeout?: number): string | undefined;
|
|
30
32
|
/**
|
|
33
|
+
* Creates a promise that rejects if not resolved within the specified timeout.
|
|
34
|
+
*
|
|
31
35
|
* @internal
|
|
32
36
|
*/
|
|
33
37
|
export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeout: number): Promise<T>;
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACtC,MAAM,GAAG,SAAS,CAQpB;AAED
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACtC,MAAM,GAAG,SAAS,CAQpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAoBpB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,IAAI,EAC5C,QAAQ,EAAE,CACT,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAC1B,IAAI,EACT,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,CAAC,CAgBZ"}
|
package/dist/utils.js
CHANGED
|
@@ -65,6 +65,8 @@ function validateCommandLineArgs(codeLoader, fluidFileConverter) {
|
|
|
65
65
|
}
|
|
66
66
|
exports.validateCommandLineArgs = validateCommandLineArgs;
|
|
67
67
|
/**
|
|
68
|
+
* Verifies that the specified input file exists, the output file does not exist.
|
|
69
|
+
*
|
|
68
70
|
* @internal
|
|
69
71
|
*/
|
|
70
72
|
function getArgsValidationError(inputFile, outputFile, timeout) {
|
|
@@ -89,6 +91,8 @@ function getArgsValidationError(inputFile, outputFile, timeout) {
|
|
|
89
91
|
}
|
|
90
92
|
exports.getArgsValidationError = getArgsValidationError;
|
|
91
93
|
/**
|
|
94
|
+
* Creates a promise that rejects if not resolved within the specified timeout.
|
|
95
|
+
*
|
|
92
96
|
* @internal
|
|
93
97
|
*/
|
|
94
98
|
async function timeoutPromise(executor, timeout) {
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAIzB;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AAClD,CAAC;AAFD,wCAEC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,QAAgB;IACtD,yBAAyB;IACzB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC1C,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AAC/D,CAAC;AAJD,wDAIC;AAED;;;GAGG;AACH,SAAgB,uBAAuB,CACtC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,wFAAwF,CAAC;IACjG,CAAC;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,qGAAqG,CAAC;IAC9G,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAXD,0DAWC;AAED
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAIzB;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,QAAQ,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AAC;QAC9D,OAAO,iBAAiB,CAAC;IAC1B,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAxBD,wDAwBC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CACnC,QAGS,EACT,OAAe;IAEf,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,OAAO,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAEvF,QAAQ,CACP,CAAC,KAAK,EAAE,EAAE;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,2EAA2E;YAC3E,MAAM,CAAC,MAAM,CAAC,CAAC;QAChB,CAAC,CACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC;AAtBD,wCAsBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\n\nimport type { IFluidFileConverter } from \"./codeLoaderBundle.js\";\n\n/**\n * Is the given snapshot in JSON format\n * @param content - snapshot file content\n * @internal\n */\nexport function isJsonSnapshot(content: Buffer): boolean {\n\treturn content.toString(undefined, 0, 1) === \"{\";\n}\n\n/**\n * Get the ODSP snapshot file content\n * Works on both JSON and binary snapshot formats\n * @param filePath - path to the ODSP snapshot file\n * @internal\n */\nexport function getSnapshotFileContent(filePath: string): string | Buffer {\n\t// TODO: read file stream\n\tconst content = fs.readFileSync(filePath);\n\treturn isJsonSnapshot(content) ? content.toString() : content;\n}\n\n/**\n * Validate provided command line arguments\n * @internal\n */\nexport function validateCommandLineArgs(\n\tcodeLoader?: string,\n\tfluidFileConverter?: IFluidFileConverter,\n): string | undefined {\n\tif (codeLoader && fluidFileConverter !== undefined) {\n\t\treturn '\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.';\n\t}\n\tif (!codeLoader && fluidFileConverter === undefined) {\n\t\treturn '\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.';\n\t}\n\treturn undefined;\n}\n\n/**\n * Verifies that the specified input file exists, the output file does not exist.\n *\n * @internal\n */\nexport function getArgsValidationError(\n\tinputFile: string,\n\toutputFile: string,\n\ttimeout?: number,\n): string | undefined {\n\t// Validate input file\n\tif (!inputFile) {\n\t\treturn \"Input file name argument is missing.\";\n\t} else if (!fs.existsSync(inputFile)) {\n\t\treturn \"Input file does not exist.\";\n\t}\n\n\t// Validate output file\n\tif (!outputFile) {\n\t\treturn \"Output file argument is missing.\";\n\t} else if (fs.existsSync(outputFile)) {\n\t\treturn `Output file already exists [${outputFile}].`;\n\t}\n\n\tif (timeout !== undefined && (isNaN(timeout) || timeout < 0)) {\n\t\treturn \"Invalid timeout\";\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Creates a promise that rejects if not resolved within the specified timeout.\n *\n * @internal\n */\nexport async function timeoutPromise<T = void>(\n\texecutor: (\n\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\treject: (reason?: any) => void,\n\t) => void,\n\ttimeout: number,\n): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tconst timer = setTimeout(() => reject(new Error(`Timed out (${timeout}ms)`)), timeout);\n\n\t\texecutor(\n\t\t\t(value) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(value);\n\t\t\t},\n\t\t\t(reason) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n\t\t\t\treject(reason);\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
|
package/eslint.config.mts
CHANGED
|
@@ -46,6 +46,10 @@ const config: Linter.Config[] = [
|
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
+
// Override @typescript-eslint/parser to use explicit project list instead of projectService.
|
|
50
|
+
// This package has special .cjs.ts test files excluded from the main test tsconfig that
|
|
51
|
+
// require a separate tsconfig.cjs.lint.json for linting. typescript-eslint's projectService
|
|
52
|
+
// can't auto-discover this non-standard configuration.
|
|
49
53
|
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
50
54
|
languageOptions: {
|
|
51
55
|
parserOptions: {
|
package/lib/fluidRunner.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IFluidFileConverter } from "./codeLoaderBundle.js";
|
|
6
6
|
/**
|
|
7
|
+
* Entry point for the Fluid runner CLI tool that exports ODSP snapshots.
|
|
8
|
+
*
|
|
7
9
|
* @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
|
|
8
10
|
* @internal
|
|
9
11
|
*/
|
package/lib/fluidRunner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAOjE
|
|
1
|
+
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAOjE;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiHzF"}
|
package/lib/fluidRunner.js
CHANGED
|
@@ -11,6 +11,8 @@ import { validateAndParseTelemetryOptions } from "./logger/loggerUtils.js";
|
|
|
11
11
|
import { parseBundleAndExportFile } from "./parseBundleAndExportFile.js";
|
|
12
12
|
import { validateCommandLineArgs } from "./utils.js";
|
|
13
13
|
/**
|
|
14
|
+
* Entry point for the Fluid runner CLI tool that exports ODSP snapshots.
|
|
15
|
+
*
|
|
14
16
|
* @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
|
|
15
17
|
* @internal
|
|
16
18
|
*/
|
package/lib/fluidRunner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,wDAAwD;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,wDAAwD;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,wDAAwD;AACxD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,kBAAwC;IACzE,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAChC,OAAO,C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AC,YAAY,EAAE,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CACD;SACA,IAAI,EAAE;SACN,aAAa,CAAC,CAAC,CAAC;SAChB,KAAK,EAAE,CAAC;AACX,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport yargs from \"yargs\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { hideBin } from \"yargs/helpers\";\n\nimport type { IFluidFileConverter } from \"./codeLoaderBundle.js\";\nimport { exportFile } from \"./exportFile.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { validateAndParseTelemetryOptions } from \"./logger/loggerUtils.js\";\nimport { parseBundleAndExportFile } from \"./parseBundleAndExportFile.js\";\nimport { validateCommandLineArgs } from \"./utils.js\";\n\n/**\n * Entry point for the Fluid runner CLI tool that exports ODSP snapshots.\n *\n * @param fluidFileConverter - needs to be provided if \"codeLoaderBundle\" is not and vice versa\n * @internal\n */\nexport async function fluidRunner(fluidFileConverter?: IFluidFileConverter): Promise<void> {\n\tawait yargs(hideBin(process.argv))\n\t\t.command(\n\t\t\t\"exportFile\",\n\t\t\t\"Generate an output for a local ODSP snapshot\",\n\t\t\t(argv) =>\n\t\t\t\targv\n\t\t\t\t\t.option(\"codeLoader\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Path to code loader bundle. Required if this application is being called without modification.\\nSee \"README.md\" for more details.',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"inputFile\", {\n\t\t\t\t\t\tdescribe: \"Path to local ODSP snapshot\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"outputFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of output file (cannot already exist).\\nExecution result will be written here\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFile\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Path of telemetry file for config and session data (cannot already exist)\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: true,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"options\", {\n\t\t\t\t\t\tdescribe: \"Additional options passed to container on execution\",\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryFormat\", {\n\t\t\t\t\t\tdescribe: 'Output format for telemetry. Current options are: [\"JSON\", \"CSV\"]',\n\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: \"JSON\",\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"telemetryProp\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t'Property to add to every telemetry entry. Formatted like \"--telemetryProp prop1 value1 --telemetryProp prop2 \\\\\"value 2\\\\\"\".',\n\t\t\t\t\t\ttype: \"array\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"eventsPerFlush\", {\n\t\t\t\t\t\tdescribe:\n\t\t\t\t\t\t\t\"Number of telemetry events per flush to telemetryFile (only applicable for JSON format)\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"timeout\", {\n\t\t\t\t\t\tdescribe: \"Allowed timeout in ms before process is automatically cancelled\",\n\t\t\t\t\t\ttype: \"number\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t})\n\t\t\t\t\t.option(\"disableNetworkFetch\", {\n\t\t\t\t\t\tdescribe: \"Should network fetch calls be explicitly disabled?\",\n\t\t\t\t\t\ttype: \"boolean\",\n\t\t\t\t\t\tdemandOption: false,\n\t\t\t\t\t\tdefault: false,\n\t\t\t\t\t}),\n\n\t\t\tasync (argv) => {\n\t\t\t\tconst argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);\n\t\t\t\tif (argsError) {\n\t\t\t\t\tconsole.error(argsError);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tconst telemetryOptionsResult = validateAndParseTelemetryOptions(\n\t\t\t\t\targv.telemetryFormat,\n\t\t\t\t\targv.telemetryProp,\n\t\t\t\t\targv.eventsPerFlush,\n\t\t\t\t);\n\t\t\t\tif (!telemetryOptionsResult.success) {\n\t\t\t\t\tconsole.error(telemetryOptionsResult.error);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\n\t\t\t\tconst result = await (argv.codeLoader\n\t\t\t\t\t? parseBundleAndExportFile(\n\t\t\t\t\t\t\targv.codeLoader,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t\t)\n\t\t\t\t\t: exportFile(\n\t\t\t\t\t\t\tfluidFileConverter!,\n\t\t\t\t\t\t\targv.inputFile,\n\t\t\t\t\t\t\targv.outputFile,\n\t\t\t\t\t\t\targv.telemetryFile,\n\t\t\t\t\t\t\targv.options,\n\t\t\t\t\t\t\ttelemetryOptionsResult.telemetryOptions,\n\t\t\t\t\t\t\targv.timeout,\n\t\t\t\t\t\t\targv.disableNetworkFetch,\n\t\t\t\t\t\t));\n\n\t\t\t\tif (!result.success) {\n\t\t\t\t\tconsole.error(`${result.eventName}: ${result.errorMessage}`);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t\tprocess.exit(0);\n\t\t\t},\n\t\t)\n\t\t.help()\n\t\t.demandCommand(1)\n\t\t.parse();\n}\n"]}
|
package/lib/utils.d.ts
CHANGED
|
@@ -24,10 +24,14 @@ export declare function getSnapshotFileContent(filePath: string): string | Buffe
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function validateCommandLineArgs(codeLoader?: string, fluidFileConverter?: IFluidFileConverter): string | undefined;
|
|
26
26
|
/**
|
|
27
|
+
* Verifies that the specified input file exists, the output file does not exist.
|
|
28
|
+
*
|
|
27
29
|
* @internal
|
|
28
30
|
*/
|
|
29
31
|
export declare function getArgsValidationError(inputFile: string, outputFile: string, timeout?: number): string | undefined;
|
|
30
32
|
/**
|
|
33
|
+
* Creates a promise that rejects if not resolved within the specified timeout.
|
|
34
|
+
*
|
|
31
35
|
* @internal
|
|
32
36
|
*/
|
|
33
37
|
export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeout: number): Promise<T>;
|
package/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACtC,MAAM,GAAG,SAAS,CAQpB;AAED
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACtC,MAAM,GAAG,SAAS,CAQpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAoBpB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,IAAI,EAC5C,QAAQ,EAAE,CACT,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAC1B,IAAI,EACT,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,CAAC,CAgBZ"}
|
package/lib/utils.js
CHANGED
|
@@ -36,6 +36,8 @@ export function validateCommandLineArgs(codeLoader, fluidFileConverter) {
|
|
|
36
36
|
return undefined;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
+
* Verifies that the specified input file exists, the output file does not exist.
|
|
40
|
+
*
|
|
39
41
|
* @internal
|
|
40
42
|
*/
|
|
41
43
|
export function getArgsValidationError(inputFile, outputFile, timeout) {
|
|
@@ -59,6 +61,8 @@ export function getArgsValidationError(inputFile, outputFile, timeout) {
|
|
|
59
61
|
return undefined;
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
64
|
+
* Creates a promise that rejects if not resolved within the specified timeout.
|
|
65
|
+
*
|
|
62
66
|
* @internal
|
|
63
67
|
*/
|
|
64
68
|
export async function timeoutPromise(executor, timeout) {
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACtD,yBAAyB;IACzB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC1C,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CACtC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,wFAAwF,CAAC;IACjG,CAAC;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,qGAAqG,CAAC;IAC9G,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC7C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,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,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,QAGS,EACT,OAAe;IAEf,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACzC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,cAAc,OAAO,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAEvF,QAAQ,CACP,CAAC,KAAK,EAAE,EAAE;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,2EAA2E;YAC3E,MAAM,CAAC,MAAM,CAAC,CAAC;QAChB,CAAC,CACD,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\n\nimport type { IFluidFileConverter } from \"./codeLoaderBundle.js\";\n\n/**\n * Is the given snapshot in JSON format\n * @param content - snapshot file content\n * @internal\n */\nexport function isJsonSnapshot(content: Buffer): boolean {\n\treturn content.toString(undefined, 0, 1) === \"{\";\n}\n\n/**\n * Get the ODSP snapshot file content\n * Works on both JSON and binary snapshot formats\n * @param filePath - path to the ODSP snapshot file\n * @internal\n */\nexport function getSnapshotFileContent(filePath: string): string | Buffer {\n\t// TODO: read file stream\n\tconst content = fs.readFileSync(filePath);\n\treturn isJsonSnapshot(content) ? content.toString() : content;\n}\n\n/**\n * Validate provided command line arguments\n * @internal\n */\nexport function validateCommandLineArgs(\n\tcodeLoader?: string,\n\tfluidFileConverter?: IFluidFileConverter,\n): string | undefined {\n\tif (codeLoader && fluidFileConverter !== undefined) {\n\t\treturn '\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.';\n\t}\n\tif (!codeLoader && fluidFileConverter === undefined) {\n\t\treturn '\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.';\n\t}\n\treturn undefined;\n}\n\n/**\n * Verifies that the specified input file exists, the output file does not exist.\n *\n * @internal\n */\nexport function getArgsValidationError(\n\tinputFile: string,\n\toutputFile: string,\n\ttimeout?: number,\n): string | undefined {\n\t// Validate input file\n\tif (!inputFile) {\n\t\treturn \"Input file name argument is missing.\";\n\t} else if (!fs.existsSync(inputFile)) {\n\t\treturn \"Input file does not exist.\";\n\t}\n\n\t// Validate output file\n\tif (!outputFile) {\n\t\treturn \"Output file argument is missing.\";\n\t} else if (fs.existsSync(outputFile)) {\n\t\treturn `Output file already exists [${outputFile}].`;\n\t}\n\n\tif (timeout !== undefined && (isNaN(timeout) || timeout < 0)) {\n\t\treturn \"Invalid timeout\";\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Creates a promise that rejects if not resolved within the specified timeout.\n *\n * @internal\n */\nexport async function timeoutPromise<T = void>(\n\texecutor: (\n\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\treject: (reason?: any) => void,\n\t) => void,\n\ttimeout: number,\n): Promise<T> {\n\treturn new Promise<T>((resolve, reject) => {\n\t\tconst timer = setTimeout(() => reject(new Error(`Timed out (${timeout}ms)`)), timeout);\n\n\t\texecutor(\n\t\t\t(value) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(value);\n\t\t\t},\n\t\t\t(reason) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n\t\t\t\treject(reason);\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-runner",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.82.0",
|
|
4
4
|
"description": "Utility for running various functionality inside a Fluid Framework environment",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -71,29 +71,29 @@
|
|
|
71
71
|
"temp-directory": "nyc/.nyc_output"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@fluidframework/aqueduct": "~2.
|
|
75
|
-
"@fluidframework/container-definitions": "~2.
|
|
76
|
-
"@fluidframework/container-loader": "~2.
|
|
77
|
-
"@fluidframework/core-interfaces": "~2.
|
|
78
|
-
"@fluidframework/driver-definitions": "~2.
|
|
79
|
-
"@fluidframework/odsp-driver": "~2.
|
|
80
|
-
"@fluidframework/odsp-driver-definitions": "~2.
|
|
81
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
74
|
+
"@fluidframework/aqueduct": "~2.82.0",
|
|
75
|
+
"@fluidframework/container-definitions": "~2.82.0",
|
|
76
|
+
"@fluidframework/container-loader": "~2.82.0",
|
|
77
|
+
"@fluidframework/core-interfaces": "~2.82.0",
|
|
78
|
+
"@fluidframework/driver-definitions": "~2.82.0",
|
|
79
|
+
"@fluidframework/odsp-driver": "~2.82.0",
|
|
80
|
+
"@fluidframework/odsp-driver-definitions": "~2.82.0",
|
|
81
|
+
"@fluidframework/telemetry-utils": "~2.82.0",
|
|
82
82
|
"@json2csv/plainjs": "^7.0.6",
|
|
83
83
|
"yargs": "17.7.2"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
87
87
|
"@biomejs/biome": "~1.9.3",
|
|
88
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
88
|
+
"@fluid-internal/mocha-test-setup": "~2.82.0",
|
|
89
89
|
"@fluid-tools/build-cli": "^0.63.0",
|
|
90
90
|
"@fluidframework/build-common": "^2.0.3",
|
|
91
91
|
"@fluidframework/build-tools": "^0.63.0",
|
|
92
|
-
"@fluidframework/eslint-config-fluid": "~2.
|
|
93
|
-
"@fluidframework/fluid-runner-previous": "npm:@fluidframework/fluid-runner@2.
|
|
92
|
+
"@fluidframework/eslint-config-fluid": "~2.82.0",
|
|
93
|
+
"@fluidframework/fluid-runner-previous": "npm:@fluidframework/fluid-runner@2.81.0",
|
|
94
94
|
"@microsoft/api-extractor": "7.52.11",
|
|
95
95
|
"@types/mocha": "^10.0.10",
|
|
96
|
-
"@types/node": "
|
|
96
|
+
"@types/node": "~20.19.30",
|
|
97
97
|
"@types/yargs": "^17.0.32",
|
|
98
98
|
"c8": "^10.1.3",
|
|
99
99
|
"concurrently": "^9.2.1",
|
package/src/fluidRunner.ts
CHANGED
|
@@ -15,6 +15,8 @@ import { parseBundleAndExportFile } from "./parseBundleAndExportFile.js";
|
|
|
15
15
|
import { validateCommandLineArgs } from "./utils.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
+
* Entry point for the Fluid runner CLI tool that exports ODSP snapshots.
|
|
19
|
+
*
|
|
18
20
|
* @param fluidFileConverter - needs to be provided if "codeLoaderBundle" is not and vice versa
|
|
19
21
|
* @internal
|
|
20
22
|
*/
|
package/src/utils.ts
CHANGED
|
@@ -46,6 +46,8 @@ export function validateCommandLineArgs(
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
+
* Verifies that the specified input file exists, the output file does not exist.
|
|
50
|
+
*
|
|
49
51
|
* @internal
|
|
50
52
|
*/
|
|
51
53
|
export function getArgsValidationError(
|
|
@@ -75,6 +77,8 @@ export function getArgsValidationError(
|
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
/**
|
|
80
|
+
* Creates a promise that rejects if not resolved within the specified timeout.
|
|
81
|
+
*
|
|
78
82
|
* @internal
|
|
79
83
|
*/
|
|
80
84
|
export async function timeoutPromise<T = void>(
|