From 6cdecad0acfef5723f3a08ff8d992caabeb0fd20 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 5 Oct 2022 11:31:31 +0200 Subject: [PATCH] Removed `real_name` of the libraries. It has been removed from the gRPC API: arduino/arduino-cli#1890 This PR switches from `real_name` to `name` in the UI, as the `name` is the canonical form provided by the CLI. Closes #1525 Signed-off-by: Akos Kitta --- arduino-ide-extension/package.json | 4 +-- .../src/common/protocol/library-service.ts | 6 ---- .../cc/arduino/cli/commands/v1/lib_pb.d.ts | 4 --- .../cc/arduino/cli/commands/v1/lib_pb.js | 30 ------------------- .../src/node/examples-service-impl.ts | 4 +-- .../src/node/library-service-impl.ts | 4 +-- 6 files changed, 5 insertions(+), 47 deletions(-) diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index e9bcb6a0d..a51e42af1 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -159,9 +159,9 @@ "arduino": { "cli": { "version": { - "owner": "cmaglie", + "owner": "arduino", "repo": "arduino-cli", - "commitish": "download_progress_refactor" + "commitish": "c8ff042" } }, "fwuploader": { diff --git a/arduino-ide-extension/src/common/protocol/library-service.ts b/arduino-ide-extension/src/common/protocol/library-service.ts index bd7d2bfd7..fb01356d2 100644 --- a/arduino-ide-extension/src/common/protocol/library-service.ts +++ b/arduino-ide-extension/src/common/protocol/library-service.ts @@ -162,12 +162,6 @@ export enum LibraryLocation { } export interface LibraryPackage extends ArduinoComponent { - /** - * Same as [`Library#real_name`](https://arduino.github.io/arduino-cli/latest/rpc/commands/#library). - * Should be used for the UI, and `name` is used to uniquely identify a library. It does not have an ID. - */ - readonly label: string; - /** * An array of string that should be included into the `ino` file if this library is used. * For example, including `SD` will prepend `#include ` to the `ino` file. While including `Bridge` diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts index 1437d3e0a..93c23d8f3 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts @@ -765,9 +765,6 @@ export class Library extends jspb.Message { getContainerPlatform(): string; setContainerPlatform(value: string): Library; - getRealName(): string; - setRealName(value: string): Library; - getDotALinkage(): boolean; setDotALinkage(value: boolean): Library; @@ -836,7 +833,6 @@ export namespace Library { sourceDir: string, utilityDir: string, containerPlatform: string, - realName: string, dotALinkage: boolean, precompiled: boolean, ldFlags: string, diff --git a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js index 6c9c870f1..4b3c39af4 100644 --- a/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js +++ b/arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js @@ -5447,7 +5447,6 @@ proto.cc.arduino.cli.commands.v1.Library.toObject = function(includeInstance, ms sourceDir: jspb.Message.getFieldWithDefault(msg, 11, ""), utilityDir: jspb.Message.getFieldWithDefault(msg, 12, ""), containerPlatform: jspb.Message.getFieldWithDefault(msg, 14, ""), - realName: jspb.Message.getFieldWithDefault(msg, 16, ""), dotALinkage: jspb.Message.getBooleanFieldWithDefault(msg, 17, false), precompiled: jspb.Message.getBooleanFieldWithDefault(msg, 18, false), ldFlags: jspb.Message.getFieldWithDefault(msg, 19, ""), @@ -5548,10 +5547,6 @@ proto.cc.arduino.cli.commands.v1.Library.deserializeBinaryFromReader = function( var value = /** @type {string} */ (reader.readString()); msg.setContainerPlatform(value); break; - case 16: - var value = /** @type {string} */ (reader.readString()); - msg.setRealName(value); - break; case 17: var value = /** @type {boolean} */ (reader.readBool()); msg.setDotALinkage(value); @@ -5724,13 +5719,6 @@ proto.cc.arduino.cli.commands.v1.Library.serializeBinaryToWriter = function(mess f ); } - f = message.getRealName(); - if (f.length > 0) { - writer.writeString( - 16, - f - ); - } f = message.getDotALinkage(); if (f) { writer.writeBool( @@ -6084,24 +6072,6 @@ proto.cc.arduino.cli.commands.v1.Library.prototype.setContainerPlatform = functi }; -/** - * optional string real_name = 16; - * @return {string} - */ -proto.cc.arduino.cli.commands.v1.Library.prototype.getRealName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 16, "")); -}; - - -/** - * @param {string} value - * @return {!proto.cc.arduino.cli.commands.v1.Library} returns this - */ -proto.cc.arduino.cli.commands.v1.Library.prototype.setRealName = function(value) { - return jspb.Message.setProto3StringField(this, 16, value); -}; - - /** * optional bool dot_a_linkage = 17; * @return {boolean} diff --git a/arduino-ide-extension/src/node/examples-service-impl.ts b/arduino-ide-extension/src/node/examples-service-impl.ts index 1bf43c470..63860c555 100644 --- a/arduino-ide-extension/src/node/examples-service-impl.ts +++ b/arduino-ide-extension/src/node/examples-service-impl.ts @@ -124,11 +124,11 @@ export class ExamplesServiceImpl implements ExamplesService { * location of the examples. Otherwise it creates the example container from the direct examples FS paths. */ private async tryGroupExamples({ - label, + name, exampleUris, installDirUri, }: LibraryPackage): Promise { - const container = SketchContainer.create(label); + const container = SketchContainer.create(name); if (!installDirUri || !exampleUris.length) { return container; } diff --git a/arduino-ide-extension/src/node/library-service-impl.ts b/arduino-ide-extension/src/node/library-service-impl.ts index c7f1c28b4..bdd9631f1 100644 --- a/arduino-ide-extension/src/node/library-service-impl.ts +++ b/arduino-ide-extension/src/node/library-service-impl.ts @@ -66,7 +66,7 @@ export class LibraryServiceImpl if (installedLib.hasLibrary()) { const lib = installedLib.getLibrary(); if (lib) { - installedLibsIdx.set(lib.getRealName(), installedLib); + installedLibsIdx.set(lib.getName(), installedLib); } } } @@ -210,7 +210,6 @@ export class LibraryServiceImpl return toLibrary( { name: library.getName(), - label: library.getRealName(), installedVersion, installable: true, description: library.getSentence(), @@ -443,7 +442,6 @@ function toLibrary( ): LibraryPackage { return { name: '', - label: '', exampleUris: [], installable: false, deprecated: false,