Nothing Special   »   [go: up one dir, main page]

DEV Community

Cover image for JUST: do it
Giuliano1993
Giuliano1993

Posted on

JUST: do it

Good morning everyone and happy MonDEV ☕

Excited for a new week? I am quite electrified to get to work with some new upcoming projects and interesting processes on old projects, following a weekend of actual relaxation (a rather rare thing)! 😁

So let's go straight to talk about today's tool.

If I were to describe it using a quite famous quote, I would say "It's not a package json, it's not a bash script, it only knows what it's not".

If you are confused it's quite understandable.

Today I'm talking about Just, a kind of scripting language to save a series of commands (called recipes) to run on our projects, a bit like we are used to do with npm run in JS environments, but it works with any type of language and environment. It supports the major OS and can also be adopted in your GitHub pipelines through GitHub actions.

Using it is quite simple: install Just on your PC, then create a file called justfile (lacks a bit of imagination, I realize) within your project.

At this point you are ready to add your commands to your file to execute.

An example of use could be, thinking about a Laravel application:

pull:
    git pull
    php artisan migrate
    php artisan cache:clear
    php artisan test
test:
    php artisan test

Enter fullscreen mode Exit fullscreen mode

or, taking inspiration from an example in the documentation, to run a python script without knowing its path and version, and wanting to pass arguments:

python := `which python`
script *ARGS:
    {{ python }} script.py {{ ARGS }}
Enter fullscreen mode Exit fullscreen mode

then from the terminal it will be enough to enter the command just recipename as for example

just pull
Enter fullscreen mode Exit fullscreen mode

To execute all associated commands.

These are just a couple of examples, but it really lends itself to any use you might want to make of it.

And if you have suggestions on the matter I am always curious to hear them! 😁

Articles of the week

Multithreading in Node.js: Using Atomics for Safe Shared Memory Operations: Last week I was very focused on studying Multi-Threading with Node, so I came across various articles about it. I propose one about the Atomic API, of which I had never heard of and which can be an interesting topic to delve into, if you are also interested in the topic.

Pest 3 is released! In the very first Newsletter I talked about Laracon and the release of Pest! This year Pest 3 was announced and brings many new features, bringing tests to a collaborative level directly from code! Check out this article to discover the latest news for this testing library!

I hope as always to have offered you some interesting ideas for your week!

Feedback is always welcome, in the meantime,

Until next Monday!

Happy Coding 0_1

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.