Skip to content

[RFC] Modules naming conventions #814

Open
@murtukov

Description

@murtukov
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? yes
Version/Branch 1.0

Before starting to separate the bundle into modules, we need to decide naming conventions.

This discussion addresses following topics:

  1. Naming on GitHub
  2. Naming on Packagist (for composer require command)
  3. Naming of the bundle class, e.g. OverblogGraphQLBundle
  4. Namespaces
  5. Naming of configs

Some rules from Symfony best practices for reusable bundles:

  • Bundle name should not contain more than 2 words + suffix Bundle
  • The bundle class name should be used as the name of the repository (AcmeBlogBundle and not BlogBundle for instance).
  • Symfony core Bundles do not prefix the Bundle class with Symfony and always add a Bundle sub-namespace; for example: Symfony\Bundle\FrameworkBundle\FrameworkBundle.

If module defines it's own services, than it should be a normal Symfony bundle, otherwise it can be a generic php library.

Questions:

  • Should we include the prefix "graphql" to module names? Including it makes names sometimes too long, but not including it deprives the module of information that it deals with GraphQL.

    Examples:

    • overblog/profiler-bundle or overblog/graphql-profiler-bundle
    • overblog/graphql-expression-language-bundle or overblog/graphql-expression-language-bundle
    • OverblogProfilerBundle or OverblogGraphqlProfilerBundle (this breaks the best practices rule "no more than 2 words")
  • Should we rename the core bundle and in what?
    Suggestion: overblog/graphql-core-bundle

  • What namespaces should we use?
    Current namespace is Overblog/GraphQLBundle
    Suggested: Oveblog/GraphQL/CoreBundle, Oveblog/GraphQL/ProfilerBundle etc.

  • What config filenames and key names should we use?
    Current filename is graphql.yaml and key name is overblog_graphql.
    Suggestion:

    • Option 1: overblog_graphql.core, overblog_graphql.profiler, overblog_graphql.expression_language
    • Option 2: overblog.graphql.core, overblog.graphql.profiler, overblog.graphql.expression_language
    • Option 3: overblog.graphql_core, overblog.graphql_profiler, overblog.graphql_expression_language

Please write your opinions and suggestions as detailed as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions