Microsoft MakeCode

Best way to maintain a common file?

Trying to figure out the cleanest way to have a shared functions file across multiple projects. seems like there isn’t an easy way. I’ve found 2 options.

  1. Add a custom.ts and then copy that around to other projects.

  2. Create a project with all of the function in it inside a namespace i.e.
    namespace common {
    // code
    Save the code then in a new project where they want to use that code select extensions and then selected the common uf2 file.

Both options feel prone to mistakes (especial having 11-14 year old kids doing it). I think a feature of being able to add a common.ts just like custom.ts would be nice. I’ve tried hand editing the pxt.json but doesn’t seem to allow referencing any files outside of the current location.

1 Like

One way to do this is by using our Github support! More information on it can be found here:

@peli is the expert

We are actively working on integrate support for GitHub and authoring a project with multiple collaborators (using the traditional, commit/merge/branch flows). Unfortunately, it is not yet available in LEGO.