Skip to content

Universal and minimalist scripts & tasks runner. Built with mono-repo in mind and for everyone from end users to @npm and @yarnpkg.

License

Notifications You must be signed in to change notification settings

tunnckoCore/scripts

@tunnckocore/scripts npm version github release License

Universal and minimalist scripts & tasks runner.

Please consider following this project's author, Charlike Mike Reagent, and ⭐ the project to show your ❤️ and support.

Code style CircleCI linux build CodeCov coverage status DavidDM dependency status Renovate App Status Make A Pull Request Semantically Released

If you have any how-to kind of questions, please read the Contributing Guide and Code of Conduct documents.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Become a Patron Conventional Commits NPM Downloads Weekly NPM Downloads Monthly NPM Downloads Total Share Love Tweet

Project is semantically & automatically released on CircleCI with new-release and its New Release GitHub App.

Features

  • Super composable scripts/tasks.
  • Powerful, fast and simple.
  • Built-in monorepo support.
  • Infinitly extensible shareable configs/presets of scripts/tasks.
  • Future-proof, intuitive API and resolving design.
  • "Task runner" or "Command executor"
  • Great for building exec commands on top of it
  • Main goal: standardized method for executing
    • we can build pnpm exec and npm exec on top of it
    • improve Yarn's main command-less call, e.g. yarn without params/arguments/flags

Table of Contents

(TOC generated by verb using markdown-toc)

Install

This project requires Node.js ^8.10.0 || >=10.13.0. Install it using yarn or npm.
We highly recommend to use Yarn when you think to contribute to this project.

$ yarn add @tunnckocore/scripts

CLI

To start using it is just enough to execute

scripts  # or tunnckocore-scripts, or @tunnckocore/scripts

It will list you all the available tasks/scripts. The cool thing is that it can load shareable configs, such as the scripts.config.js file in this repository. To do that, you need to pass some npm module as extends script. For example

{
 "scripts": {
   "start": "scripts",
   "extends": "@myorg/our-scripts"
 }
}

Then everything will be available through running yarn start or npm start. The tasks in those "preset / config" files are nothing more than a string, array of strings (executed in sequence), or function which may return string or array of mixed types. Feature number X. You can create hooks for any installed CLI program. Lets say we have eslint install, right? Then we can create such pre and post hooks in our config:

export const preeslint = 'echo "Before ESLint run"'
export const posteslint = 'echo "After ESLint run"'

And just run yarn start eslint index.js --fix Another feature is that you all this works in monorepo environment too. Normally, if you didn't know to now, you can run any install CLI program with yarn. For example yarn eslint ... or yarn babel. Yes, but this not works well in monorepo environments and that's why projects such as Yarn Workspaces, Pnpm's pnpm recurisve and Lerna exists. All of them have their Pros and Cons, same here with @tunnckocore/scripts. The thing is, that we can do that with yarn start. With shareable configs/tasks/scripts everything goes great. You can share even between monorepos, or extend each other configs.

API

Generated using docks.

Collecting tasks/scripts from various places such as scripts.config.js or even all the defined ones from package.json's field scripts. You can also pass scripts.extends and pass local javascript file or some npm module which in turn can be either CJS or ESM written.

Params

  • [argv] {Array} array of string, defaults to process.argv.slice(2)
  • [options] {object} optioanl settings, like cwd and manager, also can pass tasks from here

Returns

  • Promise if object is resolved, then it's all the collected tasks/scripts from configs, if array, then it's array of execa results.

back to top

See Also

Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your existance!

  • asia: Blazingly fast, magical and minimalist testing framework, for Today and… more | homepage
  • charlike: Small, fast and streaming project scaffolder with support for hundreds… more | homepage
  • docks: Extensible system for parsing and generating documentation. It just freaking… more | homepage
  • gitcommit: Lightweight and joyful git commit replacement. Conventional Commits compliant. | homepage
  • new-release: MIRROR] Publish project to NPM following Conventional Commits specification and… more | homepage

back to top

Contributing

Follow the Guidelines

Please read the Contributing Guide and Code of Conduct documents for advices.
For bugs reports and feature requests, please create an issue or ping @tunnckoCore at Twitter.

Support the project

Become a Partner or Sponsor? 💵 Check the Partner, Sponsor or Omega-level tiers! 🎉 You can get your company logo, link & name on this file. It's also rendered on package page in npmjs.com and yarnpkg.com sites too! 🚀

Not financial support? Okey! Pull requests, stars and all kind of contributions are always welcome. ✨

OPEN Open Source

This project is following OPEN Open Source model

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is built on collective efforts and it's not strongly guarded by its founders.

There are a few basic ground-rules for its contributors

  1. Any significant modifications must be subject to a pull request to get feedback from other contributors.
  2. Pull requests to get feedback are encouraged for any other trivial contributions, but are not required.
  3. Contributors should attempt to adhere to the prevailing code-style and development workflow.

Wonderful Contributors

Thanks to the hard work of these wonderful people this project is alive! It follows the all-contributors specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) See how, here.


Charlike Mike Reagent

💻 📖 💬 👀 🔍

Consider showing your support to them. 💖

License

Copyright (c) 2018-present, Charlike Mike Reagent <mameto2011@gmail.com> & contributors.
Released under the Apache-2.0 License.