Skip to content

Add a Composer script namespace option #159

@raphaelstolt

Description

@raphaelstolt

The generated Composer script could be namespaced. With a new --composer-script-namespace option the namespace could be injected.

When not set the Composer script namespace should be derived from the project name.

If it's a short name (<=9 characters) it should be taken as is while being lowercased.

 Logger => logger

If it's a long name it should be build from the initial letters while also being lowercased. .

SomeUsefulLibrary => sul
Some-useful-Library => sul
some_Useful_library => sul

Having namespaced Composer scripts adds documentation while also introducing a typing overhead.

> composer 
 sul
  sul:application-version-guard  Run the sul:application-version-guard script as defined in composer.json.
  sul:configure-commit-template  Run the sul:configure-commit-template script as defined in composer.json.
  sul:cs-fix                     Run the sul:cs-fix script as defined in composer.json.
  sul:cs-lint                    Run the sul:cs-lint script as defined in composer.json.
  sul:test                       Run the sul:test script as defined in composer.json.
  sul:test-with-coverage         Run the sul:test-with-coverage script as defined in composer.json.
  sul:travis-lint                Run the sul:travis-lint script as defined in composer.json.

What's your opinion on this?

Should we also namespace the construct Composer scripts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions