Skip to content

Commit 64a5ac8

Browse files
committed
fix: patch for missing google proto files in CLI
Use the `google proto files from the `v1.0.4` release for the time being Ref: arduino/arduino-cli#2755 Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
1 parent 979f92b commit 64a5ac8

File tree

6 files changed

+44
-34
lines changed

6 files changed

+44
-34
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"typescript.tsc.autoDetect": "off",
33
"typescript.tsdk": "./node_modules/typescript/lib",
44
"editor.codeActionsOnSave": {
5-
"source.fixAll.eslint": true
5+
"source.fixAll.eslint": "explicit"
66
}
77
}

.vscode/tasks.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
{
3737
"id": "source",
38-
"default": "0.33.0-rc1",
38+
"default": "v1.1.0",
3939
"type": "promptString",
4040
"description": "The source to genegare from. It can be an Arduino CLI version (as a semver), a GitHub commitish, or a filesystem path with the proto file"
4141
}

package-lock.json

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ardunno-cli-gen",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "Generates nice-grpc API for the Arduino CLI",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/generate.ts

+10
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,16 @@ async function download(
284284
const archive = await Open.file(zipPath);
285285
const protoPath = join(path, 'rpc');
286286
await archive.extract({ path: protoPath });
287+
// Patch for https://github.com/arduino/arduino-cli/issues/2755
288+
// Download the 1.0.4 version and use the missing google/rpc/status.proto
289+
if (semver.version !== '1.0.4') {
290+
const { protoPath: v104ProtoPath, dispose: v104Dispose } =
291+
await download(new SemVer('v1.0.4'));
292+
await fs.cp(join(v104ProtoPath, 'google'), join(protoPath, 'google'), {
293+
recursive: true,
294+
});
295+
v104Dispose();
296+
}
287297
return {
288298
protoPath,
289299
dispose: () => rimraf(path) as Promise<unknown> as Promise<void>,

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "es2016",
3+
"target": "ES2018",
44
"module": "Node16",
55
"moduleResolution": "node16",
66
"esModuleInterop": true,

0 commit comments

Comments
 (0)