Skip to content

Commit 9225640

Browse files
committed
Merge branch 'release/v3.3.4'
2 parents 7562546 + 1b3fe7d commit 9225640

File tree

4 files changed

+80
-78
lines changed

4 files changed

+80
-78
lines changed

Diff for: app/index.html

+38-38
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,30 @@
44
<meta charset="utf-8">
55
<title>PlatformIO Home</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
</head>
8+
<body>
79
<script>
810
if (window.document.documentMode) {
911
window.alert('Your browser is not supported. Please use one of the modern browsers (Chrome, Firefox, Opera, Safari, etc).');
1012
window.location = 'https://www.google.com/chrome/';
1113
}
1214

13-
document.addEventListener('keydown', e => {
15+
function getQueryVariable(variable) {
16+
if (!window.location) {
17+
return null;
18+
}
19+
var query = window.location.search.substring(1);
20+
var vars = query.split('&');
21+
for (var i = 0; i < vars.length; i++) {
22+
var pair = vars[i].split('=');
23+
if (decodeURIComponent(pair[0]) == variable) {
24+
return decodeURIComponent(pair[1]);
25+
}
26+
}
27+
return null;
28+
}
29+
30+
function onDidKeyDown(e) {
1431
const obj = {
1532
altKey: e.altKey,
1633
code: e.code,
@@ -25,46 +42,29 @@
2542
try {
2643
window.parent.postMessage({'command': 'kbd-event', 'data': obj}, '*');
2744
} catch (err) {}
28-
});
29-
30-
function getQueryVariable(variable) {
31-
if (!window.location) {
32-
return null;
33-
}
34-
var query = window.location.search.substring(1);
35-
var vars = query.split('&');
36-
for (var i = 0; i < vars.length; i++) {
37-
var pair = vars[i].split('=');
38-
if (decodeURIComponent(pair[0]) == variable) {
39-
return decodeURIComponent(pair[1]);
40-
}
41-
}
42-
return null;
4345
}
44-
</script>
45-
</head>
46+
document.addEventListener('keydown', onDidKeyDown);
47+
4648
<% if (process.env.NODE_ENV === 'production') { %>
47-
<script>
48-
var workspace = getQueryVariable('workspace');
49-
var theme = getQueryVariable('theme');
50-
if (!workspace || workspace === 'undefined') {
51-
workspace = 'platformio';
52-
};
53-
if (!theme || theme === 'undefined') {
54-
theme = 'dark';
55-
};
56-
var link = document.createElement('link');
57-
var pathname = (window.location? window.location.pathname : '/');
58-
if (pathname[pathname.length - 1] !== '/') {
59-
pathname += '/';
60-
}
61-
link.href = pathname + 'themes/' + workspace + '.' + theme + '.min.css';
62-
link.type = 'text/css';
63-
link.rel = 'stylesheet';
64-
document.getElementsByTagName('head')[0].appendChild(link);
65-
</script>
49+
var workspace = getQueryVariable('workspace');
50+
var theme = getQueryVariable('theme');
51+
if (!workspace || workspace === 'undefined') {
52+
workspace = 'platformio';
53+
};
54+
if (!theme || theme === 'undefined') {
55+
theme = 'dark';
56+
};
57+
var link = document.createElement('link');
58+
var pathname = (window.location? window.location.pathname : '/');
59+
if (pathname[pathname.length - 1] !== '/') {
60+
pathname += '/';
61+
}
62+
link.href = pathname + 'themes/' + workspace + '.' + theme + '.min.css';
63+
link.type = 'text/css';
64+
link.rel = 'stylesheet';
65+
document.getElementsByTagName('head')[0].appendChild(link);
6666
<% } %>
67-
<body>
67+
</script>
6868
<div id="app">Loading...</div>
6969
</body>
7070
</html>

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

+26-21
Original file line numberDiff line numberDiff line change
@@ -77,31 +77,37 @@ function* _inspectMemory({ projectDir, env }) {
7777

7878
function* _inspectCode({ projectDir, env }) {
7979
const start = Date.now();
80-
let codeCheckResults;
80+
let lastError = undefined;
8181
try {
82-
codeCheckResults = yield call(backendFetchData, {
82+
const codeCheckResults = yield call(backendFetchData, {
8383
query: 'core.call',
8484
params: [
8585
['check', '-d', projectDir, '-e', env, '--json-output'],
8686
{ force_subprocess: true }
8787
]
8888
});
8989
yield _updateMetric('code', projectDir, env, Date.now() - start);
90-
91-
if (codeCheckResults && codeCheckResults.length) {
92-
return codeCheckResults;
93-
}
94-
} catch (e) {
95-
if (e instanceof jsonrpc.JsonRpcError) {
96-
// Try to recover from error because of return code <> 0
97-
codeCheckResults = JSON.parse(e.data);
98-
if (codeCheckResults && codeCheckResults.length) {
99-
return codeCheckResults;
100-
}
90+
return codeCheckResults;
91+
} catch (err) {
92+
lastError = err;
93+
console.warn('Problem has occured when inspecting a code', err);
94+
}
95+
// examine tool output in verbose mode
96+
try {
97+
const output = yield call(backendFetchData, {
98+
query: 'core.call',
99+
params: [
100+
['check', '-d', projectDir, '-e', env, '--verbose'],
101+
{ force_subprocess: true }
102+
]
103+
});
104+
throw new Error(output);
105+
} catch (err) {
106+
if (err.data) {
107+
throw new Error(err.data.replace('\\n', '\n'));
101108
}
102-
throw e;
103109
}
104-
throw new Error('Unexpected code check result');
110+
throw lastError;
105111
}
106112

107113
function* watchInspectProject() {
@@ -148,13 +154,10 @@ function* watchInspectProject() {
148154

149155
if (code) {
150156
codeCheckResult = yield call(_inspectCode, configuration);
151-
yield put(
152-
updateEntity(RESULT_KEY, {
153-
memory: memoryResult,
154-
codeChecks: codeCheckResult
155-
})
156-
);
157157
}
158+
yield put(
159+
updateEntity(RESULT_KEY, { memory: memoryResult, codeChecks: codeCheckResult })
160+
);
158161
const entity = { memory: memoryResult, codeChecks: codeCheckResult };
159162
if (onEnd) {
160163
onEnd(entity);
@@ -172,6 +175,8 @@ function* watchInspectProject() {
172175
}
173176
} else if (e instanceof SyntaxError) {
174177
error = 'Bad JSON';
178+
} else {
179+
error = e.toString();
175180
}
176181
if (onEnd) {
177182
onEnd(undefined, error);

Diff for: package.json

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "platformio-home",
3-
"version": "3.3.3",
3+
"version": "3.3.4",
44
"description": "PlatformIO Home",
55
"repository": {
66
"type": "git",
@@ -19,11 +19,11 @@
1919
"license": "Apache-2.0",
2020
"dependencies": {
2121
"antd": "~3.26.20",
22-
"clipboard": "~2.0.6",
23-
"highlight.js": "~10.5.0",
22+
"clipboard": "~2.0.7",
23+
"highlight.js": "~10.6.0",
2424
"humanize": "~0.0.9",
2525
"jsonrpc-lite": "~2.2.0",
26-
"marked": "~1.2.7",
26+
"marked": "~2.0.1",
2727
"prop-types": "~15.7.2",
2828
"querystringify": "~2.2.0",
2929
"rc-animate": "~3.1.1",
@@ -38,29 +38,29 @@
3838
"redux-saga": "~1.1.3",
3939
"sha.js": "~2.4.11",
4040
"superagent": "~6.1.0",
41-
"url-parse": "~1.4.7"
41+
"url-parse": "~1.5.1"
4242
},
4343
"devDependencies": {
44-
"@babel/core": "~7.12.10",
45-
"@babel/plugin-proposal-class-properties": "~7.12.1",
46-
"@babel/plugin-proposal-function-bind": "~7.12.1",
47-
"@babel/plugin-proposal-object-rest-spread": "~7.12.1",
44+
"@babel/core": "~7.13.8",
45+
"@babel/plugin-proposal-class-properties": "~7.13.0",
46+
"@babel/plugin-proposal-function-bind": "~7.12.13",
47+
"@babel/plugin-proposal-object-rest-spread": "~7.13.8",
4848
"@babel/preset-react": "~7.12.10",
4949
"babel-eslint": "~10.1.0",
5050
"babel-loader": "~8.2.2",
5151
"babel-plugin-import": "~1.13.3",
5252
"babel-plugin-redux-saga": "~1.1.2",
5353
"copy-webpack-plugin": "~7.0.0",
54-
"css-loader": "~5.0.1",
54+
"css-loader": "~5.1.1",
5555
"css-minimizer-webpack-plugin": "^1.2.0",
56-
"eslint": "~7.18.0",
57-
"eslint-config-prettier": "~7.2.0",
56+
"eslint": "~7.21.0",
57+
"eslint-config-prettier": "~8.1.0",
5858
"eslint-import-resolver-webpack": "~0.13.0",
5959
"eslint-plugin-import": "~2.22.1",
6060
"eslint-plugin-prettier": "~3.3.1",
6161
"eslint-plugin-react": "~7.22.0",
6262
"file-loader": "~6.2.0",
63-
"html-webpack-plugin": "~4.5.1",
63+
"html-webpack-plugin": "~5.3.1",
6464
"less": "~3.12.2",
6565
"less-loader": "~7.3.0",
6666
"mini-css-extract-plugin": "~1.3.4",
@@ -71,10 +71,9 @@
7171
"style-loader": "~2.0.0",
7272
"terser-webpack-plugin": "^5.1.1",
7373
"url-loader": "~4.1.1",
74-
"webpack": "~5.17.0",
75-
"webpack-bundle-analyzer": "~3.9.0",
76-
"webpack-cleanup-plugin": "~0.5.1",
77-
"webpack-cli": "~4.4.0",
74+
"webpack": "~5.24.4",
75+
"webpack-bundle-analyzer": "~4.4.0",
76+
"webpack-cli": "~4.5.0",
7877
"webpack-dev-server": "~3.11.2"
7978
},
8079
"themes": {

Diff for: scripts/webpack.common.js

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const fs = require('fs');
1010
const path = require('path');
1111
const webpack = require('webpack');
1212
const CopyWebpackPlugin = require('copy-webpack-plugin');
13-
const WebpackCleanupPlugin = require('webpack-cleanup-plugin');
1413

1514
const rootDir = path.resolve(__dirname, '..');
1615
const mediaDir = path.join(rootDir, 'app', 'media');
@@ -132,7 +131,6 @@ module.exports = {
132131
],
133132

134133
plugins: [
135-
// new WebpackCleanupPlugin(),
136134
new webpack.DefinePlugin({
137135
APP_VERSION: JSON.stringify(packageConfig.version)
138136
}),

0 commit comments

Comments
 (0)