You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .verb.md
+80Lines changed: 80 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,18 @@ Project is [semantically](https://semver.org) & automatically released on [Circl
37
37
38
38
-->
39
39
40
+
## Features
41
+
- Super composable scripts/tasks.
42
+
- Powerful, fast and simple.
43
+
- Built-in monorepo support.
44
+
- Infinitly extensible shareable configs/presets of scripts/tasks.
45
+
- Future-proof, intuitive API and resolving design.
46
+
- "Task runner" or "Command executor"
47
+
- Great for building `exec` commands on top of it
48
+
- Main goal: standardized method for executing
49
+
+ we can build `pnpm exec` and `npm exec` on top of it
50
+
+ improve Yarn's main command-less call, e.g. `yarn` without params/arguments/flags
51
+
40
52
## Table of Contents
41
53
42
54
<!-- toc -->
@@ -51,9 +63,77 @@ _We highly recommend to use Yarn when you think to contribute to this project._
51
63
$ yarn add {%= name %}
52
64
```
53
65
66
+
## CLI
67
+
68
+
To start using it is just enough to execute
69
+
70
+
```bash
71
+
scripts # or tunnckocore-scripts, or @tunnckocore/scripts
72
+
```
73
+
74
+
It will list you all the available tasks/scripts.
75
+
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.
76
+
77
+
For example
78
+
79
+
```json
80
+
{
81
+
"scripts": {
82
+
"start": "scripts",
83
+
"extends": "@myorg/our-scripts"
84
+
}
85
+
}
86
+
```
87
+
88
+
Then everything will be available through running `yarn start` or `npm start`.
89
+
The tasks in those "preset / config" files are nothing more than a string, array of strings
90
+
(executed in sequence), or function which may return string or array of mixed types.
91
+
92
+
93
+
Feature number X. You can create hooks for any installed CLI program.
94
+
95
+
Lets say we have `eslint` install, right? Then we can create such `pre` and `post` hooks
96
+
in our config:
97
+
98
+
```js
99
+
exportconstpreeslint='echo "Before ESLint run"'
100
+
exportconstposteslint='echo "After ESLint run"'
101
+
```
102
+
103
+
And just run `yarn start eslint index.js --fix`
104
+
105
+
Another feature is that you all this works in monorepo environment too.
106
+
Normally, if you didn't know to now, you can run any install CLI program with yarn.
107
+
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
108
+
have their Pros and Cons, same here with `@tunnckocore/scripts`.
109
+
110
+
The thing is, that we can do that with `yarn start`.
111
+
112
+
With shareable configs/tasks/scripts everything goes great. You can share even between monorepos,
113
+
or extend each other configs.
114
+
115
+
54
116
## API
55
117
56
118
<!-- docks-start -->
119
+
_Generated using [docks](http://npm.im/docks)._
120
+
121
+
### [src/index.js](/src/index.js)
122
+
123
+
#### [scripts](/src/index.js#L20)
124
+
Collecting tasks/scripts from various places such as `scripts.config.js`
125
+
or even all the defined ones from `package.json`'s field `scripts`.
126
+
You can also pass `scripts.extends` and pass local javascript file
127
+
or some npm module which in turn can be either CJS or ESM written.
128
+
129
+
**Params**
130
+
-`[argv]`**{Array}** array of string, defaults to `process.argv.slice(2)`
131
+
-`[options]`**{object}** optioanl settings, like `cwd` and `manager`, also can pass `tasks` from here
132
+
133
+
**Returns**
134
+
-`Promise` if object is resolved, then it's all the collected tasks/scripts from configs,
_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_
53
68
54
69
## Install
55
70
56
-
This project requires [**Node.js**](https://nodejs.org)**^8.11.0 || ^10.12.0**. Install it using
71
+
This project requires [**Node.js**](https://nodejs.org)**^8.11.0 || >=10.13.0**. Install it using
57
72
[**yarn**](https://yarnpkg.com) or [**npm**](https://npmjs.com).
58
73
_We highly recommend to use Yarn when you think to contribute to this project._
59
74
60
75
```bash
61
76
$ yarn add @tunnckocore/scripts
62
77
```
63
78
79
+
## CLI
80
+
81
+
To start using it is just enough to execute
82
+
83
+
```bash
84
+
scripts # or tunnckocore-scripts, or @tunnckocore/scripts
85
+
```
86
+
87
+
It will list you all the available tasks/scripts.
88
+
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.
89
+
90
+
For example
91
+
92
+
```json
93
+
{
94
+
"scripts": {
95
+
"start": "scripts",
96
+
"extends": "@myorg/our-scripts"
97
+
}
98
+
}
99
+
```
100
+
101
+
Then everything will be available through running `yarn start` or `npm start`.
102
+
The tasks in those "preset / config" files are nothing more than a string, array of strings
103
+
(executed in sequence), or function which may return string or array of mixed types.
104
+
105
+
Feature number X. You can create hooks for any installed CLI program.
106
+
107
+
Lets say we have `eslint` install, right? Then we can create such `pre` and `post` hooks
108
+
in our config:
109
+
110
+
```js
111
+
exportconstpreeslint='echo "Before ESLint run"'
112
+
exportconstposteslint='echo "After ESLint run"'
113
+
```
114
+
115
+
And just run `yarn start eslint index.js --fix`
116
+
117
+
Another feature is that you all this works in monorepo environment too.
118
+
Normally, if you didn't know to now, you can run any install CLI program with yarn.
119
+
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
120
+
have their Pros and Cons, same here with `@tunnckocore/scripts`.
121
+
122
+
The thing is, that we can do that with `yarn start`.
123
+
124
+
With shareable configs/tasks/scripts everything goes great. You can share even between monorepos,
125
+
or extend each other configs.
126
+
64
127
## API
65
128
66
129
<!-- docks-start -->
130
+
_Generated using [docks](http://npm.im/docks)._
131
+
132
+
### [src/index.js](/src/index.js)
133
+
134
+
#### [scripts](/src/index.js#L20)
135
+
Collecting tasks/scripts from various places such as `scripts.config.js`
136
+
or even all the defined ones from `package.json`'s field `scripts`.
137
+
You can also pass `scripts.extends` and pass local javascript file
138
+
or some npm module which in turn can be either CJS or ESM written.
139
+
140
+
**Params**
141
+
-`[argv]`**{Array}** array of string, defaults to `process.argv.slice(2)`
142
+
-`[options]`**{object}** optioanl settings, like `cwd` and `manager`, also can pass `tasks` from here
143
+
144
+
**Returns**
145
+
-`Promise` if object is resolved, then it's all the collected tasks/scripts from configs,
146
+
if array, then it's array of [execa][] results.
147
+
67
148
<!-- docks-end -->
68
149
69
-
**[back to top](#thetop)**
150
+
__[back to top](#thetop)__
70
151
71
152
## See Also
72
153
73
154
Some of these projects are used here or were inspiration for this one, others are just related. So, thanks for your
74
155
existance!
75
-
76
-
-[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')
77
-
-[charlike](https://www.npmjs.com/package/charlike): Small & fast project scaffolder with sane defaults. Supports hundreds… [more](https://github.com/tunnckoCoreLabs/charlike) | [homepage](https://github.com/tunnckoCoreLabs/charlike'Small & fast project scaffolder with sane defaults. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options')
78
-
-[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!')
79
-
-[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.')
80
-
-[new-release](https://www.npmjs.com/package/new-release): A stable alternative to [semantic-release][]. Only handles NPM publishing and… [more](https://github.com/tunnckoCore/new-release#readme) | [homepage](https://github.com/tunnckoCore/new-release#readme'A stable alternative to [semantic-release][]. Only handles NPM publishing and nothing more. For creating GitHub releases use the Semantic Release GitHub App')
81
-
-[parse-commit-message](https://www.npmjs.com/package/parse-commit-message): An extensible parser for commit message that follows Conventional Commits… [more](https://github.com/olstenlarck/parse-commit-message) | [homepage](https://github.com/olstenlarck/parse-commit-message'An extensible parser for commit message that follows Conventional Commits v1 spec')
156
+
-[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")
157
+
-[charlike](https://www.npmjs.com/package/charlike): Small & fast project scaffolder with sane defaults. Supports hundreds… [more](https://github.com/tunnckoCoreLabs/charlike) | [homepage](https://github.com/tunnckoCoreLabs/charlike"Small & fast project scaffolder with sane defaults. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options")
158
+
-[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!")
159
+
-[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.")
160
+
-[new-release](https://www.npmjs.com/package/new-release): A stable alternative to [semantic-release][]. Only handles NPM publishing and… [more](https://github.com/tunnckoCore/new-release#readme) | [homepage](https://github.com/tunnckoCore/new-release#readme"A stable alternative to [semantic-release][]. Only handles NPM publishing and nothing more. For creating GitHub releases use the Semantic Release GitHub App")
82
161
83
162
**[back to top](#thetop)**
84
163
@@ -138,9 +217,11 @@ _This file was generated by [verb-generate-readme](https://github.com/verbose/ve
0 commit comments