Covalent is a reusable UI platform from Teradata for building web applications with common standards and tooling. It is based on Angular 2 and Material Design.
Covalent Github Repo: https://github.com/Teradata/covalent
Covalent-Electron is the Electron Platform to build desktop apps using Covalent and Electron
- Ensure you have Node 4.4 and NPM 3+ installed.
- Install
npm install
- Create Electron package
npm run package
- For a system running OS X the dist-app/Covalent-darwin-x64/Covalent.app folder generated can be executed.
- For a Windows x64 build the Covalent-win32-x64/Covalent.exe can be executed.
The development build includes the ability to "live-reload" code in both the renderer process and the main electron application. After running the commands below simply save a file in the code base and it will be automatically refreshed in the running Electron application
- Ensure you have Node 4.4 and NPM 3+ installed.
- Install
npm install
- Create Electron package and run live-reload
npm run live-reload
Alternatively if you want to also open the Dev Tools while running live-reload run this command instead
- Create Electron package and run live-reload
npm run live-reload -- --openDevTools
To utilize "internal" (eg. fs, path, etc.) or "3rd party" (eg. winston, uuid, etc.) node modules from within your Covalent Electron application, you must perform the following steps to ensure the node modules are accessible. Assume for this example you want to utilize a node module named "some_node_module".
-
Add the require for the module in src/electron-load.js in the below location
/* * Require external node modules here */ var some_node_module = require('some_node_module');
Make sure it is below the line:
module.paths.push(path.resolve(electron.remote.app.getAppPath() + '/node_modules'));
This line is where the node_modules directory becomes available to electron
-
Declare a corresponding variable in src/typings.d.ts to ensure the compiler does not complain about references to the module in Typescript.
declare var some_node_module: any;
-
If the node module is a "3rd party" module, include the module as a dependency in the electron/package.json. This is a separate package.json, differentiated from the top level package.json, that defines modules you want to be accessible in the electron app.
"dependencies": { "some_node_module": "^0.0.1" },
-
In your Typescript, you can now reference the module as follows.
some_node_module.xyz();