poku 2.6.2 → 2.6.3-canary.402af07

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.
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.help = void 0;
4
+ const format_js_1 = require("../services/format.js");
5
+ const write_js_1 = require("../services/write.js");
6
+ const b = (text) => `${(0, format_js_1.format)(text).bold()}`;
7
+ const i = (text) => `${(0, format_js_1.format)(text).italic()}`;
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('●');
13
+ const summary = [
14
+ ['--bun', 'Enforce tests to run through Bun.'],
15
+ ['--concurrency', 'Limit the number of tests running concurrently.'],
16
+ ['--config, -c', 'Specify a configuration file.'],
17
+ ['--debug, -d', 'Show detailed logs.'],
18
+ ['--deno', 'Enforce tests to run through Deno.'],
19
+ ['--denoAllow', 'Allow permissions for Deno.'],
20
+ ['--denoCjs', 'Support CommonJS in Deno.'],
21
+ ['--denoDeny', 'Deny permissions for Deno.'],
22
+ ['--enforce, -x', 'Validate options before running tests.'],
23
+ ['--envFile', 'Read and set an environment file.'],
24
+ ['--exclude', 'Exclude by path using Regex to match files.'],
25
+ ['--failFast', 'Stop tests at the first failure.'],
26
+ ['--filter', 'Filter by path using Regex to match files.'],
27
+ ['--help, -h', "Show Poku's CLI basic usage."],
28
+ ['--killPid', 'Terminate the specified processes.'],
29
+ ['--killPort', 'Terminate the specified ports.'],
30
+ ['--killRange', 'Terminate the specified port ranges.'],
31
+ ['--listFiles', 'Display all the files returned in the terminal.'],
32
+ ['--node', 'Enforce tests to run through Node.js.'],
33
+ ['--parallel, -p', 'Run tests files in parallel.'],
34
+ ['--platform', 'Enforce tests to run through a platform.'],
35
+ ['--quiet, -q', 'Run tests with no logs.'],
36
+ ['--version, -v', "Show Poku's installed version."],
37
+ ['--watch, -w', 'Watch for test events.'],
38
+ ['--watchInterval', 'Set an interval for watch events.'],
39
+ ];
40
+ const sortedSummary = summary.sort(([a], [b]) => a.localeCompare(b));
41
+ const largeEndPad = (() => Math.max(...summary.map(([start]) => start.length)))();
42
+ const header = `
43
+ 🐷 ${(0, format_js_1.format)(' Poku — CLI Usage ').bg('brightMagenta')}
44
+
45
+ › ${u(b('Usage:'))}
46
+
47
+ poku ${options} ${paths}
48
+ poku ${paths} ${options}
49
+
50
+ › ${u(b('Ensuring platforms:'))}
51
+
52
+ poku ${b('--node')} ${options} ${paths}
53
+ poku ${b('--bun')} ${options} ${paths}
54
+ poku ${b('--deno')} ${options} ${paths}
55
+
56
+ › ${u(b('Tips:'))}
57
+
58
+ ${bullet} All CLI options use camel case pattern (e.g.: ${b('--failFast')}).
59
+ ${bullet} Use ${b('=')} to set an option value (e.g.: ${b('--concurrency=4')}).
60
+ ${bullet} If you're seeing this, ${u('feel special')} ✨
61
+ `;
62
+ const main = `
63
+ 🐽 ${(0, format_js_1.format)(' Poku — Options ').bg('brightMagenta')}
64
+
65
+ › ${u(b('Summary:'))}
66
+
67
+ ${sortedSummary
68
+ .map(([command, description]) => `${command.padEnd(largeEndPad)} ${d(description)}`)
69
+ .join('\n')}
70
+
71
+ › ${u(b('Notes:'))}
72
+
73
+ ${bullet} For Glob support, see:
74
+ ${u('https://poku.io/docs/documentation/poku/include-files#by-extending-glob-patterns-from-shell')}
75
+
76
+ ${bullet} Avoid conflicts for environments with multiple platforms:
77
+ ${u('https://poku.io/docs/tutorials/cross-platform')}
78
+ `;
79
+ const footer = `
80
+ ${b('Documentation:')} ${u('https://poku.io')}
81
+
82
+ ${bullet} ${b('Poku')} is made with ${b('love')} and ${b('care')} in every detail.
83
+ ${bullet} Give him a ${b('star')} to show your support 🌟
84
+ `;
85
+ const help = () => {
86
+ write_js_1.Write.hr();
87
+ write_js_1.Write.log(header.trim());
88
+ write_js_1.Write.hr();
89
+ write_js_1.Write.log(main.trim());
90
+ write_js_1.Write.hr();
91
+ write_js_1.Write.log(footer.trim());
92
+ write_js_1.Write.hr();
93
+ };
94
+ exports.help = help;
package/lib/bin/index.js CHANGED
@@ -18,6 +18,11 @@ const options_js_1 = require("../parsers/options.js");
18
18
  write_js_1.Write.log(VERSION);
19
19
  return;
20
20
  }
21
+ if ((0, get_arg_js_1.hasArg)('help') || (0, get_arg_js_1.hasArg)('h', '-')) {
22
+ const { help } = require('./help.js');
23
+ help();
24
+ return;
25
+ }
21
26
  const enforce = (0, get_arg_js_1.hasArg)('enforce') || (0, get_arg_js_1.hasArg)('x', '-');
22
27
  const configFile = (0, get_arg_js_1.getArg)('config') || (0, get_arg_js_1.getArg)('c', '-');
23
28
  const defaultConfigs = await (0, options_js_1.getConfigs)(configFile);
@@ -7,4 +7,4 @@ exports.results = {
7
7
  skip: 0,
8
8
  todo: 0,
9
9
  };
10
- exports.VERSION = '2.6.2';
10
+ exports.VERSION = '2.6.3-canary.402af07';
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.strict = void 0;
7
- const strict_1 = __importDefault(require("assert/strict"));
8
4
  const assert_js_1 = require("../../builders/assert.js");
9
- exports.strict = (0, assert_js_1.createAssert)(strict_1.default);
5
+ const get_runtime_js_1 = require("../../parsers/get-runtime.js");
6
+
7
+ const nodeAssert = !get_runtime_js_1.nodeVersion || get_runtime_js_1.nodeVersion >= 16
8
+ ? require("assert/strict")
9
+ : require("assert");
10
+ exports.strict = (0, assert_js_1.createAssert)(nodeAssert);
@@ -1,7 +1,7 @@
1
1
  export declare function todo(message: string): void;
2
- export declare function todo(message: string, _cb?: () => Promise<unknown>): Promise<void>;
3
- export declare function todo(message: string, _cb?: () => unknown): void;
4
- export declare function skip(message: string, _cb: () => Promise<unknown>): Promise<void>;
5
- export declare function skip(message: string, _cb: () => unknown): void;
6
- export declare function skip(_cb: () => Promise<unknown>): Promise<void>;
7
- export declare function skip(_cb: () => unknown): void;
2
+ export declare function todo(message: string, cb?: () => Promise<unknown>): Promise<void>;
3
+ export declare function todo(message: string, cb?: () => unknown): void;
4
+ export declare function skip(message: string, cb: () => Promise<unknown>): Promise<void>;
5
+ export declare function skip(message: string, cb: () => unknown): void;
6
+ export declare function skip(cb: () => Promise<unknown>): Promise<void>;
7
+ export declare function skip(cb: () => unknown): void;
@@ -7,30 +7,8 @@ const indentation_js_1 = require("../../configs/indentation.js");
7
7
  const format_js_1 = require("../../services/format.js");
8
8
  async function todo(message, _cb) {
9
9
  write_js_1.Write.log(`${indentation_js_1.indentation.hasDescribe ? ' ' : ''}${(0, format_js_1.format)(`● ${message}`).cyan().bold()}`);
10
-
11
- if (typeof _cb === 'function') {
12
- const isAsync = _cb.constructor.name === 'AsyncFunction';
13
- if (isAsync)
14
- return await Promise.resolve();
15
- return;
16
- }
17
-
18
10
  }
19
11
  async function skip(messageOrCb, _cb) {
20
- const message = (typeof messageOrCb === 'string' && messageOrCb) || 'Skipping';
12
+ const message = typeof messageOrCb === 'string' ? messageOrCb : 'Skipping';
21
13
  write_js_1.Write.log(`${indentation_js_1.indentation.hasDescribe ? ' ' : ''}${(0, format_js_1.format)(`◯ ${message}`).info().bold()}`);
22
-
23
- if (typeof messageOrCb === 'function') {
24
- const isAsync = messageOrCb.constructor.name === 'AsyncFunction';
25
- if (isAsync)
26
- return await Promise.resolve();
27
- return;
28
- }
29
- if (typeof _cb === 'function') {
30
- const isAsync = _cb.constructor.name === 'AsyncFunction';
31
- if (isAsync)
32
- return await Promise.resolve();
33
- return;
34
- }
35
-
36
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poku",
3
- "version": "2.6.2",
3
+ "version": "2.6.3-canary.402af07",
4
4
  "description": "🐷 Poku makes testing easy for Node.js, Bun, Deno, and you at the same time.",
5
5
  "main": "./lib/modules/index.js",
6
6
  "license": "MIT",
@@ -64,7 +64,7 @@
64
64
  "packages-update": "^2.0.0",
65
65
  "prettier": "^3.3.3",
66
66
  "tsx": "4.19.0",
67
- "typescript": "^5.5.4"
67
+ "typescript": "^5.6.2"
68
68
  },
69
69
  "keywords": [
70
70
  "🐷",