Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
electron-angular-native
Advanced tools
Easy to use, ready for distribution boilerplate for Electron Angular applications supporting native code.
Native code is supported in two different ways:
In order to clone and run this repository you'll need Git and Node.js (which comes with npm) installed on your computer.
Clone the repository
If you're behind a corporate firewall configure git
proxy:
git config --global http.proxy http://proxy.company.com:port
git config --global https.proxy http://proxy.company.com:port
From your bash (git-bash or similar) command line:
# Clone this repository
# git > 2.13
git clone --recurse-submodules https://github.com/meltedspark/electron-angular-native
# git <= 2.12
git clone --recursive https://github.com/meltedspark/electron-angular-native
# Go into the repository
cd electron-angular-native
Prepare the environment
If you're behind a corporate firewall configure npm
proxy:
npm config set proxy http://proxy.company.com:port
npm config set https-proxy http://proxy.company.com:port
EXTREMELY IMPORTANT: Make sure you have python v2.7
and appropriate C\C++ compiler toolchain
installed:
You will also need to install:
- On Unix:
python
(v2.7
recommended,v3.x.x
is not supported)make
- A proper C/C++ compiler toolchain, like GCC
- On Mac OS X:
python
(v2.7
recommended,v3.x.x
is not supported) (already installed on Mac OS X)- Xcode
- You also need to install the
Command Line Tools
via Xcode. You can find this under the menuXcode -> Preferences -> Downloads
- This step will install
gcc
and the related toolchain containingmake
- On Windows:
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
- Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using
npm install --global --production windows-build-tools
from an elevated PowerShell or CMD.exe (run as Administrator).- Option 2: Install tools and configuration manually:
- Visual C++ Build Environment:
Option 1: Install Visual C++ Build Tools using the Default Install option.
Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.
:bulb: [Windows Vista / 7 only] requires .NET Framework 4.5.1
- Install Python 2.7 (
v3.x.x
is not supported), and runnpm config set python python2.7
(or see below for further instructions on specifying the proper Python version and path.)- Launch cmd,
npm config set msvs_version 2015
If you have multiple Python versions installed, you can set
npm
's 'python' config key to the appropriate value:
$ npm config set python /path/to/executable/python2.7
Note that OS X is just a flavour of Unix and so needs
python
,make
, and C/C++. An easy way to obtain these is to install XCode from Apple, and then use it to install the command line tools (under Preferences -> Downloads).
From your bash (git-bash or similar) command line:
# Install dependencies
npm install
src/
directorysrc/native/
directory (a new native source code shall be put there as well)simplelib
) are fetched from another git repository as git submodule and can be found in native-artifacts/precompiled-libraries
directory.simplelib
.native-artifacts/native-addons
directory (first time compiled on npm install
)You can define application name, version, author and runtime node dependencies in app.package.js
Running application in debug mode:
npm start
This will run your Electron Angular application in watch mode, i.e. if you change any .ts
file the application will reload the changes automatically.
The application starts with debug tools open so that you can place breakpoints and debug your Typescript code.
Note that first time you run npm start
the application might open with console error saying "Not allowed to load local resource: file:///.../electron-angular-native/serve/index.html".
The reason for that is that webpack compilation and electron serve run simultaneously and the application starts before the code is ready.
All you need to do is wait - once the compilation is complete the application will reload with the compiled code.
Debugging production build (AoT, Uglify etc.):
Sometimes you want to make sure your code compiles in production mode during the development (or even debug AoT related issues).
In order to build the application in production mode run:
npm run build:prod
If you want to debug the application in production mode (built with AoT) use this:
npm run start:prod
Compiling native code:
Native code is not compiled on every npm start
(it's only compiled on npm install
and before the distribution), but if you want to recompile it, run the following command from your bash command line:
npm run electron:build:native
Running end to end tests with Spectron:
To run end to end tests use the following command:
npm run e2e
This will run all the tests in e2e
directory (the tests extension must be .e2e-spec.ts
).
For your convenience there is a helper class SpectronUtils
which can be used for tests definition and two test examples:
native-links.e2e-spec.ts
verifies that the links that loaded from native modules present upon the application startsanity.e2e-spec.ts
verifies that the application startsNote that end-to-end tests check the end user application (meaning the application created with npm run dist
command). This means that prior to executing npm run e2e
you have to execute npm run dist
at least once
Run the following from the root folder to create a distribution for:
Current platform:
npm run dist
Windows 32 bit:
npm run dist:windows:32
Windows 64 bit:
npm run dist:windows:64
Linux 32 bit:
npm run dist:linux:32
Linux 64 bit:
npm run dist:linux:64
OSX:
npm run dist:osx
Be aware that cross-platform builds are performed on remote server
Distributed application is built in production mode (to benefit from Angular AoT).
If for some reason you want it in dev mode (JIT), run npm run dist:dev
Build artifact can be found in build-artifacts folder
FAQs
 
The npm package electron-angular-native receives a total of 0 weekly downloads. As such, electron-angular-native popularity was classified as not popular.
We found that electron-angular-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.