@kvell007/embed-labs-cli 0.1.0-alpha.11 → 0.1.0-alpha.12
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 +37 -11
- package/dist/index.js.map +1 -1
- package/dist/local-toolchain.d.ts +40 -5
- package/dist/local-toolchain.js +244 -59
- package/dist/local-toolchain.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -83,8 +83,8 @@ const BUILD_IMAGE_DTB_USAGE = "Usage: embed build image dtb --dtb <local.dtb|loc
|
|
|
83
83
|
const IMAGE_DTB_COMPOSE_USAGE = "Usage: embed image dtb compose --package <dtb-package.json> --base-image <boot.img|image.img> --output <image> [--manifest <manifest.json>] [--force] [--json]";
|
|
84
84
|
const LOCAL_TOOLCHAIN_LATEST_USAGE = "Usage: embed local toolchain latest [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--json]";
|
|
85
85
|
const LOCAL_TOOLCHAIN_CURRENT_USAGE = "Usage: embed local toolchain current [--install-root <path>] [--json]";
|
|
86
|
-
const LOCAL_TOOLCHAIN_INSTALL_USAGE = "Usage: embed local toolchain install [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--force] [--json]\nDefault source: the production download channel at download.embedboard.com.";
|
|
87
|
-
const LOCAL_TOOLCHAIN_VALIDATE_USAGE = "Usage: embed local toolchain validate [--release-root <path>] [--json]";
|
|
86
|
+
const LOCAL_TOOLCHAIN_INSTALL_USAGE = "Usage: embed local toolchain install [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--mode minimal|compile|qt|full|images] [--force] [--json]\nDefault source: the production download channel at download.embedboard.com.";
|
|
87
|
+
const LOCAL_TOOLCHAIN_VALIDATE_USAGE = "Usage: embed local toolchain validate [--release-root <path>] [--mode minimal|compile|qt|full|images] [--json]";
|
|
88
88
|
const LOCAL_COMPILE_TAISHANPI_USAGE = "Usage: embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--release-root <path>] [--account <account_id>] [--json]";
|
|
89
89
|
const LOCAL_BUILD_QT_SMOKE_USAGE = "Usage: embed local build qt-smoke --build-dir <dir> [--source <qt-smoke-dir>] [--release-root <path>] [--account <account_id>] [--json]";
|
|
90
90
|
const BOARD_REGISTRY_LIST_USAGE = "Usage: embed board registry list [--json]";
|
|
@@ -543,7 +543,7 @@ async function main(argv) {
|
|
|
543
543
|
if (typeof request === "string") {
|
|
544
544
|
return output(parsed, fail("invalid_args", request), undefined, 2);
|
|
545
545
|
}
|
|
546
|
-
return output(parsed, ok(await validateLocalToolchain(request
|
|
546
|
+
return output(parsed, ok(await validateLocalToolchain(request)), renderLocalToolchainValidation);
|
|
547
547
|
}
|
|
548
548
|
if (action === "compile" && parsed.command[2] === "taishanpi") {
|
|
549
549
|
const request = localCompileTaishanPiRequest(parsed, await authStatus());
|
|
@@ -4164,7 +4164,7 @@ function localToolchainCurrentRequest(parsed) {
|
|
|
4164
4164
|
return { installRoot: installRoot.value };
|
|
4165
4165
|
}
|
|
4166
4166
|
function localToolchainInstallRequest(parsed) {
|
|
4167
|
-
const unknownFlag = firstUnknownFlag(parsed, ["json", "board", "board-id", "channel", "metadata-root", "source-url", "source-release-root", "install-root", "force"]);
|
|
4167
|
+
const unknownFlag = firstUnknownFlag(parsed, ["json", "board", "board-id", "channel", "metadata-root", "source-url", "source-release-root", "install-root", "mode", "force"]);
|
|
4168
4168
|
if (unknownFlag) {
|
|
4169
4169
|
return `Unknown flag --${unknownFlag}. ${LOCAL_TOOLCHAIN_INSTALL_USAGE}`;
|
|
4170
4170
|
}
|
|
@@ -4193,6 +4193,9 @@ function localToolchainInstallRequest(parsed) {
|
|
|
4193
4193
|
const installRoot = optionalTrimmedStringFlag(parsed, "install-root");
|
|
4194
4194
|
if (installRoot.error)
|
|
4195
4195
|
return installRoot.error;
|
|
4196
|
+
const mode = optionalTrimmedStringFlag(parsed, "mode");
|
|
4197
|
+
if (mode.error)
|
|
4198
|
+
return mode.error;
|
|
4196
4199
|
return {
|
|
4197
4200
|
boardId: board.value,
|
|
4198
4201
|
channel: channel.value,
|
|
@@ -4200,11 +4203,12 @@ function localToolchainInstallRequest(parsed) {
|
|
|
4200
4203
|
sourceUrl: sourceUrl.value,
|
|
4201
4204
|
sourceReleaseRoot: sourceReleaseRoot.value,
|
|
4202
4205
|
installRoot: installRoot.value,
|
|
4206
|
+
mode: mode.value,
|
|
4203
4207
|
force: booleanFlag(parsed, "force")
|
|
4204
4208
|
};
|
|
4205
4209
|
}
|
|
4206
4210
|
function localToolchainValidateRequest(parsed) {
|
|
4207
|
-
const unknownFlag = firstUnknownFlag(parsed, ["json", "release-root"]);
|
|
4211
|
+
const unknownFlag = firstUnknownFlag(parsed, ["json", "release-root", "mode"]);
|
|
4208
4212
|
if (unknownFlag) {
|
|
4209
4213
|
return `Unknown flag --${unknownFlag}. ${LOCAL_TOOLCHAIN_VALIDATE_USAGE}`;
|
|
4210
4214
|
}
|
|
@@ -4216,7 +4220,11 @@ function localToolchainValidateRequest(parsed) {
|
|
|
4216
4220
|
if (releaseRoot.error) {
|
|
4217
4221
|
return releaseRoot.error;
|
|
4218
4222
|
}
|
|
4219
|
-
|
|
4223
|
+
const mode = optionalTrimmedStringFlag(parsed, "mode");
|
|
4224
|
+
if (mode.error) {
|
|
4225
|
+
return mode.error;
|
|
4226
|
+
}
|
|
4227
|
+
return { releaseRoot: releaseRoot.value, mode: mode.value };
|
|
4220
4228
|
}
|
|
4221
4229
|
function localCompileTaishanPiRequest(parsed, auth) {
|
|
4222
4230
|
const unknownFlag = firstUnknownFlag(parsed, ["json", "source", "output", "release-root", "account", "account-id"]);
|
|
@@ -5359,11 +5367,19 @@ function renderLocalToolchainLatest(result) {
|
|
|
5359
5367
|
`version=${result.version}`,
|
|
5360
5368
|
`host=${result.host}`,
|
|
5361
5369
|
result.metadata_root ? `metadata_root=${result.metadata_root}` : "metadata=built-in",
|
|
5362
|
-
result.download ? `download=${result.download.mirror_kind}:${result.download.source_url}` : "",
|
|
5363
|
-
result.download ? `archive_sha256=${result.download.archive.sha256}` : "",
|
|
5364
|
-
result.download ? `archive_size_bytes=${result.download.archive.size_bytes}` : "",
|
|
5370
|
+
result.download?.source_url ? `download=${result.download.mirror_kind}:${result.download.source_url}` : "",
|
|
5371
|
+
result.download?.archive ? `archive_sha256=${result.download.archive.sha256}` : "",
|
|
5372
|
+
result.download?.archive ? `archive_size_bytes=${result.download.archive.size_bytes}` : "",
|
|
5373
|
+
result.download?.components?.length ? `components=${result.download.components.length}` : "",
|
|
5374
|
+
result.download?.default_mode ? `default_mode=${result.download.default_mode}` : "",
|
|
5365
5375
|
result.download_error ? `download_error=${result.download_error}` : ""
|
|
5366
5376
|
].filter(Boolean);
|
|
5377
|
+
if (result.download?.components?.length) {
|
|
5378
|
+
lines.push("download_components:");
|
|
5379
|
+
for (const component of result.download.components) {
|
|
5380
|
+
lines.push(` ${component.id}@${component.version} modes=${component.install_modes?.join(",") || "all"} bytes=${component.archive.size_bytes}`);
|
|
5381
|
+
}
|
|
5382
|
+
}
|
|
5367
5383
|
if (result.packages.length > 0) {
|
|
5368
5384
|
lines.push("packages:");
|
|
5369
5385
|
for (const pkg of result.packages) {
|
|
@@ -5386,6 +5402,7 @@ function renderLocalToolchainCurrent(result) {
|
|
|
5386
5402
|
`board=${result.board_id}`,
|
|
5387
5403
|
result.version ? `version=${result.version}` : "",
|
|
5388
5404
|
result.channel ? `channel=${result.channel}` : "",
|
|
5405
|
+
result.mode ? `mode=${result.mode}` : "",
|
|
5389
5406
|
result.release_root ? `release_root=${result.release_root}` : "",
|
|
5390
5407
|
`install_root=${result.install_root}`,
|
|
5391
5408
|
`registry=${result.registry_path}`
|
|
@@ -5398,13 +5415,21 @@ function renderLocalToolchainInstall(result) {
|
|
|
5398
5415
|
`version=${result.version}`,
|
|
5399
5416
|
`channel=${result.channel}`,
|
|
5400
5417
|
`host=${result.host}`,
|
|
5418
|
+
`mode=${result.mode}`,
|
|
5401
5419
|
`install_root=${result.install_root}`,
|
|
5402
5420
|
`release_root=${result.release_root}`,
|
|
5403
5421
|
`registry=${result.registry_path}`,
|
|
5404
5422
|
`source=${result.source.kind}:${result.source.value}`,
|
|
5405
5423
|
result.source.downloaded_path ? `downloaded=${result.source.downloaded_path}` : "",
|
|
5424
|
+
result.source.components?.length ? `components=${result.source.components.length}` : "",
|
|
5406
5425
|
`validation=${result.validation.ok ? "ok" : "failed"}`
|
|
5407
5426
|
].filter(Boolean);
|
|
5427
|
+
if (result.source.components?.length) {
|
|
5428
|
+
lines.push("installed_components:");
|
|
5429
|
+
for (const component of result.source.components) {
|
|
5430
|
+
lines.push(` ${component.id}@${component.version} ${component.mirror_kind || ""} bytes=${component.size_bytes}`);
|
|
5431
|
+
}
|
|
5432
|
+
}
|
|
5408
5433
|
if (result.installed_paths.length > 0) {
|
|
5409
5434
|
lines.push("installed_paths:");
|
|
5410
5435
|
for (const installedPath of result.installed_paths) {
|
|
@@ -5423,6 +5448,7 @@ function renderLocalToolchainValidation(result) {
|
|
|
5423
5448
|
const lines = [
|
|
5424
5449
|
result.ok ? "Local toolchain ready." : "Local toolchain not ready.",
|
|
5425
5450
|
`board=${result.board_id}`,
|
|
5451
|
+
`mode=${result.mode}`,
|
|
5426
5452
|
`host=${result.host.platform}/${result.host.arch}`,
|
|
5427
5453
|
`release_root=${result.release_root}`
|
|
5428
5454
|
];
|
|
@@ -6450,9 +6476,9 @@ Usage:
|
|
|
6450
6476
|
embed image boot-logo compose --package <boot-logo-package.json> --base-image <boot.img|image.img> --output <image> [--manifest <manifest.json>] [--force] [--json]
|
|
6451
6477
|
embed local toolchain latest [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--json]
|
|
6452
6478
|
embed local toolchain current [--install-root <path>] [--json]
|
|
6453
|
-
embed local toolchain install [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--force] [--json]
|
|
6479
|
+
embed local toolchain install [--board taishanpi-1m-rk3566] [--channel stable] [--metadata-root <path>] [--source-url <tar.gz-url>|--source-release-root <path>] [--install-root <path>] [--mode minimal|compile|qt|full|images] [--force] [--json]
|
|
6454
6480
|
Defaults to the production download channel at download.embedboard.com.
|
|
6455
|
-
embed local toolchain validate [--release-root <path>] [--json]
|
|
6481
|
+
embed local toolchain validate [--release-root <path>] [--mode minimal|compile|qt|full|images] [--json]
|
|
6456
6482
|
embed local compile taishanpi --source <main.c|main.cpp> --output <artifact> [--release-root <path>] [--account <account_id>] [--json]
|
|
6457
6483
|
embed local build qt-smoke --build-dir <dir> [--source <qt-smoke-dir>] [--release-root <path>] [--account <account_id>] [--json]
|
|
6458
6484
|
embed debug tools [--json]
|