preboot / angular-webpack

A complete, yet simple, starter for Angular v2+ using webpack
MIT License
1.29k stars 557 forks source link

The angular-cli puts components created by 'ng generate component' in src/client/app/ #80

Closed cdoremus closed 7 years ago

cdoremus commented 8 years ago

The angular-cli places new components created by 'ng generate component' in src/client/app/ rather than the src/app/components folder that angular2-webpack uses for their components.

Here's the output of a ng generate component command I just ran:

craig@craig-G750JX:~/git/angular2-webpack$ ng generate component my-feature1
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
installing component
  create src/client/app/my-feature1/my-feature1.component.css
  create src/client/app/my-feature1/my-feature1.component.html
  create src/client/app/my-feature1/my-feature1.component.spec.ts
  create src/client/app/my-feature1/my-feature1.component.ts
  create src/client/app/my-feature1/index.ts
craig@craig-G750JX:~/git/angular2-webpack$ 

I am using angular-cli 0.0.33 with node 5.7.1.

Foxandxss commented 8 years ago

Angular-cli is evolving a lot and we are not really paying attention to it. I will research.

cdoremus commented 8 years ago

Yes, I just watched a short talk by Hans Larsen, the leader of the angular-cli team, published today (https://youtu.be/JLsR75sf9OY?t=154) and he mentioned that the folder structure is still likely to change. You might want to remove the content on angular-cli from the Readme file for now.

Foxandxss commented 8 years ago

Yup, I talked with a co-worker that works on the CLI and got the same response.

Angular style is more or less going to the same ideas we have in here and I will eventually migrate this repo to our official ng2 style guide and then the CLI generation should work too.

Still, I will add a warning for this.

Thanks for the heads up.

kuncevic commented 8 years ago

@cdoremus Angular-cli is quite interesting topic and I was also wondering how would it play with angular2-webpack but haven't try it myself yet.

@Foxandxss Just thinking in a long run when acnular-cli will get to some mature level would there be any sense of using angular2-webpack or any other similar seeds and boilerplates. What is your thoughts on that?

Foxandxss commented 8 years ago

What you mean with "much scene in using"?

kuncevic commented 8 years ago

Ahh that was a typo. I meant much sense so. I just rephrased that part a bit.

Foxandxss commented 8 years ago

I have yet to play seriously with the CLI, but if you don't like what the CLI has to offer, you will want to use a different solution. CLI is not the solution to all kind of projects.

kuncevic commented 8 years ago

Yeah CLI it is still pretty much in early proof of concept but I can see that it will offer some cool stuff which makes a lots of scene but probably it is too early to judge that until it evolve some level of stability. But so far it is sounds like it is gonna be great default option of building, bundling, testing and deploying angular2 apps

GaryB432 commented 8 years ago

There is a lengthy section on CLI in this new ng2 video.

Seems great for starting an app from scratch as it has its own conventions and style. Seed apps such as this one may need to reorganize to sync up with that style once it stabilizes if it wants to integrate with or be supported by the CLI. Based on the video demo, I think I'll be sticking with angular2-webpack.

gravity-addiction commented 8 years ago

Just my two cents.. i'm not totally happy with how angular2 breaks up the pieces at the moment. pipes and services are fine. components and directives aren't very clear.. since some, but not all, directives can easily become components. For me, it's

  1. (Components) components that are attached to the end of a router.
  2. (Gadgets) component-directives, which i call gadgets, are components that are called with a tag directive <my-gadget></my-gadget>.
  3. (Directives) directives which modify a tag, <div my-directive></div>

still working on a good folder structure, currently i'm using the "old" standard, additionally putting a gadgets folder under the component.. like app/components/my-component/gadgets/my-gadget

kuncevic commented 8 years ago

@gravity-addiction Components, Gadgets, Directives sounds like too many concepts. As for me they are all just a Components.

@cdoremus it would if be great if CLI would allow to configure folder structure and not forced to default one

thekalinga commented 7 years ago

Do we still have advantages of using this repo when compared to cli? Since angular-cli also allows you tot use webpack, codelyzer, scss, protractor, tslint

Foxandxss commented 7 years ago

It goes down whether you want your webpack config accessible or not.

thekalinga commented 7 years ago

Oh ok.. Thanks..

I've not done much reading on webpack & its config.

Is it possible to add a small section to README which explains to new comers on how this will be helpful when compared to CLI?

strictd commented 7 years ago

Biggest advantage for me is not being stuck with how the cli breaks up your project structure. The CLI is wonderful for new comers, I've suggested it to many as an easy way to get started with angular projects. As soon as the questions come about customizing their dev environment I feel they've graduated past the cli and point them to preboot/angular2-webpack.

Someone told me a while back that if I had a better idea to show it.. Yesterday I pushed up a public angular-monorepo project .. It still needs some work getting the testing libraries in order.. The basic webpack-dev-server and dist/ builds are working great. All the projects use the same root level node_modules folder, a lot of paths are defined by the .env project files. Most of my monorepo is based off this angular2-webpack starter. In the monorepo a preboot/ project directory is direct src/ from here.. The starter commands are the same, they have been slightly modified to fit the modified directory structure.

This starter is still in alpha phase, use or develop at your own risk.. https://github.com/strictd/angular-monorepo

Foxandxss commented 7 years ago

Well, there is no more angular cli in this repo and won't be for the time being. Closing.