简体   繁体   English

琥珀色Smalltalk协作和版本控制

[英]Amber Smalltalk Collaboration and Version Control

How does version control and collaboration work with Amber? 版本控制和协作如何与Amber一起使用?

When I created a new package I saw that three files were created: 创建新程序包时,我看到创建了三个文件:

  • js/MyPackage.deploy.js JS / MyPackage.deploy.js
  • js/MyPackage.js JS / MyPackage.js
  • st/MyPackage.st 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? 我可以将更改仅合并到.st文件中,并让Amber服务器接收吗?

First a short explanation of the three files: 首先简要说明三个文件:

  • st/MyPackage.st : the Smalltalk source also known as fileout st/MyPackage.st源也称为fileout
  • js/MyPackage.js : the equivalent to the Smalltalk source compiled to JS (including metadata such as Smalltalk sourcecode) js/MyPackage.js :相当于编译为JS的Smalltalk源代码(包括元数据,例如Smalltalk源代码)
  • js/MyPackage.deploy.js : equals the other .js file but does not contain metadata not needed in deployment js/MyPackage.deploy.js :等于其他.js文件,但不包含部署中不需要的元数据

To run an Amber application one of the .js files is needed. 要运行Amber应用程序,需要一个.js文件。 Which one depends on the deploy mode but for development the one without .deploy in the name is used. 哪一种取决于部署模式,但是对于开发而言,使用名称中没有.deploy的一种。

The .js files in turn can be generated from the .st files using the Amber commandline compiler (eg through Grunt.js) or by doing a file-in in the IDE and commiting the relevant package. 可以使用Amber命令行编译器(例如,通过Grunt.js)或通过在IDE中进行文件输入并提交相关程序包,从.st文件生成.js文件。

In general, we keep all three files under version control but for now the most crucial ones are the .st files since those are usually easier to merge than generated JS code. 通常,我们将所有三个文件都保留在版本控制下,但目前最关键的是.st文件,因为它们通常比生成的JS代码更易于合并。

However, keeping and merging only the .st files is not sufficient since those are not loadable by Amber. 但是,仅保留和合并.st文件是不够的,因为Amber无法加载这些文件。 Nico for example uses a local git hook to recompile the .st files upon pulling the latest changes. 例如,Nico在提取最新更改时使用本地git钩子重新编译.st文件。 See this message from the Amber mailinglist. 请参阅琥珀色邮件列表中的此消息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM