Coder Social home page Coder Social logo

teradata / covalent-electron Goto Github PK

View Code? Open in Web Editor NEW
44.0 15.0 10.0 2.99 MB

Desktop build of Covalent using Electron

License: MIT License

JavaScript 27.16% TypeScript 46.17% HTML 20.56% CSS 6.10%
electron desktop-apps angular2 angular-material covalent angular ng2 ng nodejs angular4

covalent-electron's Introduction

Covalent-Electron is the Electron Platform to build desktop apps using Covalent and Electron

Build Status Join the chat at https://gitter.im/Teradata/covalent

Covalent

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

Covalent-Code-Editor is an Angular Component for text and code editing based on Covalent and Monaco Editor. The component can run in both Electron and Web Browsers.

Covalent-Code-Editor Github Repo: https://github.com/Teradata/covalent-code-editor

Setup

Production Build

  • 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.

Development Build

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 run VsCode and attach as the Debugger to Covalent Electron see here:


Including Node Modules in Covalent Electron

To utilize "internal" (eg. fs, path, etc.) or "3rd party" (eg. winston, uuid, monaco-editor, 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".

  1. 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

  2. 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;

  3. 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" },

  4. In your Typescript, you can now reference the module as follows.

    some_node_module.xyz();


Running Unit Tests in Covalent Electron

Covalent Electron utilizes Karma and ng test to execute unit tests inside an Electron Test Harness. The tests can be run against a standalone Angular 2 Component, an Angular 2 component that uses "internal" node modules, or an Angular 2 component that uses "3rd party" (eg. winston, uuid, monaco-editor, etc.) node modules


covalent-electron's People

Contributors

emoralesb05 avatar jeremysmartt avatar kyleledbetter avatar stevenov7 avatar thomaslennan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

covalent-electron's Issues

Initial roadmap

First things to tackle for electron:

  • Create covalent-electron-quickstart with scripts for deployment.
  • Make covalent-electron repo only for docs and electron module (utilities, db conn, helper classes, etc etc).
  • Auto reload code after modification for faster dev. (electron-reload).
  • Try to load/save a file from OS in ng2 app.
  • Try to make a jdbc connection and call a query.
  • Check localStorage.
  • Make endpoints configurable after packaging (check for versioning).
  • offline vs online usages (like slack).
  • Add Monaco Editor (VSCode)
  • Add File-select component and load files in Monaco-editor

Add external node_modules

I've included the packages as is written in electron-load, and added the variable into typings but I can't make use of it inside electron.

Moving Window after live-reload causes error

This repository's issues are reserved for feature requests and bug reports.

Do you want to request a feature or report a bug?

BUG

Bug Report

  • run npm run live-update
  • make a change in home.component.html
  • see that the live-update is successful
  • now move the window of the application around with the mouse and let go
  • the error shown in the screenshot below is displayed
Screenshots or link to CodePen/Plunker/JSfiddle

image

What is the expected behavior?

Should be able to move the window after live-update without error

npm run package fails on gulp copy --option noreload

In latest master, npm run package on osx/node-8.4 produces following error:
$ npm run package

[email protected] package /Volumes/Larder/Downloads/covalent-electron-develop
npm run ngbuild && npm run build && npm run npm-install && node "./node_modules/electron-packager/cli.js" dist Covalent --icon=src/app/assets/ico/icon.icns --out=dist-app --overwrite

[email protected] ngbuild /Volumes/Larder/Downloads/covalent-electron-develop
rimraf ./dist && ng build

11% building modules 13/18 modules 5 active ...ode_modules/style-loader/addStyles.js(node:23265) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Hash: e0a0529e5a70fbdd3ffb
Time: 10577ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 962 kB {5} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 32.2 kB {4} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 459 kB {5} [initial] [rendered]
chunk {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 109 kB {5} [initial] [rendered]
chunk {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 5.07 MB [initial] [rendered]
chunk {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

[email protected] build /Volumes/Larder/Downloads/covalent-electron-develop
gulp copy --option noreload

/Volumes/Larder/Downloads/covalent-electron-develop/node_modules/require-dir/index.js:97
if (!require.extensions.hasOwnProperty(ext)) {
^

TypeError: require.extensions.hasOwnProperty is not a function
at requireDir (/Volumes/Larder/Downloads/covalent-electron-develop/node_modules/require-dir/index.js:97:37)
at Object. (/Volumes/Larder/Downloads/covalent-electron-develop/gulpfile.js:3:23)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Liftoff.handleArguments (/Volumes/Larder/Downloads/covalent-electron-develop/node_modules/gulp/bin/gulp.js:116:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: gulp copy --option noreload
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/michal/.npm/_logs/2017-08-31T09_02_06_319Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] package: npm run ngbuild && npm run build && npm run npm-install && node "./node_modules/electron-packager/cli.js" dist Covalent --icon=src/app/assets/ico/icon.icns --out=dist-app --overwrite
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] package script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Is that a new issue or did I overlook something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.