@tramvai/cli 5.53.81 → 5.53.111
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 +1 -1
- package/bin/const.js +5 -0
- package/bin/platform.js +12 -6
- package/bin/spawn.js +6 -0
- package/lib/api/analyze/index.d.ts.map +1 -1
- package/lib/api/analyze/index.js +1 -13
- package/lib/api/analyze/index.js.map +1 -1
- package/lib/api/benchmark/build.d.ts +1 -6
- package/lib/api/benchmark/build.d.ts.map +1 -1
- package/lib/api/benchmark/build.js +59 -23
- package/lib/api/benchmark/build.js.map +1 -1
- package/lib/api/benchmark/const.d.ts +2 -0
- package/lib/api/benchmark/const.d.ts.map +1 -0
- package/lib/api/benchmark/const.js +5 -0
- package/lib/api/benchmark/const.js.map +1 -0
- package/lib/api/benchmark/index.d.ts +4 -6
- package/lib/api/benchmark/index.d.ts.map +1 -1
- package/lib/api/benchmark/index.js.map +1 -1
- package/lib/api/benchmark/start.d.ts +1 -7
- package/lib/api/benchmark/start.d.ts.map +1 -1
- package/lib/api/benchmark/start.js +56 -49
- package/lib/api/benchmark/start.js.map +1 -1
- package/lib/api/benchmark/types.d.ts +76 -12
- package/lib/api/benchmark/types.d.ts.map +1 -1
- package/lib/api/benchmark/utils/compilationUtils.d.ts +4 -0
- package/lib/api/benchmark/utils/compilationUtils.d.ts.map +1 -0
- package/lib/api/benchmark/utils/compilationUtils.js +157 -0
- package/lib/api/benchmark/utils/compilationUtils.js.map +1 -0
- package/lib/api/benchmark/utils/stats.d.ts +2 -7
- package/lib/api/benchmark/utils/stats.d.ts.map +1 -1
- package/lib/api/benchmark/utils/stats.js +36 -22
- package/lib/api/benchmark/utils/stats.js.map +1 -1
- package/lib/api/build/index.d.ts +1 -0
- package/lib/api/build/index.d.ts.map +1 -1
- package/lib/api/build/index.js.map +1 -1
- package/lib/api/index.js +1 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/start/index.d.ts +1 -0
- package/lib/api/start/index.d.ts.map +1 -1
- package/lib/api/start/index.js.map +1 -1
- package/lib/builder/webpack/analyzePlugins/rsdoctor.d.ts +5 -5
- package/lib/builder/webpack/analyzePlugins/rsdoctor.d.ts.map +1 -1
- package/lib/builder/webpack/analyzePlugins/rsdoctor.js +7 -9
- package/lib/builder/webpack/analyzePlugins/rsdoctor.js.map +1 -1
- package/lib/builder/webpack/index.d.ts.map +1 -1
- package/lib/builder/webpack/index.js +14 -12
- package/lib/builder/webpack/index.js.map +1 -1
- package/lib/builder/webpack/providers/build/client.d.ts.map +1 -1
- package/lib/builder/webpack/providers/build/client.js +3 -2
- package/lib/builder/webpack/providers/build/client.js.map +1 -1
- package/lib/builder/webpack/providers/build/server.d.ts.map +1 -1
- package/lib/builder/webpack/providers/build/server.js +3 -2
- package/lib/builder/webpack/providers/build/server.js.map +1 -1
- package/lib/builder/webpack/providers/shared.d.ts.map +1 -1
- package/lib/builder/webpack/providers/shared.js +39 -5
- package/lib/builder/webpack/providers/shared.js.map +1 -1
- package/lib/builder/webpack/providers/start/shared.d.ts.map +1 -1
- package/lib/builder/webpack/providers/start/shared.js +6 -2
- package/lib/builder/webpack/providers/start/shared.js.map +1 -1
- package/lib/builder/webpack/tokens.d.ts +10 -16
- package/lib/builder/webpack/tokens.d.ts.map +1 -1
- package/lib/cli/index.d.ts.map +1 -1
- package/lib/cli/index.js +12 -12
- package/lib/cli/index.js.map +1 -1
- package/lib/commands/analyze/command.d.ts +1 -1
- package/lib/commands/analyze/command.d.ts.map +1 -1
- package/lib/commands/benchmark/benchmark.d.ts +3 -1
- package/lib/commands/benchmark/benchmark.d.ts.map +1 -1
- package/lib/commands/benchmark/benchmark.js +130 -31
- package/lib/commands/benchmark/benchmark.js.map +1 -1
- package/lib/commands/benchmark/command.d.ts +9 -0
- package/lib/commands/benchmark/command.d.ts.map +1 -1
- package/lib/commands/benchmark/command.js +12 -0
- package/lib/commands/benchmark/command.js.map +1 -1
- package/lib/commands/build/command.d.ts.map +1 -1
- package/lib/commands/build/command.js +5 -0
- package/lib/commands/build/command.js.map +1 -1
- package/lib/commands/start/command.d.ts.map +1 -1
- package/lib/commands/start/command.js +5 -0
- package/lib/commands/start/command.js.map +1 -1
- package/lib/commands/update/checkVersionValidator.d.ts +1 -1
- package/lib/commands/update/checkVersionValidator.d.ts.map +1 -1
- package/lib/commands/update/checkVersionValidator.js +3 -2
- package/lib/commands/update/checkVersionValidator.js.map +1 -1
- package/lib/commands/update/command.d.ts +1 -1
- package/lib/commands/update/dependantLibs.d.ts +1 -1
- package/lib/commands/update/dependantLibs.d.ts.map +1 -1
- package/lib/commands/update/dependantLibs.js +3 -2
- package/lib/commands/update/dependantLibs.js.map +1 -1
- package/lib/commands/update/update.d.ts.map +1 -1
- package/lib/commands/update/update.js +6 -3
- package/lib/commands/update/update.js.map +1 -1
- package/lib/commands/update/updatePackageJson.d.ts +1 -1
- package/lib/commands/update/updatePackageJson.d.ts.map +1 -1
- package/lib/commands/update/updatePackageJson.js +7 -7
- package/lib/commands/update/updatePackageJson.js.map +1 -1
- package/lib/config/configManager.d.ts +2 -0
- package/lib/config/configManager.d.ts.map +1 -1
- package/lib/config/configManager.js +2 -0
- package/lib/config/configManager.js.map +1 -1
- package/lib/di/tokens/config.d.ts +5 -8
- package/lib/di/tokens/config.d.ts.map +1 -1
- package/lib/library/webpack/blocks/css.d.ts.map +1 -1
- package/lib/library/webpack/blocks/css.js +42 -15
- package/lib/library/webpack/blocks/css.js.map +1 -1
- package/lib/library/webpack/blocks/js.d.ts.map +1 -1
- package/lib/library/webpack/blocks/js.js +57 -11
- package/lib/library/webpack/blocks/js.js.map +1 -1
- package/lib/library/webpack/common/main.d.ts.map +1 -1
- package/lib/library/webpack/common/main.js +7 -0
- package/lib/library/webpack/common/main.js.map +1 -1
- package/lib/library/webpack/utils/browserslist.d.ts +4 -0
- package/lib/library/webpack/utils/browserslist.d.ts.map +1 -0
- package/lib/library/webpack/utils/browserslist.js +27 -0
- package/lib/library/webpack/utils/browserslist.js.map +1 -0
- package/lib/library/webpack/utils/rsdoctor.d.ts +2 -0
- package/lib/library/webpack/utils/rsdoctor.d.ts.map +1 -0
- package/lib/library/webpack/utils/rsdoctor.js +27 -0
- package/lib/library/webpack/utils/rsdoctor.js.map +1 -0
- package/lib/library/webpack/utils/threadLoader.d.ts.map +1 -1
- package/lib/library/webpack/utils/threadLoader.js +3 -3
- package/lib/library/webpack/utils/threadLoader.js.map +1 -1
- package/lib/library/webpack/utils/transpiler.d.ts.map +1 -1
- package/lib/library/webpack/utils/transpiler.js +3 -16
- package/lib/library/webpack/utils/transpiler.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +240 -120
- package/lib/typings/build/Builder.d.ts +6 -2
- package/lib/typings/build/Builder.d.ts.map +1 -1
- package/lib/typings/configEntry/cli.d.ts +9 -0
- package/lib/typings/configEntry/cli.d.ts.map +1 -1
- package/lib/utils/commands/dependencies/getLatestPackageVersion.d.ts +1 -1
- package/lib/utils/commands/dependencies/getLatestPackageVersion.d.ts.map +1 -1
- package/lib/utils/commands/dependencies/getLatestPackageVersion.js +4 -2
- package/lib/utils/commands/dependencies/getLatestPackageVersion.js.map +1 -1
- package/lib/utils/commands/dependencies/packageHasVersion.d.ts +1 -1
- package/lib/utils/commands/dependencies/packageHasVersion.d.ts.map +1 -1
- package/lib/utils/commands/dependencies/packageHasVersion.js +3 -2
- package/lib/utils/commands/dependencies/packageHasVersion.js.map +1 -1
- package/package.json +19 -18
- package/schema.json +240 -120
- package/src/api/analyze/index.ts +3 -16
- package/src/api/benchmark/__integration__/start.test.ts +10 -12
- package/src/api/benchmark/build.ts +75 -30
- package/src/api/benchmark/const.ts +1 -0
- package/src/api/benchmark/index.ts +4 -6
- package/src/api/benchmark/start.ts +69 -65
- package/src/api/benchmark/types.ts +82 -14
- package/src/api/benchmark/utils/compilationUtils.ts +213 -0
- package/src/api/benchmark/utils/stats.ts +45 -28
- package/src/api/build/index.ts +1 -0
- package/src/api/index.ts +1 -1
- package/src/api/start/index.ts +1 -0
- package/src/builder/webpack/analyzePlugins/rsdoctor.ts +11 -14
- package/src/builder/webpack/index.ts +16 -21
- package/src/builder/webpack/providers/build/client.ts +7 -2
- package/src/builder/webpack/providers/build/server.ts +7 -2
- package/src/builder/webpack/providers/shared.ts +53 -5
- package/src/builder/webpack/providers/start/shared.ts +7 -2
- package/src/cli/index.ts +3 -2
- package/src/commands/analyze/command.ts +1 -1
- package/src/commands/benchmark/benchmark.ts +168 -33
- package/src/commands/benchmark/command.ts +12 -0
- package/src/commands/build/command.ts +6 -0
- package/src/commands/new/templates/shared/package.json.hbs +1 -1
- package/src/commands/start/command.ts +6 -0
- package/src/commands/update/checkVersionValidator.ts +4 -2
- package/src/commands/update/dependantLibs.ts +3 -1
- package/src/commands/update/update.ts +6 -3
- package/src/commands/update/updatePackageJson.spec.ts +19 -3
- package/src/commands/update/updatePackageJson.ts +7 -2
- package/src/config/configManager.ts +4 -0
- package/src/library/webpack/blocks/css.ts +52 -16
- package/src/library/webpack/blocks/js.ts +61 -12
- package/src/library/webpack/common/main.ts +8 -0
- package/src/library/webpack/utils/browserslist.ts +29 -0
- package/src/library/webpack/utils/rsdoctor.ts +26 -0
- package/src/library/webpack/utils/threadLoader.ts +1 -0
- package/src/library/webpack/utils/transpiler.ts +3 -18
- package/src/models/config.spec.ts +4 -0
- package/src/schema/autogeneratedSchema.json +240 -120
- package/src/schema/tramvai.spec.ts +2 -0
- package/src/typings/build/Builder.ts +7 -2
- package/src/typings/configEntry/cli.ts +11 -0
- package/src/utils/commands/dependencies/getLatestPackageVersion.ts +4 -1
- package/src/utils/commands/dependencies/packageHasVersion.ts +7 -2
- package/lib/api/analyze/providers/shared.d.ts +0 -3
- package/lib/api/analyze/providers/shared.d.ts.map +0 -1
- package/lib/api/analyze/providers/shared.js +0 -23
- package/lib/api/analyze/providers/shared.js.map +0 -1
- package/lib/builder/webpack/providers/analyze/shared.d.ts +0 -3
- package/lib/builder/webpack/providers/analyze/shared.d.ts.map +0 -1
- package/lib/builder/webpack/providers/analyze/shared.js +0 -141
- package/lib/builder/webpack/providers/analyze/shared.js.map +0 -1
- package/src/api/analyze/providers/shared.ts +0 -26
- package/src/api/benchmark/utils/stats.spec.ts +0 -36
- package/src/builder/webpack/providers/analyze/shared.ts +0 -160
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ After any command you can pass `--help` string, e.g. `tramvai --help` or `tramva
|
|
|
35
35
|
- `tramvai start-prod` - run app in development mode, but code will be build in the production mode
|
|
36
36
|
- `tramvai build` - build an app for server and client
|
|
37
37
|
- `tramvai static` - generate static HTML for application pages
|
|
38
|
-
- `tramvai
|
|
38
|
+
- `tramvai benchmark` - run benchmark for application build (run build multiple times and calculate mean values)
|
|
39
39
|
- `tramvai generate` - code generation for different components. E.g. new projects, react components, actions and etc.
|
|
40
40
|
- `tramvai update` - update `@tramvai/cli` and all of the `@tramvai` and `@tramvai-tinkoff` dependencies in the project. This command additionally executes dependency deduplication and code migrations
|
|
41
41
|
- `tramvai add` - add `@tramvai` or `@tramvai-tinkoff` dependency to the app. This command additionally executes dependency deduplication and code migrations
|
package/bin/const.js
ADDED
package/bin/platform.js
CHANGED
|
@@ -6,6 +6,8 @@ const path = require('node:path');
|
|
|
6
6
|
const chokidar = require('chokidar');
|
|
7
7
|
const chalk = require('chalk');
|
|
8
8
|
|
|
9
|
+
const { restartReason } = require('./const');
|
|
10
|
+
|
|
9
11
|
let abortController;
|
|
10
12
|
|
|
11
13
|
function run() {
|
|
@@ -18,13 +20,17 @@ const watchedFileName = 'tramvai.json';
|
|
|
18
20
|
function onConfigChange() {
|
|
19
21
|
console.log(chalk.yellow(`${watchedFileName} changed, restart process...`));
|
|
20
22
|
|
|
21
|
-
abortController.abort();
|
|
23
|
+
abortController.abort(restartReason);
|
|
22
24
|
abortController = run();
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
// Watch for tramvai.json changes only for `tramvai start` command
|
|
28
|
+
const isStartCommand = process.argv[2] === 'start';
|
|
29
|
+
if (isStartCommand) {
|
|
30
|
+
try {
|
|
31
|
+
const tramvaiJsonPath = path.resolve(process.cwd(), watchedFileName);
|
|
32
|
+
chokidar.watch(tramvaiJsonPath).on('change', onConfigChange);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error(`Something went wrong while watching for changes in ${watchedFileName}: ${err}`);
|
|
35
|
+
}
|
|
30
36
|
}
|
package/bin/spawn.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const { spawn: cpSpawn } = require('child_process');
|
|
2
2
|
const exit = require('exit');
|
|
3
3
|
|
|
4
|
+
const { restartReason } = require('./const');
|
|
5
|
+
|
|
4
6
|
const args = process.argv.slice(2);
|
|
5
7
|
const maxMemory = process.env.MAX_USED_MEMORY || '3000';
|
|
6
8
|
const maxSemiSpaceSize = process.env.MAX_SEMI_SPACE_SIZE || '128';
|
|
@@ -42,6 +44,10 @@ It's unexpected, please check available/used memory and cpu while running last c
|
|
|
42
44
|
});
|
|
43
45
|
|
|
44
46
|
cliInstance.on('exit', async (code, sig) => {
|
|
47
|
+
if (signal.aborted && signal.reason === restartReason) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
if (sig) {
|
|
46
52
|
console.warn(`Process was exited with signal "${sig}"
|
|
47
53
|
It's unexpected, please check available/used memory and cpu while running last command`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,YAAY,CAAC;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;;AAEvF,wBAOG"}
|
package/lib/api/analyze/index.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const createCommand_1 = require("../../commands/createCommand");
|
|
4
|
-
const tokens_1 = require("../../di/tokens");
|
|
5
|
-
const di_1 = require("../../utils/di");
|
|
6
|
-
const shared_1 = require("./providers/shared");
|
|
7
4
|
exports.default = (0, createCommand_1.createCommand)({
|
|
8
5
|
name: 'analyze',
|
|
9
6
|
command: async (di) => {
|
|
10
|
-
|
|
11
|
-
(0, di_1.registerProviders)(di, shared_1.sharedProviders);
|
|
12
|
-
const builderFactory = di.get(tokens_1.ABSTRACT_BUILDER_FACTORY_TOKEN);
|
|
13
|
-
const builder = await builderFactory.createBuilder('webpack', {
|
|
14
|
-
options: {
|
|
15
|
-
shouldBuildClient: true,
|
|
16
|
-
shouldBuildServer: false,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
await builder.analyze({ plugin });
|
|
7
|
+
throw new Error('tramvai analyze is deprecated, please use `tramvai start|build --analyze=pluginName`\n');
|
|
20
8
|
},
|
|
21
9
|
});
|
|
22
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":";;AACA,gEAA6D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/analyze/index.ts"],"names":[],"mappings":";;AACA,gEAA6D;AAY7D,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK,EAAE,EAAE,EAAiB,EAAE;QACnC,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { Container } from '@tinkoff/dippy';
|
|
2
2
|
import type { Params as OriginalBuildParams } from '../build/index';
|
|
3
3
|
import type { Params, Result } from './index';
|
|
4
|
-
import type { RunStats } from './types';
|
|
5
4
|
export interface BuildParams extends Params {
|
|
6
5
|
command: 'build';
|
|
7
6
|
commandOptions: OriginalBuildParams;
|
|
8
7
|
}
|
|
9
|
-
export
|
|
10
|
-
noCache?: RunStats;
|
|
11
|
-
cache?: RunStats;
|
|
12
|
-
}
|
|
13
|
-
export declare const benchmarkBuild: (di: Container) => Promise<BuildResult>;
|
|
8
|
+
export declare const benchmarkBuild: (di: Container) => Promise<Result>;
|
|
14
9
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/build.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAiC,MAAM,gBAAgB,CAAC;AAEnG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAO9C,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,mBAAmB,CAAC;CACrC;AAoFD,eAAO,MAAM,cAAc,OAAc,SAAS,KAAG,QAAQ,MAAM,CAoBlE,CAAC"}
|
|
@@ -4,43 +4,79 @@ exports.benchmarkBuild = void 0;
|
|
|
4
4
|
const tokens_1 = require("../../di/tokens");
|
|
5
5
|
const clearCache_1 = require("./utils/clearCache");
|
|
6
6
|
const stats_1 = require("./utils/stats");
|
|
7
|
+
const compilationUtils_1 = require("./utils/compilationUtils");
|
|
8
|
+
const const_1 = require("./const");
|
|
7
9
|
const runBuildCommand = async (di, { times, shouldClearCache, }) => {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
10
|
+
const clientBuildTimeSamples = [];
|
|
11
|
+
const serverBuildTimeSamples = [];
|
|
12
|
+
const clientMaxMemoryRssSamples = [];
|
|
13
|
+
const serverMaxMemoryRssSamples = [];
|
|
14
|
+
const serverCompilationTimings = [];
|
|
15
|
+
const clientCompilationTimings = [];
|
|
16
|
+
const maxMemoryRssSamples = [];
|
|
11
17
|
const { commandOptions } = di.get(tokens_1.COMMAND_PARAMETERS_TOKEN);
|
|
18
|
+
commandOptions.benchmark = true;
|
|
19
|
+
const buildType = commandOptions.buildType ?? 'all';
|
|
20
|
+
const benchmarkStartTime = new Date().toISOString();
|
|
12
21
|
for (let i = 0; i < times; i++) {
|
|
13
22
|
if (shouldClearCache) {
|
|
14
23
|
await (0, clearCache_1.clearCacheDirectory)(di);
|
|
15
24
|
}
|
|
16
|
-
const
|
|
25
|
+
const attemptStartTime = Date.now();
|
|
26
|
+
const { getBuildStats } = await di
|
|
17
27
|
.get(tokens_1.COMMAND_RUNNER_TOKEN)
|
|
18
28
|
.run('build', commandOptions);
|
|
19
|
-
const stats =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const stats = getBuildStats();
|
|
30
|
+
// at first attempt do not save metrics if cache is used
|
|
31
|
+
if (!shouldClearCache && i === 0) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (buildType === 'all' || buildType === 'server') {
|
|
35
|
+
serverCompilationTimings.push(await (0, compilationUtils_1.getServerCompilationTimings)(benchmarkStartTime, attemptStartTime, i));
|
|
36
|
+
serverBuildTimeSamples.push(stats.server.buildTime);
|
|
37
|
+
if (stats.server.maxMemoryRss) {
|
|
38
|
+
clientMaxMemoryRssSamples.push(stats.server.maxMemoryRss);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (buildType === 'all' || buildType === 'client') {
|
|
42
|
+
clientCompilationTimings.push(await (0, compilationUtils_1.getClientCompilationTimings)(benchmarkStartTime, attemptStartTime, i));
|
|
43
|
+
clientBuildTimeSamples.push(stats.client.buildTime);
|
|
44
|
+
if (stats.client.maxMemoryRss) {
|
|
45
|
+
clientMaxMemoryRssSamples.push(stats.client.maxMemoryRss);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (stats.maxMemoryRss) {
|
|
49
|
+
maxMemoryRssSamples.push(stats.maxMemoryRss);
|
|
50
|
+
}
|
|
23
51
|
}
|
|
24
52
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
53
|
+
serverCompilationTimings,
|
|
54
|
+
clientCompilationTimings,
|
|
55
|
+
clientBuildTimeSamples,
|
|
56
|
+
serverBuildTimeSamples,
|
|
27
57
|
maxMemoryRssSamples,
|
|
58
|
+
clientMaxMemoryRssSamples,
|
|
59
|
+
serverMaxMemoryRssSamples,
|
|
28
60
|
};
|
|
29
61
|
};
|
|
30
62
|
const benchmarkBuild = async (di) => {
|
|
31
|
-
const { times =
|
|
32
|
-
const noCache =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
const { times = const_1.DEFAULT_TIMES, commandOptions } = di.get(tokens_1.COMMAND_PARAMETERS_TOKEN);
|
|
64
|
+
const noCache = !commandOptions.fileCache;
|
|
65
|
+
let result;
|
|
66
|
+
if (noCache) {
|
|
67
|
+
result = await runBuildCommand(di, {
|
|
68
|
+
times,
|
|
69
|
+
shouldClearCache: true,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
result = await runBuildCommand(di, {
|
|
74
|
+
// additional first attempt for cache warmup
|
|
75
|
+
times: times + 1,
|
|
76
|
+
shouldClearCache: false,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return (0, stats_1.getResultStats)(result);
|
|
44
80
|
};
|
|
45
81
|
exports.benchmarkBuild = benchmarkBuild;
|
|
46
82
|
//# sourceMappingURL=build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/api/benchmark/build.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/api/benchmark/build.ts"],"names":[],"mappings":";;;AAGA,4CAAiF;AAGjF,mDAAyD;AACzD,yCAA+C;AAC/C,+DAAoG;AACpG,mCAAwC;AAOxC,MAAM,eAAe,GAAG,KAAK,EAC3B,EAAa,EACb,EACE,KAAK,EACL,gBAAgB,GAIjB,EACiB,EAAE;IACpB,MAAM,sBAAsB,GAAa,EAAE,CAAC;IAC5C,MAAM,sBAAsB,GAAa,EAAE,CAAC;IAE5C,MAAM,yBAAyB,GAAa,EAAE,CAAC;IAC/C,MAAM,yBAAyB,GAAa,EAAE,CAAC;IAE/C,MAAM,wBAAwB,GAAuB,EAAE,CAAC;IACxD,MAAM,wBAAwB,GAAuB,EAAE,CAAC;IAExD,MAAM,mBAAmB,GAAa,EAAE,CAAC;IAEzC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iCAAwB,CAAgB,CAAC;IAC3E,cAAc,CAAC,SAAS,GAAG,IAAI,CAAC;IAEhC,MAAM,SAAS,GAAG,cAAc,CAAC,SAAS,IAAI,KAAK,CAAC;IAEpD,MAAM,kBAAkB,GAAG,IAAI,IAAI,EAAE,CAAC,W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C,MAAM,CAAC,YAAY,CAAC,CAAC;aAC3D;SACF;QAED,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAC9C;KACF;IAED,OAAO;QACL,wBAAwB;QACxB,wBAAwB;QACxB,sBAAsB;QACtB,sBAAsB;QACtB,mBAAmB;QACnB,yBAAyB;QACzB,yBAAyB;KAC1B,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,cAAc,GAAG,KAAK,EAAE,EAAa,EAAmB,EAAE;IACrE,MAAM,EAAE,KAAK,GAAG,qBAAa,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iCAAwB,CAAW,CAAC;IAC7F,MAAM,OAAO,GAAG,CAAC,cAAc,CAAC,SAAS,CAAC;IAE1C,IAAI,MAAM,CAAC;IAEX,IAAI,OAAO,EAAE;QACX,MAAM,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE;YACjC,KAAK;YACL,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE;YACjC,4CAA4C;YAC5C,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,gBAAgB,EAAE,KAAK;SACxB,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAC;AAChC,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/api/benchmark/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,CAAC,CAAC"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type { Provider } from '@tinkoff/dippy';
|
|
2
|
-
import type { BuildParams
|
|
3
|
-
import type { StartParams
|
|
2
|
+
import type { BuildParams } from './build';
|
|
3
|
+
import type { StartParams } from './start';
|
|
4
4
|
import type { RunStats } from './types';
|
|
5
5
|
export interface Params {
|
|
6
6
|
command: string;
|
|
7
7
|
commandOptions: any;
|
|
8
8
|
times?: number;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export type BenchmarkCommand = (params: StartParams | BuildParams, providers?: Provider[]) => Promise<StartResult | BuildResult>;
|
|
10
|
+
export type Result = RunStats;
|
|
11
|
+
export type BenchmarkCommand = (params: StartParams | BuildParams, providers?: Provider[]) => Promise<Result>;
|
|
14
12
|
declare const _default: import("../../typings/commands").Command;
|
|
15
13
|
export default _default;
|
|
16
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,GAAG,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;AAE9B,MAAM,MAAM,gBAAgB,GAAG,CAC7B,MAAM,EAAE,WAAW,GAAG,WAAW,EACjC,SAAS,CAAC,EAAE,QAAQ,EAAE,KACnB,OAAO,CAAC,MAAM,CAAC,CAAC;;AAErB,wBAkBG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":";;AACA,gEAA6D;AAC7D,4CAAmF;AAEnF,mCAAyC;AAEzC,mCAAyC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/benchmark/index.ts"],"names":[],"mappings":";;AACA,gEAA6D;AAC7D,4CAAmF;AAEnF,mCAAyC;AAEzC,mCAAyC;AAgBzC,kBAAe,IAAA,6BAAa,EAAC;IAC3B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,EAAE,EAAmB,EAAE;QAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iCAAwB,CAAW,CAAC;QAE/D,QAAQ,OAAO,EAAE;YACf,KAAK,OAAO;gBACV,OAAO,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;YAC5B,KAAK,OAAO;gBACV,OAAO,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;SAC7B;IACH,CAAC;IACD,SAAS,EAAE;QACT;YACE,OAAO,EAAE,+BAAsB;YAC/B,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import type { Container } from '@tinkoff/dippy';
|
|
2
2
|
import type { Params as OriginalStartParams } from '../start/index';
|
|
3
3
|
import type { Params, Result } from './index';
|
|
4
|
-
import type { RunStats } from './types';
|
|
5
4
|
export interface StartParams extends Params {
|
|
6
5
|
command: 'start';
|
|
7
6
|
commandOptions: OriginalStartParams;
|
|
8
7
|
}
|
|
9
|
-
export
|
|
10
|
-
noCache?: RunStats;
|
|
11
|
-
cache?: RunStats;
|
|
12
|
-
rebuild?: RunStats;
|
|
13
|
-
}
|
|
14
|
-
export declare const benchmarkStart: (di: Container) => Promise<StartResult>;
|
|
8
|
+
export declare const benchmarkStart: (di: Container) => Promise<Result>;
|
|
15
9
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/start.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAiC,MAAM,gBAAgB,CAAC;AAEnG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAO9C,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,mBAAmB,CAAC;CACrC;AAqFD,eAAO,MAAM,cAAc,OAAc,SAAS,KAAG,QAAQ,MAAM,CAoBlE,CAAC"}
|
|
@@ -4,73 +4,80 @@ exports.benchmarkStart = void 0;
|
|
|
4
4
|
const tokens_1 = require("../../di/tokens");
|
|
5
5
|
const clearCache_1 = require("./utils/clearCache");
|
|
6
6
|
const stats_1 = require("./utils/stats");
|
|
7
|
-
const
|
|
7
|
+
const compilationUtils_1 = require("./utils/compilationUtils");
|
|
8
|
+
const const_1 = require("./const");
|
|
8
9
|
const runStartCommand = async (di, { times, shouldClearCache, }) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const clientBuildTimeSamples = [];
|
|
11
|
+
const serverBuildTimeSamples = [];
|
|
12
|
+
const clientMaxMemoryRssSamples = [];
|
|
13
|
+
const serverMaxMemoryRssSamples = [];
|
|
14
|
+
const serverCompilationTimings = [];
|
|
15
|
+
const clientCompilationTimings = [];
|
|
16
|
+
const maxMemoryRssSamples = [];
|
|
12
17
|
const { commandOptions } = di.get(tokens_1.COMMAND_PARAMETERS_TOKEN);
|
|
18
|
+
commandOptions.benchmark = true;
|
|
19
|
+
const buildType = commandOptions.buildType ?? 'all';
|
|
20
|
+
const benchmarkStartTime = new Date().toISOString();
|
|
13
21
|
for (let i = 0; i < times; i++) {
|
|
14
22
|
if (shouldClearCache) {
|
|
15
23
|
await (0, clearCache_1.clearCacheDirectory)(di);
|
|
16
24
|
}
|
|
25
|
+
const attemptStartTime = Date.now();
|
|
17
26
|
const { close, getBuildStats } = await di
|
|
18
27
|
.get(tokens_1.COMMAND_RUNNER_TOKEN)
|
|
19
28
|
.run('start', commandOptions);
|
|
20
29
|
const stats = getBuildStats();
|
|
21
30
|
await close();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
// at first attempt do not save metrics if cache is used
|
|
32
|
+
if (!shouldClearCache && i === 0) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (buildType === 'all' || buildType === 'server') {
|
|
36
|
+
serverCompilationTimings.push(await (0, compilationUtils_1.getServerCompilationTimings)(benchmarkStartTime, attemptStartTime, i));
|
|
37
|
+
serverBuildTimeSamples.push(stats.server.buildTime);
|
|
38
|
+
if (stats.server.maxMemoryRss) {
|
|
39
|
+
serverMaxMemoryRssSamples.push(stats.server.maxMemoryRss);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (buildType === 'all' || buildType === 'client') {
|
|
43
|
+
clientCompilationTimings.push(await (0, compilationUtils_1.getClientCompilationTimings)(benchmarkStartTime, attemptStartTime, i));
|
|
44
|
+
clientBuildTimeSamples.push(stats.client.buildTime);
|
|
45
|
+
if (stats.client.maxMemoryRss) {
|
|
46
|
+
clientMaxMemoryRssSamples.push(stats.client.maxMemoryRss);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (stats.maxMemoryRss) {
|
|
50
|
+
maxMemoryRssSamples.push(stats.maxMemoryRss);
|
|
51
|
+
}
|
|
25
52
|
}
|
|
26
53
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
54
|
+
serverCompilationTimings,
|
|
55
|
+
clientCompilationTimings,
|
|
56
|
+
clientMaxMemoryRssSamples,
|
|
57
|
+
serverMaxMemoryRssSamples,
|
|
58
|
+
clientBuildTimeSamples,
|
|
59
|
+
serverBuildTimeSamples,
|
|
29
60
|
maxMemoryRssSamples,
|
|
30
61
|
};
|
|
31
62
|
};
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
for (let i = 0; i < REBUILD_WARMUP_TIMES; i++) {
|
|
42
|
-
await invalidate();
|
|
63
|
+
const benchmarkStart = async (di) => {
|
|
64
|
+
const { times = const_1.DEFAULT_TIMES, commandOptions } = di.get(tokens_1.COMMAND_PARAMETERS_TOKEN);
|
|
65
|
+
const noCache = !commandOptions.fileCache;
|
|
66
|
+
let result;
|
|
67
|
+
if (noCache) {
|
|
68
|
+
result = await runStartCommand(di, {
|
|
69
|
+
times,
|
|
70
|
+
shouldClearCache: true,
|
|
71
|
+
});
|
|
43
72
|
}
|
|
44
|
-
|
|
45
|
-
await
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
73
|
+
else {
|
|
74
|
+
result = await runStartCommand(di, {
|
|
75
|
+
// additional first attempt for cache warmup
|
|
76
|
+
times: times + 1,
|
|
77
|
+
shouldClearCache: false,
|
|
78
|
+
});
|
|
50
79
|
}
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
clientSamples,
|
|
54
|
-
serverSamples,
|
|
55
|
-
maxMemoryRssSamples,
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
const benchmarkStart = async (di) => {
|
|
59
|
-
const { times = 5 } = di.get(tokens_1.COMMAND_PARAMETERS_TOKEN);
|
|
60
|
-
const noCache = await runStartCommand(di, {
|
|
61
|
-
times: Math.max(Math.floor(times / 3), 2),
|
|
62
|
-
shouldClearCache: true,
|
|
63
|
-
});
|
|
64
|
-
const cache = await runStartCommand(di, {
|
|
65
|
-
times: Math.max(Math.floor(times / 2), 2),
|
|
66
|
-
shouldClearCache: false,
|
|
67
|
-
});
|
|
68
|
-
const rebuild = await runRebuild(di, { times });
|
|
69
|
-
return {
|
|
70
|
-
cache: (0, stats_1.getResultStats)(cache),
|
|
71
|
-
noCache: (0, stats_1.getResultStats)(noCache),
|
|
72
|
-
rebuild: (0, stats_1.getResultStats)(rebuild),
|
|
73
|
-
};
|
|
80
|
+
return (0, stats_1.getResultStats)(result);
|
|
74
81
|
};
|
|
75
82
|
exports.benchmarkStart = benchmarkStart;
|
|
76
83
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/api/benchmark/start.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/api/benchmark/start.ts"],"names":[],"mappings":";;;AAGA,4CAAiF;AAGjF,mDAAyD;AACzD,yCAA+C;AAC/C,+DAAoG;AACpG,mCAAwC;AAOxC,MAAM,eAAe,GAAG,KAAK,EAC3B,EAAa,EACb,EACE,KAAK,EACL,gBAAgB,GAIjB,EACiB,EAAE;IACpB,MAAM,sBAAsB,GAAa,EAAE,CAAC;IAC5C,MAAM,sBAAsB,GAAa,EAAE,CAAC;IAC5C,MAAM,yBAAyB,GAAa,EAAE,CAAC;IAC/C,MAAM,yBAAyB,GAAa,EAAE,CAAC;IAE/C,MAAM,wBAAwB,GAAuB,EAAE,CAAC;IACxD,MAAM,wBAAwB,GAAuB,EAAE,CAAC;IAExD,MAAM,mBAAmB,GAAa,EAAE,CAAC;IAEzC,MAAM,EAAE,cAAc,EAAE,GAAG,EAA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
|
3
|
-
mean: number;
|
|
4
|
-
std: number;
|
|
5
|
-
variance: number;
|
|
6
|
-
}
|
|
7
1
|
export type Samples = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
serverCompilationTimings: CompilationStats[];
|
|
3
|
+
serverBuildTimeSamples: number[];
|
|
4
|
+
clientCompilationTimings: CompilationStats[];
|
|
5
|
+
clientBuildTimeSamples: number[];
|
|
6
|
+
maxMemoryRssSamples: number[];
|
|
7
|
+
clientMaxMemoryRssSamples: number[];
|
|
8
|
+
serverMaxMemoryRssSamples: number[];
|
|
9
|
+
};
|
|
10
|
+
export type CompilationStats = {
|
|
11
|
+
totalBuildCosts: Record<string, number>;
|
|
12
|
+
loaderBuildCosts: Record<string, number>;
|
|
13
|
+
pluginBuildCosts: Record<string, number>;
|
|
11
14
|
};
|
|
12
15
|
export type RunStats = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
serverCompilationStats: CompilationStats | undefined;
|
|
17
|
+
clientCompilationStats: CompilationStats | undefined;
|
|
18
|
+
clientBuildTime: number | undefined;
|
|
19
|
+
serverBuildTime: number | undefined;
|
|
20
|
+
clientMaxMemoryRss: number | undefined;
|
|
21
|
+
serverMaxMemoryRss: number | undefined;
|
|
22
|
+
maxMemoryRss: number | undefined;
|
|
23
|
+
};
|
|
24
|
+
type PlainObject<T = any> = {
|
|
25
|
+
[key: string]: T;
|
|
16
26
|
};
|
|
27
|
+
interface ProcessData {
|
|
28
|
+
/**
|
|
29
|
+
* process id
|
|
30
|
+
*/
|
|
31
|
+
pid: number;
|
|
32
|
+
/**
|
|
33
|
+
* parent process id
|
|
34
|
+
*/
|
|
35
|
+
ppid: number | null;
|
|
36
|
+
}
|
|
37
|
+
export interface LoaderTransformData extends ProcessData {
|
|
38
|
+
/** loader name */
|
|
39
|
+
loader: string;
|
|
40
|
+
/**
|
|
41
|
+
* loader index
|
|
42
|
+
*/
|
|
43
|
+
loaderIndex: number;
|
|
44
|
+
/** loader path */
|
|
45
|
+
path: string;
|
|
46
|
+
input: string | null | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* - isPitch: true: the result of loader.pitch()
|
|
49
|
+
* - isPitch: false: the code result of loader()
|
|
50
|
+
*/
|
|
51
|
+
result: string | null | undefined;
|
|
52
|
+
/** Timestamp when called */
|
|
53
|
+
startAt: number;
|
|
54
|
+
endAt: number;
|
|
55
|
+
/** loader configuration */
|
|
56
|
+
options: PlainObject;
|
|
57
|
+
/** pitching loader */
|
|
58
|
+
isPitch: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* is sync
|
|
61
|
+
*/
|
|
62
|
+
sync: boolean;
|
|
63
|
+
/** Error during conversion */
|
|
64
|
+
/** module layer */
|
|
65
|
+
layer?: string;
|
|
66
|
+
}
|
|
67
|
+
export type MinimalLoaderData = Pick<LoaderTransformData, 'startAt' | 'endAt' | 'pid' | 'loader'>;
|
|
68
|
+
export interface PluginData {
|
|
69
|
+
/** hook tap name */
|
|
70
|
+
tapName: string;
|
|
71
|
+
/** hook call time-consuming */
|
|
72
|
+
costs: number;
|
|
73
|
+
startAt: number;
|
|
74
|
+
endAt: number;
|
|
75
|
+
/** hook function type */
|
|
76
|
+
type: 'sync' | 'async' | 'promise';
|
|
77
|
+
/** hook function result */
|
|
78
|
+
result: any;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
17
81
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/types.ts"],"names":[],"mappings":"AAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/benchmark/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,wBAAwB,EAAE,gBAAgB,EAAE,CAAC;IAC7C,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,wBAAwB,EAAE,gBAAgB,EAAE,CAAC;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AE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAE9B,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AAElG,MAAM,WAAW,UAAU;IACzB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACnC,2BAA2B;IAC3B,MAAM,EAAE,GAAG,CAAC;CACb"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CompilationStats } from '../types';
|
|
2
|
+
export declare function getServerCompilationTimings(benchmarkStartTime: string, attemptStartTime: number, attempt: number): Promise<CompilationStats>;
|
|
3
|
+
export declare function getClientCompilationTimings(benchmarkStartTime: string, attemptStartTime: number, attempt: number): Promise<CompilationStats>;
|
|
4
|
+
//# sourceMappingURL=compilationUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compilationUtils.d.ts","sourceRoot":"","sources":["../../../../src/api/benchmark/utils/compilationUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAsD,MAAM,UAAU,CAAC;AAEhG,wBAAsB,2BAA2B,CAC/C,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,6BAGhB;AAED,wBAAsB,2BAA2B,CAC/C,kBAAkB,EAAE,MAAM,EAC1B,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,MAAM,6BAGhB"}
|