Skip to content

Commit 0fb9a06

Browse files
authored
Merge ed60048 into 964ea3b
2 parents 964ea3b + ed60048 commit 0fb9a06

File tree

174 files changed

+6404
-7058
lines changed

Some content is hidden

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

174 files changed

+6404
-7058
lines changed

Diff for: .eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
'docs/*',
1717
'scripts/*',
1818
'electron-app/*',
19+
'!electron-app/webpack.config.js',
1920
'plugins/*',
2021
'arduino-ide-extension/src/node/cli-protocol',
2122
],

Diff for: .github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- os: windows-2019
4343
certificate-secret: WINDOWS_SIGNING_CERTIFICATE_PFX # Name of the secret that contains the certificate.
4444
certificate-password-secret: WINDOWS_SIGNING_CERTIFICATE_PASSWORD # Name of the secret that contains the certificate password.
45-
certificate-extension: pfx # File extension for the certificate.
45+
certificate-extension: pfx # File extension for the certificate.
4646
- os: ubuntu-20.04
4747
- os: macos-latest
4848
# APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from:
@@ -57,10 +57,10 @@ jobs:
5757
- name: Checkout
5858
uses: actions/checkout@v3
5959

60-
- name: Install Node.js 16.x
60+
- name: Install Node.js 16.14
6161
uses: actions/setup-node@v3
6262
with:
63-
node-version: '16.x'
63+
node-version: '16.14'
6464
registry-url: 'https://registry.npmjs.org'
6565

6666
- name: Install Python 3.x

Diff for: .github/workflows/check-i18n-task.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ jobs:
2929
- name: Checkout repository
3030
uses: actions/checkout@v3
3131

32-
- name: Install Node.js 16.x
32+
- name: Install Node.js 16.14
3333
uses: actions/setup-node@v3
3434
with:
35-
node-version: '16.x'
35+
node-version: '16.14'
3636
registry-url: 'https://registry.npmjs.org'
3737

3838
- name: Install Go

Diff for: .github/workflows/i18n-nightly-push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v3
1818

19-
- name: Install Node.js 16.x
19+
- name: Install Node.js 16.14
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: '16.x'
22+
node-version: '16.14'
2323
registry-url: 'https://registry.npmjs.org'
2424

2525
- name: Install Go

Diff for: .github/workflows/i18n-weekly-pull.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v3
1818

19-
- name: Install Node.js 16.x
19+
- name: Install Node.js 16.14
2020
uses: actions/setup-node@v3
2121
with:
22-
node-version: '16.x'
22+
node-version: '16.14'
2323
registry-url: 'https://registry.npmjs.org'
2424

2525
- name: Install Go

Diff for: .gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build/
77
arduino-ide-extension/Examples/
88
!electron/build/
99
src-gen/
10-
webpack.config.js
10+
electron/build/webpack.config.js
1111
gen-webpack.config.js
1212
.DS_Store
1313
# switching from `electron` to `browser` in dev mode.

Diff for: arduino-ide-extension/package.json

+35-25
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"compose-changelog": "node ./scripts/compose-changelog.js",
1010
"download-cli": "node ./scripts/download-cli.js",
1111
"download-fwuploader": "node ./scripts/download-fwuploader.js",
12-
"copy-i18n": "npx ncp ../i18n ./build/i18n",
12+
"copy-i18n": "ncp ../i18n ./build/i18n",
1313
"download-ls": "node ./scripts/download-ls.js",
1414
"download-examples": "node ./scripts/download-examples.js",
1515
"generate-protocol": "node ./scripts/generate-protocol.js",
@@ -21,28 +21,28 @@
2121
"test:watch": "mocha --watch --watch-files lib \"./lib/test/**/*.test.js\""
2222
},
2323
"dependencies": {
24-
"@grpc/grpc-js": "^1.6.7",
25-
"@theia/application-package": "1.31.1",
26-
"@theia/core": "1.31.1",
27-
"@theia/debug": "1.31.1",
28-
"@theia/editor": "1.31.1",
29-
"@theia/electron": "1.31.1",
30-
"@theia/filesystem": "1.31.1",
31-
"@theia/keymaps": "1.31.1",
32-
"@theia/markers": "1.31.1",
33-
"@theia/messages": "1.31.1",
34-
"@theia/monaco": "1.31.1",
35-
"@theia/monaco-editor-core": "1.67.2",
36-
"@theia/navigator": "1.31.1",
37-
"@theia/outline-view": "1.31.1",
38-
"@theia/output": "1.31.1",
39-
"@theia/plugin-ext": "1.31.1",
40-
"@theia/preferences": "1.31.1",
41-
"@theia/scm": "1.31.1",
42-
"@theia/search-in-workspace": "1.31.1",
43-
"@theia/terminal": "1.31.1",
44-
"@theia/typehierarchy": "1.31.1",
45-
"@theia/workspace": "1.31.1",
24+
"@grpc/grpc-js": "^1.8.14",
25+
"@theia/application-package": "1.37.0",
26+
"@theia/core": "1.37.0",
27+
"@theia/debug": "1.37.0",
28+
"@theia/editor": "1.37.0",
29+
"@theia/electron": "1.37.0",
30+
"@theia/filesystem": "1.37.0",
31+
"@theia/keymaps": "1.37.0",
32+
"@theia/markers": "1.37.0",
33+
"@theia/messages": "1.37.0",
34+
"@theia/monaco": "1.37.0",
35+
"@theia/monaco-editor-core": "1.72.3",
36+
"@theia/navigator": "1.37.0",
37+
"@theia/outline-view": "1.37.0",
38+
"@theia/output": "1.37.0",
39+
"@theia/plugin-ext": "1.37.0",
40+
"@theia/preferences": "1.37.0",
41+
"@theia/scm": "1.37.0",
42+
"@theia/search-in-workspace": "1.37.0",
43+
"@theia/terminal": "1.37.0",
44+
"@theia/typehierarchy": "1.37.0",
45+
"@theia/workspace": "1.37.0",
4646
"@tippyjs/react": "^4.2.5",
4747
"@types/auth0-js": "^9.14.0",
4848
"@types/btoa": "^1.2.3",
@@ -51,6 +51,7 @@
5151
"@types/glob": "^7.2.0",
5252
"@types/google-protobuf": "^3.7.2",
5353
"@types/js-yaml": "^3.12.2",
54+
"@types/jsdom": "^21.1.1",
5455
"@types/keytar": "^4.4.0",
5556
"@types/lodash.debounce": "^4.0.6",
5657
"@types/node-fetch": "^2.5.7",
@@ -65,7 +66,7 @@
6566
"auth0-js": "^9.14.0",
6667
"btoa": "^1.2.1",
6768
"classnames": "^2.3.1",
68-
"cpy": "^8.1.2",
69+
"cpy": "^10.0.0",
6970
"cross-fetch": "^3.1.5",
7071
"dateformat": "^3.0.3",
7172
"deepmerge": "^4.2.2",
@@ -76,8 +77,9 @@
7677
"glob": "^7.1.6",
7778
"google-protobuf": "^3.20.1",
7879
"hash.js": "^1.1.7",
79-
"is-online": "^9.0.1",
80+
"is-online": "^10.0.0",
8081
"js-yaml": "^3.13.1",
82+
"jsdom": "^21.1.1",
8183
"jsonc-parser": "^2.2.0",
8284
"just-diff": "^5.1.1",
8385
"jwt-decode": "^3.1.2",
@@ -88,6 +90,7 @@
8890
"open": "^8.0.6",
8991
"p-debounce": "^2.1.0",
9092
"p-queue": "^2.4.2",
93+
"process": "^0.11.10",
9194
"ps-tree": "^1.2.0",
9295
"query-string": "^7.0.1",
9396
"react-disable": "^0.1.1",
@@ -101,6 +104,7 @@
101104
"temp": "^0.9.1",
102105
"temp-dir": "^2.0.0",
103106
"tree-kill": "^1.2.1",
107+
"util": "^0.12.5",
104108
"which": "^1.3.1"
105109
},
106110
"devDependencies": {
@@ -147,6 +151,9 @@
147151
"examples"
148152
],
149153
"theiaExtensions": [
154+
{
155+
"preload": "lib/electron-browser/preload"
156+
},
150157
{
151158
"backend": "lib/node/arduino-ide-backend-module",
152159
"frontend": "lib/browser/arduino-ide-frontend-module"
@@ -157,6 +164,9 @@
157164
{
158165
"frontendElectron": "lib/electron-browser/theia/core/electron-window-module"
159166
},
167+
{
168+
"frontendElectron": "lib/electron-browser/electron-arduino-module"
169+
},
160170
{
161171
"electronMain": "lib/electron-main/arduino-electron-main-module"
162172
}

Diff for: arduino-ide-extension/scripts/download-examples.js

+14-16
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,29 @@
44
const version = '1.10.0';
55

66
(async () => {
7-
const os = require('os');
8-
const { promises: fs } = require('fs');
9-
const path = require('path');
7+
const os = require('node:os');
8+
const { promises: fs } = require('node:fs');
9+
const path = require('node:path');
1010
const shell = require('shelljs');
1111
const { v4 } = require('uuid');
12+
const { exec } = require('./utils');
1213

1314
const repository = path.join(os.tmpdir(), `${v4()}-arduino-examples`);
1415
if (shell.mkdir('-p', repository).code !== 0) {
1516
shell.exit(1);
1617
}
1718

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-
}
19+
exec(
20+
'git',
21+
['clone', 'https://github.com/arduino/arduino-examples.git', repository],
22+
shell
23+
);
2524

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

3331
const destination = path.join(__dirname, '..', 'Examples');
3432
shell.mkdir('-p', destination);

Diff for: arduino-ide-extension/scripts/download-fwuploader.js

+3-79
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// @ts-check
22

33
(async () => {
4-
const fs = require('fs');
5-
const path = require('path');
6-
const temp = require('temp');
4+
const path = require('node:path');
75
const shell = require('shelljs');
86
const semver = require('semver');
97
const downloader = require('./downloader');
8+
const { taskBuildFromGit } = require('./utils');
109

1110
const version = (() => {
1211
const pkg = require(path.join(__dirname, '..', 'package.json'));
@@ -86,81 +85,6 @@
8685
shell.exit(1);
8786
}
8887
} else {
89-
// We assume an object with `owner`, `repo`, commitish?` properties.
90-
const { owner, repo, commitish } = version;
91-
if (!owner) {
92-
shell.echo(`Could not retrieve 'owner' from ${JSON.stringify(version)}`);
93-
shell.exit(1);
94-
}
95-
if (!repo) {
96-
shell.echo(`Could not retrieve 'repo' from ${JSON.stringify(version)}`);
97-
shell.exit(1);
98-
}
99-
const url = `https://github.com/${owner}/${repo}.git`;
100-
shell.echo(
101-
`Building Firmware Uploader from ${url}. Commitish: ${
102-
commitish ? commitish : 'HEAD'
103-
}`
104-
);
105-
106-
if (fs.existsSync(destinationPath)) {
107-
shell.echo(
108-
`Skipping the Firmware Uploader build because it already exists: ${destinationPath}`
109-
);
110-
return;
111-
}
112-
113-
if (shell.mkdir('-p', buildFolder).code !== 0) {
114-
shell.echo('Could not create build folder.');
115-
shell.exit(1);
116-
}
117-
118-
const tempRepoPath = temp.mkdirSync();
119-
shell.echo(`>>> Cloning Firmware Uploader source to ${tempRepoPath}...`);
120-
if (shell.exec(`git clone ${url} ${tempRepoPath}`).code !== 0) {
121-
shell.exit(1);
122-
}
123-
shell.echo('<<< Cloned Firmware Uploader repo.');
124-
125-
if (commitish) {
126-
shell.echo(`>>> Checking out ${commitish}...`);
127-
if (
128-
shell.exec(`git -C ${tempRepoPath} checkout ${commitish}`).code !== 0
129-
) {
130-
shell.exit(1);
131-
}
132-
shell.echo(`<<< Checked out ${commitish}.`);
133-
}
134-
135-
shell.echo(`>>> Building the Firmware Uploader...`);
136-
if (shell.exec('go build', { cwd: tempRepoPath }).code !== 0) {
137-
shell.exit(1);
138-
}
139-
shell.echo('<<< Firmware Uploader build done.');
140-
141-
if (!fs.existsSync(path.join(tempRepoPath, fwuploderName))) {
142-
shell.echo(
143-
`Could not find the Firmware Uploader at ${path.join(
144-
tempRepoPath,
145-
fwuploderName
146-
)}.`
147-
);
148-
shell.exit(1);
149-
}
150-
151-
const builtFwUploaderPath = path.join(tempRepoPath, fwuploderName);
152-
shell.echo(
153-
`>>> Copying Firmware Uploader from ${builtFwUploaderPath} to ${destinationPath}...`
154-
);
155-
if (shell.cp(builtFwUploaderPath, destinationPath).code !== 0) {
156-
shell.exit(1);
157-
}
158-
shell.echo(`<<< Copied the Firmware Uploader.`);
159-
160-
shell.echo('<<< Verifying Firmware Uploader...');
161-
if (!fs.existsSync(destinationPath)) {
162-
shell.exit(1);
163-
}
164-
shell.echo('>>> Verified Firmware Uploader.');
88+
taskBuildFromGit(version, destinationPath, 'Firmware Uploader');
16589
}
16690
})();

0 commit comments

Comments
 (0)