Extensible multi-platform debugger frontend.
After cloning this repository run the following commands:
npm install
npm run build:native-modulesNote that the first time you rebuild the native modules it may take a few minutes (and there won't be any visible indicator that anything is actually happening) because the task is busy downloading the headers and libs needed to rebuild the modules. If anything actually goes wrong during this process errors will be displayed in the console.
Once the native modules have been rebuilt you can build the app itself by executing
npm run build:full from the root directory, and once built the app can be launched with
npm start or npm run electron.
-
Launch the Hydragon app:
npm start
OR
npm run electron
-
Compile TypeScript source files in
app/src:npm run build -s
-
Run the
cleantask followed by thebuild:fulltask:npm run build:clean -s
-
Compile TypeScrypt source files, preprocess html templates, vulcanize
app/bower_components, and copy custom element templates toapp/lib:npm run build:full -s
This task should really only be run on a fresh checkout or after the
cleantask, otherwise it's probably sufficient to run one of the finer grained tasks. -
Rebuild all native Node module in
app/node_modulesdir:npm run build:native-modules -s
See also Native NodeJS modules.
-
Compile TypeScript source files in
tasksdir to JavaScript:npm run build:tasks -s
This task is only used when debugging the tasks.
-
Build tests:
npm run build:test -s
-
Delete output generated by the
build:fulltask:npm run clean
-
Launch the Hydragon app with main process debugging enabled:
npm run electron:debug
See also Debugging JavaScript in the main process.
-
Run
tslinton the TypeScript source files:npm run lint -s
-
Launch
node-inspectorfor debugging the main process of the Hydragon app:npm run node-inspector
See also Debugging JavaScript in the main process.
-
Run the tests:
npm test -sOR with debugging of the main process enabled:
npm run test:debug -s
-
Bundle the contents of
app/bower_components:npm run vulcanize
See also Custom Elements.
appbower_components- Bower components that are used at runtime by the application.lib- JavaScript files generated by the build process.node_modules- Node modules that are used at runtime by the application.src- Application source.static- Various files that will be loaded by the application at runtime, all files in this directory should be ready to use at runtime (if a file needs any kind of pre-processing it doesn't belong in here).tests- Test harness.typings- TypeScript type definitions for modules innode_modules.
tasks- Tasks used to build, run, and test the application.node_modules- Node modules used by the build system.typings- TypeScript type definitions for modules innode_modules.
node-inspector can be used to debug JavaScript code running in the main Electron process by following these steps:
- Start
node-inspectorby runningnpm run node-inspectorfrom the project root directory. - Start Hydragon by running
npm run electron:debug. - Open the URL that
node-inspectorprints out inChrome, e.g.http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858
Native NodeJS modules used during the build must be built specifically for the NodeJS version used by the build system and the various development packages. However, native NodeJS modules used by Hydragon or any of its dependencies must be built with the same NodeJS SDK version that's integrated into the Electron runtime.
To that end any NodeJS modules used by the build system must be referenced in the package.json
file located in this directory, while any NodeJS modules used by Hydragon at runtime must be
referenced in the package.json found in the app directory. More background info can be found in
the Electron docs on native NodeJS modules.
To download the NodeJS SDK used to build Electron and rebuild any native modules in
app/node_modules execute the following command in the terminal:
npm run build:native-modulesThere are a number of build tasks associated with the custom elements in
app/src/renderer-process/elements, during development you may need to run some or all of them
depending on what which files you're modifying. These tasks can be run in any order.
npm run vulcanizewill bundle up the dependencies inapp/bower_components, this needs to be rerun whenever the contents ofapp/bower_componentschange.npm run preprocesswill preprocess some of the element.htmlfiles.grunt syncwill copy all the element.htmlfiles to theapp/libdirectory, this is where the app will load them from at runtime.npm run build:rendererwill compile all the element.tsfiles and place the output in theapp/libdirectory.
To install the Devtron DevTools extension launch Hydragon
using npm start, then open the Electron DevTools console and run require('devtron').install().
The Devtron extension will now be loaded every time the application is launched, to uninstall the
extension run require('devtron').uninstall().
To install the React DevTools extension
launch Hydragon using npm start, then open the Electron DevTools console and run
require('electron-react-devtools').install(). The React extension will now be loaded every time
the application is launched, to uninstall the extension run
require('electron-react-devtools').uninstall().
MIT