/Magento-2-Module-Skeleton

This Module provides a basic Skeleton for further Magento 2 Modules.

Primary LanguagePHPOtherNOASSERTION

WIP - Magento 2 Module Skeleton Dependency Status

If you decided to make an open source module, you should make sure that ever body understand what you did. To make your work less harder, I want to provide a Skeleton Module. Checkout this module, remove the parts you do not need and fill out the gabs you think they are useful.




Introduction

This module provides a skeleton for a new Magento 2 Module. It comes with examples, best practice advices and useful templates for documentation, specification or testing.

If you think, you have alternative methods or another way of thinking, please feel free to contribute to this skeleton.

This Skeleton tries to cover several aspects:

About this README

The README is the first step to a good documentation. This file will be used by Github / Gitlab as a homepage and every developer will know, that there might be some useful information about the code and the structure.

The README File can contain the whole documentation, but if a module is getting bigger and bigger, it might be handy to use a new directory. We call it doc. Due to that, we will continue this documentation in the given directory.

Quality of Code

Magento 2 PHP Mess Detector

Magento 2 uses a custom Mess Detector Ruleset. You will find it under:

/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml

To run the Mess Detector via console, you can run:

# Run in Magento 2 root
php vendor/bin/phpmd app/code/ text dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml

or

# Run in Magento 2 root
php bin/magento dev/test/run static

Magento 2 PHP Code Style

Magento 2 also comes with a custom Code Style Ruleset. You can run the Codesniffer via console with the following commands:

# Run in Magento 2 root
php vendor/bin/phpcs .

Security Advisories

Make sure, your composer Packages do not contain any security issues. Validate your composer files by:

Magento 2 Coding Standards

Legal Advices and Licenses

Templates for Specification and Documentation

API Documentation

The following resource links are a good entry point to document API's in generell.

Common Specifications

To make sure, your project is perfectly maintained, I would recommend to use Semantic Versioning and a Changelog in a specific format. You will find more information about these two topics in the following links:

Basic Setup for Tests

Tools to get up and running

The following tools are personal recommandations and are used to handle common generating and/or documentating tasks.

Changelog Generator

https://github.com/skywinder/github-changelog-generator

Contribution Guide Generator

https://github.com/WeAllJS/weallcontribute

Code of Conduct Generator

https://github.com/WeAllJS/weallbehave