Skip to content

Commit 19a0a31

Browse files
author
Akos Kitta
committed
fix: remove network timeout
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent a0651ac commit 19a0a31

File tree

3 files changed

+37
-30
lines changed

3 files changed

+37
-30
lines changed

electron/build/template-package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"main": "scripts/arduino-ide-electron-main.js",
33
"author": "Arduino SA",
44
"resolutions": {
5+
"electron-builder": "23.0.2",
56
"**/fs-extra": "^4.0.3"
67
},
78
"dependencies": {

electron/packager/index.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
theia,
164164
dependencies: appPackageJson.dependencies,
165165
devDependencies: appPackageJson.devDependencies,
166-
// VS Code extensions and the plugins folder is defined in the top level `package.json`. The template picks them up.
166+
// VS Code extensions and the plugins folder is defined in the root `package.json`. The template picks them up.
167167
theiaPluginsDir: rootPackageJson.theiaPluginsDir,
168168
theiaPlugins: rootPackageJson.theiaPlugins,
169169
};
@@ -209,20 +209,12 @@ ${fs
209209
'Installing dependencies'
210210
);
211211
exec(
212-
`yarn --network-timeout 1000000 --cwd ${join(
213-
repoRoot,
214-
'electron',
215-
'build'
216-
)} build`,
212+
`yarn --cwd ${join(repoRoot, 'electron', 'build')} build`,
217213
`Building the ${productName} application`
218214
);
219215
exec(
220-
`yarn --network-timeout 1000000 --cwd ${join(
221-
repoRoot,
222-
'electron',
223-
'build'
224-
)} rebuild`,
225-
'Rebuild native dependencies'
216+
`yarn --cwd ${join(repoRoot, 'electron', 'build')} rebuild`,
217+
'Rebuilding native dependencies'
226218
);
227219

228220
//------------------------------------------------------------------------------+
@@ -243,12 +235,8 @@ ${fs
243235
// Package the electron application. |
244236
//-----------------------------------+
245237
exec(
246-
`yarn --network-timeout 1000000 --cwd ${join(
247-
repoRoot,
248-
'electron',
249-
'build'
250-
)} package`,
251-
`Packaging your ${productName} application`
238+
`yarn --cwd ${join(repoRoot, 'electron', 'build')} package`,
239+
`Packaging the ${productName} application`
252240
);
253241

254242
//-----------------------------------------------------------------------------------------------------+
@@ -265,7 +253,7 @@ ${fs
265253
}
266254
}
267255
echo(
268-
`🎉 Success. Your application is at: ${join(
256+
`🎉 Success. The application is at: ${join(
269257
repoRoot,
270258
'electron',
271259
'build',

electron/packager/test/utils.test.js

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const testMe = require('../utils');
77
const sinon = require('sinon');
88

99
describe('utils', () => {
10-
1110
describe('adjustArchiveStructure', () => {
12-
1311
let consoleStub;
1412

1513
beforeEach(() => {
16-
consoleStub = sinon.stub(console, 'log').value(() => { });
14+
consoleStub = sinon.stub(console, 'log').value(() => {
15+
/* NOOP */
16+
});
1717
});
1818

1919
afterEach(() => {
@@ -34,8 +34,15 @@ describe('utils', () => {
3434

3535
it('should reject when target directory does not exist', async () => {
3636
try {
37-
const zip = path.join(__dirname, 'resources', 'zip-with-base-folder.zip');
38-
await testMe.adjustArchiveStructure(zip, path.join(__dirname, 'some', 'missing', 'path'));
37+
const zip = path.join(
38+
__dirname,
39+
'resources',
40+
'zip-with-base-folder.zip'
41+
);
42+
await testMe.adjustArchiveStructure(
43+
zip,
44+
path.join(__dirname, 'some', 'missing', 'path')
45+
);
3946
throw new Error('Expected a rejection');
4047
} catch (e) {
4148
expect(e).to.be.an.instanceOf(Error);
@@ -45,7 +52,11 @@ describe('utils', () => {
4552

4653
it('should reject when target is a file', async () => {
4754
try {
48-
const zip = path.join(__dirname, 'resources', 'zip-with-base-folder.zip');
55+
const zip = path.join(
56+
__dirname,
57+
'resources',
58+
'zip-with-base-folder.zip'
59+
);
4960
await testMe.adjustArchiveStructure(zip, path.join(__filename));
5061
throw new Error('Expected a rejection');
5162
} catch (e) {
@@ -56,7 +67,10 @@ describe('utils', () => {
5667

5768
it('should be a NOOP when the zip already has the desired base folder', async () => {
5869
const zip = path.join(__dirname, 'resources', 'zip-with-base-folder.zip');
59-
const actual = await testMe.adjustArchiveStructure(zip, track.mkdirSync());
70+
const actual = await testMe.adjustArchiveStructure(
71+
zip,
72+
track.mkdirSync()
73+
);
6074
expect(actual).to.be.equal(zip);
6175
});
6276

@@ -92,7 +106,13 @@ describe('utils', () => {
92106

93107
const verifyOut = track.mkdirSync();
94108
await unpack(actual, verifyOut);
95-
expect(fs.lstatSync(path.join(verifyOut, 'zip-with-symlink', 'folder', 'symlinked-sub')).isSymbolicLink()).to.be.true;
109+
expect(
110+
fs
111+
.lstatSync(
112+
path.join(verifyOut, 'zip-with-symlink', 'folder', 'symlinked-sub')
113+
)
114+
.isSymbolicLink()
115+
).to.be.true;
96116
});
97117

98118
it('should adjust the archive structure if base folder is not present', async () => {
@@ -113,7 +133,5 @@ describe('utils', () => {
113133
expect(subs).to.have.lengthOf(3);
114134
expect(subs.sort()).to.be.deep.equal(['a.txt', 'b.txt', 'foo']);
115135
});
116-
117136
});
118-
119-
});
137+
});

0 commit comments

Comments
 (0)