How does version control and collaboration work with Amber?
When I created a new package I saw that three files were created:
- js/MyPackage.deploy.js
- js/MyPackage.js
- st/MyPackage.st
Do I need to put all of them under version control? Can I merge changes into only the .st file and have the Amber server pick them up?
First a short explanation of the three files:
st/MyPackage.st: the Smalltalk source also known as fileoutjs/MyPackage.js: the equivalent to the Smalltalk source compiled to JS (including metadata such as Smalltalk sourcecode)js/MyPackage.deploy.js: equals the other.jsfile but does not contain metadata not needed in deploymentTo run an Amber application one of the
.jsfiles is needed. Which one depends on the deploy mode but for development the one without.deployin the name is used.The
.jsfiles in turn can be generated from the.stfiles using the Amber commandline compiler (e.g. through Grunt.js) or by doing a file-in in the IDE and commiting the relevant package.In general, we keep all three files under version control but for now the most crucial ones are the
.stfiles since those are usually easier to merge than generated JS code.However, keeping and merging only the
.stfiles is not sufficient since those are not loadable by Amber. Nico for example uses a local git hook to recompile the.stfiles upon pulling the latest changes. See this message from the Amber mailinglist.