@memlab/cli 1.0.4 → 1.0.5
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/README.md +3 -2
- package/dist/commands/RunMeasureCommand.js +2 -0
- package/dist/commands/WarmupAppCommand.js +2 -0
- package/dist/commands/snapshot/TakeSnapshotCommand.js +2 -0
- package/dist/options/HeadfulBrowserOption.d.ts +18 -0
- package/dist/options/HeadfulBrowserOption.js +37 -0
- package/dist/options/heap/JSEngineOption.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
This is the memlab CLI library. It contains all memlab commands, command-line options, and command-line interfaces.
|
|
4
4
|
The library supports adding new commands.
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
https://facebookincubator.github.io/memlab
|
|
6
|
+
## Online Resources
|
|
7
|
+
* [Official Website and Demo](https://facebookincubator.github.io/memlab)
|
|
8
|
+
* [Documentation](https://facebookincubator.github.io/memlab/docs/intro)
|
|
@@ -40,6 +40,7 @@ const ScenarioFileOption_1 = __importDefault(require("../options/ScenarioFileOpt
|
|
|
40
40
|
const SetDeviceOption_1 = __importDefault(require("../options/SetDeviceOption"));
|
|
41
41
|
const DisableXvfbOption_1 = __importDefault(require("../options/DisableXvfbOption"));
|
|
42
42
|
const NumberOfRunsOption_1 = __importDefault(require("../options/NumberOfRunsOption"));
|
|
43
|
+
const HeadfulBrowserOption_1 = __importDefault(require("../options/HeadfulBrowserOption"));
|
|
43
44
|
class RunMeasureCommand extends BaseCommand_1.default {
|
|
44
45
|
getCommandName() {
|
|
45
46
|
return 'measure';
|
|
@@ -59,6 +60,7 @@ class RunMeasureCommand extends BaseCommand_1.default {
|
|
|
59
60
|
}
|
|
60
61
|
getOptions() {
|
|
61
62
|
return [
|
|
63
|
+
new HeadfulBrowserOption_1.default(),
|
|
62
64
|
new NumberOfRunsOption_1.default(),
|
|
63
65
|
new AppOption_1.default(),
|
|
64
66
|
new InteractionOption_1.default(),
|
|
@@ -33,6 +33,7 @@ const SetDeviceOption_1 = __importDefault(require("../options/SetDeviceOption"))
|
|
|
33
33
|
const DisableXvfbOption_1 = __importDefault(require("../options/DisableXvfbOption"));
|
|
34
34
|
const SkipWarmupOption_1 = __importDefault(require("../options/SkipWarmupOption"));
|
|
35
35
|
const CheckXvfbSupportCommand_1 = __importDefault(require("./snapshot/CheckXvfbSupportCommand"));
|
|
36
|
+
const HeadfulBrowserOption_1 = __importDefault(require("../options/HeadfulBrowserOption"));
|
|
36
37
|
class FBWarmupAppCommand extends BaseCommand_1.default {
|
|
37
38
|
getCommandName() {
|
|
38
39
|
return 'warmup';
|
|
@@ -51,6 +52,7 @@ class FBWarmupAppCommand extends BaseCommand_1.default {
|
|
|
51
52
|
}
|
|
52
53
|
getOptions() {
|
|
53
54
|
return [
|
|
55
|
+
new HeadfulBrowserOption_1.default(),
|
|
54
56
|
new AppOption_1.default(),
|
|
55
57
|
new InteractionOption_1.default(),
|
|
56
58
|
new RunningModeOption_1.default(),
|
|
@@ -39,6 +39,7 @@ const SetDeviceOption_1 = __importDefault(require("../../options/SetDeviceOption
|
|
|
39
39
|
const DisableXvfbOption_1 = __importDefault(require("../../options/DisableXvfbOption"));
|
|
40
40
|
const InitDirectoryCommand_1 = __importDefault(require("../InitDirectoryCommand"));
|
|
41
41
|
const CheckXvfbSupportCommand_1 = __importDefault(require("./CheckXvfbSupportCommand"));
|
|
42
|
+
const HeadfulBrowserOption_1 = __importDefault(require("../../options/HeadfulBrowserOption"));
|
|
42
43
|
class TakeSnapshotCommand extends BaseCommand_1.default {
|
|
43
44
|
getCommandName() {
|
|
44
45
|
return 'snapshot';
|
|
@@ -62,6 +63,7 @@ class TakeSnapshotCommand extends BaseCommand_1.default {
|
|
|
62
63
|
}
|
|
63
64
|
getOptions() {
|
|
64
65
|
return [
|
|
66
|
+
new HeadfulBrowserOption_1.default(),
|
|
65
67
|
new AppOption_1.default(),
|
|
66
68
|
new InteractionOption_1.default(),
|
|
67
69
|
new FullExecutionOption_1.default(),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @emails oncall+ws_labs
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
import type { ParsedArgs } from 'minimist';
|
|
11
|
+
import type { MemLabConfig } from '@memlab/core';
|
|
12
|
+
import { BaseOption } from '@memlab/core';
|
|
13
|
+
export default class HeadfulBrowserOption extends BaseOption {
|
|
14
|
+
getOptionName(): string;
|
|
15
|
+
getDescription(): string;
|
|
16
|
+
parse(config: MemLabConfig, args: ParsedArgs): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=HeadfulBrowserOption.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @emails oncall+ws_labs
|
|
9
|
+
* @format
|
|
10
|
+
*/
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
const core_1 = require("@memlab/core");
|
|
22
|
+
class HeadfulBrowserOption extends core_1.BaseOption {
|
|
23
|
+
getOptionName() {
|
|
24
|
+
return 'headful';
|
|
25
|
+
}
|
|
26
|
+
getDescription() {
|
|
27
|
+
return 'start the browser in headful mode, but default it is headless';
|
|
28
|
+
}
|
|
29
|
+
parse(config, args) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
if (args[this.getOptionName()]) {
|
|
32
|
+
config.isHeadfulBrowser = true;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = HeadfulBrowserOption;
|
|
@@ -24,10 +24,10 @@ class JSEngineOption extends core_1.BaseOption {
|
|
|
24
24
|
return 'engine';
|
|
25
25
|
}
|
|
26
26
|
getDescription() {
|
|
27
|
-
return 'set the JavaScript engine (default to
|
|
27
|
+
return 'set the JavaScript engine (default to V8)';
|
|
28
28
|
}
|
|
29
29
|
getExampleValues() {
|
|
30
|
-
return ['
|
|
30
|
+
return ['V8', 'hermes'];
|
|
31
31
|
}
|
|
32
32
|
parse(config, args) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|