mirror of
https://github.com/xodio/xod.git
synced 2026-02-20 02:01:20 +01:00
feat(xod-client, xod-client-browser, xod-client-electron): add Show Code With Debug menu item for development env
This commit is contained in:
@@ -10,6 +10,7 @@ import { HotKeys } from 'react-hotkeys';
|
||||
import * as XP from 'xod-project';
|
||||
import client from 'xod-client';
|
||||
import { foldEither, notNil } from 'xod-func-tools';
|
||||
import { LIVENESS } from 'xod-arduino';
|
||||
|
||||
import packageJson from '../../package.json';
|
||||
import PopupInstallApp from '../components/PopupInstallApp';
|
||||
@@ -275,6 +276,13 @@ class App extends client.App {
|
||||
]),
|
||||
submenu(items.deploy, [
|
||||
onClick(items.showCodeForArduino, this.onShowCodeArduino),
|
||||
...(process.env.IS_DEV
|
||||
? [
|
||||
onClick(items.showCodeWithDebug, () =>
|
||||
this.onShowCodeArduino(LIVENESS.DEBUG)
|
||||
),
|
||||
]
|
||||
: []),
|
||||
onClick(items.uploadToArduino, this.onUpload),
|
||||
onClick(items.runSimulation, this.onRunSimulation),
|
||||
]),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const path = require('path');
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
/* eslint-enable import/no-extraneous-dependencies */
|
||||
const baseConfig = require('./webpack.config.js');
|
||||
@@ -18,4 +19,9 @@ module.exports = merge.smart(baseConfig, {
|
||||
contentBase: pkgpath('dist'),
|
||||
compress: true,
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.IS_DEV': true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
@@ -61,7 +61,7 @@ import {
|
||||
proceedPackageUpgrade,
|
||||
} from '../../arduinoDependencies/actions';
|
||||
import { loadWorkspacePath } from '../../app/workspaceActions';
|
||||
import { getPathToBundledWorkspace } from '../../app/utils';
|
||||
import { getPathToBundledWorkspace, IS_DEV } from '../../app/utils';
|
||||
|
||||
import getLibraryNames from '../../arduinoDependencies/getLibraryNames';
|
||||
|
||||
@@ -677,6 +677,13 @@ class App extends client.App {
|
||||
]),
|
||||
submenu(items.deploy, [
|
||||
onClick(items.showCodeForArduino, this.onShowCodeArduino),
|
||||
...(IS_DEV
|
||||
? [
|
||||
onClick(items.showCodeWithDebug, () =>
|
||||
this.onShowCodeArduino(LIVENESS.DEBUG)
|
||||
),
|
||||
]
|
||||
: []),
|
||||
onClick(items.uploadToArduino, this.onUploadToArduinoClicked),
|
||||
onClick(items.runSimulation, this.onRunSimulation),
|
||||
onClick(
|
||||
|
||||
@@ -93,7 +93,7 @@ export default class App extends React.Component {
|
||||
this.props.actions.fetchGrant(/* startup */ true);
|
||||
}
|
||||
|
||||
onShowCodeArduino() {
|
||||
onShowCodeArduino(liveness = LIVENESS.NONE) {
|
||||
R.compose(
|
||||
foldEither(
|
||||
R.compose(
|
||||
@@ -104,7 +104,7 @@ export default class App extends React.Component {
|
||||
),
|
||||
R.map(transpile),
|
||||
this.transformProjectForTranspiler
|
||||
)(LIVENESS.NONE);
|
||||
)(liveness);
|
||||
}
|
||||
|
||||
onRunSimulation() {
|
||||
|
||||
@@ -103,6 +103,9 @@ const rawItems = {
|
||||
showCodeForArduino: {
|
||||
label: 'Show Code for Arduino',
|
||||
},
|
||||
showCodeWithDebug: {
|
||||
label: 'Show Code with Debug',
|
||||
},
|
||||
uploadToArduino: {
|
||||
label: 'Upload to Arduino...',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user