Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tunnckoCore/scripts

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

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# @tunnckocore/scripts [![npm version][npmv-img]][npmv-url] [![github release][ghrelease-img]][ghrelease-url] [![License][license-img]][license-url]

> Universal and minimalist scripts & tasks runner.

Please consider following this project's author, [Charlike Mike Reagent](https://github.com/tunnckoCore), and :star: the project to show your :heart: and support.

[![Code style][codestyle-img]][codestyle-url]
[![CircleCI linux build][linuxbuild-img]][linuxbuild-url]
[![CodeCov coverage status][codecoverage-img]][codecoverage-url]
[![DavidDM dependency status][dependencies-img]][dependencies-url]
[![Renovate App Status][renovateapp-img]][renovateapp-url]
[![Make A Pull Request][prs-welcome-img]][prs-welcome-url]
[![Semantically Released][new-release-img]][new-release-url]

If you have any _how-to_ kind of questions, please read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents.
For bugs reports and feature requests, [please create an issue][open-issue-url] or ping
[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter.

[![Become a Patron][patreon-img]][patreon-url]
[![Conventional Commits][ccommits-img]][ccommits-url]
[![NPM Downloads Weekly][downloads-weekly-img]][npmv-url]
[![NPM Downloads Monthly][downloads-monthly-img]][npmv-url]
[![NPM Downloads Total][downloads-total-img]][npmv-url]
[![Share Love Tweet][shareb]][shareu]

Project is [semantically](https://semver.org) & automatically released on [CircleCI](https://circleci.com) with [new-release][] and its [New Release](https://github.com/apps/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

- [Install](#install)
- [CLI](#cli)
- [API](#api)
* [src/index.js](#srcindexjs)
+ [scripts](#scripts)
- [See Also](#see-also)
- [Contributing](#contributing)
* [Follow the Guidelines](#follow-the-guidelines)
* [Support the project](#support-the-project)
* [OPEN Open Source](#open-open-source)
* [Wonderful Contributors](#wonderful-contributors)
- [License](#license)

_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_

## Install

This project requires [**Node.js**](https://nodejs.org) **^8.10.0 || >=10.13.0**. Install it using
[**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com).
_We highly recommend to use Yarn when you think to contribute to this project._

```bash
$ yarn add @tunnckocore/scripts
```

## CLI
To start using it is just enough to execute
```bash
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
```json
{
"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:
```js
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](http://npm.im/docks)._

### [src/index.js](/src/index.js)

#### [scripts](/src/index.js#L18)
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](#thetop)**

## 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](https://www.npmjs.com/package/asia): Blazingly fast, magical and minimalist testing framework, for Today and… [more](https://github.com/olstenlarck/asia#readme) | [homepage](https://github.com/olstenlarck/asia#readme "Blazingly fast, magical and minimalist testing framework, for Today and Tomorrow")
- [charlike](https://www.npmjs.com/package/charlike): Small, fast and streaming project scaffolder with support for hundreds… [more](https://github.com/tunnckoCoreLabs/charlike) | [homepage](https://github.com/tunnckoCoreLabs/charlike "Small, fast and streaming project scaffolder with support for hundreds of template engines and sane defaults")
- [docks](https://www.npmjs.com/package/docks): Extensible system for parsing and generating documentation. It just freaking… [more](https://github.com/tunnckoCore/docks) | [homepage](https://github.com/tunnckoCore/docks "Extensible system for parsing and generating documentation. It just freaking works!")
- [gitcommit](https://www.npmjs.com/package/gitcommit): Lightweight and joyful `git commit` replacement. Conventional Commits compliant. | [homepage](https://github.com/tunnckoCore/gitcommit "Lightweight and joyful `git commit` replacement. Conventional Commits compliant.")
- [new-release](https://www.npmjs.com/package/new-release): MIRROR] Publish project to NPM following Conventional Commits specification and… [more](https://github.com/tunnckoCoreLabs/new-release) | [homepage](https://github.com/tunnckoCoreLabs/new-release "[MIRROR] Publish project to NPM following Conventional Commits specification and SemVer. Uses git-commits-since for detecting git commits since last SemVer tag and detect-next-version for what next version bump should be.")

**[back to top](#thetop)**

## Contributing

### Follow the Guidelines

Please read the [Contributing Guide](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md) documents for advices.
For bugs reports and feature requests, [please create an issue][open-issue-url] or ping
[@tunnckoCore](https://twitter.com/tunnckoCore) at Twitter.

### Support the project

[Become a Partner or Sponsor?][patreon-url] :dollar: Check the **Partner**, **Sponsor** or **Omega-level** tiers! :tada: You can get your company logo, link & name on this file. It's also rendered on package page in [npmjs.com][npmv-url] and [yarnpkg.com](https://yarnpkg.com/en/package/@tunnckocore/scripts) sites too! :rocket:

Not financial support? Okey! [Pull requests](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request), stars and all kind of [contributions](https://opensource.guide/how-to-contribute/#what-it-means-to-contribute) are always
welcome. :sparkles:

### OPEN Open Source

This project is following [OPEN Open Source](http://openopensource.org) 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](https://github.com/tunnckoCoreLabs/contributing#opening-a-pull-request) 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](https://github.com/kentcdodds/all-contributors) specification.
Don't hesitate to add yourself to that list if you have made any contribution! ;) [See how,
here](https://github.com/jfmengels/all-contributors-cli#usage).

| [
Charlike Mike Reagent](https://tunnckocore.com)
[💻](https://github.com/tunnckoCoreLabs/scripts/commits?author=tunnckoCore "Code") [📖](https://github.com/tunnckoCoreLabs/scripts/commits?author=tunnckoCore "Documentation") [💬](#question-tunnckoCore "Answering Questions") [👀](#review-tunnckoCore "Reviewed Pull Requests") [🔍](#fundingFinding-tunnckoCore "Funding Finding") |
| :---: |

Consider showing your [support](#support-the-project) to them. :sparkling_heart:

## License

Copyright (c) 2018-present, [Charlike Mike Reagent](https://tunnckocore.com) `` & [contributors](#wonderful-contributors).
Released under the [Apache-2.0 License][license-url].

[npmv-url]: https://www.npmjs.com/package/@tunnckocore/scripts
[npmv-img]: https://badgen.net/npm/v/@tunnckocore/scripts?icon=npm

[ghrelease-url]: https://github.com/tunnckoCoreLabs/scripts/releases/latest
[ghrelease-img]: https://badgen.net/github/release/tunnckoCoreLabs/scripts?icon=github

[license-url]: https://github.com/tunnckoCoreLabs/scripts/blob/master/LICENSE
[license-img]: https://badgen.net/npm/license/@tunnckocore/scripts

[codestyle-url]: https://github.com/airbnb/javascript
[codestyle-img]: https://badgen.net/badge/code%20style/airbnb/ff5a5f?icon=airbnb

[linuxbuild-url]: https://circleci.com/gh/tunnckoCoreLabs/scripts/tree/master
[linuxbuild-img]: https://badgen.net/circleci/github/tunnckoCoreLabs/scripts/master?label=build&icon=circleci

[codecoverage-url]: https://codecov.io/gh/tunnckoCoreLabs/scripts
[codecoverage-img]: https://badgen.net/codecov/c/github/tunnckoCoreLabs/scripts?icon=codecov

[dependencies-url]: https://david-dm.org/tunnckoCoreLabs/scripts
[dependencies-img]: https://badgen.net/david/dep/tunnckoCoreLabs/scripts?label=deps

[ccommits-url]: https://conventionalcommits.org/
[ccommits-img]: https://badgen.net/badge/conventional%20commits/v1.0.0/dfb317
[new-release-url]: https://ghub.io/new-release
[new-release-img]: https://badgen.net/badge/semantically/released/05c5ff

[downloads-weekly-img]: https://badgen.net/npm/dw/@tunnckocore/scripts
[downloads-monthly-img]: https://badgen.net/npm/dm/@tunnckocore/scripts
[downloads-total-img]: https://badgen.net/npm/dt/@tunnckocore/scripts

[renovateapp-url]: https://renovatebot.com
[renovateapp-img]: https://badgen.net/badge/renovate/enabled/green
[prs-welcome-img]: https://badgen.net/badge/PRs/welcome/green
[prs-welcome-url]: http://makeapullrequest.com
[paypal-donate-url]: https://paypal.me/tunnckoCore/10
[paypal-donate-img]: https://badgen.net/badge/$/support/purple
[patreon-url]: https://www.patreon.com/bePatron?u=5579781
[patreon-img]: https://badgen.net/badge/patreon/tunnckoCore/F96854?icon=patreon
[patreon-sponsor-img]: https://badgen.net/badge/become/a%20sponsor/F96854?icon=patreon

[shareu]: https://twitter.com/intent/tweet?text=https://github.com/tunnckoCoreLabs/scripts&via=tunnckoCore
[shareb]: https://badgen.net/badge/twitter/share/1da1f2?icon=twitter
[open-issue-url]: https://github.com/tunnckoCoreLabs/scripts/issues/new

[execa]: https://github.com/sindresorhus/execa
[new-release]: https://github.com/tunnckoCore/new-release
[semantic-release]: https://github.com/semantic-release/semantic-release