bivium 0.6.2 → 0.7.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 +26 -22
- package/cli.js +573 -273
- package/docs/api.md +5 -1
- package/docs/ci.md +4 -2
- package/docs/cli.md +69 -8
- package/docs/config.md +13 -10
- package/docs/how-it-works.md +18 -3
- package/docs/recipes.md +6 -4
- package/docs/tuning.md +35 -29
- package/index.d.ts +14 -26
- package/package.json +1 -1
- package/shared.js +189 -40
package/docs/api.md
CHANGED
|
@@ -111,10 +111,14 @@ It returns one of two shapes:
|
|
|
111
111
|
A narrower that throws, or returns anything else,
|
|
112
112
|
runs its suites in full with the reason too.
|
|
113
113
|
|
|
114
|
-
carbon-components-svelte runs one
|
|
114
|
+
carbon-components-svelte runs one built on
|
|
115
|
+
[crassus](https://github.com/metonym/crassus), a CSS cascade
|
|
116
|
+
regression tool.
|
|
115
117
|
|
|
116
118
|
## Related
|
|
117
119
|
|
|
118
120
|
- [Config](config.md): `defineConfig` and every key
|
|
119
121
|
- [CLI](cli.md): the same plan from the command line
|
|
120
122
|
- [How it works](how-it-works.md): the graph a plan walks
|
|
123
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
124
|
+
other tools
|
package/docs/ci.md
CHANGED
|
@@ -120,8 +120,8 @@ when no key matches exactly.
|
|
|
120
120
|
The cache lives in `node_modules/.cache/bivium`
|
|
121
121
|
when `node_modules` exists, and in `.bivium/cache` otherwise.
|
|
122
122
|
The plan job runs before any install, so its cache is `.bivium/cache`.
|
|
123
|
-
bivium writes a `.gitignore` there, so the cache never shows up as
|
|
124
|
-
change.
|
|
123
|
+
bivium writes a `.gitignore` there, so the cache never shows up as
|
|
124
|
+
a change.
|
|
125
125
|
|
|
126
126
|
## What a plan costs
|
|
127
127
|
|
|
@@ -146,3 +146,5 @@ and 124 MB on Node.
|
|
|
146
146
|
- [CLI](cli.md): `plan --github` and the other commands
|
|
147
147
|
- [Config](config.md): a suite's `output`, and `cache`
|
|
148
148
|
- [How it works](how-it-works.md): what a plan reads
|
|
149
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
150
|
+
other tools
|
package/docs/cli.md
CHANGED
|
@@ -24,11 +24,39 @@ It has five commands:
|
|
|
24
24
|
`plan` prints the tests each suite needs for the changes since a base.
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
bivium plan [base] [--json] [--github]
|
|
27
|
+
bivium plan [base] [--json] [--github] [--list]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
`base` defaults to the config's `base`,
|
|
31
31
|
else the upstream default branch.
|
|
32
|
+
|
|
33
|
+
On a terminal, each suite gets a verdict first:
|
|
34
|
+
how many of its tests run, and for how many changed files;
|
|
35
|
+
or that all of them run, or none, and why.
|
|
36
|
+
A gray line says what it planned against: the base, its merge base,
|
|
37
|
+
and the config file.
|
|
38
|
+
Lines for each other full-run cause,
|
|
39
|
+
package change and narrower note follow it.
|
|
40
|
+
Then a table counts the selected tests by folder,
|
|
41
|
+
and a last line says how many tests it planned and what that took:
|
|
42
|
+
|
|
43
|
+
```console
|
|
44
|
+
$ bunx bivium plan
|
|
45
|
+
3 of 12 tests run for 1 changed file (unit)
|
|
46
|
+
no tests run (e2e): no change reaches a test
|
|
47
|
+
since origin/main (merge base 6b844dd) · config bivium.config.ts
|
|
48
|
+
|
|
49
|
+
directory unit
|
|
50
|
+
tests/* 2
|
|
51
|
+
tests/css/ 1
|
|
52
|
+
────
|
|
53
|
+
2 directories 3
|
|
54
|
+
|
|
55
|
+
✓ Planned 3 tests · 323 ms · --list for the files
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Piped, run by a coding agent, or with `--list`,
|
|
59
|
+
it prints the files instead.
|
|
32
60
|
The first line says what it planned against: the base, its merge base,
|
|
33
61
|
how many files changed, and the config file.
|
|
34
62
|
Then each suite gets one line:
|
|
@@ -42,6 +70,7 @@ Then each suite gets one line:
|
|
|
42
70
|
|
|
43
71
|
Options:
|
|
44
72
|
|
|
73
|
+
- `--list` prints the files on a terminal too, as a pipe gets them.
|
|
45
74
|
- `--json` prints the plan as data, with the fields below.
|
|
46
75
|
- `--github` also writes each suite's selection to `$GITHUB_OUTPUT` as
|
|
47
76
|
`<output>=all`, `none`, or the files separated by spaces.
|
|
@@ -128,7 +157,7 @@ bivium why tests/Button.test.ts src/Button.svelte --format chain
|
|
|
128
157
|
each with where it is and how to fix it.
|
|
129
158
|
|
|
130
159
|
```sh
|
|
131
|
-
bivium check [--base <ref>] [--max-unknown <n>] [--json]
|
|
160
|
+
bivium check [--base <ref>] [--max-unknown <n>] [--all] [--json]
|
|
132
161
|
```
|
|
133
162
|
|
|
134
163
|
A node is a file, a barrel name, or a package in the graph.
|
|
@@ -138,9 +167,34 @@ Every test that reaches one runs on every change.
|
|
|
138
167
|
A changed file under a suite's `root` that no test reaches runs the
|
|
139
168
|
whole suite: the orphan rule.
|
|
140
169
|
|
|
141
|
-
`check` leads with
|
|
170
|
+
`check` leads with a verdict: how many files it can't follow,
|
|
171
|
+
and how many tests those run on every change.
|
|
172
|
+
A gray line counts the rest.
|
|
173
|
+
Then each cause gets a section: the cause, how many,
|
|
174
|
+
up to three places it's at, and its fix once.
|
|
175
|
+
A place whose fix differs carries its own.
|
|
176
|
+
A last line says whether the check passes, and what failed:
|
|
177
|
+
|
|
178
|
+
```console
|
|
179
|
+
$ bunx bivium check
|
|
180
|
+
2 files bivium can't follow send 2 tests to every change
|
|
181
|
+
|
|
182
|
+
reads the disk without @depends-on · 2 files
|
|
183
|
+
├ test/u.test.js:1
|
|
184
|
+
└ test/w.test.js:1
|
|
185
|
+
fix name what it reads: `// @depends-on <glob>`, or `// @reads <glob>` for…
|
|
186
|
+
|
|
187
|
+
unresolved relative import · 1 import in 1 file
|
|
188
|
+
└ test/u.test.js:2 "./gone.js"
|
|
189
|
+
fix no file at that path: fix the import, or add an `edges` entry if a build…
|
|
190
|
+
|
|
191
|
+
✓ Check passes · checked in 152 ms · --all for every file
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The sections cover:
|
|
142
195
|
|
|
143
|
-
- every unknown
|
|
196
|
+
- every unknown a test reaches, by cause,
|
|
197
|
+
with where and how to fix each;
|
|
144
198
|
- unknowns no test depends on, apart and not counted toward
|
|
145
199
|
`--max-unknown`: plans only run tests, so these widen nothing;
|
|
146
200
|
- files under a suite's `root` that no test reaches,
|
|
@@ -161,6 +215,8 @@ whole suite: the orphan rule.
|
|
|
161
215
|
|
|
162
216
|
Options:
|
|
163
217
|
|
|
218
|
+
- `--all` lists every place, and each fix whole.
|
|
219
|
+
`--json` has the rest, such as the tests each unknown runs.
|
|
164
220
|
- `--max-unknown <n>` fails when more than `n` unknowns reach a test.
|
|
165
221
|
- `--base <ref>` sets the base.
|
|
166
222
|
Default: `HEAD`.
|
|
@@ -208,6 +264,9 @@ These work with every command, before or after it:
|
|
|
208
264
|
- `--cwd <dir>`: the repository.
|
|
209
265
|
Default: the current directory.
|
|
210
266
|
- `--no-cache`: read every file, and skip the extraction cache.
|
|
267
|
+
- `--color` or `--no-color`: force color on or off.
|
|
268
|
+
Default: on when stdout is a terminal and no coding agent runs it;
|
|
269
|
+
`NO_COLOR` and `FORCE_COLOR` are read too.
|
|
211
270
|
- `--help` or `-h`: print usage.
|
|
212
271
|
- `--version` or `-v`: print the version.
|
|
213
272
|
|
|
@@ -217,8 +276,8 @@ A path can be repo-relative, relative to the current directory
|
|
|
217
276
|
(`./tests/a.test.ts`), or absolute.
|
|
218
277
|
|
|
219
278
|
An unknown command, option, suite, test, or `--format` is an error.
|
|
220
|
-
The message names what's close, when something
|
|
221
|
-
`unknown option --jsno (did you mean --json?)`.
|
|
279
|
+
The message names what's close, when something
|
|
280
|
+
is: `unknown option --jsno (did you mean --json?)`.
|
|
222
281
|
|
|
223
282
|
## Exit status
|
|
224
283
|
|
|
@@ -267,8 +326,8 @@ Each command has a JSON form that answers one question:
|
|
|
267
326
|
- `bivium plan --json` gives the selection per suite and why:
|
|
268
327
|
`causes` (typed) for each full run, `totals` for the scale,
|
|
269
328
|
and `changed`, `base`, and `mergeBase`.
|
|
270
|
-
- `bivium why <test> --format json` gives the chain from a change to
|
|
271
|
-
test.
|
|
329
|
+
- `bivium why <test> --format json` gives the chain from a change to
|
|
330
|
+
a test.
|
|
272
331
|
Each link has a `kind`, such as `import` or `goto`, and an `at`,
|
|
273
332
|
as `file:line`.
|
|
274
333
|
- `bivium check --json` gives `ok` and a `summary` of what widens plans,
|
|
@@ -357,3 +416,5 @@ tests/e2e.test.ts runs on every change
|
|
|
357
416
|
- [CI](ci.md): planning in GitHub Actions
|
|
358
417
|
- [Tuning a plan](tuning.md): fixing what `check` reports
|
|
359
418
|
- [API](api.md): the same plan from code
|
|
419
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
420
|
+
other tools
|
package/docs/config.md
CHANGED
|
@@ -93,8 +93,8 @@ The rest become edges where their files exist.
|
|
|
93
93
|
`pages` lists the pages only a `goto()` opens.
|
|
94
94
|
A listed page that no test opens is wired to no test,
|
|
95
95
|
and so are the files only such pages load.
|
|
96
|
-
A change to one selects nothing, and doesn't run the suite by the
|
|
97
|
-
rule.
|
|
96
|
+
A change to one selects nothing, and doesn't run the suite by the
|
|
97
|
+
orphan rule.
|
|
98
98
|
|
|
99
99
|
### `setup` and `wiring`
|
|
100
100
|
|
|
@@ -201,8 +201,8 @@ or vouch that they read nothing in the repository.
|
|
|
201
201
|
|
|
202
202
|
### `edges`
|
|
203
203
|
|
|
204
|
-
`edges` maps a generated file to the inputs a build makes it
|
|
205
|
-
`{ "dist/*.css": "styles/**" }`.
|
|
204
|
+
`edges` maps a generated file to the inputs a build makes it
|
|
205
|
+
from: `{ "dist/*.css": "styles/**" }`.
|
|
206
206
|
The generated file depends on its inputs transitively,
|
|
207
207
|
as with `@depends-on`.
|
|
208
208
|
|
|
@@ -212,13 +212,14 @@ An import that resolves under the key, by extension or as an index,
|
|
|
212
212
|
then lands on that file instead of being unresolved.
|
|
213
213
|
|
|
214
214
|
In a value, `$1`, `$2`… stand for what the key's wildcards matched,
|
|
215
|
-
counted from the
|
|
216
|
-
`{ "examples/*/package.json": "examples/$1/**" }`.
|
|
215
|
+
counted from the
|
|
216
|
+
left: `{ "examples/*/package.json": "examples/$1/**" }`.
|
|
217
217
|
|
|
218
218
|
### `reads`
|
|
219
219
|
|
|
220
|
-
`reads` maps a file to the files it reads as text,
|
|
221
|
-
`
|
|
220
|
+
`reads` maps a file to the files it reads as text,
|
|
221
|
+
as `@reads`
|
|
222
|
+
does: `{ "tests/*.test.ts": "tests/__snapshots__/$1.test.ts.snap" }`.
|
|
222
223
|
Only a direct change to a read file counts:
|
|
223
224
|
its imports and unknowns don't spread to the reader.
|
|
224
225
|
Values take `$1`… as in `edges`.
|
|
@@ -262,8 +263,8 @@ bivium itself is always inert.
|
|
|
262
263
|
or a plugin a config names by string.
|
|
263
264
|
Setting it, even to `[]`, says every other package without a `bin` is
|
|
264
265
|
loaded only by imports.
|
|
265
|
-
A lockfile change that reaches one no test imports
|
|
266
|
-
importers.
|
|
266
|
+
A lockfile change that reaches one no test imports
|
|
267
|
+
then selects only its importers.
|
|
267
268
|
A package with a `bin` always counts as one a test may run.
|
|
268
269
|
|
|
269
270
|
## What `check` allows
|
|
@@ -342,3 +343,5 @@ whatever loads an entry names it itself.
|
|
|
342
343
|
- [Recipes](recipes.md): Vitest, Jest, Playwright, pnpm workspaces,
|
|
343
344
|
generated code
|
|
344
345
|
- [How it works](how-it-works.md): what the graph follows
|
|
346
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
347
|
+
other tools
|
package/docs/how-it-works.md
CHANGED
|
@@ -93,9 +93,10 @@ so bivium reads it:
|
|
|
93
93
|
|
|
94
94
|
```console
|
|
95
95
|
$ bunx bivium plan
|
|
96
|
+
4 of 12 tests run for 1 changed file
|
|
97
|
+
since origin/main (merge base 1c0ffee) · config bivium.config.ts
|
|
96
98
|
bun.lock: @biomejs/biome 2.5.14 → 2.6.3, inert
|
|
97
99
|
bun.lock: svelte 5.57.1 → 5.57.2
|
|
98
|
-
unit tests: 4 of 12 files
|
|
99
100
|
…
|
|
100
101
|
```
|
|
101
102
|
|
|
@@ -118,8 +119,8 @@ A changed package can also be used in ways the graph can't see:
|
|
|
118
119
|
a CLI a test spawns, a runner, a type package.
|
|
119
120
|
So when a change reaches a package that a `package.json` declares
|
|
120
121
|
or some file imports, and no test imports it, everything runs.
|
|
121
|
-
The plan names the
|
|
122
|
-
(`bun.lock: playwright 1.63.0 → 1.64.0, and no test imports it`).
|
|
122
|
+
The plan names the
|
|
123
|
+
reason (`bun.lock: playwright 1.63.0 → 1.64.0, and no test imports it`).
|
|
123
124
|
A package in `inert` is the exception:
|
|
124
125
|
`inert` lists packages no test uses except by importing them,
|
|
125
126
|
such as linters and formatters.
|
|
@@ -145,6 +146,20 @@ Other lockfiles (`yarn.lock`, `bun.lockb`, `npm-shrinkwrap.json`) are
|
|
|
145
146
|
files like any other.
|
|
146
147
|
Outside the roots, a change to one runs everything.
|
|
147
148
|
|
|
149
|
+
## Not supported
|
|
150
|
+
|
|
151
|
+
What bivium leaves to other tools, and what to use instead:
|
|
152
|
+
|
|
153
|
+
| bivium doesn't | Instead |
|
|
154
|
+
| --- | --- |
|
|
155
|
+
| run your tests | `bivium run` hands the selection to your runner's command |
|
|
156
|
+
| read your runner's config | name its setup files in a suite's `setup` |
|
|
157
|
+
| scan CSS | `edges` from a stylesheet to its sources, or a [narrower](api.md#narrowers) |
|
|
158
|
+
| parse `yarn.lock` or `bun.lockb` | they're files like any other, so a change to one doesn't seed packages |
|
|
159
|
+
| select below the file | a test file is selected whole, every case in it |
|
|
160
|
+
| follow an import it can't read | the file counts as depending on every change, so its tests always run |
|
|
161
|
+
| build or cache outputs | Nx, Turborepo, or Bazel, which skip whole projects |
|
|
162
|
+
|
|
148
163
|
## Compared with
|
|
149
164
|
|
|
150
165
|
Tools that select or skip tests differ in what they select
|
package/docs/recipes.md
CHANGED
|
@@ -46,8 +46,8 @@ which the imports alone don't show:
|
|
|
46
46
|
`src/a/Button.test.tsx` reads
|
|
47
47
|
`src/a/__snapshots__/Button.test.tsx.snap`.
|
|
48
48
|
|
|
49
|
-
For Jest, set `run` to your Jest command
|
|
50
|
-
`setupFiles`.
|
|
49
|
+
For Jest, set `run` to your Jest command
|
|
50
|
+
and `setup` to Jest's `setupFiles`.
|
|
51
51
|
bivium reads tsconfig `paths` itself, as `vite-tsconfig-paths` does,
|
|
52
52
|
so they need no `alias`.
|
|
53
53
|
An extensionless `vi.mock("@/x")` resolves as an import does.
|
|
@@ -75,8 +75,8 @@ Set `roots` to the packages and apps whose changes the suites need to
|
|
|
75
75
|
see; a changed file outside them that isn't ignored runs everything.
|
|
76
76
|
|
|
77
77
|
Workspace packages resolve through their `package.json` `exports`.
|
|
78
|
-
A `.js` specifier into one (`@acme/ui/Button.js`) reaches its
|
|
79
|
-
source.
|
|
78
|
+
A `.js` specifier into one (`@acme/ui/Button.js`) reaches its
|
|
79
|
+
`.ts` source.
|
|
80
80
|
A `pnpm-lock.yaml` change selects through the packages it changed
|
|
81
81
|
(see [Lockfiles](how-it-works.md#lockfiles)).
|
|
82
82
|
|
|
@@ -133,3 +133,5 @@ and the generator's config, and not every change.
|
|
|
133
133
|
|
|
134
134
|
- [Config](config.md): every key
|
|
135
135
|
- [Tuning a plan](tuning.md): when a plan still runs too much
|
|
136
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
137
|
+
other tools
|
package/docs/tuning.md
CHANGED
|
@@ -10,26 +10,30 @@ or `vitest.config.ts` runs the whole suite:
|
|
|
10
10
|
|
|
11
11
|
```console
|
|
12
12
|
$ bunx bivium plan
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
all 4 tests run: README.md: no unit test imports it
|
|
14
|
+
since origin/main (merge base 9236bd3) · config bivium.config.ts
|
|
15
|
+
full run: vitest.config.ts: no unit test imports it
|
|
16
|
+
|
|
17
|
+
✓ Planned 4 tests · 256 ms
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
`bivium check` lists those files before they change, each with a fix:
|
|
19
21
|
|
|
20
22
|
```console
|
|
21
|
-
$ bunx bivium check
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
$ bunx bivium check --all
|
|
24
|
+
bivium can follow every file a test reaches
|
|
25
|
+
2 files no test reaches
|
|
26
|
+
|
|
27
|
+
no test reaches: a change runs the whole suite · 2 files in suite unit
|
|
28
|
+
├ README.md
|
|
29
|
+
fix if a test reads or runs it, say so with `reads` or `@depends-on` in that
|
|
30
|
+
test or what loads it; if none can observe it, list it in the suite's
|
|
31
|
+
`nonInputs`, or delete it if it's dead
|
|
32
|
+
└ vitest.config.ts
|
|
33
|
+
fix if the runner loads it, name it in the suite's `wiring` (or `setup`, if
|
|
34
|
+
it runs before every test), which makes the full run deliberate
|
|
35
|
+
|
|
36
|
+
✓ Check passes · checked in 254 ms
|
|
33
37
|
```
|
|
34
38
|
|
|
35
39
|
## A change no test reaches
|
|
@@ -130,14 +134,14 @@ takes `// @lists <path>`.
|
|
|
130
134
|
## Dead globs
|
|
131
135
|
|
|
132
136
|
A dead glob is a pattern that looks fine and never selects its file,
|
|
133
|
-
such as a typo'd `@depends-on`, or one that points only at files
|
|
134
|
-
skips.
|
|
137
|
+
such as a typo'd `@depends-on`, or one that points only at files
|
|
138
|
+
bivium skips.
|
|
135
139
|
`check` looks for them.
|
|
136
140
|
It tests these patterns against every file git lists,
|
|
137
141
|
tracked or untracked, inside the roots or not:
|
|
138
142
|
|
|
139
|
-
- every `@depends-on`, `@reads`, `@lists`
|
|
140
|
-
pattern;
|
|
143
|
+
- every `@depends-on`, `@reads`, `@lists`
|
|
144
|
+
and `import.meta.glob` pattern;
|
|
141
145
|
- every `edges` and `reads` value;
|
|
142
146
|
- every suite's `setup`.
|
|
143
147
|
|
|
@@ -151,16 +155,16 @@ It reports a pattern with one of these problems:
|
|
|
151
155
|
|
|
152
156
|
```console
|
|
153
157
|
$ bunx bivium check
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
tests/a.test.ts
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
bivium can follow every file a test reaches
|
|
159
|
+
2 dead globs
|
|
160
|
+
|
|
161
|
+
dead glob: a change to what it matches selects nothing · 2 globs in 1 file
|
|
162
|
+
├ tests/a.test.ts:1 depends-on docs/**: matches only ignored files (1…
|
|
163
|
+
fix point it at files the selector reads, or allowlist it in `deadGlobs`…
|
|
164
|
+
└ tests/a.test.ts:2 reads src/tokns.css: matches nothing
|
|
165
|
+
fix fix the path
|
|
166
|
+
|
|
167
|
+
✗ 2 dead globs · checked in 241 ms · --all for every file
|
|
164
168
|
```
|
|
165
169
|
|
|
166
170
|
A config value with captures (`$1`) is dead only when it matches nothing
|
|
@@ -190,3 +194,5 @@ deadGlobs: [
|
|
|
190
194
|
- [Config](config.md): every key named here
|
|
191
195
|
- [CLI](cli.md): `check`, `why` and `graph`
|
|
192
196
|
- [Recipes](recipes.md): settings for common runners
|
|
197
|
+
- [Not supported](how-it-works.md#not-supported): what bivium leaves to
|
|
198
|
+
other tools
|
package/index.d.ts
CHANGED
|
@@ -27,8 +27,8 @@ export interface Config<Suite extends string = string> {
|
|
|
27
27
|
narrowers?: readonly Narrower<NoInfer<Suite>>[];
|
|
28
28
|
/**
|
|
29
29
|
* Paths (directories or files, not globs) the graph reads. A changed file
|
|
30
|
-
* outside them that isn't ignored runs everything. Default: the
|
|
31
|
-
* repository.
|
|
30
|
+
* outside them that isn't ignored runs everything. Default: the
|
|
31
|
+
* whole repository.
|
|
32
32
|
*/
|
|
33
33
|
roots?: string | readonly string[];
|
|
34
34
|
/**
|
|
@@ -81,8 +81,8 @@ export interface Config<Suite extends string = string> {
|
|
|
81
81
|
barrels?: Globs;
|
|
82
82
|
/**
|
|
83
83
|
* Packages to treat as external though no `package.json` declares them:
|
|
84
|
-
* ones a dependency installs. Any other undeclared bare specifier
|
|
85
|
-
* unknown.
|
|
84
|
+
* ones a dependency installs. Any other undeclared bare specifier
|
|
85
|
+
* is unknown.
|
|
86
86
|
*/
|
|
87
87
|
external?: readonly string[];
|
|
88
88
|
/**
|
|
@@ -141,7 +141,6 @@ export interface Config<Suite extends string = string> {
|
|
|
141
141
|
}
|
|
142
142
|
/** A test suite: its files, how to run them, and how they're wired. */
|
|
143
143
|
export interface SuiteConfig {
|
|
144
|
-
/** The suite's test files. */
|
|
145
144
|
tests: Globs;
|
|
146
145
|
/**
|
|
147
146
|
* The command `bivium run` runs. `{files}` is replaced by the selected
|
|
@@ -168,8 +167,8 @@ export interface SuiteConfig {
|
|
|
168
167
|
*/
|
|
169
168
|
pages?: Globs;
|
|
170
169
|
/**
|
|
171
|
-
* Files whose change runs the whole suite: a second harness, a
|
|
172
|
-
* config.
|
|
170
|
+
* Files whose change runs the whole suite: a second harness, a
|
|
171
|
+
* runner config.
|
|
173
172
|
*/
|
|
174
173
|
wiring?: Globs;
|
|
175
174
|
/**
|
|
@@ -194,12 +193,11 @@ export interface SuiteConfig {
|
|
|
194
193
|
*/
|
|
195
194
|
types?: boolean;
|
|
196
195
|
/**
|
|
197
|
-
* The step output `bivium plan --github` writes the selection
|
|
198
|
-
* `<name>-tests`.
|
|
196
|
+
* The step output `bivium plan --github` writes the selection
|
|
197
|
+
* to. Default: `<name>-tests`.
|
|
199
198
|
*/
|
|
200
199
|
output?: string;
|
|
201
200
|
}
|
|
202
|
-
/** One glob, or several. */
|
|
203
201
|
export type Globs = string | readonly string[];
|
|
204
202
|
/**
|
|
205
203
|
* Replaces the coarse seeds of some changed files with finer ones from a
|
|
@@ -256,7 +254,6 @@ export interface GraphView<Suite extends string = string> {
|
|
|
256
254
|
* them, not counting files whose dependencies are unknown.
|
|
257
255
|
*/
|
|
258
256
|
dependents(nodes: Iterable<string>): ReadonlySet<string>;
|
|
259
|
-
/** A suite's test files. */
|
|
260
257
|
tests(suite: Suite): readonly string[];
|
|
261
258
|
}
|
|
262
259
|
/**
|
|
@@ -285,11 +282,10 @@ export interface PlanResult<Suite extends string = string> {
|
|
|
285
282
|
* 5.2.0`.
|
|
286
283
|
*/
|
|
287
284
|
packages: string[];
|
|
288
|
-
/** The base ref. */
|
|
289
285
|
base: string;
|
|
290
286
|
/**
|
|
291
|
-
* The merge base of `base` and `HEAD`, which the working tree is
|
|
292
|
-
* with.
|
|
287
|
+
* The merge base of `base` and `HEAD`, which the working tree is
|
|
288
|
+
* compared with.
|
|
293
289
|
*/
|
|
294
290
|
mergeBase: string;
|
|
295
291
|
/** The files changed since the merge base, untracked ones included. */
|
|
@@ -334,8 +330,8 @@ export interface FullRunCause<Suite extends string = string> {
|
|
|
334
330
|
/** Types a config. Returns it unchanged. */
|
|
335
331
|
export declare function defineConfig<Suite extends string>(config: Config<Suite>): Config<Suite>;
|
|
336
332
|
/**
|
|
337
|
-
* An error bivium names: its `code` says which failure, its `kind` what
|
|
338
|
-
* do.
|
|
333
|
+
* An error bivium names: its `code` says which failure, its `kind` what
|
|
334
|
+
* to do.
|
|
339
335
|
*/
|
|
340
336
|
export declare class BiviumError extends Error {
|
|
341
337
|
readonly code: BiviumErrorCode;
|
|
@@ -348,17 +344,9 @@ export declare class BiviumError extends Error {
|
|
|
348
344
|
*/
|
|
349
345
|
export type BiviumErrorCode =
|
|
350
346
|
/** No command, or `why` without a test. */
|
|
351
|
-
"BV_MISSING_ARGUMENT"
|
|
352
|
-
/** A command bivium doesn't have. */
|
|
353
|
-
| "BV_UNKNOWN_COMMAND"
|
|
354
|
-
/** An option the command doesn't take. */
|
|
355
|
-
| "BV_UNKNOWN_OPTION"
|
|
347
|
+
"BV_MISSING_ARGUMENT" | "BV_UNKNOWN_COMMAND" | "BV_UNKNOWN_OPTION"
|
|
356
348
|
/** An option's value is missing or of the wrong form. */
|
|
357
|
-
| "BV_BAD_OPTION_VALUE"
|
|
358
|
-
/** More arguments than the command takes. */
|
|
359
|
-
| "BV_UNEXPECTED_ARGUMENT"
|
|
360
|
-
/** A suite the config doesn't define. */
|
|
361
|
-
| "BV_UNKNOWN_SUITE"
|
|
349
|
+
| "BV_BAD_OPTION_VALUE" | "BV_UNEXPECTED_ARGUMENT" | "BV_UNKNOWN_SUITE"
|
|
362
350
|
/** A path that is no suite's test. */
|
|
363
351
|
| "BV_UNKNOWN_TEST"
|
|
364
352
|
/** A path that names no file of the graph. */
|