Skip to content

Commit

Permalink
feat: use Arduino CLI 1.0.4 (#2457)
Browse files Browse the repository at this point in the history
* fix: use `@pingghost/protoc` to compile proto files

The npm package previously used (`protoc`) is still lacking apple arm32 support, see YePpHa/node-protoc#10

* feat: use Arduino CLI 1.0.4

* fix: allow use of node16 in github actions

* chore: update `arduino-language-server` version for cli-1.0.0

* fix: deprecated platform order test

Arduino deprecated platforms should have more priority then other deprecated ones
  • Loading branch information
giacomocusinato authored Sep 6, 2024
1 parent c3adde5 commit 1ec0a8c
Show file tree
Hide file tree
Showing 28 changed files with 10,139 additions and 1,897 deletions.
6 changes: 3 additions & 3 deletions arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
},
"optionalDependencies": {
"grpc-tools": "^1.12.4",
"protoc": "^1.0.4"
"@pingghost/protoc": "^1.0.2"
},
"mocha": {
"require": [
Expand Down Expand Up @@ -170,7 +170,7 @@
],
"arduino": {
"arduino-cli": {
"version": "0.36.0-rc.1"
"version": "1.0.4"
},
"arduino-fwuploader": {
"version": "2.4.1"
Expand All @@ -179,7 +179,7 @@
"version": {
"owner": "arduino",
"repo": "arduino-language-server",
"commitish": "91c2ba8"
"commitish": "05ec308"
}
},
"clangd": {
Expand Down
5 changes: 3 additions & 2 deletions arduino-ide-extension/scripts/generate-protocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
const { exec } = require('./utils');
const glob = require('glob');
const { SemVer, gte, valid: validSemVer } = require('semver');
const protoc = path.dirname(require('protoc/protoc'));

// Use a node-protoc fork until apple arm32 is supported
// https://github.com/YePpHa/node-protoc/pull/10
const protoc = path.dirname(require('@pingghost/protoc/protoc'));
const repository = await fs.mkdtemp(path.join(os.tmpdir(), 'arduino-cli-'));

const { owner, repo, commitish } = (() => {
Expand Down
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/node/boards-service-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ function createBoardsPackage(
if (!actualRelease) {
return undefined;
}
const { name, typeList, boardsList, deprecated, compatible } = actualRelease;
const { name, typesList, boardsList, deprecated, compatible } = actualRelease;
if (!compatible) {
return undefined; // never show incompatible platforms
}
Expand All @@ -602,7 +602,7 @@ function createBoardsPackage(
),
description: boardsList.map(({ name }) => name).join(', '),
boards: boardsList,
types: typeList,
types: typesList,
moreInfoLink: website,
author: maintainer,
deprecated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ export class BoardListResponse extends jspb.Message {
getPortsList(): Array<DetectedPort>;
setPortsList(value: Array<DetectedPort>): BoardListResponse;
addPorts(value?: DetectedPort, index?: number): DetectedPort;
clearWarningsList(): void;
getWarningsList(): Array<string>;
setWarningsList(value: Array<string>): BoardListResponse;
addWarnings(value: string, index?: number): string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardListResponse.AsObject;
Expand All @@ -398,6 +402,7 @@ export class BoardListResponse extends jspb.Message {
export namespace BoardListResponse {
export type AsObject = {
portsList: Array<DetectedPort.AsObject>,
warningsList: Array<string>,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3387,7 +3387,7 @@ proto.cc.arduino.cli.commands.v1.BoardListRequest.prototype.setFqbn = function(v
* @private {!Array<number>}
* @const
*/
proto.cc.arduino.cli.commands.v1.BoardListResponse.repeatedFields_ = [1];
proto.cc.arduino.cli.commands.v1.BoardListResponse.repeatedFields_ = [1,2];



Expand Down Expand Up @@ -3421,7 +3421,8 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.toObject = function
proto.cc.arduino.cli.commands.v1.BoardListResponse.toObject = function(includeInstance, msg) {
var f, obj = {
portsList: jspb.Message.toObjectList(msg.getPortsList(),
proto.cc.arduino.cli.commands.v1.DetectedPort.toObject, includeInstance)
proto.cc.arduino.cli.commands.v1.DetectedPort.toObject, includeInstance),
warningsList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
};

if (includeInstance) {
Expand Down Expand Up @@ -3463,6 +3464,10 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.deserializeBinaryFromReader =
reader.readMessage(value,proto.cc.arduino.cli.commands.v1.DetectedPort.deserializeBinaryFromReader);
msg.addPorts(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.addWarnings(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -3500,6 +3505,13 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.serializeBinaryToWriter = fun
proto.cc.arduino.cli.commands.v1.DetectedPort.serializeBinaryToWriter
);
}
f = message.getWarningsList();
if (f.length > 0) {
writer.writeRepeatedString(
2,
f
);
}
};


Expand Down Expand Up @@ -3541,6 +3553,43 @@ proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.clearPortsList = fu
};


/**
* repeated string warnings = 2;
* @return {!Array<string>}
*/
proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.getWarningsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
};


/**
* @param {!Array<string>} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardListResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.setWarningsList = function(value) {
return jspb.Message.setField(this, 2, value || []);
};


/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.cc.arduino.cli.commands.v1.BoardListResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.addWarnings = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
};


/**
* Clears the list making it empty but non-null.
* @return {!proto.cc.arduino.cli.commands.v1.BoardListResponse} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListResponse.prototype.clearWarningsList = function() {
return this.setWarningsList([]);
};



/**
* List of repeated fields within this message type.
Expand Down
Loading

0 comments on commit 1ec0a8c

Please sign in to comment.