msupply-foundation / conforma-server

Conforma application manager (IRIMS) back-end
GNU Affero General Public License v3.0
4 stars 1 forks source link

Suggestion: make `yarn` scripts available on server (build version) #937

Open CarlosNZ opened 1 year ago

CarlosNZ commented 1 year ago

Currently if you try to run the scripts such as yarn migrate or yarn backup, the server complains about missing ts-node, which makes sense since the JS build doesn't need it. However it is possible to run them by writing a long-winded command into the build folder and running the actual .js file using node.

It would be good if this was a bit easier.

Suggestion: make a common "scripts" file for parsing these yarn commands -- if in development, run the script as it does currently. But in production, run a different version of the command that calls the compiled '.js' verison of the script.

I'm thinking this would be good for:

It might also be good if we could run yarn release from the server, so we could run builds directly from the server, but that would require a bit more work.

CarlosNZ commented 1 year ago

Adding to this, we should also allow a few other testing related things to be enabled in Docker instance via environmental variables. I'm thinking:

Just thinking of ways to improve our ability to test things in a build rather than just in dev. Ideally the automated test suite could be run in a build environment too.