Git Product home page Git Product logo

electron-schematics's People

Contributors

avif avatar azure-pipelines[bot] avatar eranshmil avatar pontusr avatar shalomdotnet avatar shalompeles avatar shpelles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

electron-schematics's Issues

electron 5?

Just checking this out - very cool.

Are you planning to support electron v5?

Thanks! Chad

Changing BrowserWindow options for title and icon seems to be ignored (macOS)

When changing the options for title and icon for BrowserWindow, it doesn't change anything.

Description

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?

Expected Behavior

Changing this options should adjust the icon / title.
Probably the blueprints should be adjusted to satisfy macOS users.

Actual Behavior

Options seems not to change anything.

Steps to Reproduce

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

Your Environment

  • Version used: 0.7.0
  • Operating System and version (desktop or mobile): macOS Mojave 10.14.3
  • NodeJS version: 11.12.0
  • Electron version: 3.0.0
  • NPM version: 6.9.0
  • Link to your project: not at github :(

Multiple electron processes

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:

capture

Multiple processes after uncaught exceptions

Description

image
Electron is not being killed all of the time.

Expected Behavior

The task must be killed every time.

Actual Behavior

Most of the time, when there is a runtime error, the task is not being killed but a new one is opened.

Possible Fix

Add 'SIGKILL' to tree kill command.
PR: #19

Steps to Reproduce

  1. Run with ng serve.
  2. Create a runtime error and leave the alert message opened.
  3. Fix the runtime error and most of the time there will be an old task that can't be closed without kill command.

Context

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

Your Environment

  • Version used: v0.6.0
  • Operating System and version (desktop or mobile): macOS 10.13.6 (High Sierra)
  • NodeJS version: v8.12.0
  • Electron version: v3.0.9
  • NPM/Yarn version: v1.12.3

Allow to specify targets for electron-builder

Description

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.

Expected Behavior

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.

Possible Fix

We currently do this in our local fork by changing this line:

return from(build({ config: builderConfig.root + 'electron-builder.json' })).pipe(

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 });
            }),
        );
    }

Steps to Reproduce

Attempt to build windows on mac or vice versa.

Allow us to set electron and electron-builder version

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?

console.log doesn't work

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

const child = proc.spawn(electron, [projectRoot, '--serve']);

For example: proc.spawn(electron, [projectRoot, '--serve'], {stdio: ['pipe', process.stdout, process.stderr]});

Allow to pass --configuration and other parameters when building

Description

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

Expected Behavior

ng cli parameters should work as expected

Actual Behavior

--configuration parameter is ignored - all others cause error when building.

Steps to Reproduce

  1. npm install -g @angular/cli
  2. ng new my-dream-app
  3. cd my-dream-app
  4. ng add @electron-schematics/schematics
  5. ng build electron --configuration=production

Not able to reference assets in production

Description

Because the baseHref is not set to './' the bundled build will not be able to reference assets in the app.asar.

Expected Behavior

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.

Actual Behavior

Electron will try to find the assets at 'index.html/assets/image.png' which obviously produces a 404.

Possible Fix

#29

Steps to Reproduce

  1. npm install -g @angular/cli
  2. ng new my-dream-app
  3. cd my-dream-app
  4. ng add @electron-schematics/schematics
  5. Place image.png in /src/assets
  6. Add <img src="assets/image.png"> to /src/app/app.component.html
  7. ng build electron
  8. Execute /dist/electron Setup 0.0.1.[exe, dmg, AppImage] (installer for your OS)
  9. Open devtools and verify the cause of the issue.

Context

We need to be able to reuse reference to asssets in the web project without modification.

Your Environment

  • Version used: 0.7.0
    Across Mac/Windows/Linux

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.