Skip to content

Commit a63a2c9

Browse files
committed
Merge branch 'release/v3.3.2'
2 parents 47f5d95 + ff17a6e commit a63a2c9

File tree

17 files changed

+161
-135
lines changed

17 files changed

+161
-135
lines changed

Diff for: .github/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Number of days of inactivity before an issue becomes stale
2-
daysUntilStale: 60
2+
daysUntilStale: 30
33
# Number of days of inactivity before a stale issue is closed
44
daysUntilClose: 7
55
# Issues with these labels will never be considered stale

Diff for: app/config.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
export const IS_WINDOWS =
1818
navigator && navigator.platform && navigator.platform.startsWith('Win');
1919
export const INPUT_FILTER_DELAY = 300; // ms, dalay before filtering projects, libs, platorms
20-
export const PLATFORMIO_API_ENDPOINT = 'http://api.platformio.org';
20+
export const PLATFORMIO_API_ENDPOINT = 'https://api.platformio.org';
2121

22-
let wsrpc = 'ws://127.0.0.1:8008/wsrpc';
22+
let pathname = window.location ? window.location.pathname : '/';
23+
if (pathname[pathname.length - 1] !== '/') {
24+
pathname += '/';
25+
}
26+
let wsrpc = `ws://127.0.0.1:8008${pathname}wsrpc`;
2327
if (process.env.NODE_ENV === 'production' && window.location && window.location.host) {
24-
wsrpc = `ws://${window.location.host}/wsrpc`;
28+
wsrpc = `ws://${window.location.host}${pathname}wsrpc`;
2529
}
2630
export const BACKEND_ENDPOINT = wsrpc;

Diff for: app/index.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@
5454
theme = 'dark';
5555
};
5656
var link = document.createElement('link');
57-
link.href = './themes/' + workspace + '-' + theme + '.css';
57+
var pathname = (window.location? window.location.pathname : '/');
58+
if (pathname[pathname.length - 1] !== '/') {
59+
pathname += '/';
60+
}
61+
link.href = pathname + 'themes/' + workspace + '-' + theme + '.css';
5862
link.type = 'text/css';
5963
link.rel = 'stylesheet';
6064
document.getElementsByTagName('head')[0].appendChild(link);

Diff for: app/modules/account/sagas.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { call, put, select, take, takeLatest } from 'redux-saga/effects';
2323
import { deleteEntity, updateEntity } from '../../store/actions';
2424
import { notifyError, notifySuccess, osOpenUrl } from '../core/actions';
2525

26-
import { apiFetchData } from '../../store/api';
26+
import { backendFetchData } from '../../store/backend';
2727
import { inIframe } from '../core/helpers';
2828
import jsonrpc from 'jsonrpc-lite';
2929
import { message } from 'antd';
@@ -74,7 +74,7 @@ function* watchLoadAccountInfo() {
7474
}
7575

7676
try {
77-
data = yield call(apiFetchData, {
77+
data = yield call(backendFetchData, {
7878
query: 'core.call',
7979
params: [
8080
['account', 'show', '--json-output', ...(extended ? [] : ['--offline'])]
@@ -96,7 +96,7 @@ function* watchLoadAccountInfo() {
9696
function* watchLoginAccount() {
9797
yield takeLatest(actions.LOGIN_ACCOUNT, function*({ username, password, onEnd }) {
9898
try {
99-
yield call(apiFetchData, {
99+
yield call(backendFetchData, {
100100
query: 'core.call',
101101
params: [['account', 'login', '--username', username, '--password', password]]
102102
});
@@ -134,7 +134,7 @@ function* watchLoginWithProvider() {
134134

135135
function* loginAccountWithCode(client_id, code, redirectUri) {
136136
try {
137-
yield call(apiFetchData, {
137+
yield call(backendFetchData, {
138138
query: 'account.call_client',
139139
params: ['login_with_code', client_id, code, redirectUri]
140140
});
@@ -150,7 +150,7 @@ function* watchLogoutAccount() {
150150
yield takeLatest(actions.LOGOUT_ACCOUNT, function*() {
151151
try {
152152
yield put(updateEntity('accountInfo', {}));
153-
yield call(apiFetchData, {
153+
yield call(backendFetchData, {
154154
query: 'core.call',
155155
params: [['account', 'logout']]
156156
});
@@ -174,7 +174,7 @@ function* watchRegisterAccount() {
174174
}) {
175175
let err = null;
176176
try {
177-
yield call(apiFetchData, {
177+
yield call(backendFetchData, {
178178
query: 'core.call',
179179
params: [
180180
[
@@ -217,7 +217,7 @@ function* watchForgotAccount() {
217217
yield takeLatest(actions.FORGOT_ACCOUNT, function*({ username, onEnd }) {
218218
let err = null;
219219
try {
220-
yield call(apiFetchData, {
220+
yield call(backendFetchData, {
221221
query: 'core.call',
222222
params: [['account', 'forgot', '--username', username]]
223223
});
@@ -249,7 +249,7 @@ function* watchPasswordAccount() {
249249
}) {
250250
let err = null;
251251
try {
252-
yield call(apiFetchData, {
252+
yield call(backendFetchData, {
253253
query: 'core.call',
254254
params: [
255255
[
@@ -288,7 +288,7 @@ function* watchTokenAccount() {
288288
if (regenerate) {
289289
args.push('--regenerate');
290290
}
291-
const data = yield call(apiFetchData, {
291+
const data = yield call(backendFetchData, {
292292
query: 'core.call',
293293
params: [args]
294294
});
@@ -317,7 +317,7 @@ function* watchUpdateProfile() {
317317
}) {
318318
let err = null;
319319
try {
320-
const response = yield call(apiFetchData, {
320+
const response = yield call(backendFetchData, {
321321
query: 'core.call',
322322
params: [
323323
[

Diff for: app/modules/core/containers/code-beautifier.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Icon, Spin } from 'antd';
2121
import PropTypes from 'prop-types';
2222
import React from 'react';
2323
import { connect } from 'react-redux';
24-
import hljs from 'highlight.js/lib/highlight';
24+
import hljs from 'highlight.js/lib/core';
2525
import { requestContent } from '../actions';
2626
import { selectRequestedContent } from '../selectors';
2727

Diff for: app/modules/core/sagas.jsx

+23-15
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { ConsentRejectedError } from '@core/errors';
2828
import React from 'react';
2929
import URL from 'url-parse';
3030
import { USER_CONSENTS_KEY } from '@core/constants';
31-
import { apiFetchData } from '../../store/api';
31+
import { backendFetchData } from '../../store/backend';
3232
import { getStore } from '../../store/index';
3333
import jsonrpc from 'jsonrpc-lite';
3434
import qs from 'querystringify';
@@ -91,6 +91,14 @@ function* watchNotifyError() {
9191
[
9292
/Updating.+VCS.+recurse-submodules/g,
9393
'https://github.com/platformio/platformio-home/issues/143'
94+
],
95+
[
96+
/Error: Detected a whitespace character/g,
97+
'https://github.com/platformio/platform-espressif32/issues/470'
98+
],
99+
[
100+
/Error: Could not find the package/g,
101+
'https://github.com/platformio/platformio-home/issues/2144'
94102
]
95103
];
96104
for (const [regex, url] of knownIssues) {
@@ -191,36 +199,36 @@ function* watchOSRequests() {
191199
const redirectWindow = window.open(url.toString(), '_blank');
192200
redirectWindow.location;
193201
} else {
194-
yield call(apiFetchData, {
202+
yield call(backendFetchData, {
195203
query: 'os.open_url',
196204
params: [url.toString()]
197205
});
198206
}
199207
break;
200208

201209
case actions.OS_REVEAL_FILE:
202-
yield call(apiFetchData, {
210+
yield call(backendFetchData, {
203211
query: 'os.reveal_file',
204212
params: [action.path]
205213
});
206214
break;
207215

208216
case actions.OS_RENAME_FILE:
209-
yield call(apiFetchData, {
217+
yield call(backendFetchData, {
210218
query: 'os.rename',
211219
params: [action.src, action.dst]
212220
});
213221
break;
214222

215223
case actions.OS_COPY_FILE:
216-
yield call(apiFetchData, {
224+
yield call(backendFetchData, {
217225
query: 'os.copy',
218226
params: [action.src, action.dst]
219227
});
220228
break;
221229

222230
case actions.OS_MAKE_DIRS:
223-
yield call(apiFetchData, {
231+
yield call(backendFetchData, {
224232
query: 'os.make_dirs',
225233
params: [action.path]
226234
});
@@ -265,7 +273,7 @@ function* watchRequestContent() {
265273
}
266274

267275
if (!content) {
268-
content = yield call(apiFetchData, {
276+
content = yield call(backendFetchData, {
269277
query: 'os.request_content',
270278
params: [uri, data, headers, cacheValid]
271279
});
@@ -297,7 +305,7 @@ function* watchOsFSGlob() {
297305
return;
298306
}
299307
try {
300-
items = yield call(apiFetchData, {
308+
items = yield call(backendFetchData, {
301309
query: 'os.glob',
302310
params: [pathnames, rootDir]
303311
});
@@ -328,7 +336,7 @@ function* watchLoadLogicalDevices() {
328336
return;
329337
}
330338
try {
331-
items = yield call(apiFetchData, {
339+
items = yield call(backendFetchData, {
332340
query: 'os.get_logical_devices'
333341
});
334342
yield put(updateEntity('logicalDevices', items));
@@ -347,7 +355,7 @@ function* watchOsListDir() {
347355
items = {};
348356
}
349357
try {
350-
const result = yield call(apiFetchData, {
358+
const result = yield call(backendFetchData, {
351359
query: 'os.list_dir',
352360
params: [/^[A-Z]:$/.test(path) ? path + '\\' : path]
353361
});
@@ -369,7 +377,7 @@ function* watchOsIsFile() {
369377
items = {};
370378
}
371379
try {
372-
const result = yield call(apiFetchData, {
380+
const result = yield call(backendFetchData, {
373381
query: 'os.is_file',
374382
params: [path]
375383
});
@@ -391,7 +399,7 @@ function* watchOsIsDir() {
391399
items = {};
392400
}
393401
try {
394-
const result = yield call(apiFetchData, {
402+
const result = yield call(backendFetchData, {
395403
query: 'os.is_dir',
396404
params: [path]
397405
});
@@ -428,21 +436,21 @@ function* watchToggleFavoriteFolder() {
428436

429437
function* watchOpenTextDocument() {
430438
yield takeEvery(actions.OPEN_TEXT_DOCUMENT, function*({ path, line, column }) {
431-
const is_file = yield call(apiFetchData, {
439+
const is_file = yield call(backendFetchData, {
432440
query: 'os.is_file',
433441
params: [path]
434442
});
435443
if (!is_file) {
436444
return message.error(`File does not exist on disk ${path}`);
437445
}
438446
try {
439-
return yield call(apiFetchData, {
447+
return yield call(backendFetchData, {
440448
query: 'ide.open_text_document',
441449
params: [getSessionId(), path, line, column]
442450
});
443451
} catch (err) {
444452
console.warn(err);
445-
return yield call(apiFetchData, {
453+
return yield call(backendFetchData, {
446454
query: 'os.open_file',
447455
params: [path]
448456
});

Diff for: app/modules/device/sagas.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import * as selectors from './selectors';
2222
import { call, put, select, take } from 'redux-saga/effects';
2323
import { deleteEntity, updateEntity } from '../../store/actions';
2424

25-
import { apiFetchData } from '../../store/api';
25+
import { backendFetchData } from '../../store/backend';
2626
import { notifyError } from '../core/actions';
2727

2828
function* watchLoadSerialDevices() {
@@ -37,7 +37,7 @@ function* watchLoadSerialDevices() {
3737
}
3838
yield call(function*() {
3939
try {
40-
items = yield call(apiFetchData, {
40+
items = yield call(backendFetchData, {
4141
query: 'core.call',
4242
params: [['device', 'list', '--serial', '--json-output']]
4343
});
@@ -61,7 +61,7 @@ function* watchLoadMDNSDevices() {
6161
}
6262
yield call(function*() {
6363
try {
64-
items = yield call(apiFetchData, {
64+
items = yield call(backendFetchData, {
6565
query: 'core.call',
6666
params: [
6767
['device', 'list', '--mdns', '--json-output'],

Diff for: app/modules/home/sagas.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import * as selectors from './selectors';
2121

2222
import { call, put, select, takeLatest } from 'redux-saga/effects';
2323

24-
import { apiFetchData } from '../../store/api';
24+
import { backendFetchData } from '../../store/backend';
2525
import { updateEntity } from '../../store/actions';
2626

2727
function* watchLoadLatestTweets() {
@@ -31,7 +31,7 @@ function* watchLoadLatestTweets() {
3131
return;
3232
}
3333
try {
34-
items = yield call(apiFetchData, {
34+
items = yield call(backendFetchData, {
3535
query: 'misc.load_latest_tweets',
3636
params: [`https://news.platformio.org/tweets/${username}/data.json`]
3737
});

Diff for: app/modules/inspect/sagas.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
selectSavedConfiguration
2828
} from '@inspect/selectors';
2929

30-
import { apiFetchData } from '@store/api';
30+
import { backendFetchData } from '@store/backend';
3131
import { goTo } from '@core/helpers';
3232
import jsonrpc from 'jsonrpc-lite';
3333
import { selectProjectInfo } from '@project/selectors';
@@ -44,15 +44,15 @@ function* _updateMetric(name, projectDir, env, duration) {
4444

4545
function* _inspectMemory({ projectDir, env }) {
4646
const start = Date.now();
47-
yield call(apiFetchData, {
47+
yield call(backendFetchData, {
4848
query: 'core.call',
4949
params: [
5050
['run', '-d', projectDir, '-e', env, '-t', 'sizedata'],
5151
{ force_subprocess: true }
5252
]
5353
});
5454

55-
const buildDir = yield call(apiFetchData, {
55+
const buildDir = yield call(backendFetchData, {
5656
query: 'project.config_call',
5757
params: [
5858
{ path: pathlib.join(projectDir, 'platformio.ini') },
@@ -62,7 +62,7 @@ function* _inspectMemory({ projectDir, env }) {
6262
});
6363
const sizedataPath = pathlib.join(buildDir, env, 'sizedata.json');
6464

65-
const jsonContent = yield call(apiFetchData, {
65+
const jsonContent = yield call(backendFetchData, {
6666
query: 'os.request_content',
6767
params: [sizedataPath]
6868
});
@@ -79,7 +79,7 @@ function* _inspectCode({ projectDir, env }) {
7979
const start = Date.now();
8080
let codeCheckResults;
8181
try {
82-
codeCheckResults = yield call(apiFetchData, {
82+
codeCheckResults = yield call(backendFetchData, {
8383
query: 'core.call',
8484
params: [
8585
['check', '-d', projectDir, '-e', env, '--json-output'],

0 commit comments

Comments
 (0)