{"id":15925815,"url":"https://github.com/t1st3/generator-composer","last_synced_at":"2025-09-06T02:34:45.913Z","repository":{"id":13151614,"uuid":"15834222","full_name":"t1st3/generator-composer","owner":"t1st3","description":":elephant: Yeoman (http://yeoman.io) generator for a PHP Composer project","archived":false,"fork":false,"pushed_at":"2020-06-03T09:18:18.000Z","size":217,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T03:54:47.754Z","etag":null,"topics":["composer","generator","javascript","packagist","php","phpdocumentor","phplint","phpunit","yeoman"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t1st3.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-12T01:17:02.000Z","updated_at":"2024-04-26T11:07:26.000Z","dependencies_parsed_at":"2022-08-25T20:21:58.846Z","dependency_job_id":null,"html_url":"https://github.com/t1st3/generator-composer","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fgenerator-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fgenerator-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fgenerator-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t1st3%2Fgenerator-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t1st3","download_url":"https://codeload.github.com/t1st3/generator-composer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245289741,"owners_count":20591124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","generator","javascript","packagist","php","phpdocumentor","phplint","phpunit","yeoman"],"created_at":"2024-10-06T22:04:37.034Z","updated_at":"2025-03-24T14:32:32.520Z","avatar_url":"https://github.com/t1st3.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"generator-composer\n==================\n\n[![NPM version](https://img.shields.io/npm/v/generator-composer.svg)](https://www.npmjs.com/package/generator-composer)\n[![Dependency Status](https://img.shields.io/david/t1st3/generator-composer.svg)](https://david-dm.org/t1st3/generator-composer)\n[![devDependency Status](https://david-dm.org/t1st3/generator-composer/dev-status.svg)](https://david-dm.org/t1st3/generator-composer#info=devDependencies)\n[![Build Status](https://img.shields.io/travis/t1st3/generator-composer.svg)](https://travis-ci.org/t1st3/generator-composer)\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/t1st3/generator-composer.svg)](http://isitmaintained.com/project/t1st3/generator-composer \"Percentage of issues still open\")\n\n\nAbout\n-----------\n\nA generator for [Yeoman](http://yeoman.io).\n\nIt provides a basic boilerplate for a [Composer](http://getcomposer.org) project, which features:\n\n* automatic creation of [PhpDoc](http://phpdoc.org) documentation on build\n* a functional example\n* buildable with [Grunt](http://gruntjs.com)\n* Ready for [Github](https://github.com), [Travis-CI](https://travis-ci.org/) and [Packagist](https://packagist.org/)\n\n\nThe proposed Grunt build for the generated Composer project has the following tasks:\n\n* PHPLint to review quality of code\n* [PHPUnit](http://phpunit.de/) to run tests\n* automatic creation of a [PhpDocumentor](http://phpdoc.org) documentation\n* Usage of [Php Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd)\n* Automatic versioning of all the project when version is modified in package.json\n\nThe generated PHP project does not rely on any other PHP dependency than Composer and Packagist-installed packages (e.g. no PEAR dependency).\n\n\nInstallation\n-----------\n\nYou must have Nodejs and NPM installed. \n\nThen, to install Yeoman globally from npm, run:\n\n```\nnpm install -g yo\n```\n\nFinally, to install generator-composer globally from npm, run:\n\n```\nnpm install -g generator-composer\n```\n\nYou may also just install it locally:\n\n\n```\nnpm install generator-composer\n```\n\n\n\nUsage of the generator\n-----------\n\nOnce you have installed Node, NPM, Yeoman and the generator itself, you can initiate the generator:\n\n```\nyo composer\n```\n\nYeoman will ask you 3 questions:\n\n1. your github account (e.g. gitAccount)\n2. the name of the repository on Github (e.g. php-my-super-package)\n3. the name of the main PHP class of your project (e.g. mySuperPackage)\n\n\n\n\nBuild dependencies of your generated PHP project\n-----------\n\nIn order to build your generated Composer project from its source, you will need Grunt and PHP on the command line.\n\nSo, you must install PHP5 on your system on your command line. Test it:\n\n```\nphp --help\n```\n\n\nTo install Grunt globally on the command line (and run the above build task), run:\n\n```\nnpm install -g grunt-cli\n```\n\nThen, with Grunt, you can install Composer locally. Just run once:\n\n```\ngrunt init\n```\n\nThen, you can install PhpDocumentor, PhpUnit and PhpCPD locally. Just run once:\n\n```\nphp composer.phar install -v\n```\n\nFinally, you should also install the PHP extension named Xdebug, which will be used by PhpUnit for code coverage.\n\n\n\n\nBuild the sources of your generated PHP project\n-----------\n\nOnce all your dependencies are installed, you can build your project with Grunt:\n\n```\ngrunt build\n```\n\nThe build process will run the following tasks:\n\n* PhpLint: runs php -l over the \"src\" folder\n* Runs the tests located in the \"tests\" folder with [PHPUnit](http://phpunit.de/)\n* Generates a [PhpDocumentor](http://phpdoc.org) documentation in the \"doc\" folder from the files of the \"src\" folder\n* Detects copy/paste of code in the files of the \"src\" folder with [PhpCPD](https://github.com/sebastianbergmann/phpcpd)\n\n\n\nPublish your generated project on Packagist\n--------------\n\nThe generated PHP is ready-to-publish on [Packagist](https://packagist.org/). Just login on Packagist with Github, add the Packagist hooks to your Github account, and activate your package on Packagist.\n\n\n\nBuild the generator from its sources\n-----------\n\nThe generator itself can be built from its sources. At the moment, the build process only includes syntax checks with [JSHint](http://jshint.com) and [JSCS](https://npmjs.org/package/jscs).\n\nIn order to build the generator from its source, you will need Grunt. To install Grunt globally on the command line (and run the above build task), run:\n\n```\nnpm install -g grunt-cli\n```\n\nJust run the `grunt task` in the folder where your generator is installed:\n\n```\ngrunt\n```\n\n[![Dev dependencies Status](https://img.shields.io/david/dev/t1st3/generator-composer.svg)](https://david-dm.org/t1st3/generator-composer#info=devDependencies)\n[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\n\n\n\n\nTodos\n----------\n\n- Try to get a livereload process for the generated project (maybe with grunt-php)\n- More comments in the code\n- Include a changelog generator in the build process of the generated code\n\n\n\nCredits\n-----------\n\n* [Yeoman](http://yeoman.io)\n* [Grunt](http://gruntjs.com)\n* [Composer](http://getcomposer.org)\n\n \n\n\n\nLicense\n-----------\n\nThis generator is released under the [MIT License](https://github.com/t1st3/generator-composer/blob/master/license).\n\n[![Analytics](https://ga-beacon.appspot.com/UA-53514029-2/generator-composer/readme?pixel)](https://github.com/igrigorik/ga-beacon)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1st3%2Fgenerator-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft1st3%2Fgenerator-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft1st3%2Fgenerator-composer/lists"}