Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add angular-cli #9

Open
area73 opened this issue Aug 3, 2017 · 21 comments
Open

Add angular-cli #9

area73 opened this issue Aug 3, 2017 · 21 comments

Comments

@area73
Copy link

area73 commented Aug 3, 2017

Is it posible to add angular-cli?
Does it make sense?

@colinskow
Copy link
Owner

I am contributing to this starter, specifically because angular-cli doesn't have enough flexibility to do what I want to do. It may make sense for generating components / services / pipes etc. but not for the build process.

@area73
Copy link
Author

area73 commented Aug 16, 2017

That's what I though it make sense for generating components, service etc.
I give it a try and works fine with angular-cli to generate the above files, so any one who wants to use angular-cli it's a matter of only installing the dependency :)

@Css-IanM
Copy link

I dont think you even need it as a dep, you can install it globally and still just use it for generation.

@colinskow
Copy link
Owner

If you would like to provide instructions and an example in the README for how to generate components with angular-cli (including a working config file) then I would welcome a pull request.

@okonon
Copy link

okonon commented Sep 27, 2017

@colinskow is there a way to serve angular code in a browser ?

@colinskow
Copy link
Owner

@okonon this project is specific to Electron and does not support browsers. I recommend https://github.com/AngularClass/angular-starter

@Kaffiend
Copy link

Kaffiend commented Jan 10, 2018

I'm working on a more cli oriented electron seed. I'm still working on integrating more convenient features such as HMR (in progress) but i have live-reload and everything is proxy-ed around the cli and uses the cli build process for all angular code. So far i have not yet had to eject the underlying webpack.
This seed can be found here
https://github.com/Kaffiend/electron-angular-ngrx

Edit: Update!! Angular hosted HMR ng serve -hmr done.

@colinskow
Copy link
Owner

I definitely want to integrate CLI. Ideally without having to eject. But the Electron main process needs traditional Webpack. I won't get to it for at least a few weeks, so PRs welcome!

@Kaffiend
Copy link

Kaffiend commented Jan 10, 2018

I'm not as familiar as i'd like to be. What caveats of electron's main process require traditional webpack?
Part of the reason im building this seed from scratch is to force myself to learn all the in and outs 😄

@colinskow
Copy link
Owner

@Kaffiend there are two separate builds in this starter:

  1. Main Electron process is compiled from TypeScript and minified through Webpack. This won't be changed and is incredibly simple. Just look at the config file.
  2. Renderer process is compiled through Webpack. We want to switch this process over to angular-cli. Ideally we can figure out how to integrate CLI into our Electron dev server without having to eject the config.

@Kaffiend
Copy link

Kaffiend commented Jan 10, 2018 via email

@colinskow
Copy link
Owner

@Kaffiend it looks like your approach will work. I'd prefer not to use gulp, so let's write a script that simply uses promises to accomplish the same.

@colinskow
Copy link
Owner

Although I see how Gulp makes things a lot easier to probably best to leave it. The one thing to add is to automatically restart Electron when source files for the main process are updated.

@Kaffiend
Copy link

Kaffiend commented Jan 10, 2018 via email

@Kaffiend
Copy link

Kaffiend commented Jan 10, 2018 via email

@Kaffiend
Copy link

For now i'm going to keep gulp, as you said it does make things easier. But at the first hiccup of upstream packages hindering updates and progression I wont hesitate to yank it out 😺

@Kaffiend
Copy link

@colinskow I've got all three development build processes lined out now. Had an issue with the task completion launching the electron too soon before the cli was done serving up the HMR and you had to reload manually once it finished. gulp also suppresses STDOUT on wrapped commands to the CLI so i piped those through to display the CLI build stats and completion messages. This was also the case with the electron main process, so i piped it as well. Console logs where suppressed which could be confusing if you didnt know what was going on.

@Kaffiend
Copy link

So i've had some challenges to overcome with the CLI, external modules and render target. This required ejection. I wish there was a way around it but I've yet to find a viable one. Internally we have it up and running with HMR on an ejected project while using external modules. I will update our parallel seed this weekend with the solution we came up with as well as some more progress on the baseline of the seed for examples.

@Kaffiend
Copy link

@colinskow I've updated the seed i linked above to eject from the CLI, added native module support, and updated to support HMR workflow with the ejected CLI.

@colinskow
Copy link
Owner

@Kaffiend What issue were you running into that forced you to eject the project?

@Kaffiend
Copy link

Kaffiend commented Feb 8, 2018

setting the target so that i could have access to native modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants