Skip to content

feats/jako

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Translucent opinionated scripts runner.
jako is a minimalist toolbelt choice for monorepo projects compatible with whatever languages you are using.

[ Getting started 🤓 | Check it on NPM 👌 ]


  • Zero setup: There is no need to configure jako, and setting it up is as easy as moving your current scripts to a folder.

  • Polyglot: You are free to write your scripts using any language you want.

  • Translucent: Forget about build tools that force you to write code that only work for that specific runner. As a principle, all the scripts run by jako need to be executable also without jako. No vendor lock, less API to keep track of.

  • Extensible and modular: jako doesn't hold you back while your project is growing. Encapsulate as many independent projects as you want in a single repo and jako will let you run all your scripts from a centralized place.


The name jako comes from "JAKe + Opinionated".

Jake is the JavaScript build tool for NodeJS. Jake has been around since the very early days of Node, and is very full featured and well tested.

In essence, jako is just a tiny but powerful wrapper around jake. Under the hood, jako combines the maturity of a battle-tested codebase with a modern architecture.

divider

Getting started

Installing it

You can install it from one of these 3 options:

globally, with NPM

  $ npm install -g jako

globally, with Yarn

  $ yarn global add jako

locally

you may also install it as a development dependency in a package.json file:

    // package.json
    "devDependencies": {
      "jako": "latest"
    }

Then install it with either npm install or yarn install

Basic usage

jako [options ...] [env variables ...] target

for the full list of available options, please check jake's options.

divider

Writting your first scripts/tasks

Let's create our first script together! To do so, let's imagine you want to have a script that clears all the node_modules folders in your repo.

  1. create a /scripts/clean folder and create a file named node_modules.sh inside it:
$ mkdir -p scripts/clean
$ printf "#\!/bin/bash\nfind . \( -type d -name 'node_modules' \) -exec rm -rf '{}' +" > scripts/clean/node_modules.sh
  1. give it permission to run:
$ chmod +x **/*.sh
  1. run it!
# both calls below should be equivalent:

$ jako clean:node_modules
# or
$ cd ./scripts/clean ; ./node_modules.sh

# running `jako` with no arguments will list the available tasks
$ jako

Keep in mind that you can create scripts folder anywhere you want in your project and jako will adapt to it.

Nesting scripts folders deep inside your project is not only possible but recommended!

divider

Good practices

  • always add shebang to your scripts.
  • always give your scripts permission to run: chmod +x file-path.ext
  • jako will always call your scripts from the directory they are placed in, but not all runners will do that for you. If you, i.e, execute a bash script as ./scripts/clean/node_modules.sh instead of cd ./scripts/clean ; ./node_modules.sh, that could remove folders in different places than the ones you expected. That's why we encourage you to enforce a standardized cwd for all your scripts. In bash you can do that by appending dirname "$0" to the top of your scripts.

divider




This project is sponsored by feats.
Join a community of people helping each other get credit for their roles in projects.
From developing products and apps to architecture and campaigns.




Jako's logo illustration credit: www.vecteezy.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published