This presentation will talk about the open source model developed by the YUI team for any contributor interested in having his or her code be available as part of the open source YUI Gallery.
3. Old way to contribute
You must fork entire
YUI Gallery
repository and
submit pull request
3Confidential
4. New way to contribute
With Yogi! (a command-line tool from
the YUI team)
Keep development local on your own
repository
4Confidential
5. 5Confidential
Contribution Overview
Set up Yogi
Generate
source tree with
Yogi
Push code to
Github
Add your
custom code
Specify your
dependencies
Test via “yogi
serve”
Build via “yogi
build”
Add
documentation
and unit tests
Issue CDN
request
Set up your environment.Install nodejs (if you haven’t already).Install yogi.Create accounts on yuilibrary.com and GitHub.com (again, if you haven’t already).Configure yogi to work with the newly created accounts.Sign a CLA in order to allow Yahoo! to host your Gallery Module.Set up a file directory and initialize your new git repo.mkdirsomenamecd somenamegitinitGenerate your gallery module file tree with yogi and register your module with the gallery via “yogi create”.If you want yogi to create a harness directory structure for you use “--init” when you run “yogi create”. ( You should search the Gallery ahead of time for similar names via “yogi search XXXX”. ) Push your newly generated code to the GitHub repo you created.Add your custom code.Add to “[source-root]/js/gallery-YOURMODULENAME.jsSpecify required YUI modules dependencies.modifying [source-root]/meta/gallery-YOURMODULENAME.jsonTest your module via “yogi serve”. Open the URL given via the “listening on:” line in your browser, and you’ll see an overview of your code and documentation.Add YUIDoc comments.Add in your code via [source-root]/js/gallery-YOURMODULENAME.jsBuild your module via “yogi build”. Note your build will fail if any tests fail or jshint fails. Correct these errors and try again.Work on landing and example pages. You’ll need Selleck for this phase, so make sure it’s installed properly. Emily ran into several issues here having to do with being able to include the source JS into the example pages. Eventually she copied a version of her gallery JS file into the [source-root]/docs/assets/ directory but after she had her builds working she was able to point to the source files in the /build directory.Check for duplicate YUI.add() statements. This is a common issue where you may include YUI.add() in your source JS, but later on in the built JS it also wraps your code with a YUI.add() statement.If you run into questions or problems with creating example pages and mustache templates Emily suggests looking into YUI source code such as ScrollView for working examples.Work on unit tests.Make sure Phantomjs is up and running properly.Use Istanbul to generate the code coverage report.Issue a CDN request.Emily suggests watching the Building Modules video listed above if you run into questions regarding this step.