mediamonks / pota

Pota :tipping_hand_person: tools to carry your projects
https://mediamonks.github.io/pota/
MIT License
12 stars 5 forks source link

use turborepo for building scripts #49

Open psimk opened 2 years ago

psimk commented 2 years ago

The scripts/ folder is setup using npm workspaces, this makes it easy to create scripts packages that extend from other script packages - we can manage and test everything locally, without having to publish and install via npm.

While convenient, this does make building those scripts a bit more tricky (this is mentioned in CONTRIBUTING.md). The developer needs to make sure to build the scripts in a specific order, or else things will break.

Instead of setting up a custom script that will constantly have to be updated with the proper order, I think we can take a bigger step forward and introduce turborepo for building the scripts. Not only will it let us set an order, but it will also cache those each build (TypeScript has the --incremental flag which generates a .tsbuildinfo file, but it is a bit annoying for clean builds).


The task should be as easy as adding turborepo as a dependency to scripts/ and then creating a turbo.json with a pipeline with all of the scripts ordered.

ThaNarie commented 2 years ago

I would have to dive a bit into the turborepo docs to give meaningful feedback, but this premise sounds good!

Would this also be able to run multiple script packages into watch mode when trying to implement new features in templates that span across multiple script packages, and see them working? :) Or would this be a separate ticket?

psimk commented 2 years ago

Would this also be able to run multiple script packages into watch mode

Yes, that should be possible - however I am not exactly sure what level of complexity this would add, if its simple enough, then we could indeed do it together with building.