Skip to content

[Code health] Reorganize component directories and modules #983

@gino-m

Description

@gino-m

Based on https://medium.com/@dolanmiu/angular-folder-structure-follow-the-dom-8af5453d0808 and discussion with nwotto@, suggesting the following:

  • One component = one directory = one module.
  • Subcomponent's directories should be nested under their parent component's directory
  • Components used in >1 place should live in components/
  • Components defining page roots should live under pages/

The resulting folder hierarchy under web/ would look something like this:

src
  app
    components
      shared-component-1
      shared-component-2
    converters
    models
    pages
      page-1
        subcomponent-1
          subcomponent-1a
          subcomponent-1b
          ...
        subcomponent-2  
          ....
    service

Names of components only used in one place can be shortened when name is clear from context.

We'll keep ground- element prefix as per recommendation in Angular style guide:
https://angular.io/guide/styleguide#style-02-07

@DaoyuT @amysorto @nwkotto FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: code healthImprovements to readability or robustness of codebase

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions