PencilCode / jquery-turtle

Turtle Graphics for JQuery
Other
44 stars 25 forks source link

Make clearer how to run in development #28

Open dsaff opened 10 years ago

dsaff commented 10 years ago

I've been away from any kind of JavaScript development long enough to leave me completely at a loss about how to use modern JS tooling. So, for example, while the instructions at https://github.com/PencilCode/pencilcode-site/blob/master/README.md are great at explaining how to build and test changes to the main IDE, I'm less sure how I might make and test my first change here.

David, if you can point me in a general direction, I'd be happy to write up what I find as breadcrumbs to those to come after.

davidbau commented 10 years ago

Cool. This project is simpler than the other one, but there is also not as much elaborate tooling.

(1) "grunt uglify" is the only build step. It just uglifies jquery-turtle.js to jquery-turtle.min.js (2) "grunt qunit" is the test. There aren't enough tests currently, but there are a few. The default "grunt" target runs both.

To test changes to jquery-turtle, run "grunt testserver". It will start a server on localhost:8000 which lets you browse the project directory. You can directly visit the qunit tests in the "test/" subdirectory and add your own HTML files there (copy others in that directory to get going) to test whatever feature you would like to add. Once your feature is working, include your qunit test in your change.

davidbau commented 10 years ago

Also, there are some features that are interesting that will require the jquery-turtle library interact with the IDE. What I've been doing for these is just copying jquery-turtle.js between its spot in pencilcode-site/site/top/ and in a separate repo in jquery-turtle/ while developing, and then just testing within the context of pencilcode-site.

Note that when testing in pencilcode-site, you need to "grunt uglify" or "grunt concat" to create a turtlebits.js file before it can be tested (that file is a concatenation of jquery-turtle with several other libraries; concat contaenates without minifying the code, which can simplify debugging).

Not sure if there is a cleaner way to facilitate this process of developing features that cross between the two repos.