Skip to content

m3kh66/seul

Repository files navigation

Seul

Build Status Coverage Status Packagist

Seul is a simple Task Runner for monorepos. It doesn't need lots of configuration, and you can install and learn it in less than five minutes.

But What Is a Monorepo?

To understand what a monorepo is, Imagine you are working on a large-scale project which consists of tons of components. You might choose to have a new repository for each one because in this manner you divide your project into smaller chunks which means fast cloning, better access control, and tidier workspace. However, it also means you're going to have a hard time with debugging your dependencies and managing lots of repositories.

Well, dividing a big project into smaller modules is inevitable, although you can keep the related components in a mono repository. A monorepo is merely a repository that contains some associated projects.

What Is Seul?

In contrast to the straightforward concept of monorepo, creating and managing a monorepo is not an easy task for JavaScript developers.

Install

Seul has not yet been released. But you can build & use it on your computer, please follow the Clone & Build section section.

Create a Monorepo

A monorepo has a straightforward structure. In fact, all you need is a packages directory. As its name implies it contains all of your node modules.

mkdir seul-test
cd seul-test
mkdir packages

Show a List of Packages

To get an insight of your node modules use packages command. The following tree demonstrates the project structure.

.
└── packages
    ├── alpha
    │   ├── package.json
    │   └── yarn.lock
    └── beta
        ├── package.json
        └── yarn.lock

The command displays the information in a tabular way.

seul packages
name   version  path                                                  
-----  -------  -------------------------
alpha  1.0.0    /seul-test/packages/alpha
beta   2.0.0    /seul-test/packages/beta 

Run a Command

Seul allows you to execute a command on all or specific packages. Here in this example I will install jest on all packages.

seul run "yarn add jest --dev"

If you want to execute a command on a specific package(s), pass its name after your command. In the following example, seul will install typescript on both alpha and beta packages.

seul run "yarn add typescript --dev" alpha beta

More Complex Scripts

Indeed in a real world project you are using complicated scripts. You must define your scripts inside your repository descriptor called packages.json.

Here is a simple example of packages.json that uses a local typescript to compile the package.

{
    "scripts": {
        "clean": "rm -rf dist",
        "build": [
            "@clean",
            "tsc"
        ]
    }
}

Now you can use run command again to build your project.

seul run build

Clone & Build

To clone and build the project you need git and node installed on your computer. If you have the pre-requisites, choose a destination and run following command to start cloning.

git clone https://github.com/MehdiGolchin/seul.git

Then move into the project directory and use your prefered node package manager (npm or yarn) to install dependencies.

Install dependencies using npm:

cd seul
npm install

Or yarn:

cd seul
yarn install

If everything goes well, use your package manager again to build the project.

Build project using npm:

npm build

Or yarn:

yarn build

Test

Seul uses jest as its testing framework. To run the unit tests use your package manager again and run test script.

Test project using npm:

npm test

Or yarn:

yarn test

Link

The final step to build and run seul locally is linking. When you build the seul, typescript compiler will create a dist directory that contains compiled version of codes. All you have to do is running the command bellow inside this directory.

Link project using npm:

cd dist
npm link

Or yarn:

cd dist
yarn link

About

A simple Task Runner for your next monorepo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors