@fluidframework/fluid-runner 2.0.0-internal.2.2.1 → 2.0.0-internal.2.3.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/.eslintrc.js +1 -1
- package/dist/fluidRunner.d.ts.map +1 -1
- package/dist/fluidRunner.js +0 -2
- package/dist/fluidRunner.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +0 -1
- package/dist/utils.js.map +1 -1
- package/lib/fluidRunner.d.ts.map +1 -1
- package/lib/fluidRunner.js +0 -2
- package/lib/fluidRunner.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +0 -1
- package/lib/utils.js.map +1 -1
- package/package.json +14 -13
- package/src/fluidRunner.ts +0 -2
- package/src/utils.ts +0 -1
- package/tsconfig.json +2 -1
package/.eslintrc.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
"extends": [
|
|
8
|
-
require.resolve("@fluidframework/eslint-config-fluid"), "prettier"
|
|
8
|
+
require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"
|
|
9
9
|
],
|
|
10
10
|
"parserOptions": {
|
|
11
11
|
"project": ["./tsconfig.json", "./src/test/tsconfig.json"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;GAEG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,QAsFnE"}
|
package/dist/fluidRunner.js
CHANGED
|
@@ -24,7 +24,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.fluidRunner = void 0;
|
|
27
|
-
/* eslint-disable max-len */
|
|
28
27
|
const yargs = __importStar(require("yargs"));
|
|
29
28
|
const exportFile_1 = require("./exportFile");
|
|
30
29
|
const parseBundleAndExportFile_1 = require("./parseBundleAndExportFile");
|
|
@@ -102,5 +101,4 @@ function fluidRunner(fluidFileConverter) {
|
|
|
102
101
|
.demandCommand().argv;
|
|
103
102
|
}
|
|
104
103
|
exports.fluidRunner = fluidRunner;
|
|
105
|
-
/* eslint-enable max-len */
|
|
106
104
|
//# sourceMappingURL=fluidRunner.js.map
|
package/dist/fluidRunner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,6CAA0C;AAE1C,yEAAsE;AACtE,sDAAsD;AACtD,sDAAwE;AACxE,mCAAkD;AAElD;;GAEG;AACH,SAAgB,WAAW,CAAC,kBAAwC;IAChE,oEAAoE;IACpE,KAAK;SACA,MAAM,EAAE;SACR,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CACJ,YAAY,EACZ,8CAA8C;IAC9C,wDAAwD;IACxD,CAAC,KAAK,EAAE,EAAE,CACN,KAAK;SACA,MAAM,CAAC,YAAY,EAAE;QAClB,QAAQ,EAAE,qIAAqI;QAC/I,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,KAAK;KACtB,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACjB,QAAQ,EAAE,6BAA6B;QACvC,IAAI,EAAE,QAAQ;QACd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C,CAAC,IAAA,mDAAwB,EACtB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,sBAAsB,CAAC,gBAAgB,CAC1C,CAAC,CAAC,CAAC,IAAA,uBAAU,EACV,kBAAmB,EACnB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,sBAAsB,CAAC,gBAAgB,CAC1C,CAAC,CAAC;QAEP,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CACJ;SACA,IAAI,EAAE;SACN,aAAa,EAAE,CAAC,IAAI,CAAC;AAC9B,CAAC;AAtFD,kCAsFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as yargs from \"yargs\";\nimport { exportFile } from \"./exportFile\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { parseBundleAndExportFile } from \"./parseBundleAndExportFile\";\n// eslint-disable-next-line import/no-internal-modules\nimport { validateAndParseTelemetryOptions } from \"./logger/loggerUtils\";\nimport { validateCommandLineArgs } from \"./utils\";\n\n/**\n * @param fluidFileConverter - needs to be provided if \"codeLoaderBundle\" is not and vice versa\n */\nexport function fluidRunner(fluidFileConverter?: IFluidFileConverter) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n yargs\n .strict()\n .version(false)\n .command(\n \"exportFile\",\n \"Generate an output for a local ODSP snapshot\",\n // eslint-disable-next-line @typescript-eslint/no-shadow\n (yargs) =>\n yargs\n .option(\"codeLoader\", {\n describe: \"Path to code loader bundle. Required if this application is being called without modification.\\nSee \\\"README.md\\\" for more details.\",\n type: \"string\",\n demandOption: false,\n })\n .option(\"inputFile\", {\n describe: \"Path to local ODSP snapshot\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"outputFile\", {\n describe: \"Path of output file (cannot already exist).\\nExecution result will be written here\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"telemetryFile\", {\n describe: \"Path of telemetry file for config and session data (cannot already exist)\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"options\", {\n describe: \"Additional options passed to container on execution\",\n type: \"string\",\n demandOption: false,\n })\n .option(\"telemetryFormat\", {\n describe: \"Output format for telemetry. Current options are: [\\\"JSON\\\", \\\"CSV\\\"]\",\n type: \"string\",\n demandOption: false,\n default: \"JSON\",\n })\n .option(\"telemetryProp\", {\n describe: \"Property to add to every telemetry entry. Formatted like \\\"--telemetryProp prop1 value1 --telemetryProp prop2 \\\\\\\"value 2\\\\\\\"\\\".\",\n type: \"array\",\n demandOption: false,\n }),\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n async (argv) => {\n const argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);\n if (argsError) {\n console.error(argsError);\n process.exit(1);\n }\n const telemetryOptionsResult = validateAndParseTelemetryOptions(argv.telemetryFormat, argv.telemetryProp);\n if (!telemetryOptionsResult.success) {\n console.error(telemetryOptionsResult.error);\n process.exit(1);\n }\n\n const result = await (argv.codeLoader\n ? parseBundleAndExportFile(\n argv.codeLoader,\n argv.inputFile,\n argv.outputFile,\n argv.telemetryFile,\n argv.options,\n telemetryOptionsResult.telemetryOptions,\n ) : exportFile(\n fluidFileConverter!,\n argv.inputFile,\n argv.outputFile,\n argv.telemetryFile,\n argv.options,\n telemetryOptionsResult.telemetryOptions,\n ));\n\n if (!result.success) {\n console.error(`${result.eventName}: ${result.errorMessage}`);\n process.exit(1);\n }\n process.exit(0);\n },\n )\n .help()\n .demandCommand().argv;\n}\n"]}
|
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;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACF,wBAAgB,uBAAuB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACzC,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACF,wBAAgB,uBAAuB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACzC,MAAM,GAAG,SAAS,CAQpB"}
|
package/dist/utils.js
CHANGED
|
@@ -54,7 +54,6 @@ function validateCommandLineArgs(codeLoader, fluidFileConverter) {
|
|
|
54
54
|
return "\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.";
|
|
55
55
|
}
|
|
56
56
|
if (!codeLoader && fluidFileConverter === undefined) {
|
|
57
|
-
// eslint-disable-next-line max-len
|
|
58
57
|
return "\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.";
|
|
59
58
|
}
|
|
60
59
|
return undefined;
|
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;AAGzB;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AACrD,CAAC;AAFD,wCAEC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,QAAgB;IACnD,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;AAClE,CAAC;AAJD,wDAIC;AAED;;;GAGG;AACF,SAAgB,uBAAuB,CACpC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QAChD,OAAO,4FAA4F,CAAC;KACvG;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACjD,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAGzB;;;;GAIG;AACH,SAAgB,cAAc,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AACrD,CAAC;AAFD,wCAEC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,QAAgB;IACnD,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;AAClE,CAAC;AAJD,wDAIC;AAED;;;GAGG;AACF,SAAgB,uBAAuB,CACpC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QAChD,OAAO,4FAA4F,CAAC;KACvG;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACjD,OAAO,yGAAyG,CAAC;KACpH;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAXA,0DAWA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as fs from \"fs\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\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 return 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 */\nexport function getSnapshotFileContent(filePath: string): string | Buffer {\n // TODO: read file stream\n const content = fs.readFileSync(filePath);\n return isJsonSnapshot(content) ? content.toString() : content;\n}\n\n/**\n * Validate provided command line arguments\n * @internal\n */\n export function validateCommandLineArgs(\n codeLoader?: string,\n fluidFileConverter?: IFluidFileConverter,\n): string | undefined {\n if (codeLoader && fluidFileConverter !== undefined) {\n return \"\\\"codeLoader\\\" and \\\"fluidFileConverter\\\" cannot both be provided. See README for details.\";\n }\n if (!codeLoader && fluidFileConverter === undefined) {\n return \"\\\"codeLoader\\\" must be provided if there is no explicit \\\"fluidFileConverter\\\". See README for details.\";\n }\n return undefined;\n}\n"]}
|
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;
|
|
1
|
+
{"version":3,"file":"fluidRunner.d.ts","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAMzD;;GAEG;AACH,wBAAgB,WAAW,CAAC,kBAAkB,CAAC,EAAE,mBAAmB,QAsFnE"}
|
package/lib/fluidRunner.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/* eslint-disable max-len */
|
|
6
5
|
import * as yargs from "yargs";
|
|
7
6
|
import { exportFile } from "./exportFile";
|
|
8
7
|
import { parseBundleAndExportFile } from "./parseBundleAndExportFile";
|
|
@@ -79,5 +78,4 @@ export function fluidRunner(fluidFileConverter) {
|
|
|
79
78
|
.help()
|
|
80
79
|
.demandCommand().argv;
|
|
81
80
|
}
|
|
82
|
-
/* eslint-enable max-len */
|
|
83
81
|
//# sourceMappingURL=fluidRunner.js.map
|
package/lib/fluidRunner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"fluidRunner.js","sourceRoot":"","sources":["../src/fluidRunner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,sDAAsD;AACtD,OAAO,EAAE,gCAAgC,EAAE,M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AAU,EAAE,kBAAkB,CAAC,CAAC;QAC/E,IAAI,SAAS,EAAE;YACX,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,MAAM,sBAAsB,GAAG,gCAAgC,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1G,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU;YACjC,CAAC,CAAC,wBAAwB,CACtB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,sBAAsB,CAAC,gBAAgB,CAC1C,CAAC,CAAC,CAAC,UAAU,CACV,kBAAmB,EACnB,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,OAAO,EACZ,sBAAsB,CAAC,gBAAgB,CAC1C,CAAC,CAAC;QAEP,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACjB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,SAAS,KAAK,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACnB;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CACJ;SACA,IAAI,EAAE;SACN,aAAa,EAAE,CAAC,IAAI,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as yargs from \"yargs\";\nimport { exportFile } from \"./exportFile\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\nimport { parseBundleAndExportFile } from \"./parseBundleAndExportFile\";\n// eslint-disable-next-line import/no-internal-modules\nimport { validateAndParseTelemetryOptions } from \"./logger/loggerUtils\";\nimport { validateCommandLineArgs } from \"./utils\";\n\n/**\n * @param fluidFileConverter - needs to be provided if \"codeLoaderBundle\" is not and vice versa\n */\nexport function fluidRunner(fluidFileConverter?: IFluidFileConverter) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n yargs\n .strict()\n .version(false)\n .command(\n \"exportFile\",\n \"Generate an output for a local ODSP snapshot\",\n // eslint-disable-next-line @typescript-eslint/no-shadow\n (yargs) =>\n yargs\n .option(\"codeLoader\", {\n describe: \"Path to code loader bundle. Required if this application is being called without modification.\\nSee \\\"README.md\\\" for more details.\",\n type: \"string\",\n demandOption: false,\n })\n .option(\"inputFile\", {\n describe: \"Path to local ODSP snapshot\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"outputFile\", {\n describe: \"Path of output file (cannot already exist).\\nExecution result will be written here\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"telemetryFile\", {\n describe: \"Path of telemetry file for config and session data (cannot already exist)\",\n type: \"string\",\n demandOption: true,\n })\n .option(\"options\", {\n describe: \"Additional options passed to container on execution\",\n type: \"string\",\n demandOption: false,\n })\n .option(\"telemetryFormat\", {\n describe: \"Output format for telemetry. Current options are: [\\\"JSON\\\", \\\"CSV\\\"]\",\n type: \"string\",\n demandOption: false,\n default: \"JSON\",\n })\n .option(\"telemetryProp\", {\n describe: \"Property to add to every telemetry entry. Formatted like \\\"--telemetryProp prop1 value1 --telemetryProp prop2 \\\\\\\"value 2\\\\\\\"\\\".\",\n type: \"array\",\n demandOption: false,\n }),\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n async (argv) => {\n const argsError = validateCommandLineArgs(argv.codeLoader, fluidFileConverter);\n if (argsError) {\n console.error(argsError);\n process.exit(1);\n }\n const telemetryOptionsResult = validateAndParseTelemetryOptions(argv.telemetryFormat, argv.telemetryProp);\n if (!telemetryOptionsResult.success) {\n console.error(telemetryOptionsResult.error);\n process.exit(1);\n }\n\n const result = await (argv.codeLoader\n ? parseBundleAndExportFile(\n argv.codeLoader,\n argv.inputFile,\n argv.outputFile,\n argv.telemetryFile,\n argv.options,\n telemetryOptionsResult.telemetryOptions,\n ) : exportFile(\n fluidFileConverter!,\n argv.inputFile,\n argv.outputFile,\n argv.telemetryFile,\n argv.options,\n telemetryOptionsResult.telemetryOptions,\n ));\n\n if (!result.success) {\n console.error(`${result.eventName}: ${result.errorMessage}`);\n process.exit(1);\n }\n process.exit(0);\n },\n )\n .help()\n .demandCommand().argv;\n}\n"]}
|
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;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACF,wBAAgB,uBAAuB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACzC,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAIxE;AAED;;;GAGG;AACF,wBAAgB,uBAAuB,CACpC,UAAU,CAAC,EAAE,MAAM,EACnB,kBAAkB,CAAC,EAAE,mBAAmB,GACzC,MAAM,GAAG,SAAS,CAQpB"}
|
package/lib/utils.js
CHANGED
|
@@ -30,7 +30,6 @@ export function validateCommandLineArgs(codeLoader, fluidFileConverter) {
|
|
|
30
30
|
return "\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.";
|
|
31
31
|
}
|
|
32
32
|
if (!codeLoader && fluidFileConverter === undefined) {
|
|
33
|
-
// eslint-disable-next-line max-len
|
|
34
33
|
return "\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.";
|
|
35
34
|
}
|
|
36
35
|
return undefined;
|
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;AAGzB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACnD,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;AAClE,CAAC;AAED;;;GAGG;AACF,MAAM,UAAU,uBAAuB,CACpC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QAChD,OAAO,4FAA4F,CAAC;KACvG;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACjD,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACnD,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;AAClE,CAAC;AAED;;;GAGG;AACF,MAAM,UAAU,uBAAuB,CACpC,UAAmB,EACnB,kBAAwC;IAExC,IAAI,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QAChD,OAAO,4FAA4F,CAAC;KACvG;IACD,IAAI,CAAC,UAAU,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACjD,OAAO,yGAAyG,CAAC;KACpH;IACD,OAAO,SAAS,CAAC;AACrB,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\";\nimport { IFluidFileConverter } from \"./codeLoaderBundle\";\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 return 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 */\nexport function getSnapshotFileContent(filePath: string): string | Buffer {\n // TODO: read file stream\n const content = fs.readFileSync(filePath);\n return isJsonSnapshot(content) ? content.toString() : content;\n}\n\n/**\n * Validate provided command line arguments\n * @internal\n */\n export function validateCommandLineArgs(\n codeLoader?: string,\n fluidFileConverter?: IFluidFileConverter,\n): string | undefined {\n if (codeLoader && fluidFileConverter !== undefined) {\n return \"\\\"codeLoader\\\" and \\\"fluidFileConverter\\\" cannot both be provided. See README for details.\";\n }\n if (!codeLoader && fluidFileConverter === undefined) {\n return \"\\\"codeLoader\\\" must be provided if there is no explicit \\\"fluidFileConverter\\\". See README for details.\";\n }\n return undefined;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-runner",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.3.0",
|
|
4
4
|
"description": "Utility for running various functionality inside a Fluid Framework environment",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -58,24 +58,24 @@
|
|
|
58
58
|
"temp-directory": "nyc/.nyc_output"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@fluidframework/aqueduct": ">=2.0.0-internal.2.
|
|
61
|
+
"@fluidframework/aqueduct": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
62
62
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
63
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.2.
|
|
64
|
-
"@fluidframework/container-loader": ">=2.0.0-internal.2.
|
|
65
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
66
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.
|
|
67
|
-
"@fluidframework/odsp-driver": ">=2.0.0-internal.2.
|
|
68
|
-
"@fluidframework/odsp-driver-definitions": ">=2.0.0-internal.2.
|
|
69
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.
|
|
63
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
64
|
+
"@fluidframework/container-loader": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
65
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
66
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
67
|
+
"@fluidframework/odsp-driver": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
68
|
+
"@fluidframework/odsp-driver-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
69
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
70
70
|
"json2csv": "^5.0.7",
|
|
71
71
|
"yargs": "13.2.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@fluid-tools/build-cli": "^0.7.0",
|
|
75
75
|
"@fluidframework/build-common": "^1.1.0",
|
|
76
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
76
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
77
77
|
"@fluidframework/fluid-runner-previous": "npm:@fluidframework/fluid-runner@2.0.0-internal.2.2.0",
|
|
78
|
-
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.
|
|
78
|
+
"@fluidframework/mocha-test-setup": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
79
79
|
"@rushstack/eslint-config": "^2.5.1",
|
|
80
80
|
"@types/mocha": "^9.1.1",
|
|
81
81
|
"@types/node": "^14.18.0",
|
|
@@ -89,8 +89,9 @@
|
|
|
89
89
|
"typescript": "~4.5.5"
|
|
90
90
|
},
|
|
91
91
|
"typeValidation": {
|
|
92
|
-
"version": "2.0.0-internal.2.
|
|
93
|
-
"baselineRange": "2.0.0-internal.2.2.0",
|
|
92
|
+
"version": "2.0.0-internal.2.3.0",
|
|
93
|
+
"baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
|
|
94
|
+
"baselineVersion": "2.0.0-internal.2.2.0",
|
|
94
95
|
"broken": {}
|
|
95
96
|
}
|
|
96
97
|
}
|
package/src/fluidRunner.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
/* eslint-disable max-len */
|
|
7
6
|
import * as yargs from "yargs";
|
|
8
7
|
import { exportFile } from "./exportFile";
|
|
9
8
|
import { IFluidFileConverter } from "./codeLoaderBundle";
|
|
@@ -102,4 +101,3 @@ export function fluidRunner(fluidFileConverter?: IFluidFileConverter) {
|
|
|
102
101
|
.help()
|
|
103
102
|
.demandCommand().argv;
|
|
104
103
|
}
|
|
105
|
-
/* eslint-enable max-len */
|
package/src/utils.ts
CHANGED
|
@@ -38,7 +38,6 @@ export function getSnapshotFileContent(filePath: string): string | Buffer {
|
|
|
38
38
|
return "\"codeLoader\" and \"fluidFileConverter\" cannot both be provided. See README for details.";
|
|
39
39
|
}
|
|
40
40
|
if (!codeLoader && fluidFileConverter === undefined) {
|
|
41
|
-
// eslint-disable-next-line max-len
|
|
42
41
|
return "\"codeLoader\" must be provided if there is no explicit \"fluidFileConverter\". See README for details.";
|
|
43
42
|
}
|
|
44
43
|
return undefined;
|