What approaches are available and useful for source code control for projects written in Makecode? There's a discussion on maintaining and using libraries on Copying code between programs? but I was thinking more about the actual project or code samples.
I know there's a publishing mechanism within the makecode site but I'm not sure if that has any features to support versioning? Is this as simple as putting the equivalent javascript (TypeScript) code under source code control and just manually pasting it back when needed? Are the (bulky) hex files worth preserving?
Source code control for Makecode
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- johnpark
- Posts: 985
- Joined: Wed Mar 25, 2009 2:15 pm
Re: Source code control for Makecode
Maybe some of our Microsoft friends will weigh in, but, no there isn't a versioning system within MakeCode AFAIK, so I've been doing a very basic versioning myself using the Javascript.
- kevinjwalters
- Posts: 1026
- Joined: Sun Oct 01, 2017 3:15 pm
Re: Source code control for Makecode
Do you know what the story is on licences? Are the comments a good place to put them or is that problematic wrt bloating/size? I haven't worked out yet if there's an implied license for MakeCode either?
On the comments side, I put in Microsoft/pxt #4684 for a bug I noticed.
On the comments side, I put in Microsoft/pxt #4684 for a bug I noticed.
- johnpark
- Posts: 985
- Joined: Wed Mar 25, 2009 2:15 pm
Re: Source code control for Makecode
Interesting, thanks for posting that bug. I noticed that comment that is created on the canvas does show up in the JavaScript panel, and all comments seem to be preserved when you flip back to block view, so the start block comment must be preserved .
I wonder if the README.MD file would be a better place to put a license file? You can go to JavaScript mode, then click on the EXPLORER to expand it. You can enter text into the README.MD file and it shows up in the UI as a little book icon on the right of the canvas or script area.
- kevinjwalters
- Posts: 1026
- Joined: Sun Oct 01, 2017 3:15 pm
Re: Source code control for Makecode
I haven't read it yet but there's mention of github wrt source code management on this thread: Makecode in schools.
- ginsatodoroki
- Posts: 3
- Joined: Fri Apr 19, 2019 8:04 pm
- zostay
- Posts: 1
- Joined: Fri Jan 26, 2018 11:21 pm
Re: Source code control for Makecode
If you follow the documentation for creating a custom extension here:
https://learn.adafruit.com/custom-exten ... -extension
you can treat that as a regular firmware project. The JavaScript/TypeScript for your blocks get put into main.ts. Whenever you make changes, use the github icon on JavaScript tab and it will save a version. As far as I can tell, this works just fine whether you are creating extensions or not, so you can use it to version your block code.
https://learn.adafruit.com/custom-exten ... -extension
you can treat that as a regular firmware project. The JavaScript/TypeScript for your blocks get put into main.ts. Whenever you make changes, use the github icon on JavaScript tab and it will save a version. As far as I can tell, this works just fine whether you are creating extensions or not, so you can use it to version your block code.
Please be positive and constructive with your questions and comments.