-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat: search and install Schematics #10000
Comments
I like those ideas. Two things came in mind when reading this:
|
Great initiative, regarding search IMHO tags, looks better, as the simplier way to be listed in the search results. More steps to follow with publication === more contributions. |
Agreed. Although, this will depend on what DX we wanna have (simple query search, autocomplete...etc).
This proposal is only for Schematics that are published on NPM. It's not meant for Schematics |
@vitaliy-bobrov I'm okay with that too as long as the search process can be done in a deterministic and consistent way ^^ |
@manekinekko , it's very a good idea and if we use a specific schematics in enterprise, we can store it on a private nexus (a hoster for all packager type like npm, nuget, maven...). Do you think it's possible or not ? |
Hey! Just chiming in here from Algolia, you can see a similar search made with our index in Emma-cli. It's made for the Yarn website originally, but definitely also meant to be used by other parts of the community. We'd prefer it if the search said Ping me if you have any questions or want to try it out |
I made another little demo here https://schematics-search.firebaseapp.com/ The interface is irrlevent, I just wanted peoplr to be able to use it, we can easily put it into a CLI interface. |
Love this. I've been recommending people to add specific tags including:
|
RFC: Search and install Angular CLI Schematics
tl;dr
The goal of this proposal is to add a new
ng
command allowing to search and install Angular CLI Schematics right from the command line, using the NPM registry. Read below for more technical details.Longer version
The Angular CLI has introduced support for Schematics allowing developers to easily extend or even completely change the default behavior of the Angular CLI commands. With Schematics, we can (for instance)...
ng update
command to update the Angular dependencies of a project (and more).More generally, you can use Schematics to "[...] transforms to your project, such as create a new component or updating your code to fix breaking changes in a dependency. Or maybe you want to add a new configuration option or framework to an existing project". Read more on the angular.io.
The Angular community has already started creating custom Schematics, here are some of them:
We expect the number of the Angular CLI Schematics to grow; hence, the goal of this thread is to discuss the ability to add a new
ng
command allowing to (right from the command line):Note: the commands used below
ng search **
are just for illustration purposes!Install SchematicsNOTE: This was implemented via the
ng add
command.In order for this search to be done, we will leverage the NPM infrastructure and use the public registry as the database and we need to be able to identify what NPM packages are actually Angular CLI Schematics. Here are different proposals:
schematics
property in thepackage.json
, eg. see example:Use an NPM named scope, eg.
@ngxschematics
(ngx
being the community reserved prefix we agreed on (cc @IgorMinar) —@schematics
is already reserved for the official Schematics made by the Angular team). The community NPM scope (@ngxschematics
) would obviously be owned (and maintained) by the Angular core team. So (community) Schematics authors will have to send PRs to that repository to make their Schematics available (listed) in the Angular CLI search command (discussed here). This approach is similar to the DefinitelyTyped project (@types/**
).Have some sort of a "Market Place for Schematics" (out of the scope of this proposal). This could be merged with the previous solution.
Community Schematics authors would have to tag their schematics with an explicit set of tags, eg.
(angular, schematics)
. Community Schematics that aren't tagged using these keywords won't be listed by the Angular CLI search command (discussed here).Other topics to cover (later) are:
The search process would be done by using 3rd party search APIs that interface with the NPM registry (offering probably better performances?), here are some of them:
Similar projects (inspiration):
Please use Github's emoji to express your interest in this draft.
cc @hansl @Brocco @filipesilva
[UPDATE] working prototype (https://github.com/manekinekko/angular-cli/blob/search-install-schematics/packages/%40angular/cli/tasks/schematic-search.ts)[UPDATE] upgrade ptotype to v6.0.0-rc.6 (manekinekko@3706337)
The text was updated successfully, but these errors were encountered: