tape-six-proc 1.2.6 → 1.2.7
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 +1 -0
- package/bin/tape6-proc-node.js +44 -3
- package/bin/tape6-proc.js +32 -1
- package/llms-full.txt +4 -2
- package/llms.txt +2 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ LLM-friendly documentation is available:
|
|
|
88
88
|
|
|
89
89
|
The most recent releases:
|
|
90
90
|
|
|
91
|
+
- 1.2.7 _Added `--help` and `--version` flags. Updated dependencies._
|
|
91
92
|
- 1.2.6 _Updated dependencies. Added AI agent rule files. Improved workflows._
|
|
92
93
|
- 1.2.5 _Synchronized with `tape-six` 1.7.6+. Simplified CLI via shared config utilities. Added `--info` flag. Fixed Deno stdout flush._
|
|
93
94
|
- 1.2.4 _Synchronized with `tape-six` 1.7.4. Added Min reporter support. Improved docs and npm keywords._
|
package/bin/tape6-proc-node.js
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import {readFileSync} from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
3
5
|
import process from 'node:process';
|
|
4
6
|
import {fileURLToPath} from 'node:url';
|
|
5
7
|
|
|
6
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getOptions,
|
|
10
|
+
initFiles,
|
|
11
|
+
initReporter,
|
|
12
|
+
showInfo,
|
|
13
|
+
printFlagOptions
|
|
14
|
+
} from 'tape-six/utils/config.js';
|
|
7
15
|
|
|
8
16
|
import {getReporter, setReporter} from 'tape-six/test.js';
|
|
9
17
|
import {selectTimer} from 'tape-six/utils/timer.js';
|
|
@@ -12,6 +20,11 @@ import TestWorker from '../src/TestWorker.js';
|
|
|
12
20
|
|
|
13
21
|
const rootFolder = process.cwd();
|
|
14
22
|
|
|
23
|
+
const getVersion = () => {
|
|
24
|
+
const pkgPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../package.json');
|
|
25
|
+
return JSON.parse(readFileSync(pkgPath, 'utf8')).version;
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
const showSelf = () => {
|
|
16
29
|
const self = new URL(import.meta.url);
|
|
17
30
|
if (self.protocol === 'file:') {
|
|
@@ -22,16 +35,44 @@ const showSelf = () => {
|
|
|
22
35
|
process.exit(0);
|
|
23
36
|
};
|
|
24
37
|
|
|
38
|
+
const showVersion = () => {
|
|
39
|
+
console.log('tape6-proc ' + getVersion());
|
|
40
|
+
process.exit(0);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const showHelp = () => {
|
|
44
|
+
console.log('tape6-proc ' + getVersion() + ' \u2014 Process-isolated test runner for tape-six\n');
|
|
45
|
+
console.log('Usage: tape6-proc [options] [files...]\n');
|
|
46
|
+
const options = [
|
|
47
|
+
['--flags, -f <flags>', 'Set reporter flags (env: TAPE6_FLAGS)'],
|
|
48
|
+
['--par, -p <n>', 'Set parallelism level (env: TAPE6_PAR)'],
|
|
49
|
+
['--runFileArgs, -r <args>', 'Extra arguments for spawned interpreter (repeatable)'],
|
|
50
|
+
['--info', 'Show configuration info and exit'],
|
|
51
|
+
['--self', 'Print the path to this script and exit'],
|
|
52
|
+
['--help, -h', 'Show this help message and exit'],
|
|
53
|
+
['--version, -v', 'Show version and exit']
|
|
54
|
+
];
|
|
55
|
+
console.log('Options:');
|
|
56
|
+
const width = options.reduce((max, [flag]) => Math.max(max, flag.length), 0) + 2;
|
|
57
|
+
for (const [flag, desc] of options) {
|
|
58
|
+
console.log(' ' + flag.padEnd(width) + desc);
|
|
59
|
+
}
|
|
60
|
+
printFlagOptions();
|
|
61
|
+
process.exit(0);
|
|
62
|
+
};
|
|
63
|
+
|
|
25
64
|
const main = async () => {
|
|
26
65
|
const runFileArgs = [];
|
|
27
66
|
const options = getOptions({
|
|
28
|
-
'--self': showSelf,
|
|
67
|
+
'--self': {fn: showSelf, isValueRequired: false},
|
|
29
68
|
'--info': {isValueRequired: false},
|
|
30
69
|
'--runFileArgs': {
|
|
31
70
|
aliases: ['-r'],
|
|
32
71
|
isValueRequired: true,
|
|
33
72
|
fn: (_, _name, value) => runFileArgs.push(value)
|
|
34
|
-
}
|
|
73
|
+
},
|
|
74
|
+
'--help': {aliases: ['-h'], fn: showHelp, isValueRequired: false},
|
|
75
|
+
'--version': {aliases: ['-v'], fn: showVersion, isValueRequired: false}
|
|
35
76
|
});
|
|
36
77
|
options.flags.runFileArgs = runFileArgs;
|
|
37
78
|
|
package/bin/tape6-proc.js
CHANGED
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import {readFileSync} from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
3
5
|
import process from 'node:process';
|
|
4
6
|
import {fileURLToPath} from 'node:url';
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
import {printFlagOptions} from 'tape-six/utils/config.js';
|
|
9
|
+
|
|
10
|
+
const getVersion = () => {
|
|
11
|
+
const pkgPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../package.json');
|
|
12
|
+
return JSON.parse(readFileSync(pkgPath, 'utf8')).version;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
16
|
+
console.log('tape6-proc ' + getVersion() + ' \u2014 Process-isolated test runner for tape-six\n');
|
|
17
|
+
console.log('Usage: tape6-proc [options] [files...]\n');
|
|
18
|
+
const options = [
|
|
19
|
+
['--flags, -f <flags>', 'Set reporter flags (env: TAPE6_FLAGS)'],
|
|
20
|
+
['--par, -p <n>', 'Set parallelism level (env: TAPE6_PAR)'],
|
|
21
|
+
['--runFileArgs, -r <args>', 'Extra arguments for spawned interpreter (repeatable)'],
|
|
22
|
+
['--info', 'Show configuration info and exit'],
|
|
23
|
+
['--self', 'Print the path to this script and exit'],
|
|
24
|
+
['--help, -h', 'Show this help message and exit'],
|
|
25
|
+
['--version, -v', 'Show version and exit']
|
|
26
|
+
];
|
|
27
|
+
console.log('Options:');
|
|
28
|
+
const width = options.reduce((max, [flag]) => Math.max(max, flag.length), 0) + 2;
|
|
29
|
+
for (const [flag, desc] of options) {
|
|
30
|
+
console.log(' ' + flag.padEnd(width) + desc);
|
|
31
|
+
}
|
|
32
|
+
printFlagOptions();
|
|
33
|
+
process.exit(0);
|
|
34
|
+
} else if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
35
|
+
console.log('tape6-proc ' + getVersion());
|
|
36
|
+
process.exit(0);
|
|
37
|
+
} else if (process.argv.includes('--self')) {
|
|
7
38
|
const self = new URL(import.meta.url);
|
|
8
39
|
if (self.protocol === 'file:') {
|
|
9
40
|
console.log(fileURLToPath(self));
|
package/llms-full.txt
CHANGED
|
@@ -57,6 +57,8 @@ tape6-proc [--flags FLAGS] [--par N] [--runFileArgs ARGS] [tests...]
|
|
|
57
57
|
- `--runFileArgs ARGS` (`-r`) — extra arguments passed to the spawned interpreter. Can be specified multiple times. Mainly used for Deno permissions.
|
|
58
58
|
- `--info` — prints runtime, reporter, parallelism, flags, and test files, then exits.
|
|
59
59
|
- `--self` — prints the absolute path to `tape6-proc.js` and exits. Used in cross-runtime scripts.
|
|
60
|
+
- `--help` (`-h`) — show help message and exit.
|
|
61
|
+
- `--version` (`-v`) — show version and exit.
|
|
60
62
|
- Positional arguments: test file glob patterns. If none given, reads from configuration.
|
|
61
63
|
- Options accept `--flags FO` or `--flags=FO`. The `=` form does not support quoting.
|
|
62
64
|
|
|
@@ -165,7 +167,7 @@ Environment-specific subsections (`node`, `deno`, `bun`) are supported. The runn
|
|
|
165
167
|
|
|
166
168
|
Delegates argument parsing, reporter setup, and file resolution to `tape-six/utils/config.js`:
|
|
167
169
|
|
|
168
|
-
1. Calls `getOptions()` to parse CLI arguments (`--flags`, `--par`, `--runFileArgs`, `--info`, positional test patterns).
|
|
170
|
+
1. Calls `getOptions()` to parse CLI arguments (`--flags`, `--par`, `--runFileArgs`, `--info`, `--help`, `--version`, positional test patterns).
|
|
169
171
|
2. Calls `initReporter()` to select the reporter: TTY (default for terminals), TAP, JSONL, or Min (based on environment variables).
|
|
170
172
|
3. Calls `initFiles()` to resolve test files from configuration or CLI patterns.
|
|
171
173
|
4. Creates a `TestWorker` instance and executes all test files.
|
|
@@ -208,7 +210,7 @@ process.stderr → TextDecoderStream → lines → wrap-lines → report
|
|
|
208
210
|
|
|
209
211
|
## Dependencies
|
|
210
212
|
|
|
211
|
-
- **`tape-six`** — the core test library. Imports: `utils/config.js` (`getOptions`, `initFiles`, `initReporter`, `showInfo`), `test.js` (`getReporter`, `setReporter`), `utils/timer.js`, `State.js`, `utils/EventServer.js`, `utils/makeDeferred.js`.
|
|
213
|
+
- **`tape-six`** — the core test library. Imports: `utils/config.js` (`getOptions`, `initFiles`, `initReporter`, `showInfo`, `printFlagOptions`), `test.js` (`getReporter`, `setReporter`), `utils/timer.js`, `State.js`, `utils/EventServer.js`, `utils/makeDeferred.js`.
|
|
212
214
|
- **`dollar-shell`** — cross-runtime process spawning. Imports: `spawn`, `currentExecPath`, `runFileArgs`.
|
|
213
215
|
|
|
214
216
|
## Writing tests
|
package/llms.txt
CHANGED
|
@@ -56,6 +56,8 @@ tape6-proc [--flags FLAGS] [--par N] [--runFileArgs ARGS] [tests...]
|
|
|
56
56
|
- `--runFileArgs ARGS` (`-r`) — extra arguments for the spawned interpreter. Can be specified multiple times. Mainly for Deno permissions.
|
|
57
57
|
- `--info` — prints runtime, reporter, parallelism, flags, and test files, then exits.
|
|
58
58
|
- `--self` — prints the path to `tape6-proc.js` (for cross-runtime scripts).
|
|
59
|
+
- `--help` (`-h`) — show help message and exit.
|
|
60
|
+
- `--version` (`-v`) — show version and exit.
|
|
59
61
|
- No arguments: runs tests from configuration.
|
|
60
62
|
- Options accept `--flags FO` or `--flags=FO`. The `=` form does not support quoting.
|
|
61
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tape-six-proc",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "Process-isolated test runner for tape-six. Runs each test file in its own subprocess. Works with Node, Deno, and Bun. Supports TypeScript without transpilation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"llms-full.txt"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"dollar-shell": "^1.1.
|
|
60
|
-
"tape-six": "^1.7.
|
|
59
|
+
"dollar-shell": "^1.1.13",
|
|
60
|
+
"tape-six": "^1.7.12"
|
|
61
61
|
},
|
|
62
62
|
"tape6": {
|
|
63
63
|
"tests": [
|