@ui5/cli 5.0.0-alpha.2 → 5.0.0-alpha.4
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 +36 -0
- package/bin/ui5.cjs +12 -1
- package/lib/cli/cli.js +1 -3
- package/lib/utils/profile.js +83 -0
- package/npm-shrinkwrap.json +1445 -1988
- package/package.json +9 -63
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,42 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
|
4
4
|
|
|
5
5
|
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-cli/compare/v4.0.26...HEAD).
|
|
6
6
|
|
|
7
|
+
## [5.0.0-alpha.4](https://github.com/UI5/cli/compare/cli-v5.0.0-alpha.3...cli-v5.0.0-alpha.4) (2026-03-24)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### chore
|
|
11
|
+
|
|
12
|
+
* **cli:** Synchronize ui5-cli-packages versions
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
* The following workspace dependencies were updated
|
|
18
|
+
* dependencies
|
|
19
|
+
* @ui5/builder bumped from ^5.0.0-alpha.3 to ^5.0.0-alpha.4
|
|
20
|
+
* @ui5/fs bumped from ^5.0.0-alpha.3 to ^5.0.0-alpha.4
|
|
21
|
+
* @ui5/logger bumped from ^5.0.0-alpha.3 to ^5.0.0-alpha.4
|
|
22
|
+
* @ui5/project bumped from ^5.0.0-alpha.3 to ^5.0.0-alpha.4
|
|
23
|
+
* @ui5/server bumped from ^5.0.0-alpha.3 to ^5.0.0-alpha.4
|
|
24
|
+
|
|
25
|
+
## [5.0.0-alpha.3](https://github.com/UI5/cli/compare/cli-v5.0.0-alpha.2...cli-v5.0.0-alpha.3) (2026-02-13)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Performance Improvements
|
|
29
|
+
|
|
30
|
+
* **cli:** Add CPU profiling support ([#1260](https://github.com/UI5/cli/issues/1260)) ([d73f6b4](https://github.com/UI5/cli/commit/d73f6b41ccb123ecb4357f6d3a178e900c070087))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Dependencies
|
|
34
|
+
|
|
35
|
+
* The following workspace dependencies were updated
|
|
36
|
+
* dependencies
|
|
37
|
+
* @ui5/builder bumped from ^5.0.0-alpha.2 to ^5.0.0-alpha.3
|
|
38
|
+
* @ui5/fs bumped from ^5.0.0-alpha.2 to ^5.0.0-alpha.3
|
|
39
|
+
* @ui5/logger bumped from ^5.0.0-alpha.2 to ^5.0.0-alpha.3
|
|
40
|
+
* @ui5/project bumped from ^5.0.0-alpha.2 to ^5.0.0-alpha.3
|
|
41
|
+
* @ui5/server bumped from ^5.0.0-alpha.2 to ^5.0.0-alpha.3
|
|
42
|
+
|
|
7
43
|
## [5.0.0-alpha.2](https://github.com/UI5/cli/compare/cli-v5.0.0-alpha.1...cli-v5.0.0-alpha.2) (2025-12-15)
|
|
8
44
|
|
|
9
45
|
|
package/bin/ui5.cjs
CHANGED
|
@@ -94,8 +94,19 @@ const ui5 = {
|
|
|
94
94
|
},
|
|
95
95
|
|
|
96
96
|
async invokeCLI(pkg) {
|
|
97
|
+
let profile;
|
|
98
|
+
if (process.env.UI5_CLI_PROFILE) {
|
|
99
|
+
profile = await import("../lib/utils/profile.js");
|
|
100
|
+
await profile.start();
|
|
101
|
+
}
|
|
97
102
|
const {default: cli} = await import("../lib/cli/cli.js");
|
|
98
|
-
await cli(pkg);
|
|
103
|
+
const argv = await cli(pkg);
|
|
104
|
+
|
|
105
|
+
// Stop profiling after CLI finished execution
|
|
106
|
+
// Except for "serve" command, which continues running and only stops on sigint (see profile.js)
|
|
107
|
+
if (profile && argv._[0] !== "serve") {
|
|
108
|
+
await profile.stop();
|
|
109
|
+
}
|
|
99
110
|
},
|
|
100
111
|
|
|
101
112
|
async main() {
|
package/lib/cli/cli.js
CHANGED
|
@@ -68,7 +68,5 @@ export default async (pkg) => {
|
|
|
68
68
|
// Format terminal output to full available width
|
|
69
69
|
cli.wrap(cli.terminalWidth());
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
// The property needs to be accessed to initialize everything.
|
|
73
|
-
cli.argv;
|
|
71
|
+
return cli.parse();
|
|
74
72
|
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import {writeFileSync} from "node:fs";
|
|
3
|
+
import {Session} from "node:inspector/promises";
|
|
4
|
+
|
|
5
|
+
let session;
|
|
6
|
+
let processSignals;
|
|
7
|
+
|
|
8
|
+
export async function start() {
|
|
9
|
+
if (session) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
session = new Session();
|
|
13
|
+
session.connect();
|
|
14
|
+
await session.post("Profiler.enable");
|
|
15
|
+
await session.post("Profiler.start");
|
|
16
|
+
console.log(`Recording CPU profile...`);
|
|
17
|
+
processSignals = registerSigHooks();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function writeProfile(profile) {
|
|
21
|
+
const formatter = new Intl.DateTimeFormat("en-GB", {
|
|
22
|
+
year: "numeric",
|
|
23
|
+
month: "2-digit",
|
|
24
|
+
day: "2-digit",
|
|
25
|
+
hour: "2-digit",
|
|
26
|
+
minute: "2-digit",
|
|
27
|
+
second: "2-digit",
|
|
28
|
+
});
|
|
29
|
+
const dateParts = Object.create(null);
|
|
30
|
+
const parts = formatter.formatToParts(new Date());
|
|
31
|
+
parts.forEach((p) => {
|
|
32
|
+
dateParts[p.type] = p.value;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const fileName = `./ui5_${dateParts.year}-${dateParts.month}-${dateParts.day}_` +
|
|
36
|
+
`${dateParts.hour}-${dateParts.minute}-${dateParts.second}.cpuprofile`;
|
|
37
|
+
console.log(`\nSaving CPU profile to ${fileName}...`);
|
|
38
|
+
writeFileSync(fileName, JSON.stringify(profile));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function stop() {
|
|
42
|
+
if (!session) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const {profile} = await session.post("Profiler.stop");
|
|
46
|
+
session = null;
|
|
47
|
+
if (profile) {
|
|
48
|
+
await writeProfile(profile);
|
|
49
|
+
}
|
|
50
|
+
if (processSignals) {
|
|
51
|
+
deregisterSigHooks(processSignals);
|
|
52
|
+
processSignals = null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function registerSigHooks() {
|
|
57
|
+
function createListener(exitCode) {
|
|
58
|
+
return function() {
|
|
59
|
+
// Gracefully end profiling, then exit
|
|
60
|
+
stop().then(() => {
|
|
61
|
+
process.exit(exitCode);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const processSignals = {
|
|
67
|
+
"SIGHUP": createListener(128 + 1),
|
|
68
|
+
"SIGINT": createListener(128 + 2),
|
|
69
|
+
"SIGTERM": createListener(128 + 15),
|
|
70
|
+
"SIGBREAK": createListener(128 + 21)
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
for (const signal of Object.keys(processSignals)) {
|
|
74
|
+
process.on(signal, processSignals[signal]);
|
|
75
|
+
}
|
|
76
|
+
return processSignals;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function deregisterSigHooks(signals) {
|
|
80
|
+
for (const signal of Object.keys(signals)) {
|
|
81
|
+
process.removeListener(signal, signals[signal]);
|
|
82
|
+
}
|
|
83
|
+
}
|