From 34420ed8cdb4ce2f84ffae58bf0d150ee0dc422b Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Mon, 29 Nov 2021 22:40:25 +0100 Subject: [PATCH 1/3] Adding support for RP2040. Work in progress. --- src/chrome-app-daemon.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chrome-app-daemon.js b/src/chrome-app-daemon.js index 753bb31f..cc9abf20 100644 --- a/src/chrome-app-daemon.js +++ b/src/chrome-app-daemon.js @@ -237,10 +237,9 @@ export default class ChromeOsDaemon extends Daemon { * data: "compiled sketch" * } */ - _upload({ - board, port, commandline, data - }) { - try { + _upload(uploadPayload, uploadCommandInfo) { + const { board, port, commandline, data } = uploadPayload; + try { window.oauth.token().then(token => { this.channel.postMessage({ command: 'upload', @@ -249,7 +248,8 @@ export default class ChromeOsDaemon extends Daemon { port, commandline, data, - token: token.token + token: token.token, + extrafiles: uploadCommandInfo.files || [] } }); }); From bffbc2b0048b1b505a8ee47c26955420d37cd9a9 Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Thu, 9 Dec 2021 12:14:27 +0100 Subject: [PATCH 2/3] Support compilation extrafiles on ChromeOS Similarly to what has been done in #498, we're adding support to extrafiles compilation on ChromeOS as well. See also https://github.com/arduino/arduino-create-agent-js-client/pull/498 --- package.json | 2 +- src/chrome-app-daemon.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7ce8ec7b..d1a13354 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.6.0", + "version": "2.7.0", "description": "JS module providing discovery of the Arduino Create Plugin and communication with it", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/chrome-app-daemon.js b/src/chrome-app-daemon.js index cc9abf20..5e687631 100644 --- a/src/chrome-app-daemon.js +++ b/src/chrome-app-daemon.js @@ -239,7 +239,8 @@ export default class ChromeOsDaemon extends Daemon { */ _upload(uploadPayload, uploadCommandInfo) { const { board, port, commandline, data } = uploadPayload; - try { + const extrafiles = uploadCommandInfo && uploadCommandInfo.files && Array.isArray(uploadCommandInfo.files) || [] + try { window.oauth.token().then(token => { this.channel.postMessage({ command: 'upload', @@ -249,7 +250,7 @@ export default class ChromeOsDaemon extends Daemon { commandline, data, token: token.token, - extrafiles: uploadCommandInfo.files || [] + extrafiles } }); }); From 7315a39c2f140757a1081a49e5a20e59342f6751 Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Thu, 9 Dec 2021 12:53:32 +0100 Subject: [PATCH 3/3] Fixed wrong check on 'uploadCommandInfo.files' --- src/chrome-app-daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chrome-app-daemon.js b/src/chrome-app-daemon.js index 5e687631..507f2f33 100644 --- a/src/chrome-app-daemon.js +++ b/src/chrome-app-daemon.js @@ -239,7 +239,7 @@ export default class ChromeOsDaemon extends Daemon { */ _upload(uploadPayload, uploadCommandInfo) { const { board, port, commandline, data } = uploadPayload; - const extrafiles = uploadCommandInfo && uploadCommandInfo.files && Array.isArray(uploadCommandInfo.files) || [] + const extrafiles = uploadCommandInfo && uploadCommandInfo.files && Array.isArray(uploadCommandInfo.files) ? uploadCommandInfo.files : []; try { window.oauth.token().then(token => { this.channel.postMessage({