angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

Add Alias to PWA schematic #11472

Closed jonbcampos closed 4 years ago

jonbcampos commented 6 years ago

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [X] feature request

Area

- [ ] devkit
- [X] schematics

Versions

"@angular-devkit/schematics": "^0.6.8", "@angular/pwa": "^0.6.8",

Repro steps

Feature requiest

Desired functionality

I'm creating a schematics project that will require using the PWA schematic. I can't seem to call it with externalSchematic. The issue seems to be the fact that the name is "ng-add". My feature request is to add an alias to the PWA schematic. This works to call the material schematic already: https://github.com/angular/material2/blob/master/src/lib/schematics/collection.json#L10

jonbcampos commented 6 years ago

Totally get it. If you add an alias then someone (me or people like me) can include the PWA schematic as a node dependency and call it from another schematic. Currently I am able to do something similar with including the PWA schematic as part of my collection.json.

On Wed, Aug 8, 2018 at 12:03 PM Chaz Gatian notifications@github.com wrote:

PWA is a private schematic and cannot be invoked directly

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/11472#issuecomment-411479354, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIgzTOFuposPtTjtmgHC6YtWmJs_Y-Sks5uOxnygaJpZM4VEPIv .

-- Jonathan Campos

StephenFluin commented 6 years ago

@hansl is this a bigger problem that developers cannot nest or refer to ng-add schematics, or is there a way for them to do that?

jonbcampos commented 6 years ago

Just so it is clear. I can nest with the angular material schematic because it includes an alias along with the add. Just not with the pwa schematic.

On Wed, Aug 22, 2018, 9:46 PM Stephen Fluin notifications@github.com wrote:

@hansl https://github.com/hansl is this a bigger problem that developers cannot nest or refer to ng-add schematics, or is there a way for them to do that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/11472#issuecomment-415264653, or mute the thread https://github.com/notifications/unsubscribe-auth/AAIgzQDgEP0voChX42jaMKiup7vOOPmjks5uThdxgaJpZM4VEPIv .

codingnuclei commented 4 years ago

@StephenFluin @jonbcampos

I have been looking at this as I ran into this problem today.

The issue lies with the fact that the schematic is hidden, and more importantly private.

https://github.com/angular/angular-cli/blob/8118ab5e955338fedee9cdeed45cddf2c0e107b2/packages/angular/pwa/collection.json

Can anyone think of reason why the PWA schematic has these properties set to true? If not happy to do a PR

StephenFluin commented 4 years ago

@vikerman Can you take a look at this when you get a chance?

angular-automatic-lock-bot[bot] commented 4 years ago

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.