@binary-balance/seshat 0.1.0-rc.1 → 0.1.0
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 +126 -5
- package/package.json +11 -7
package/README.md
CHANGED
|
@@ -1,8 +1,129 @@
|
|
|
1
1
|
# Seshat
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Seshat is a native CLI for TypeScript and TSX complexity analysis and mutation
|
|
4
|
+
testing. `check` runs both assessments, `crap` runs complexity and coverage
|
|
5
|
+
analysis, and `mutate` runs mutation testing from the original test baseline.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Install the entry package in the project you want to assess:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install --save-dev @binary-balance/seshat
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The package declares and verifies Node.js 24.20.0 exactly. It selects one
|
|
16
|
+
native payload for the current platform from these five verified targets:
|
|
17
|
+
|
|
18
|
+
- Linux x64 (glibc; Debian 11 userspace, glibc 2.31)
|
|
19
|
+
- Linux ARM64 (glibc; Ubuntu 22.04, glibc 2.35)
|
|
20
|
+
- macOS x64 (macOS 15.0 minimum)
|
|
21
|
+
- macOS ARM64 (macOS 15.0 minimum)
|
|
22
|
+
- Windows x64 (Windows Server 2022 verification)
|
|
23
|
+
|
|
24
|
+
These are the known verification floors; see the [native platform support
|
|
25
|
+
matrix](https://github.com/Binary-Balance/seshat/blob/main/docs/platform-support.md)
|
|
26
|
+
for the detailed target evidence.
|
|
27
|
+
|
|
28
|
+
## Minimal mutation example
|
|
29
|
+
|
|
30
|
+
For a small Node test setup, install TypeScript in the project first:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm install --save-dev typescript
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Create `src/rules.mts`:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
export function classify(value: number): 'positive' | 'negative' {
|
|
40
|
+
return value >= 0 ? 'positive' : 'negative';
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Create `tests/rules.test.mjs`:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import assert from 'node:assert/strict';
|
|
48
|
+
import {test} from 'node:test';
|
|
49
|
+
import {classify} from '../src/rules.mts';
|
|
50
|
+
|
|
51
|
+
test('classifies zero and positive values', () => {
|
|
52
|
+
assert.equal(classify(0), 'positive');
|
|
53
|
+
assert.equal(classify(1), 'positive');
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Create `tsconfig.json`:
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"compilerOptions": {
|
|
62
|
+
"strict": true,
|
|
63
|
+
"noEmit": true,
|
|
64
|
+
"skipLibCheck": true,
|
|
65
|
+
"target": "ES2022",
|
|
66
|
+
"module": "NodeNext",
|
|
67
|
+
"moduleResolution": "NodeNext",
|
|
68
|
+
"allowImportingTsExtensions": true
|
|
69
|
+
},
|
|
70
|
+
"include": ["src/**/*.mts"]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Create `seshat.json`:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"source": {"include": ["src/**/*.mts"]},
|
|
79
|
+
"capture": [
|
|
80
|
+
"package.json",
|
|
81
|
+
"package-lock.json",
|
|
82
|
+
"tsconfig.json",
|
|
83
|
+
"src",
|
|
84
|
+
"tests",
|
|
85
|
+
"node_modules"
|
|
86
|
+
],
|
|
87
|
+
"setups": [{
|
|
88
|
+
"name": "node",
|
|
89
|
+
"runner": "node",
|
|
90
|
+
"cwd": ".",
|
|
91
|
+
"typecheck": [
|
|
92
|
+
"node",
|
|
93
|
+
"node_modules/typescript/bin/tsc",
|
|
94
|
+
"--project",
|
|
95
|
+
"tsconfig.json"
|
|
96
|
+
],
|
|
97
|
+
"test": [
|
|
98
|
+
"node",
|
|
99
|
+
"--test",
|
|
100
|
+
"--test-concurrency=1",
|
|
101
|
+
"--test-reporter={seshatReporter}",
|
|
102
|
+
"tests/rules.test.mjs"
|
|
103
|
+
],
|
|
104
|
+
"coverage": {
|
|
105
|
+
"command": ["node", "-e", "process.exit(0)"],
|
|
106
|
+
"report": "coverage/unused.json"
|
|
107
|
+
}
|
|
108
|
+
}]
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Run mutation testing and save its JSON report:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
./node_modules/.bin/seshat mutate --config ./seshat.json \
|
|
116
|
+
--json --no-progress > seshat-report.json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The `coverage` block is required by the configuration schema but is not run by
|
|
120
|
+
`mutate`; the no-op command above keeps this example dependency-light. `check`
|
|
121
|
+
and `crap` do run coverage and need a command that writes a fresh Istanbul JSON
|
|
122
|
+
report. Use the complete [Node example](https://github.com/Binary-Balance/seshat/tree/main/examples/node),
|
|
123
|
+
[Vitest example](https://github.com/Binary-Balance/seshat/tree/main/examples/vitest),
|
|
124
|
+
or [Jest/Expo example](https://github.com/Binary-Balance/seshat/tree/main/examples/jest-expo)
|
|
125
|
+
for those commands.
|
|
126
|
+
|
|
127
|
+
See the [full configuration guide](https://github.com/Binary-Balance/seshat/blob/main/docs/configuration.md)
|
|
128
|
+
for all fields and runner setup, and the [JSON report format](https://github.com/Binary-Balance/seshat/blob/main/docs/report-format.md)
|
|
129
|
+
for the `--json` output contract.
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@binary-balance/seshat",
|
|
3
|
-
"version": "0.1.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A native CLI for TypeScript and TSX complexity analysis and mutation testing.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Binary-Balance/seshat.git"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"engines": {
|
|
8
12
|
"node": "24.20.0"
|
|
@@ -16,10 +20,10 @@
|
|
|
16
20
|
"LICENSE"
|
|
17
21
|
],
|
|
18
22
|
"optionalDependencies": {
|
|
19
|
-
"@binary-balance/seshat-linux-x64": "0.1.0
|
|
20
|
-
"@binary-balance/seshat-linux-arm64": "0.1.0
|
|
21
|
-
"@binary-balance/seshat-darwin-x64": "0.1.0
|
|
22
|
-
"@binary-balance/seshat-darwin-arm64": "0.1.0
|
|
23
|
-
"@binary-balance/seshat-win32-x64": "0.1.0
|
|
23
|
+
"@binary-balance/seshat-linux-x64": "0.1.0",
|
|
24
|
+
"@binary-balance/seshat-linux-arm64": "0.1.0",
|
|
25
|
+
"@binary-balance/seshat-darwin-x64": "0.1.0",
|
|
26
|
+
"@binary-balance/seshat-darwin-arm64": "0.1.0",
|
|
27
|
+
"@binary-balance/seshat-win32-x64": "0.1.0"
|
|
24
28
|
}
|
|
25
29
|
}
|