Add new "common" schematic to share configurations for all schematics at once

Open
#33,221 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
cli

Research direction

Start with the generate command and the schematic configuration-resolution path. Compare the proposed common configuration with the current per-artifact configuration, then define how common values apply and how direct artifact values override them. Done means schematics can inherit shared defaults while preserving per-artifact overrides.

Written by the indexing model from the issue text.

Description

area: @angular-devkit/schematics gemini-triaged
Command

generate

Description

Implement an internal artifact to commonize the configuration of schematics so that all schematics can share a common configuration by default, and override on a per-artifact basis if needed. Currently, all configurations are duplicated, and while not that annoying to deal with for a single collection, it can quickly add up when using several collections.

Describe the solution you'd like

Actual :

{
  "schematics": {
    "@schematics/angular:component": { "skipSelector": true },
    "@schematics/angular:directive": { "skipSelector": true },
    "@schematics/angular:pipe": { "skipSelector": true }
  }
}

Proposed :

{
  "schematics": {
    "@schematics/angular:common": { "skipSelector": true }
  }
}

This new common schematic would contain either

  • only fields that are common to all artifacts
  • All fields possible, even if not applicable to certain artifacts

Resolving would follow this pattern :

  • Look for common artifact schematic value
  • If existing, apply value
    • If all fields are possible : also check if value is applicable to artifact
  • Look for direct artifact schematic value
  • Override value
Describe alternatives you've considered

Doing it by hand as already done today is the only solution

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
16h 35m
Merged PRs (30d)
176

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.