shpelles / electron-schematics Goto Github PK
View Code? Open in Web Editor NEWElectron extensions for Angular Schematics
Electron extensions for Angular Schematics
Just checking this out - very cool.
Are you planning to support electron v5?
Thanks! Chad
When changing the options for title
and icon
for BrowserWindow
, it doesn't change anything.
I have changed the default options for BrowserWindow
like that:
mainWindow = new BrowserWindow({
// ...
title: 'My App',
icon: 'assets/icon.png'
});
When serving the electron app or building it using ng serve electron
/ ng build electron
, the App name in the macOS titlebar doesn't change and the icon is still the default icon provided by electron itself.
To which paint is the path in icon
setting pointing to when the app is build? To the src
-directory of the angular application?
Changing this options should adjust the icon / title.
Probably the blueprints should be adjusted to satisfy macOS users.
Options seems not to change anything.
Adjust the file main.ts
like that:
mainWindow = new BrowserWindow({
// ...
title: 'My App',
icon: 'assets/icon.png'
});
run ng serve electron
or ng build electron
I've noticed that when starting project with ng serve electron
and then modifying main.ts
file it seems to create a lot of "hanging" processes upon each restart, which consumes CPU and doesn't seems to disappear over time. This is with a default Angular project created using ng new
.
See screenshot below:
Electron is not being killed all of the time.
The task must be killed every time.
Most of the time, when there is a runtime error, the task is not being killed but a new one is opened.
Add 'SIGKILL' to tree kill command.
PR: #19
After working a few hours on the project, there are too much opened tasks and I had to kill them all using the activity monitor (aka task manager).
I plan to use NativeScript's code sharing to build a web and mobile app and would also like to generate an electron app from the same code base. Has this been tested with an Angular project generated by the NativeScript schematic?
We need to be able to specify which build targets are built when building for example windows on a mac and so on. AFAIK this is not possible to do using electron-builder.json. By default electron-builder only targets the local platform.
Either passing command line parameters (preferred by us since we also build using build servers).
Example from: https://www.electron.build/cli
--mac, -m, -o, --macos Build for macOS, accepts target list (see
https://goo.gl/5uHuzj). [array]
--linux, -l Build for Linux, accepts target list (see
https://goo.gl/4vwQad) [array]
--win, -w, --windows Build for Windows, accepts target list (see
https://goo.gl/jYsTEJ) [array]
--x64 Build for x64 [boolean]
--ia32 Build for ia32 [boolean]
--armv7l Build for armv7l [boolean]
--arm64 Build for arm64 [boolean]
and/or
specify them programatically via package.json or similar.
We currently do this in our local fork by changing this line:
into something like this (we obviously pick up the list of platforms from outside the class)
const Platforms = build.Platform;
const targetPlatforms = build.createTargets([Platform.WINDOWS, Platform.MAC, Platform.LINUX]);
private _packApp(builderConfig: BuilderConfiguration<ElectronBuilderSchema>): Observable<BuildEvent> {
return from(build({targets: targetPlatforms, config: builderConfig.root + 'electron-builder.json' })).pipe(
mapTo({ success: true }),
catchError(err => {
this.context.logger.error('Failed to build the electron app', err);
return of({ success: false });
}),
);
}
Attempt to build windows on mac or vice versa.
Thanks for these excellent schematics ๐ฅ
It works great - however, we probably need to move to Electron 4 very soon and we would very much need a newer version of electron-builder already now.
Any plans for upgrading or alternatively, allowing us to configure these dependencies separately?
I've noticed that console.log doesn't seem to be outputing anything to the terminal when ng serve electron
command is being used. From what I understand this is related to how electron is started (through process spawning in node).
Therefore, it would be good to pipe an output of child process to parent process when spawning electron
For example: proc.spawn(electron, [projectRoot, '--serve'], {stdio: ['pipe', process.stdout, process.stderr]});
We need to be able to add parameters such as --configuration
to the build so that we can do for example: ng build electron --configuration=production
ng cli parameters should work as expected
--configuration parameter is ignored - all others cause error when building.
npm install -g @angular/cli
ng new my-dream-app
cd my-dream-app
ng add @electron-schematics/schematics
ng build electron --configuration=production
Because the baseHref is not set to './' the bundled build will not be able to reference assets in the app.asar.
References in angular templates in the related web project to for example 'assets/image.png' should resolve correctly also in the bundled app produced by electron-builder.
Electron will try to find the assets at 'index.html/assets/image.png' which obviously produces a 404.
npm install -g @angular/cli
ng new my-dream-app
cd my-dream-app
ng add @electron-schematics/schematics
<img src="assets/image.png">
to /src/app/app.component.htmlng build electron
We need to be able to reuse reference to asssets in the web project without modification.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.