Angular-cli: [Enhancement] Multi Module Projects

Created on 19 Jun 2016  路  11Comments  路  Source: angular/angular-cli

Hey,

As projects evolve and become larger, multi module architecture become a crucial ability.
I think that incorporating a new code generator for modules would solve this problem.

For example:

ng g module components
ng g module demo-app
ng g module editor-app

npm run start-demo-app
npm run test demo-app
npm run lint components

I saw material2 implements this kind of functionality, and I was able to recreate it by following these steps:

  1. karma-test-shim.js - appPaths is modified to cover all modules
  2. angular-cli-build.js - Angular2App is built and returned based on the environment variable.
  3. multiple tsconfig.ts directories under src/.

What do you think?

2 (required) feature

Most helpful comment

@filipesilva Do you have an update regarding the lib app support? Is it slatted for any future release yet? :) My team and I would LOVE to have this functionality within the CLI

All 11 comments

This would be useful, but would also require more changes than you listed. For example, the support for modules would need to be directly integrated into ng serve and ng build.

Maybe, we could instead introduce a new option for ng new which would create a headless library instead of a full blown app project.

An example for multi module application creation using the new flag would be:

ng new comopnents --lib
ng new components-demo
ng new myapp

cd myapp && npm install --save file:../components
cd ../components-demo && npm install --save file:../components

With that approach, only ng build and ng init\new would need to be changed (I think).
What do you think?

What you just described now is the upcoming lib app support. It's a bit different than what's happening in material 2 though.

Couldn't find where do you mention the lib app support, when it should be approximately shipped? :)

I don't have a date, but it should be included in 1.0.

Thanks :)

Hi guys,
As far as I understand this upcoming lib app support will allow developers to generate 3rd party modules, like AngularFire2, which than can be able published to npm registry and installed by other users via npm install command, am I right?
I currently use 1.0.0-beta.11-webpack.8 angular-cli, but there is no mention about lib generators. Maybe I missed something?

@amalieiev yeap, that's the plan. We don't have any details on it right now, nor is the functionality in any release.

@filipesilva Do you have an update regarding the lib app support? Is it slatted for any future release yet? :) My team and I would LOVE to have this functionality within the CLI

Heya, I'm closing this issue since lib support is being tracked in https://github.com/angular/angular-cli/issues/1692, and there is already multiple app support (https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/multiple-apps.md).

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings