feat: search and install Schematics
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- angular, typescript
Línea de trabajo
Comienza con packages/@angular/cli/tasks/schematic-search.ts y el commit del prototipo enlazado, y después compara su comportamiento con los ejemplos de ng search del RFC. Revisa cómo se espera que funcionen el registro de NPM y la identificación de paquetes de Schematics, incluida la nota de que la instalación se implementó mediante ng add. Los criterios de finalización para la búsqueda, la selección interactiva, el descubrimiento de paquetes y la instalación local aún deben acordarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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)...
- use the official
ng updatecommand to update the Angular dependencies of a project (and more). - use the Nrwl Nx Workspace to scaffold enterprise-grade Angular applications with proven project structure and patterns.
- use your own Schematics to transform any Feature module to a Lazy Loading Feature module.
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:
- @nrwl/schematics
- @ngrx/schematics
- @ionic-angular/schematics
- @nativescript/schematics
- @angular-extensions/schematics
- @ssilvert/keycloak-schematic
- @decerto/schematics
- @michael.warneke/ng-schematics
- material-schematics
- ngx-schematics-collection
- angular-crud
- custom-schematics
- ng-schematics-utils
- enterprise-angular-generator
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!
- Searching for available Schematics
> ng search foo_
● foo_abc (description) (popularity index)
○ foo_def (description) (popularity index)
○ foo_ghi (description) (popularity index)
○ foo_ijk (description) (popularity index)
- Interactively search for Schematics
> ng search
? Find and install Angular CLI Schematics: foo_
● foo_abc (description) (popularity index)
○ foo_def (description) (popularity index)
○ foo_ghi (description) (popularity index)
○ foo_ijk (description) (popularity index)
- Interactively installing Schematics
> ng search
? Find and install Angular CLI Schematics: bar_ [ENTER]
● bar_def (description) (popularity index)
○ bar_ijk (description) (popularity index)
Installing packages for tooling via npm...
Install Schematics
NOTE: This was implemented via theng addcommand.
> ng schematics install foo_abc foo_ghi
Installing...
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:
- Use the current
schematicsproperty in thepackage.json, eg. see example:
{
...
"schematics": "./src/collection.json"
}
-
Use an NPM named scope, eg.
@ngxschematics(ngxbeing the community reserved prefix we agreed on (cc @IgorMinar) —@schematicsis 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:
- list, update or remove local Schematics.
- Replace an active Schematic, eg. defaults, with a new one.
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 (https://github.com/manekinekko/angular-cli/commit/37063374c731386b460fff925183a9d461d0a364)

- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 16 h 35 min
- PR fusionados (30 d)
- 176
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Abiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/angular-cli#33055 · 1 comentario · 3 reacciones ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Abiertoarea: @angular/build gemini-triaged
Dificultad 4/5 3-5 días Aptitud para principiantes 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 asignado ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 asignado ·
Todos los issues de angular/angular-cli
Issues similares
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Abiertoclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
supermomonga/zcode-acp#24 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
growthbook/growthbook#7100 ·
-
triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100