Skip to content

Commit 807b2ad

Browse files
author
Akos Kitta
committed
Support of the CLI config.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent c7bf98d commit 807b2ad

File tree

95 files changed

+2947
-22433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2947
-22433
lines changed

.gitignore

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ build/
88
src-gen/
99
*webpack.config.js
1010
.DS_Store
11-
/workspace/static
12-
.DS_Store
1311
# switching from `electron` to `browser` in dev mode.
1412
.browser_modules
15-
# LS logs
16-
inols*.log
17-
yarn-error.log
13+
yarn*.log
14+
# For the VS Code extensions used by Theia.
15+
plugins
16+
# generated JS/TS for the gRPC API
17+
arduino-ide-extension/src/node/cli-protocol
18+
# the config files for the CLI
19+
arduino-ide-extension/data/cli/config

.vscode/launch.json

+4-27
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"--hostname=localhost",
3737
"--no-cluster",
3838
"--remote-debugging-port=9222",
39-
"--no-app-auto-install"
39+
"--no-app-auto-install",
40+
"--plugins=local-dir:plugins"
4041
],
4142
"env": {
4243
"NODE_ENV": "development"
@@ -61,7 +62,8 @@
6162
"--hostname=0.0.0.0",
6263
"--port=3000",
6364
"--no-cluster",
64-
"--no-app-auto-install"
65+
"--no-app-auto-install",
66+
"--plugins=local-dir:plugins"
6567
],
6668
"windows": {
6769
"env": {
@@ -81,31 +83,6 @@
8183
"smartStep": true,
8284
"internalConsoleOptions": "openOnSessionStart",
8385
"outputCapture": "std"
84-
},
85-
{
86-
"type": "node",
87-
"request": "launch",
88-
"name": "App (Browser - Debug CLI daemon)",
89-
"program": "${workspaceRoot}/browser-app/src-gen/backend/main.js",
90-
"args": [
91-
"--hostname=0.0.0.0",
92-
"--port=3000",
93-
"--no-cluster",
94-
"--no-app-auto-install",
95-
"--debug-cli=true"
96-
],
97-
"env": {
98-
"NODE_ENV": "development"
99-
},
100-
"sourceMaps": true,
101-
"outFiles": [
102-
"${workspaceRoot}/browser-app/src-gen/backend/*.js",
103-
"${workspaceRoot}/browser-app/lib/**/*.js",
104-
"${workspaceRoot}/arduino-ide-extension/lib/**/*.js"
105-
],
106-
"smartStep": true,
107-
"internalConsoleOptions": "openOnSessionStart",
108-
"outputCapture": "std"
10986
}
11087
]
11188
}

.vscode/tasks.json

+79-47
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,80 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
"label": "Arduino Editor - Start Browser Example",
8-
"type": "shell",
9-
"command": "yarn --cwd ./browser-app start",
10-
"group": "build",
11-
"presentation": {
12-
"reveal": "always",
13-
"panel": "new",
14-
"clear": true
15-
}
16-
},
17-
{
18-
"label": "Arduino Editor - Watch Theia Extension",
19-
"type": "shell",
20-
"command": "yarn --cwd ./arduino-ide-extension watch",
21-
"group": "build",
22-
"presentation": {
23-
"reveal": "always",
24-
"panel": "new",
25-
"clear": false
26-
}
27-
},
28-
{
29-
"label": "Arduino Editor - Watch Browser Example",
30-
"type": "shell",
31-
"command": "yarn --cwd ./browser-app watch",
32-
"group": "build",
33-
"presentation": {
34-
"reveal": "always",
35-
"panel": "new",
36-
"clear": false
37-
}
38-
},
39-
{
40-
"label": "Arduino Editor - Watch All",
41-
"type": "shell",
42-
"dependsOn": [
43-
"Arduino Editor - Watch Theia Extension",
44-
"Arduino Editor - Watch Browser Example"
45-
]
46-
}
47-
]
48-
}
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Arduino Pro IDE - Start Browser App",
8+
"type": "shell",
9+
"command": "yarn --cwd ./browser-app start",
10+
"group": "build",
11+
"presentation": {
12+
"reveal": "always",
13+
"panel": "new",
14+
"clear": true
15+
}
16+
},
17+
{
18+
"label": "Arduino Pro IDE - Watch IDE Extension",
19+
"type": "shell",
20+
"command": "yarn --cwd ./arduino-ide-extension watch",
21+
"group": "build",
22+
"presentation": {
23+
"reveal": "always",
24+
"panel": "new",
25+
"clear": false
26+
}
27+
},
28+
{
29+
"label": "Arduino Pro IDE - Watch Debugger Extension",
30+
"type": "shell",
31+
"command": "yarn --cwd ./arduino-debugger-extension watch",
32+
"group": "build",
33+
"presentation": {
34+
"reveal": "always",
35+
"panel": "new",
36+
"clear": false
37+
}
38+
},
39+
{
40+
"label": "Arduino Pro IDE - Watch Browser App",
41+
"type": "shell",
42+
"command": "yarn --cwd ./browser-app watch",
43+
"group": "build",
44+
"presentation": {
45+
"reveal": "always",
46+
"panel": "new",
47+
"clear": false
48+
}
49+
},
50+
{
51+
"label": "Arduino Pro IDE - Watch Electron App",
52+
"type": "shell",
53+
"command": "yarn --cwd ./electron-app watch",
54+
"group": "build",
55+
"presentation": {
56+
"reveal": "always",
57+
"panel": "new",
58+
"clear": false
59+
}
60+
},
61+
{
62+
"label": "Arduino Pro IDE - Watch All [Browser]",
63+
"type": "shell",
64+
"dependsOn": [
65+
"Arduino Pro IDE - Watch IDE Extension",
66+
"Arduino Pro IDE - Watch Debugger Extension",
67+
"Arduino Pro IDE - Watch Browser App"
68+
]
69+
},
70+
{
71+
"label": "Arduino Pro IDE - Watch All [Electron]",
72+
"type": "shell",
73+
"dependsOn": [
74+
"Arduino Pro IDE - Watch IDE Extension",
75+
"Arduino Pro IDE - Watch Debugger Extension",
76+
"Arduino Pro IDE - Watch Electron App"
77+
]
78+
}
79+
]
80+
}

arduino-debugger-extension/package.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,9 @@
2020
"build": "tsc && yarn lint",
2121
"watch": "tsc -w"
2222
},
23-
"devDependencies": {
24-
"rimraf": "^2.6.1",
25-
"tslint": "^5.5.0",
26-
"typescript": "3.5.1"
27-
},
2823
"files": [
2924
"lib",
30-
"src",
31-
"build",
32-
"data"
25+
"src"
3326
],
3427
"theiaExtensions": [
3528
{

arduino-debugger-extension/src/node/arduino-debug-adapter-contribution.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { injectable, inject } from 'inversify';
33
import { DebugAdapterContribution, DebugAdapterExecutable } from '@theia/debug/lib/common/debug-model';
44
import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration';
55
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
6-
import { ArduinoCli } from 'arduino-ide-extension/lib/node/arduino-cli';
6+
import { ArduinoDaemonImpl } from 'arduino-ide-extension/lib/node/arduino-daemon-impl';
77

88
@injectable()
99
export class ArduinoDebugAdapterContribution implements DebugAdapterContribution {
@@ -12,7 +12,7 @@ export class ArduinoDebugAdapterContribution implements DebugAdapterContribution
1212
readonly label = 'Arduino';
1313
readonly languages = ['c', 'cpp', 'ino'];
1414

15-
@inject(ArduinoCli) arduinoCli: ArduinoCli;
15+
@inject(ArduinoDaemonImpl) daemon: ArduinoDaemonImpl;
1616

1717
getSchemaAttributes(): IJSONSchema[] {
1818
return [
@@ -66,7 +66,7 @@ export class ArduinoDebugAdapterContribution implements DebugAdapterContribution
6666
const startFunction = config.pauseAtMain ? 'main' : 'setup';
6767
const res: ActualDebugConfig = {
6868
...config,
69-
arduinoCli: await this.arduinoCli.getExecPath(),
69+
arduinoCli: await this.daemon.getExecPath(),
7070
fqbn: '${fqbn}',
7171
uploadPort: '${port}',
7272
initCommands: [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"$id": "http://arduino.cc/arduino-cli.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"title": "Arduino CLI Configuration",
6+
"properties": {
7+
"board_manager": {
8+
"type": "object",
9+
"description": "Board Manager Configuration",
10+
"properties": {
11+
"additional_urls": {
12+
"type": "array",
13+
"description": "If your board requires 3rd party core packages to work, you can list the URLs to additional package indexes in the Arduino CLI configuration file.",
14+
"items": {
15+
"type": "string",
16+
"description": "URL pointing to the 3rd party core package index JSON.",
17+
"pattern": "^(.*)$"
18+
},
19+
"additionalProperties": false
20+
}
21+
},
22+
"additionalProperties": false
23+
},
24+
"daemon": {
25+
"type": "object",
26+
"description": "CLI Daemon Configuration",
27+
"properties": {
28+
"port": {
29+
"type": [
30+
"string",
31+
"number"
32+
],
33+
"description": "The CLI daemon port where the gRPC clients can connect to.",
34+
"pattern": "^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$",
35+
"additionalProperties": false
36+
}
37+
},
38+
"additionalProperties": false
39+
},
40+
"directories": {
41+
"type": "object",
42+
"description": "Directories Configuration",
43+
"properties": {
44+
"data": {
45+
"type": "string",
46+
"description": "Path to the the data folder where core packages will be stored.",
47+
"pattern": "^(.*)$"
48+
},
49+
"downloads": {
50+
"type": "string",
51+
"description": "Path to the staging folder.",
52+
"pattern": "^(.*)$"
53+
},
54+
"user": {
55+
"type": "string",
56+
"description": "Path to the sketchbooks.",
57+
"pattern": "^(.*)$"
58+
}
59+
},
60+
"additionalProperties": false
61+
},
62+
"logging": {
63+
"type": "object",
64+
"description": "Logging Configuration",
65+
"properties": {
66+
"file": {
67+
"type": "string",
68+
"description": "Path to the file where logs will be written.",
69+
"pattern": "^(.*)$"
70+
},
71+
"format": {
72+
"type": "string",
73+
"description": "The output format for the logs, can be 'text' or 'json'",
74+
"enum": [
75+
"text",
76+
"json"
77+
]
78+
},
79+
"level": {
80+
"type": "string",
81+
"description": "Messages with this level and above will be logged.",
82+
"enum": [
83+
"trace",
84+
"debug",
85+
"info",
86+
"warning",
87+
"error",
88+
"fatal",
89+
"panic"
90+
]
91+
}
92+
},
93+
"additionalProperties": false
94+
},
95+
"telemetry": {
96+
"type": "object",
97+
"description": "Telemetry Configuration",
98+
"properties": {
99+
"addr": {
100+
"type": "string",
101+
"description": "Address to the telemetry endpoint. Must be a full address with host, address, and port. For instance, ':9090' represents 'localhost:9090'",
102+
"pattern": "^(.*)$"
103+
},
104+
"enabled": {
105+
"type": "boolean",
106+
"description": "Whether the telemetry is enabled or not."
107+
},
108+
"additionalProperties": false
109+
},
110+
"additionalProperties": false
111+
}
112+
},
113+
"additionalProperties": false
114+
}

0 commit comments

Comments
 (0)