@kvell007/embed-labs-cli 0.1.0-alpha.36 → 0.1.0-alpha.38
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/dist/index.js +50 -4
- package/dist/index.js.map +1 -1
- package/dist/local-toolchain.d.ts +9 -0
- package/dist/local-toolchain.js +169 -1
- package/dist/local-toolchain.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6976,7 +6976,14 @@ function renderLocalToolchainList(result) {
|
|
|
6976
6976
|
lines.push(` update_command=${environment.update_command}`);
|
|
6977
6977
|
}
|
|
6978
6978
|
if (environment.components?.length) {
|
|
6979
|
-
lines.push(`
|
|
6979
|
+
lines.push(` component_catalog=${localToolchainComponentSummary(environment.components)}`);
|
|
6980
|
+
if (environment.latest.default_mode) {
|
|
6981
|
+
lines.push(` default_mode_download=${environment.latest.default_mode}: ${localToolchainComponentSummaryForMode(environment.components, environment.latest.default_mode)}`);
|
|
6982
|
+
}
|
|
6983
|
+
if (environment.installed?.mode && environment.installed.mode !== environment.latest.default_mode) {
|
|
6984
|
+
lines.push(` installed_mode_components=${environment.installed.mode}: ${localToolchainComponentSummaryForMode(environment.components, environment.installed.mode)}`);
|
|
6985
|
+
}
|
|
6986
|
+
lines.push(` mode_downloads=${localToolchainModeSummaries(environment.install_modes, environment.components).join("; ")}`);
|
|
6980
6987
|
lines.push(` package_groups=${localToolchainComponentGroups(environment.components).join(", ")}`);
|
|
6981
6988
|
lines.push(` detail_command=embedlabs local toolchain latest --board ${environment.board_id}`);
|
|
6982
6989
|
}
|
|
@@ -7001,7 +7008,21 @@ function localToolchainStatusLabel(status) {
|
|
|
7001
7008
|
}
|
|
7002
7009
|
function localToolchainComponentSummary(components) {
|
|
7003
7010
|
const totalBytes = components.reduce((total, component) => total + component.size_bytes, 0);
|
|
7004
|
-
return `${components.length}
|
|
7011
|
+
return `${components.length} components, ${formatByteSize(totalBytes)}`;
|
|
7012
|
+
}
|
|
7013
|
+
function localToolchainComponentSummaryForMode(components, mode) {
|
|
7014
|
+
return localToolchainComponentSummary(localToolchainComponentsForMode(components, mode));
|
|
7015
|
+
}
|
|
7016
|
+
function localToolchainModeSummaries(modes, components) {
|
|
7017
|
+
return modes.map((mode) => `${mode}=${localToolchainComponentSummaryForMode(components, mode)}`);
|
|
7018
|
+
}
|
|
7019
|
+
function localToolchainComponentsForMode(components, mode) {
|
|
7020
|
+
return components.filter((component) => {
|
|
7021
|
+
if (!component.install_modes?.length) {
|
|
7022
|
+
return true;
|
|
7023
|
+
}
|
|
7024
|
+
return component.install_modes.includes(mode);
|
|
7025
|
+
});
|
|
7005
7026
|
}
|
|
7006
7027
|
function localToolchainComponentGroups(components) {
|
|
7007
7028
|
const groups = new Set();
|
|
@@ -7057,9 +7078,16 @@ function renderLocalToolchainLatest(result) {
|
|
|
7057
7078
|
result.download_error ? `download_error=${result.download_error}` : ""
|
|
7058
7079
|
].filter(Boolean);
|
|
7059
7080
|
if (result.download?.components?.length) {
|
|
7081
|
+
const modes = [...new Set(result.download.components.flatMap((component) => component.install_modes ?? ["all"]))].filter((mode) => mode !== "all");
|
|
7082
|
+
if (result.download.default_mode) {
|
|
7083
|
+
lines.push(`default_mode_download=${result.download.default_mode}: ${localToolchainDownloadComponentSummaryForMode(result.download.components, result.download.default_mode)}`);
|
|
7084
|
+
}
|
|
7085
|
+
if (modes.length > 0) {
|
|
7086
|
+
lines.push(`mode_downloads=${modes.map((mode) => `${mode}=${localToolchainDownloadComponentSummaryForMode(result.download?.components ?? [], mode)}`).join("; ")}`);
|
|
7087
|
+
}
|
|
7060
7088
|
lines.push("download_components:");
|
|
7061
7089
|
for (const component of result.download.components) {
|
|
7062
|
-
lines.push(` ${component.id}@${component.version} modes=${component.install_modes?.join(",") || "all"}
|
|
7090
|
+
lines.push(` ${component.id}@${component.version} modes=${component.install_modes?.join(",") || "all"} size=${formatByteSize(component.archive.size_bytes)} file=${component.archive.file}`);
|
|
7063
7091
|
}
|
|
7064
7092
|
}
|
|
7065
7093
|
if (result.packages.length > 0) {
|
|
@@ -7070,6 +7098,11 @@ function renderLocalToolchainLatest(result) {
|
|
|
7070
7098
|
}
|
|
7071
7099
|
return lines.join("\n");
|
|
7072
7100
|
}
|
|
7101
|
+
function localToolchainDownloadComponentSummaryForMode(components, mode) {
|
|
7102
|
+
const selected = localToolchainComponentsForMode(components ?? [], mode);
|
|
7103
|
+
const totalBytes = selected.reduce((total, component) => total + component.archive.size_bytes, 0);
|
|
7104
|
+
return `${selected.length} components, ${formatByteSize(totalBytes)}`;
|
|
7105
|
+
}
|
|
7073
7106
|
function renderLocalToolchainCurrent(result) {
|
|
7074
7107
|
if (!result.installed) {
|
|
7075
7108
|
return [
|
|
@@ -7132,11 +7165,24 @@ function renderLocalToolchainValidation(result) {
|
|
|
7132
7165
|
`board=${result.board_id}`,
|
|
7133
7166
|
`mode=${result.mode}`,
|
|
7134
7167
|
`host=${result.host.platform}/${result.host.arch}`,
|
|
7135
|
-
`release_root=${result.release_root}
|
|
7168
|
+
`release_root=${result.release_root}`,
|
|
7169
|
+
`summary=${result.summary_for_user}`
|
|
7136
7170
|
];
|
|
7171
|
+
if (!result.ok && result.missing_groups.length > 0) {
|
|
7172
|
+
lines.push(`missing_groups=${result.missing_groups.join(", ")}`);
|
|
7173
|
+
}
|
|
7174
|
+
if (result.repair_command) {
|
|
7175
|
+
lines.push(`repair_command=${result.repair_command}`);
|
|
7176
|
+
}
|
|
7137
7177
|
for (const check of result.checked_paths) {
|
|
7138
7178
|
lines.push(`${check.exists ? "ok" : "missing"} ${check.label}: ${check.path}`);
|
|
7139
7179
|
}
|
|
7180
|
+
if (result.path_leaks.length > 0) {
|
|
7181
|
+
lines.push("path_leaks:");
|
|
7182
|
+
for (const leak of result.path_leaks) {
|
|
7183
|
+
lines.push(` ${leak.label}: ${leak.path} contains ${leak.forbidden}`);
|
|
7184
|
+
}
|
|
7185
|
+
}
|
|
7140
7186
|
if (result.notes.length > 0) {
|
|
7141
7187
|
lines.push("notes:");
|
|
7142
7188
|
for (const note of result.notes) {
|