poku 4.3.1 → 4.3.2-canary.d448b1f7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -19
- package/lib/bin/enforce.js +149 -0
- package/lib/bin/help.js +64 -70
- package/lib/bin/index.js +283 -193
- package/lib/bin/watch.js +268 -94
- package/lib/modules/_shared.cjs +1769 -0
- package/lib/modules/_shared.d.ts +325 -0
- package/lib/modules/_shared.js +1793 -0
- package/lib/modules/index.cjs +1 -0
- package/lib/modules/index.d.ts +253 -24
- package/lib/modules/index.js +1 -44
- package/lib/modules/plugins.cjs +53 -0
- package/lib/modules/plugins.d.ts +17 -9
- package/lib/modules/plugins.js +52 -75
- package/package.json +27 -10
- package/lib/@types/assert.d.ts +0 -8
- package/lib/@types/background-process.d.ts +0 -41
- package/lib/@types/code.d.ts +0 -1
- package/lib/@types/describe.d.ts +0 -8
- package/lib/@types/each.d.ts +0 -12
- package/lib/@types/list-files.d.ts +0 -14
- package/lib/@types/plugin.d.ts +0 -106
- package/lib/@types/poku.d.ts +0 -148
- package/lib/@types/runner.d.ts +0 -1
- package/lib/@types/wait-for.d.ts +0 -46
- package/lib/@types/watch.d.ts +0 -1
- package/lib/builders/assert.d.ts +0 -34
- package/lib/builders/assert.js +0 -143
- package/lib/builders/reporter.d.ts +0 -2
- package/lib/builders/reporter.js +0 -11
- package/lib/configs/each.d.ts +0 -5
- package/lib/configs/each.js +0 -13
- package/lib/configs/indentation.d.ts +0 -6
- package/lib/configs/indentation.js +0 -9
- package/lib/configs/poku.d.ts +0 -85
- package/lib/configs/poku.js +0 -58
- package/lib/modules/essentials/assert.d.ts +0 -32
- package/lib/modules/essentials/assert.js +0 -9
- package/lib/modules/essentials/poku.d.ts +0 -7
- package/lib/modules/essentials/poku.js +0 -80
- package/lib/modules/essentials/strict.d.ts +0 -32
- package/lib/modules/essentials/strict.js +0 -9
- package/lib/modules/helpers/create-service.d.ts +0 -16
- package/lib/modules/helpers/create-service.js +0 -142
- package/lib/modules/helpers/describe.d.ts +0 -14
- package/lib/modules/helpers/describe.js +0 -93
- package/lib/modules/helpers/each.d.ts +0 -37
- package/lib/modules/helpers/each.js +0 -73
- package/lib/modules/helpers/env.d.ts +0 -2
- package/lib/modules/helpers/env.js +0 -29
- package/lib/modules/helpers/exit.d.ts +0 -2
- package/lib/modules/helpers/exit.js +0 -30
- package/lib/modules/helpers/get-pids.d.ts +0 -5
- package/lib/modules/helpers/get-pids.js +0 -24
- package/lib/modules/helpers/it/core.d.ts +0 -15
- package/lib/modules/helpers/it/core.js +0 -125
- package/lib/modules/helpers/kill.d.ts +0 -9
- package/lib/modules/helpers/kill.js +0 -39
- package/lib/modules/helpers/list-files.d.ts +0 -6
- package/lib/modules/helpers/list-files.js +0 -92
- package/lib/modules/helpers/log.d.ts +0 -2
- package/lib/modules/helpers/log.js +0 -16
- package/lib/modules/helpers/modifiers.d.ts +0 -15
- package/lib/modules/helpers/modifiers.js +0 -45
- package/lib/modules/helpers/skip.d.ts +0 -1
- package/lib/modules/helpers/skip.js +0 -11
- package/lib/modules/helpers/test.d.ts +0 -10
- package/lib/modules/helpers/test.js +0 -5
- package/lib/modules/helpers/wait-for.d.ts +0 -7
- package/lib/modules/helpers/wait-for.js +0 -70
- package/lib/parsers/assert.d.ts +0 -1
- package/lib/parsers/assert.js +0 -9
- package/lib/parsers/callback.d.ts +0 -2
- package/lib/parsers/callback.js +0 -21
- package/lib/parsers/find-file-from-stack.d.ts +0 -3
- package/lib/parsers/find-file-from-stack.js +0 -82
- package/lib/parsers/get-arg.d.ts +0 -5
- package/lib/parsers/get-arg.js +0 -40
- package/lib/parsers/get-runner.d.ts +0 -3
- package/lib/parsers/get-runner.js +0 -41
- package/lib/parsers/get-runtime.d.ts +0 -2
- package/lib/parsers/get-runtime.js +0 -14
- package/lib/parsers/options.d.ts +0 -2
- package/lib/parsers/options.js +0 -37
- package/lib/parsers/os.d.ts +0 -1
- package/lib/parsers/os.js +0 -5
- package/lib/parsers/output.d.ts +0 -5
- package/lib/parsers/output.js +0 -54
- package/lib/parsers/time.d.ts +0 -2
- package/lib/parsers/time.js +0 -13
- package/lib/polyfills/jsonc.d.ts +0 -6
- package/lib/polyfills/jsonc.js +0 -99
- package/lib/polyfills/os.d.ts +0 -1
- package/lib/polyfills/os.js +0 -8
- package/lib/services/assert.d.ts +0 -2
- package/lib/services/assert.js +0 -43
- package/lib/services/each.d.ts +0 -2
- package/lib/services/each.js +0 -48
- package/lib/services/enforce.d.ts +0 -1
- package/lib/services/enforce.js +0 -161
- package/lib/services/env.d.ts +0 -6
- package/lib/services/env.js +0 -60
- package/lib/services/format.d.ts +0 -35
- package/lib/services/format.js +0 -93
- package/lib/services/map-tests.d.ts +0 -6
- package/lib/services/map-tests.js +0 -117
- package/lib/services/pid.d.ts +0 -10
- package/lib/services/pid.js +0 -73
- package/lib/services/reporter.d.ts +0 -2
- package/lib/services/reporter.js +0 -15
- package/lib/services/reporters/classic.d.ts +0 -2
- package/lib/services/reporters/classic.js +0 -48
- package/lib/services/reporters/compact.d.ts +0 -2
- package/lib/services/reporters/compact.js +0 -40
- package/lib/services/reporters/dot.d.ts +0 -2
- package/lib/services/reporters/dot.js +0 -32
- package/lib/services/reporters/focus.d.ts +0 -2
- package/lib/services/reporters/focus.js +0 -33
- package/lib/services/reporters/poku.d.ts +0 -6
- package/lib/services/reporters/poku.js +0 -179
- package/lib/services/run-test-file.d.ts +0 -1
- package/lib/services/run-test-file.js +0 -122
- package/lib/services/run-test-in-process.d.ts +0 -1
- package/lib/services/run-test-in-process.js +0 -92
- package/lib/services/run-tests.d.ts +0 -1
- package/lib/services/run-tests.js +0 -67
- package/lib/services/watch.d.ts +0 -17
- package/lib/services/watch.js +0 -85
- package/lib/services/write.d.ts +0 -3
- package/lib/services/write.js +0 -14
package/README.md
CHANGED
|
@@ -209,20 +209,20 @@ deno run npm:poku
|
|
|
209
209
|
|
|
210
210
|
<table>
|
|
211
211
|
<tr>
|
|
212
|
-
<td
|
|
213
|
-
<td
|
|
212
|
+
<td><a href="https://poku.io/docs/documentation/helpers/coverage">coverage</a></td>
|
|
213
|
+
<td>☔️ Enable coverage collection using a coverage plugin.</td>
|
|
214
214
|
</tr>
|
|
215
215
|
<tr>
|
|
216
|
-
<td><a href="https://poku.io/docs/documentation/poku/
|
|
217
|
-
<td
|
|
216
|
+
<td><a href="https://poku.io/docs/documentation/poku/config-files">config</a></td>
|
|
217
|
+
<td>⚙️ Customize your <b>Poku</b> options in a config file.</td>
|
|
218
218
|
</tr>
|
|
219
219
|
<tr>
|
|
220
|
-
<td><a href="https://poku.io/docs/documentation/poku/
|
|
221
|
-
<td
|
|
220
|
+
<td width="280"><a href="https://poku.io/docs/documentation/poku/options/watch">watch</a></td>
|
|
221
|
+
<td width="770">🍿 Watch for changes and re-run related test files.</td>
|
|
222
222
|
</tr>
|
|
223
223
|
<tr>
|
|
224
|
-
<td><a href="https://poku.io/docs/documentation/
|
|
225
|
-
<td
|
|
224
|
+
<td><a href="https://poku.io/docs/documentation/poku/options/debug">debug</a></td>
|
|
225
|
+
<td>🕵🏻 Shows all logs.</td>
|
|
226
226
|
</tr>
|
|
227
227
|
</table>
|
|
228
228
|
|
|
@@ -248,9 +248,9 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
248
248
|
- [Properly running asynchronous tests on the same file](https://poku.io/docs/examples/promises).
|
|
249
249
|
- [Using **Poku** without installing it on **Deno**](https://github.com/wellwelwel/poku/discussions/565).
|
|
250
250
|
- Migrating:
|
|
251
|
-
- [
|
|
252
|
-
- [
|
|
253
|
-
- [
|
|
251
|
+
- [**3.x.x** → **4.x.x**](https://github.com/wellwelwel/poku/issues/1006)
|
|
252
|
+
- [**2.x.x** → **3.x.x**](https://github.com/wellwelwel/poku/issues/801)
|
|
253
|
+
- [**1.x.x** → **2.x.x**](https://github.com/wellwelwel/poku/issues/533)
|
|
254
254
|
|
|
255
255
|
---
|
|
256
256
|
|
|
@@ -260,11 +260,10 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
260
260
|
|
|
261
261
|
**Poku** is [continuously tested](https://github.com/wellwelwel/poku/blob/main/.github/workflows/ci_benchmark.yml) to ensure the following average expectations for basic usage:
|
|
262
262
|
|
|
263
|
-
- ~**
|
|
264
|
-
- ~**
|
|
263
|
+
- ~**5.3x** faster than [**Jest**](https://github.com/jestjs/jest) (v30.4.2)
|
|
264
|
+
- ~**4.5x** faster than [**Vitest**](https://github.com/vitest-dev/vitest) (v4.1.6)
|
|
265
265
|
|
|
266
|
-
> - You can see how the tests are run and compared in the [benchmark](https://github.com/wellwelwel/poku/tree/main/benchmark) directory.
|
|
267
|
-
> - [Comparing **Poku** and native test runners _(discussion)_](https://github.com/wellwelwel/poku/discussions/740).
|
|
266
|
+
> - You can see how the tests are run and compared in the [**benchmark**](https://github.com/wellwelwel/poku/tree/main/benchmark) directory.
|
|
268
267
|
|
|
269
268
|
---
|
|
270
269
|
|
|
@@ -272,9 +271,11 @@ To see the detailed documentation, please visit the [**Documentation**](https://
|
|
|
272
271
|
|
|
273
272
|
[](https://pkg-size.dev/poku)
|
|
274
273
|
|
|
275
|
-
- [~**
|
|
276
|
-
- [~**
|
|
277
|
-
- [~**
|
|
274
|
+
- [~**150x** lighter than **Jest**](https://pkg-size.dev/jest@30.4.2)
|
|
275
|
+
- [~**125x** lighter than **Vitest**](https://pkg-size.dev/vitest@4.1.6)
|
|
276
|
+
- [~**85x** lighter than **AVA**](https://pkg-size.dev/ava@8.0.0)
|
|
277
|
+
- [~**48x** lighter than **Mocha**](https://pkg-size.dev/mocha@11.7.5)
|
|
278
|
+
- [~**2.9x** lighter than **uvu**](https://pkg-size.dev/uvu@0.5.6)
|
|
278
279
|
|
|
279
280
|
> **Poku** size ensures _cost-saving_ **CI** for services that charge for storage and usage.
|
|
280
281
|
|
|
@@ -315,7 +316,7 @@ Really thanks to everyone who has supported and keeps supporting my work.
|
|
|
315
316
|
## License
|
|
316
317
|
|
|
317
318
|
**Poku** is under the [**MIT License**](https://github.com/wellwelwel/poku/blob/main/LICENSE).<br />
|
|
318
|
-
Copyright © 2024-present [Weslley Araújo](https://github.com/wellwelwel) and **Poku** [contributors](https://github.com/wellwelwel/poku/graphs/contributors).
|
|
319
|
+
Copyright © 2024-present [**Weslley Araújo**](https://github.com/wellwelwel) and **Poku** [**contributors**](https://github.com/wellwelwel/poku/graphs/contributors).
|
|
319
320
|
|
|
320
321
|
[node-version-url]: https://github.com/nodejs/node
|
|
321
322
|
[bun-version-url]: https://github.com/oven-sh/bun
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {stat}from'node:fs/promises';import {exit,argv}from'node:process';import {hr,log$1 as log,format,GLOBAL,getArg,reporter,hasArg}from'../modules/_shared.js';import'node:path';import'node:os';import'node:child_process';import'node:assert';import'node:assert/strict';import'node:net';import'node:url';const errors = [];
|
|
2
|
+
const pathExists = async (arg, path) => {
|
|
3
|
+
try {
|
|
4
|
+
await stat(path);
|
|
5
|
+
} catch {
|
|
6
|
+
errors.push(`--${arg}: ./${path} doesn't exists.`);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
const checkUselessValue = (arg) => {
|
|
10
|
+
const prefix = arg.length === 1 ? "-" : "--";
|
|
11
|
+
if (typeof getArg(arg, prefix) !== "undefined")
|
|
12
|
+
errors.push(`${prefix}${arg}: this flag shouldn't receive a value.`);
|
|
13
|
+
};
|
|
14
|
+
const checkRequiredValue = (arg) => {
|
|
15
|
+
const prefix = arg.length === 1 ? "-" : "--";
|
|
16
|
+
if (hasArg(arg, prefix) && typeof getArg(arg, prefix) === "undefined")
|
|
17
|
+
errors.push(`${prefix}${arg}: this flag require a value.`);
|
|
18
|
+
};
|
|
19
|
+
const checkFlags = () => {
|
|
20
|
+
const allowedFlags = /* @__PURE__ */ new Set([
|
|
21
|
+
"--concurrency",
|
|
22
|
+
"--config",
|
|
23
|
+
"--coverage",
|
|
24
|
+
"--coverageConfig",
|
|
25
|
+
"--debug",
|
|
26
|
+
"--denoAllow",
|
|
27
|
+
"--denoDeny",
|
|
28
|
+
"--enforce",
|
|
29
|
+
"--envFile",
|
|
30
|
+
"--exclude",
|
|
31
|
+
"--failFast",
|
|
32
|
+
"--filter",
|
|
33
|
+
"--isolation",
|
|
34
|
+
"--killPid",
|
|
35
|
+
"--killPort",
|
|
36
|
+
"--killRange",
|
|
37
|
+
"--only",
|
|
38
|
+
"--quiet",
|
|
39
|
+
"--reporter",
|
|
40
|
+
"--sequential",
|
|
41
|
+
"--testNamePattern",
|
|
42
|
+
"--testSkipPattern",
|
|
43
|
+
"--timeout",
|
|
44
|
+
"--watch",
|
|
45
|
+
"--watchInterval",
|
|
46
|
+
"-c",
|
|
47
|
+
"-d",
|
|
48
|
+
"-q",
|
|
49
|
+
"-r",
|
|
50
|
+
"-t",
|
|
51
|
+
"-w",
|
|
52
|
+
"-x"
|
|
53
|
+
]);
|
|
54
|
+
const args = argv.slice(2);
|
|
55
|
+
for (const arg of args) {
|
|
56
|
+
const flag = arg.split("=")[0];
|
|
57
|
+
if (!allowedFlags.has(flag) && flag.startsWith("-"))
|
|
58
|
+
errors.push(`${flag}: unrecognized flag.`);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const checkValues = async () => {
|
|
62
|
+
for (const flag of [
|
|
63
|
+
"debug",
|
|
64
|
+
"enforce",
|
|
65
|
+
"failFast",
|
|
66
|
+
"only",
|
|
67
|
+
"quiet",
|
|
68
|
+
"sequential",
|
|
69
|
+
"watch",
|
|
70
|
+
"d",
|
|
71
|
+
"x",
|
|
72
|
+
"q",
|
|
73
|
+
"w"
|
|
74
|
+
])
|
|
75
|
+
checkUselessValue(flag);
|
|
76
|
+
for (const flag of [
|
|
77
|
+
"concurrency",
|
|
78
|
+
"config",
|
|
79
|
+
"isolation",
|
|
80
|
+
"killPid",
|
|
81
|
+
"killPort",
|
|
82
|
+
"reporter",
|
|
83
|
+
"testNamePattern",
|
|
84
|
+
"testSkipPattern",
|
|
85
|
+
"timeout",
|
|
86
|
+
"watchInterval",
|
|
87
|
+
"c",
|
|
88
|
+
"r",
|
|
89
|
+
"t"
|
|
90
|
+
])
|
|
91
|
+
checkRequiredValue(flag);
|
|
92
|
+
if (GLOBAL.configFile) await pathExists("config", GLOBAL.configFile);
|
|
93
|
+
if (GLOBAL.envFile) await pathExists("envFile", GLOBAL.envFile);
|
|
94
|
+
if (getArg("concurrency") && typeof GLOBAL.configs.concurrency === "undefined")
|
|
95
|
+
errors.push("--concurrency: expects for a valid integer.");
|
|
96
|
+
if (getArg("timeout") && typeof GLOBAL.configs.timeout === "undefined")
|
|
97
|
+
errors.push("--timeout: expects for a valid integer.");
|
|
98
|
+
const isolationValue = getArg("isolation");
|
|
99
|
+
if (isolationValue && isolationValue !== "none" && isolationValue !== "process")
|
|
100
|
+
errors.push(
|
|
101
|
+
`--isolation: "${isolationValue}" is not valid. Available: none, process.`
|
|
102
|
+
);
|
|
103
|
+
const reporterValue = getArg("reporter") ?? getArg("r", "-");
|
|
104
|
+
if (reporterValue && !(reporterValue in reporter))
|
|
105
|
+
errors.push(
|
|
106
|
+
`--reporter: "${reporterValue}" is not a valid reporter. Available: ${Object.keys(reporter).join(", ")}.`
|
|
107
|
+
);
|
|
108
|
+
};
|
|
109
|
+
const checkConfigFile = () => {
|
|
110
|
+
const allowedProps = /* @__PURE__ */ new Set([
|
|
111
|
+
"$schema",
|
|
112
|
+
"include",
|
|
113
|
+
"sequential",
|
|
114
|
+
"debug",
|
|
115
|
+
"filter",
|
|
116
|
+
"exclude",
|
|
117
|
+
"failFast",
|
|
118
|
+
"envFile",
|
|
119
|
+
"exclude",
|
|
120
|
+
"failFast",
|
|
121
|
+
"concurrency",
|
|
122
|
+
"quiet",
|
|
123
|
+
"timeout",
|
|
124
|
+
"envFile",
|
|
125
|
+
"kill",
|
|
126
|
+
"isolation",
|
|
127
|
+
"platform",
|
|
128
|
+
"deno",
|
|
129
|
+
"testNamePattern",
|
|
130
|
+
"testSkipPattern"
|
|
131
|
+
]);
|
|
132
|
+
for (const prop in GLOBAL.configsFromFile) {
|
|
133
|
+
if (!allowedProps.has(prop))
|
|
134
|
+
errors.push(`${prop}: unrecognized property in the config file.`);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const enforce = async () => {
|
|
138
|
+
checkFlags();
|
|
139
|
+
checkConfigFile();
|
|
140
|
+
await checkValues();
|
|
141
|
+
if (errors.length > 0) {
|
|
142
|
+
hr();
|
|
143
|
+
log(`${format("Ensure Enabled").bold()}
|
|
144
|
+
`);
|
|
145
|
+
log(errors.map((flag) => format(flag).fail()).join("\n"));
|
|
146
|
+
hr();
|
|
147
|
+
exit(1);
|
|
148
|
+
}
|
|
149
|
+
};export{enforce};
|
package/lib/bin/help.js
CHANGED
|
@@ -1,94 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const u = (text) => `${(0, format_js_1.format)(text).underline()}`;
|
|
9
|
-
const d = (text) => `${(0, format_js_1.format)(text).dim()}`;
|
|
10
|
-
const options = i('[--options]');
|
|
11
|
-
const paths = i('[paths]');
|
|
12
|
-
const bullet = d('●');
|
|
1
|
+
import {hr,log$1 as log,format}from'../modules/_shared.js';import'node:path';import'node:process';import'node:os';import'node:child_process';import'node:assert';import'node:assert/strict';import'node:fs/promises';import'node:net';import'node:url';const b = (text) => `${format(text).bold()}`;
|
|
2
|
+
const i = (text) => `${format(text).italic()}`;
|
|
3
|
+
const u = (text) => `${format(text).underline()}`;
|
|
4
|
+
const d = (text) => `${format(text).dim()}`;
|
|
5
|
+
const options = i("[--options]");
|
|
6
|
+
const paths = i("[paths]");
|
|
7
|
+
const bullet = d("\u25CF");
|
|
13
8
|
const summary = [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
["--concurrency", "Limit the number of tests running concurrently."],
|
|
10
|
+
["--config, -c", "Specify a configuration file."],
|
|
11
|
+
["--coverage", "Enable coverage collection using a coverage plugin."],
|
|
12
|
+
["--coverageConfig", "Path to a coverage configuration file."],
|
|
13
|
+
["--debug, -d", "Show detailed logs."],
|
|
14
|
+
["--denoAllow", "Allow permissions for Deno."],
|
|
15
|
+
["--denoDeny", "Deny permissions for Deno."],
|
|
16
|
+
["--enforce, -x", "Validate options before running tests."],
|
|
17
|
+
["--envFile", "Read and set an environment file."],
|
|
18
|
+
["--exclude", "Exclude by path using Regex to match files."],
|
|
19
|
+
["--failFast", "Stop tests at the first failure."],
|
|
20
|
+
["--filter", "Filter by path using Regex to match files."],
|
|
21
|
+
["--help, -h", "Show Poku's CLI basic usage."],
|
|
22
|
+
["--killPid", "Terminate the specified processes."],
|
|
23
|
+
["--killPort", "Terminate the specified ports."],
|
|
24
|
+
["--killRange", "Terminate the specified port ranges."],
|
|
25
|
+
["--listFiles", "Display all the files returned in the terminal."],
|
|
26
|
+
["--isolation", "Set test isolation mode (none, process). Default: process."],
|
|
27
|
+
[
|
|
28
|
+
"--reporter, -r",
|
|
29
|
+
"Specify the reporter: poku, dot, compact, focus, classic."
|
|
30
|
+
],
|
|
31
|
+
["--only", "Enable selective execution of tests."],
|
|
32
|
+
["--quiet, -q", "Run tests with no logs."],
|
|
33
|
+
["--sequential", "Run tests files sequentially."],
|
|
34
|
+
["--testNamePattern, -t", "Run only tests matching the given regex."],
|
|
35
|
+
["--testSkipPattern", "Skip tests matching the given regex."],
|
|
36
|
+
["--timeout", "Set the maximum time (ms) for each test file."],
|
|
37
|
+
["--version, -v", "Show Poku's installed version."],
|
|
38
|
+
["--watch, -w", "Watch for test events."],
|
|
39
|
+
["--watchInterval", "Set an interval for watch events."]
|
|
45
40
|
];
|
|
46
|
-
const sortedSummary = summary.sort(([a], [
|
|
41
|
+
const sortedSummary = summary.sort(([a], [b2]) => a.localeCompare(b2));
|
|
47
42
|
const largeEndPad = Math.max(...summary.map(([start]) => start.length));
|
|
48
43
|
const header = `
|
|
49
|
-
|
|
44
|
+
\u{1F437} ${format(" Poku \u2014 CLI Usage ").bg("brightMagenta")}
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
\u203A ${u(b("Usage:"))}
|
|
52
47
|
|
|
53
48
|
poku ${options} ${paths}
|
|
54
49
|
poku ${paths} ${options}
|
|
55
50
|
|
|
56
|
-
|
|
51
|
+
\u203A ${u(b("Tips:"))}
|
|
57
52
|
|
|
58
|
-
${bullet} All CLI options use camel case pattern (e.g.: ${b(
|
|
59
|
-
${bullet} Use ${b(
|
|
60
|
-
${bullet} If you're seeing this, ${u(
|
|
53
|
+
${bullet} All CLI options use camel case pattern (e.g.: ${b("--failFast")}).
|
|
54
|
+
${bullet} Use ${b("=")} to set an option value (e.g.: ${b("--concurrency=4")}).
|
|
55
|
+
${bullet} If you're seeing this, ${u("feel special")} \u2728
|
|
61
56
|
`;
|
|
62
57
|
const main = `
|
|
63
|
-
|
|
58
|
+
\u{1F43D} ${format(" Poku \u2014 Options ").bg("brightMagenta")}
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
\u203A ${u(b("Summary:"))}
|
|
66
61
|
|
|
67
|
-
${sortedSummary
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
${sortedSummary.map(
|
|
63
|
+
([command, description]) => `${command.padEnd(largeEndPad)} ${d(description)}`
|
|
64
|
+
).join("\n")}
|
|
70
65
|
|
|
71
|
-
|
|
66
|
+
\u203A ${u(b("Notes:"))}
|
|
72
67
|
|
|
73
68
|
${bullet} For Glob support, see:
|
|
74
|
-
${u(
|
|
69
|
+
${u("https://poku.io/docs/documentation/poku/include-files#by-extending-glob-patterns-from-shell")}
|
|
75
70
|
|
|
76
71
|
${bullet} Avoid conflicts for environments with multiple platforms:
|
|
77
|
-
${u(
|
|
72
|
+
${u("https://poku.io/docs/tutorials/cross-platform")}
|
|
78
73
|
`;
|
|
79
74
|
const footer = `
|
|
80
|
-
${b(
|
|
75
|
+
${b("Documentation:")} ${u("https://poku.io/docs")}
|
|
81
76
|
|
|
82
|
-
${bullet} ${b(
|
|
83
|
-
${bullet} Give him a ${b(
|
|
77
|
+
${bullet} ${b("Poku")} is made with ${b("love")} and ${b("care")} in every detail.
|
|
78
|
+
${bullet} Give him a ${b("star")} to show your support \u{1F31F}
|
|
84
79
|
`;
|
|
85
80
|
const help = () => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
exports.help = help;
|
|
81
|
+
hr();
|
|
82
|
+
log(header.trim());
|
|
83
|
+
hr();
|
|
84
|
+
log(main.trim());
|
|
85
|
+
hr();
|
|
86
|
+
log(footer.trim());
|
|
87
|
+
hr();
|
|
88
|
+
};export{help};
|