Skip to content

Commit c65ca78

Browse files
author
Alberto Iannaccone
committed
Merge branch 'startup-time-signed' of github.com:arduino/arduino-ide into pluggable-monitor
# Conflicts: # arduino-ide-extension/package.json # arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx # arduino-ide-extension/src/browser/dialogs/firmware-uploader/firmware-uploader-dialog.tsx # arduino-ide-extension/src/browser/serial/monitor/monitor-widget.tsx # arduino-ide-extension/src/browser/serial/monitor/serial-monitor-send-input.tsx # arduino-ide-extension/src/node/arduino-ide-backend-module.ts
2 parents 7b15a44 + 5b60cb4 commit c65ca78

File tree

182 files changed

+3339
-1925
lines changed

Some content is hidden

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

182 files changed

+3339
-1925
lines changed
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: themes-weekly-pull
2+
3+
on:
4+
schedule:
5+
# run every friday at 5AM
6+
- cron: '0 5 * * 5'
7+
workflow_dispatch:
8+
9+
env:
10+
NODE_VERSION: 14.x
11+
12+
jobs:
13+
pull-from-jsonbin:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: ${{ env.NODE_VERSION }}
23+
registry-url: 'https://registry.npmjs.org'
24+
25+
- name: Install dependencies
26+
run: yarn
27+
28+
- name: Run themes:pull script
29+
run: yarn run themes:pull
30+
env:
31+
JSONBIN_MASTER_KEY: ${{ secrets.JSONBIN_MASTER_KEY }}
32+
JSONBIN_ID: ${{ secrets.JSONBIN_ID }}
33+
34+
- name: Generate dark tokens
35+
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/dark.json core,ide-default,ide-dark,theia core,ide-default,ide-dark
36+
37+
- name: Generate default tokens
38+
run: npx token-transformer scripts/themes/tokens/arduino-tokens.json scripts/themes/tokens/default.json core,ide-default,theia core,ide-default
39+
40+
- name: Run themes:generate script
41+
run: yarn run themes:generate
42+
43+
- name: Create Pull Request
44+
uses: peter-evans/create-pull-request@v4
45+
with:
46+
commit-message: Updated themes
47+
title: Update themes
48+
branch: themes/themes-update
49+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ yarn*.log
1717
plugins
1818
# the config files for the CLI
1919
arduino-ide-extension/data/cli/config
20+
# the tokens folder for the themes
21+
scripts/themes/tokens
22+
# environment variables
23+
.env
24+
# content trace files for electron
25+
electron-app/traces

.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"singleQuote": true,
33
"tabWidth": 2,
44
"useTabs": false,
5-
"printWidth": 80
5+
"printWidth": 80,
6+
"endOfLine": "auto"
67
}

.vscode/launch.json

+38-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "App (Electron) [Dev]",
8+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
9+
"windows": {
10+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
11+
},
12+
"cwd": "${workspaceFolder}/electron-app",
13+
"args": [
14+
".",
15+
"--log-level=debug",
16+
"--hostname=localhost",
17+
"--no-cluster",
18+
"--app-project-path=${workspaceRoot}/electron-app",
19+
"--remote-debugging-port=9222",
20+
"--no-app-auto-install",
21+
"--plugins=local-dir:../plugins",
22+
"--hosted-plugin-inspect=9339",
23+
"--nosplash",
24+
"--content-trace",
25+
"--open-devtools"
26+
],
27+
"env": {
28+
"NODE_ENV": "development"
29+
},
30+
"sourceMaps": true,
31+
"outFiles": [
32+
"${workspaceRoot}/electron-app/src-gen/backend/*.js",
33+
"${workspaceRoot}/electron-app/src-gen/frontend/*.js",
34+
"${workspaceRoot}/electron-app/lib/**/*.js",
35+
"${workspaceRoot}/arduino-ide-extension/lib/**/*.js",
36+
"${workspaceRoot}/node_modules/@theia/**/*.js"
37+
],
38+
"smartStep": true,
39+
"internalConsoleOptions": "openOnSessionStart",
40+
"outputCapture": "std"
41+
},
442
{
543
"type": "node",
644
"request": "launch",
@@ -10,7 +48,6 @@
1048
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
1149
},
1250
"cwd": "${workspaceFolder}/electron-app",
13-
"protocol": "inspector",
1451
"args": [
1552
".",
1653
"--log-level=debug",
@@ -78,7 +115,6 @@
78115
{
79116
"type": "node",
80117
"request": "launch",
81-
"protocol": "inspector",
82118
"name": "Run Test [current]",
83119
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
84120
"args": [

arduino-ide-extension/package.json

+7-9
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
"test:watch": "mocha --watch --watch-files lib \"./lib/test/**/*.test.js\""
2222
},
2323
"dependencies": {
24-
"@grpc/grpc-js": "^1.3.7",
24+
"@grpc/grpc-js": "^1.6.7",
2525
"@theia/application-package": "1.25.0",
2626
"@theia/core": "1.25.0",
2727
"@theia/editor": "1.25.0",
2828
"@theia/editor-preview": "1.25.0",
2929
"@theia/electron": "1.25.0",
3030
"@theia/filesystem": "1.25.0",
31-
"@theia/git": "1.25.0",
3231
"@theia/keymaps": "1.25.0",
3332
"@theia/markers": "1.25.0",
3433
"@theia/monaco": "1.25.0",
@@ -45,7 +44,7 @@
4544
"@types/btoa": "^1.2.3",
4645
"@types/dateformat": "^3.0.1",
4746
"@types/deepmerge": "^2.2.0",
48-
"@types/glob": "^5.0.35",
47+
"@types/glob": "^7.2.0",
4948
"@types/google-protobuf": "^3.7.2",
5049
"@types/js-yaml": "^3.12.2",
5150
"@types/keytar": "^4.4.0",
@@ -63,14 +62,12 @@
6362
"atob": "^2.1.2",
6463
"auth0-js": "^9.14.0",
6564
"btoa": "^1.2.1",
66-
"css-element-queries": "^1.2.0",
6765
"dateformat": "^3.0.3",
6866
"deepmerge": "2.0.1",
6967
"electron-updater": "^4.6.5",
70-
"fuzzy": "^0.1.3",
68+
"fast-safe-stringify": "^2.1.1",
7169
"glob": "^7.1.6",
72-
"google-protobuf": "^3.11.4",
73-
"grpc": "^1.24.11",
70+
"google-protobuf": "^3.20.1",
7471
"hash.js": "^1.1.7",
7572
"is-valid-path": "^0.1.1",
7673
"js-yaml": "^3.13.1",
@@ -91,6 +88,7 @@
9188
"semver": "^7.3.2",
9289
"string-natural-compare": "^2.0.3",
9390
"temp": "^0.9.1",
91+
"temp-dir": "^2.0.0",
9492
"tree-kill": "^1.2.1",
9593
"upath": "^1.1.2",
9694
"url": "^0.11.0",
@@ -160,10 +158,10 @@
160158
"version": "0.23.0-rc1"
161159
},
162160
"fwuploader": {
163-
"version": "2.0.0"
161+
"version": "2.2.0"
164162
},
165163
"clangd": {
166-
"version": "13.0.0"
164+
"version": "14.0.0"
167165
},
168166
"languageServer": {
169167
"version": "0.6.0"

arduino-ide-extension/scripts/download-examples.js

+84-21
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,93 @@
44
const version = '1.9.1';
55

66
(async () => {
7+
const os = require('os');
8+
const { promises: fs } = require('fs');
9+
const path = require('path');
10+
const shell = require('shelljs');
11+
const { v4 } = require('uuid');
712

8-
const os = require('os');
9-
const path = require('path');
10-
const shell = require('shelljs');
11-
const { v4 } = require('uuid');
13+
const repository = path.join(os.tmpdir(), `${v4()}-arduino-examples`);
14+
if (shell.mkdir('-p', repository).code !== 0) {
15+
shell.exit(1);
16+
}
1217

13-
const repository = path.join(os.tmpdir(), `${v4()}-arduino-examples`);
14-
if (shell.mkdir('-p', repository).code !== 0) {
15-
shell.exit(1);
16-
process.exit(1);
17-
}
18-
19-
if (shell.exec(`git clone https://github.com/arduino/arduino-examples.git ${repository}`).code !== 0) {
20-
shell.exit(1);
21-
process.exit(1);
22-
}
18+
if (
19+
shell.exec(
20+
`git clone https://github.com/arduino/arduino-examples.git ${repository}`
21+
).code !== 0
22+
) {
23+
shell.exit(1);
24+
}
2325

24-
if (shell.exec(`git -C ${repository} checkout tags/${version} -b ${version}`).code !== 0) {
25-
shell.exit(1);
26-
process.exit(1);
27-
}
26+
if (
27+
shell.exec(`git -C ${repository} checkout tags/${version} -b ${version}`)
28+
.code !== 0
29+
) {
30+
shell.exit(1);
31+
}
2832

29-
const destination = path.join(__dirname, '..', 'Examples');
30-
shell.mkdir('-p', destination);
31-
shell.cp('-fR', path.join(repository, 'examples', '*'), destination);
33+
const destination = path.join(__dirname, '..', 'Examples');
34+
shell.mkdir('-p', destination);
35+
shell.cp('-fR', path.join(repository, 'examples', '*'), destination);
3236

37+
const isSketch = async (pathLike) => {
38+
try {
39+
const names = await fs.readdir(pathLike);
40+
const dirName = path.basename(pathLike);
41+
return names.indexOf(`${dirName}.ino`) !== -1;
42+
} catch (e) {
43+
if (e.code === 'ENOTDIR') {
44+
return false;
45+
}
46+
throw e;
47+
}
48+
};
49+
const examples = [];
50+
const categories = await fs.readdir(destination);
51+
const visit = async (pathLike, container) => {
52+
const stat = await fs.lstat(pathLike);
53+
if (stat.isDirectory()) {
54+
if (await isSketch(pathLike)) {
55+
container.sketches.push({
56+
name: path.basename(pathLike),
57+
relativePath: path.relative(destination, pathLike),
58+
});
59+
} else {
60+
const names = await fs.readdir(pathLike);
61+
for (const name of names) {
62+
const childPath = path.join(pathLike, name);
63+
if (await isSketch(childPath)) {
64+
container.sketches.push({
65+
name,
66+
relativePath: path.relative(destination, childPath),
67+
});
68+
} else {
69+
const child = {
70+
label: name,
71+
children: [],
72+
sketches: [],
73+
};
74+
container.children.push(child);
75+
await visit(childPath, child);
76+
}
77+
}
78+
}
79+
}
80+
};
81+
for (const category of categories) {
82+
const example = {
83+
label: category,
84+
children: [],
85+
sketches: [],
86+
};
87+
await visit(path.join(destination, category), example);
88+
examples.push(example);
89+
}
90+
await fs.writeFile(
91+
path.join(destination, 'examples.json'),
92+
JSON.stringify(examples, null, 2),
93+
{ encoding: 'utf8' }
94+
);
95+
shell.echo(`Generated output to ${path.join(destination, 'examples.json')}`);
3396
})();

arduino-ide-extension/scripts/download-ls.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,24 @@
6666
build,
6767
`arduino-language-server${platform === 'win32' ? '.exe' : ''}`
6868
);
69-
let clangdExecutablePath, lsSuffix, clangdSuffix;
69+
let clangdExecutablePath, clangFormatExecutablePath, lsSuffix, clangdSuffix;
7070

7171
switch (platformArch) {
7272
case 'darwin-x64':
7373
clangdExecutablePath = path.join(build, 'clangd');
74+
clangFormatExecutablePath = path.join(build, 'clang-format');
7475
lsSuffix = 'macOS_64bit.tar.gz';
7576
clangdSuffix = 'macOS_64bit';
7677
break;
7778
case 'linux-x64':
7879
clangdExecutablePath = path.join(build, 'clangd');
80+
clangFormatExecutablePath = path.join(build, 'clang-format');
7981
lsSuffix = 'Linux_64bit.tar.gz';
8082
clangdSuffix = 'Linux_64bit';
8183
break;
8284
case 'win32-x64':
8385
clangdExecutablePath = path.join(build, 'clangd.exe');
86+
clangFormatExecutablePath = path.join(build, 'clang-format.exe');
8487
lsSuffix = 'Windows_64bit.zip';
8588
clangdSuffix = 'Windows_64bit';
8689
break;
@@ -103,4 +106,15 @@
103106
downloader.downloadUnzipAll(clangdUrl, build, clangdExecutablePath, force, {
104107
strip: 1,
105108
}); // `strip`: the new clangd (12.x) is zipped into a folder, so we have to strip the outmost folder.
109+
110+
const clangdFormatUrl = `https://downloads.arduino.cc/tools/clang-format_${clangdVersion}_${clangdSuffix}.tar.bz2`;
111+
downloader.downloadUnzipAll(
112+
clangdFormatUrl,
113+
build,
114+
clangFormatExecutablePath,
115+
force,
116+
{
117+
strip: 1,
118+
}
119+
);
106120
})();

0 commit comments

Comments
 (0)