Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

bug: unable to execute custom schematic application blueprint #528

Closed
Hotell opened this issue Mar 18, 2018 · 9 comments
Closed

bug: unable to execute custom schematic application blueprint #528

Hotell opened this issue Mar 18, 2018 · 9 comments

Comments

@Hotell
Copy link

Hotell commented Mar 18, 2018

Bug Report or Feature Request (mark with an x)

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

Area

- [ ] devkit
- [x] schematics

Versions

Angular CLI: 1.7.3
Node: 8.10.0
OS: darwin x64

image

Repro steps

npm i -g @martin_hotell/schematics typescript @angular/cli @angular-devkit/schematics-cli

ng new better-cli --material --collection @martin_hotell/schematics -d

The log given by the failure

image
image

Locally installed project schematics works:
image

And yes my schematics have been generated via @schematic/schematic
https://github.com/Hotell/ng-cli-schematics/blob/master/package.json ✌️

Desired functionality

being able to generate new app via custom schematic

Mention any other details that might be useful

There were issues created before which were closed for unknown reasons :) not cool at all 👀

Related:

@james-schwartzkopf
Copy link

Just a shot in the dark, you seem to be mixing npm and yarn. Are you sure you installed your global schematics and global ng in the same one? Could one of them be an older version or something?

@Hotell
Copy link
Author

Hotell commented Mar 20, 2018

just a shot in the dark, you seem to be mixing npm and yarn. Are you sure you installed your global schematics and global ng in the same one? Could one of them be an older version or something?

Nope, I'm not mixing anything, yarn is used only as task runner in local cli project in my bug issue + I've explicitly described the reproduction steps. 👉 I've updated the issue with list of my global packages.

@choucry13
Copy link

hey, any news ?

@Hotell
Copy link
Author

Hotell commented Apr 26, 2018

@choucry13 my 50 cents are there will be no news in terms of fixing this in cli 1.x, just closed issue, cause it will be resolved with cli 6. Also CLI team has hands full with making everyting ready for 6, so that's why no one responded as well, other more important priorities in pipeline 👀✌️

@choucry13
Copy link

oh thank dude :-)

@Brocco
Copy link
Contributor

Brocco commented May 8, 2018

NOTE: The following information is for version 1.4-1.7 (not 6+)

To use a custom schematic for ng new you need to specify the collection (as you've done above), and you need to specify the schematic to use (which is by default "application").

If you'd like to use a different schematic name, you will need to configure that in your global .angular-cli.json file. The reference schema is here.

This global value can also be set using...

ng set defaults.schematics.newApp yourSchematicName

This needs to be global because at the time that ng new is run there is no config file other than your global config file.

Hopefully this answers your question, if so, please close the issue.

@Hotell
Copy link
Author

Hotell commented May 9, 2018

I already know all of that, but what you're saying is I cannot execute application schematic from custom collection by providing it explicitly and I can only do that by setting the collection to global ng config ? That's sound like bug to me.

@Brocco
Copy link
Contributor

Brocco commented May 9, 2018

I don't disagree; however, this is an issue with the CLI (not devkit) can you please create an issue on that repo with a link to this issue?

@alexeagle
Copy link
Contributor

This issue was moved to angular/angular-cli#12131

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

No branches or pull requests

5 participants