GithubHelp home page GithubHelp logo

skel's Introduction

Skel

A PHP Package Creator & Skeletons

Skel is a Bash script to create Composer PHP packages based on skeletons.

Why?

Laravel 4 Workbench is great, but, in my first steps with it I found easier to develop a package right from my vendor folder, where the package will really be after I install it using Composer. Also because my new packages needed some more preparing than just setting up files in folders, I needed more information in my composer.json, my package stub had more files than the ones Laravel provided, like readme.md, changelog.md and travis.yml, I also had more info in composer.json, so there was a lot of boilerplate to be added before I go my package really ready to go, things I could avoid using my own skeleton (stub).

This script does all this for you, allowing you to use a skeleton repository to create the package and even upload a first draft of it to Github (or any other VCS service).

How it Works

Skel is very simple, when running it will

  1. Ask for some information (destination, vendor, package, vcs username, skeleton to be used...).
  2. Clone a skeleton repository of your choice.
  3. Replace everything related to the package with the information provided.
  4. Push the new package to your VCS (Github, Bitbucket...).
  5. Give you instructions on how to add the new package to your application.

You Don't Need to Add Your Package to Packagist

Skel will automatically push your new package to a VCS repository (Github, Bitbucket...), but you don't need to add it publicly to Packagist. You can require your new package on your composer.json:

"require": {
    "yourVendorName/yourPackageName": "dev-master",
},

And reference your VCS in the repositories object:

"repositories": [
    {
        "type": "vcs",
        "url":  "https://github.com/yourUsername/yourPackageName.git"
    },
],

Then you just have to tell Composer to install by cloning it, allowing you to develop your package right from your app vendor folder:

You can read more about this

composer install --prefer-source

And it's done!

Running Skel remotely from Github

bash <(curl -s https://raw.githubusercontent.com/antonioribeiro/skel/v0.1.0/skel.sh)

Installing the script on your system

DESTINATION=/usr/local/bin/skel
sudo wget https://raw.githubusercontent.com/antonioribeiro/skel/v0.1.0/skel.sh -v -O $DESTINATION
sudo chmod +x $DESTINATION 

Then you just have to run it

skel 

Skeletons

During creation of a package the script may ask for a skeleton to install, the currently available are:

All skeletons on this repository are using ThePhpLeague/Skeleton a base, and every commit to League's repository will be merged to Skel, but there are some differences:

  • Replacement strings (:package_name, :vendor_name, etc.) were unified
  • Framework specific files, for instance the Service Provider, included in Laravel 4 and 5 skeletons.

Going Faster

You can export some variables so you don't have to type too much while creating your packages, you just have to add those lines to your .bashrc and fill them properly:

export VENDOR_NAME=pragmarx
export PACKAGE_AUTHOR_NAME=Antonio Carlos Ribeiro
export [email protected]
export PACKAGE_AUTHOR_WEBSITE=https://antoniocarlosribeiro.com
export PACKAGE_AUTHOR_USERNAME=antonioribeiro
export PACKAGE_DESCRIPTION=PragmaRX Package for...
export SKELETON_VENDOR_NAME=pragmarx
export SKELETON_VENDOR_NAME_CAPITAL=PragmaRX
export SKELETON_PACKAGE_NAME=skeleton
export SKELETON_VENDOR_NAME_CAPITAL=Skeleton
export SKELETON_PACKAGE_REPOSITORY=https://github.com/antonioribeiro/skel.git
export SKELETON_VCS_USER=antonioribeiro
export SKELETON_VCS_SERVICE=github.com
export SKELETON_PACKAGE_BRANCH=league

skel's People

Contributors

antonioribeiro avatar

Stargazers

Ron avatar Douglas Maia avatar Sarfraz Ahmed avatar  avatar Leonardo Hipolito avatar Julio Bitencourt avatar Vinicius Reis avatar Matheus Lima avatar Gergely Havlicsek avatar Marcus Moore avatar ep avatar UchMan avatar

Watchers

James Cloos avatar  avatar  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.