GithubHelp home page GithubHelp logo

skeleton-bundle's Introduction

Skeleton Bundle

๐Ÿ—บ The skeleton bundle is a skeleton to use when you want to create a open source bundle.

โšก๏ธ Big thanks to mtarld for the inspiration, anytime I create a bundle I see what is done in his library https://github.com/mtarld/api-platform-ms-bundle. ๐Ÿ‘€

๐Ÿ’ก At some point, I decided to create a skeleton to avoid copy/paste and to have a base to start with.

๐Ÿ—ฃ You can clone this repository and remove the .git folder to start your own bundle. Obviously you should adapt the code to fit your needs.

๐Ÿซต If this skeleton is not up to date, please create an issue or a pull request to update it.

๐Ÿค If this skeleton helped you, please give it a star and tell me on twitter @SmaineDev

Table of contents


Inside-the-skeleton

You'll find a:

  • main.yaml.dist file in the .github/workflows folder. You should remove the .dist extension to trigger the github action.
  • Makefile with some useful commands to run tests and quality tools.
  • src directory where the core bundle classes can live.
  • FooBundle.php with classic instructions to configure a bundle.
  • services.php for configuring the "static" bundle services.
  • tests folder with an AppKernel and a config file to setup a Symfony app in order to test the bundle.

The Foo Bundle

A Symfony Bundle to [explain the purpose of the bundle here].

Getting started

Installation

You can easily install [Foo] bundle by composer

$ composer require <namespace>/foo-bundle

Then, bundle should be registered. Just verify that config\bundles.php is containing :

Namespace\FooBundle\FooBundle::class => ['all' => true],

Configuration

Then, you should register it in the configuration (config/packages/foo_lib.yaml) :

# config/packages/foo_lib.yaml
    foo_lib:
        # required
        foo: 'bar'
        # optional
        baz: 
          - 'qux'
          - 'quux'
          - 'quuz'

Usage

You can register a new foo service with implementing FooInterface or adding a tag foo_lib.foo if you don't use the autoconfiguration.

# config/services.yaml
services:
    # Register a new foo service
    Namespace\FooBundle\Foo:
        tags: ['foo_lib.foo']
class FooCustom implements FooInterface
{
    public function foo(): string
    {
        return 'bar';
    }
}

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

After writing your fix/feature, you can run following commands to make sure that everything is still ok.

# Install dev dependencies
$ composer install

# Running tests and quality tools locally
$ make all

Authors

  • John Doe - JohnDoe - <john(dot)doe@email(dot)com>

Publishing the bundle to be used by other developers through composer

1- Create the release on the repository

  • Go to https://github.com///releases/new
  • "Choose a tag" read carefully the Tagging suggestions.

2- Create the package on packagist

  • Go to https://packagist.org/packages/submit
  • Enter the github repository url
  • Click on "Check"
  • Click on "Submit"
  • Make the package auto-updatable by clicking on "Enable auto-updates" so you don't have to do it manually each time you create a new release.

3- Create the Symfony Recipe to be able to use the bundle with Symfony Flex and configure the bundle directly with composer

skeleton-bundle's People

Contributors

ismail1432 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.