@ultimat3/cli 31.41.0 → 31.42.1
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/package.json +29 -29
- package/src/output.ts +11 -0
- package/src/verify-live.ts +23 -7
- package/src/verify-merge.ts +7 -1
- package/src/verify-part-step.ts +7 -2
- package/src/verify-run.ts +4 -1
- package/src/verify-skip-ceiling.ts +7 -1
- package/src/verify-step.ts +3 -1
- package/wiki/Testing.md +6 -0
- package/wiki/Upgrading.md +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/cli",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.42.1",
|
|
4
4
|
"description": "The `x` binary: new, dev, build, verify, generate, db, mcp, doctor, deploy",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -53,34 +53,34 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/core": "^8.0.10",
|
|
56
|
-
"@ultimat3/action": "31.
|
|
57
|
-
"@ultimat3/admin": "31.
|
|
58
|
-
"@ultimat3/ai": "31.
|
|
59
|
-
"@ultimat3/auth": "31.
|
|
60
|
-
"@ultimat3/cache": "31.
|
|
61
|
-
"@ultimat3/core": "31.
|
|
62
|
-
"@ultimat3/db": "31.
|
|
63
|
-
"@ultimat3/entity": "31.
|
|
64
|
-
"@ultimat3/flags": "31.
|
|
65
|
-
"@ultimat3/http": "31.
|
|
66
|
-
"@ultimat3/i18n": "31.
|
|
67
|
-
"@ultimat3/jobs": "31.
|
|
68
|
-
"@ultimat3/mail": "31.
|
|
69
|
-
"@ultimat3/manifest": "31.
|
|
70
|
-
"@ultimat3/mcp": "31.
|
|
71
|
-
"@ultimat3/money": "31.
|
|
72
|
-
"@ultimat3/notify": "31.
|
|
73
|
-
"@ultimat3/policy": "31.
|
|
74
|
-
"@ultimat3/pwa": "31.
|
|
75
|
-
"@ultimat3/query": "31.
|
|
76
|
-
"@ultimat3/realtime": "31.
|
|
77
|
-
"@ultimat3/render": "31.
|
|
78
|
-
"@ultimat3/schema": "31.
|
|
79
|
-
"@ultimat3/scraping": "31.
|
|
80
|
-
"@ultimat3/seo": "31.
|
|
81
|
-
"@ultimat3/storage": "31.
|
|
82
|
-
"@ultimat3/testing": "31.
|
|
83
|
-
"@ultimat3/time": "31.
|
|
56
|
+
"@ultimat3/action": "31.42.1",
|
|
57
|
+
"@ultimat3/admin": "31.42.1",
|
|
58
|
+
"@ultimat3/ai": "31.42.1",
|
|
59
|
+
"@ultimat3/auth": "31.42.1",
|
|
60
|
+
"@ultimat3/cache": "31.42.1",
|
|
61
|
+
"@ultimat3/core": "31.42.1",
|
|
62
|
+
"@ultimat3/db": "31.42.1",
|
|
63
|
+
"@ultimat3/entity": "31.42.1",
|
|
64
|
+
"@ultimat3/flags": "31.42.1",
|
|
65
|
+
"@ultimat3/http": "31.42.1",
|
|
66
|
+
"@ultimat3/i18n": "31.42.1",
|
|
67
|
+
"@ultimat3/jobs": "31.42.1",
|
|
68
|
+
"@ultimat3/mail": "31.42.1",
|
|
69
|
+
"@ultimat3/manifest": "31.42.1",
|
|
70
|
+
"@ultimat3/mcp": "31.42.1",
|
|
71
|
+
"@ultimat3/money": "31.42.1",
|
|
72
|
+
"@ultimat3/notify": "31.42.1",
|
|
73
|
+
"@ultimat3/policy": "31.42.1",
|
|
74
|
+
"@ultimat3/pwa": "31.42.1",
|
|
75
|
+
"@ultimat3/query": "31.42.1",
|
|
76
|
+
"@ultimat3/realtime": "31.42.1",
|
|
77
|
+
"@ultimat3/render": "31.42.1",
|
|
78
|
+
"@ultimat3/schema": "31.42.1",
|
|
79
|
+
"@ultimat3/scraping": "31.42.1",
|
|
80
|
+
"@ultimat3/seo": "31.42.1",
|
|
81
|
+
"@ultimat3/storage": "31.42.1",
|
|
82
|
+
"@ultimat3/testing": "31.42.1",
|
|
83
|
+
"@ultimat3/time": "31.42.1",
|
|
84
84
|
"babel-preset-solid": "^1.9.16"
|
|
85
85
|
}
|
|
86
86
|
}
|
package/src/output.ts
CHANGED
|
@@ -56,6 +56,9 @@ export interface SlowFile {
|
|
|
56
56
|
/** How many of a step's slowest files the human line names; `--json` carries all it has. */
|
|
57
57
|
export const SLOWEST_SHOWN = 3;
|
|
58
58
|
|
|
59
|
+
/** Whether a `live` step's test services answered (`StepResult.services`). */
|
|
60
|
+
export type TestServicesState = 'reached' | 'unavailable';
|
|
61
|
+
|
|
59
62
|
export interface StepResult {
|
|
60
63
|
readonly name: string;
|
|
61
64
|
readonly ok: boolean;
|
|
@@ -93,6 +96,12 @@ export interface StepResult {
|
|
|
93
96
|
* looking at (#434).
|
|
94
97
|
*/
|
|
95
98
|
readonly tests?: TestCounts;
|
|
99
|
+
/**
|
|
100
|
+
* The test services a `live` step needed, as the gate found them: `reached` (already up, found or
|
|
101
|
+
* started) or `unavailable` (the suites skipped). Absent for every other step. Carried into a
|
|
102
|
+
* part so `x verify merge` judges a skip as the run that made it saw its database.
|
|
103
|
+
*/
|
|
104
|
+
readonly services?: TestServicesState;
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
// `@ultimat3/schema`'s one declaration, re-exported for this package's callers — never restated.
|
|
@@ -364,6 +373,8 @@ export function renderJson(
|
|
|
364
373
|
// The counts the human line's `why()` renders, as numbers: a `--json` reader deciding whether
|
|
365
374
|
// a skipped lane is missing a suite or missing a prerequisite needs the same fact CI's log has.
|
|
366
375
|
...(step.tests === undefined ? {} : { tests: step.tests }),
|
|
376
|
+
// What a `live` step's database was: `x verify merge` reads it from the part to judge skips.
|
|
377
|
+
...(step.services === undefined ? {} : { services: step.services }),
|
|
367
378
|
// A FAILED step carries its captured stdout, exactly as the human renderer prints it. CI runs
|
|
368
379
|
// `--json`, and without this the log said only "one or more unit tests failed" with a generic
|
|
369
380
|
// fix line — the failing test's name and its assertion diff existed and were thrown away, so
|
package/src/verify-live.ts
CHANGED
|
@@ -7,7 +7,12 @@ import type { Runner } from './exec';
|
|
|
7
7
|
import { msg } from './messages';
|
|
8
8
|
import { floorRequires, readVerifyFloor } from './verify-floor';
|
|
9
9
|
import type { LoginProbe, Probe } from './verify-services';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
ensureTestServices,
|
|
12
|
+
SERVICES_DOWN,
|
|
13
|
+
SERVICES_UP,
|
|
14
|
+
TEST_DATABASE_KEY,
|
|
15
|
+
} from './verify-services';
|
|
11
16
|
import type { StepOutcome, VerifyContext, VerifyStep } from './verify-step';
|
|
12
17
|
|
|
13
18
|
/** Whether this run asked for `live` by name or the committed floor holds it to running. */
|
|
@@ -24,6 +29,9 @@ function withEnv(ctx: VerifyContext, env: Readonly<Record<string, string>>): Ver
|
|
|
24
29
|
return { ...ctx, runner, env: { ...(ctx.env ?? Bun.env), ...env } };
|
|
25
30
|
}
|
|
26
31
|
|
|
32
|
+
/** The database answered, so a `live` test that skipped did so with one in reach. */
|
|
33
|
+
const reached = (outcome: StepOutcome): StepOutcome => ({ ...outcome, services: 'reached' });
|
|
34
|
+
|
|
27
35
|
const withWarning = (outcome: StepOutcome, warning: string): StepOutcome => ({
|
|
28
36
|
...outcome,
|
|
29
37
|
warnings: [...(outcome.warnings ?? []), warning],
|
|
@@ -47,15 +55,23 @@ export function withTestServices(step: VerifyStep, probe?: Probe, login?: LoginP
|
|
|
47
55
|
...(probe === undefined ? {} : { probe }),
|
|
48
56
|
...(login === undefined ? {} : { login }),
|
|
49
57
|
});
|
|
50
|
-
if (verdict.kind === 'ambient')
|
|
58
|
+
if (verdict.kind === 'ambient') {
|
|
59
|
+
// The caller's own URL is a database in reach; no stack and no URL is none.
|
|
60
|
+
const own = (ctx.env ?? Bun.env)[TEST_DATABASE_KEY];
|
|
61
|
+
const outcome = await step.run(ctx);
|
|
62
|
+
return own === undefined || own === '' ? outcome : reached(outcome);
|
|
63
|
+
}
|
|
51
64
|
if (verdict.kind === 'unavailable') {
|
|
52
65
|
const { code, cause, fix } = verdict.finding;
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
66
|
+
return {
|
|
67
|
+
...withWarning(
|
|
68
|
+
await step.run(ctx),
|
|
69
|
+
msg('cli.verify.services.unavailable', { code, cause, fix }),
|
|
70
|
+
),
|
|
71
|
+
services: 'unavailable',
|
|
72
|
+
};
|
|
57
73
|
}
|
|
58
|
-
const outcome = await step.run(withEnv(ctx, verdict.env));
|
|
74
|
+
const outcome = reached(await step.run(withEnv(ctx, verdict.env)));
|
|
59
75
|
// Whatever this run's `up` started, by compose's answer — a reachable Postgres beside a
|
|
60
76
|
// freshly started Redis still leaves containers running; a stack already up says nothing.
|
|
61
77
|
if (verdict.startedServices.length === 0) return outcome;
|
package/src/verify-merge.ts
CHANGED
|
@@ -344,7 +344,13 @@ function mergeStep(
|
|
|
344
344
|
// The ceiling on the SUM, always: a merge is the CI verdict, and one shard's skips say nothing.
|
|
345
345
|
const skips =
|
|
346
346
|
sharded.length > 0
|
|
347
|
-
? judgeSkips(name, tests, floor?.skipCeiling
|
|
347
|
+
? judgeSkips(name, tests, floor?.skipCeiling, {
|
|
348
|
+
// Every shard had its database: one that had none skipped by design, as a whole run would.
|
|
349
|
+
strictWithDatabase:
|
|
350
|
+
floor?.strict === true &&
|
|
351
|
+
required &&
|
|
352
|
+
sharded.every((entry) => entry.step.services === 'reached'),
|
|
353
|
+
})
|
|
348
354
|
: { findings: [], warnings: [] };
|
|
349
355
|
const riding = rider?.findings ?? [];
|
|
350
356
|
const findings = [
|
package/src/verify-part-step.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// cast past `name` and `ok`: `findings: [null]` merged green, and a step with no `durationMs`
|
|
3
3
|
// reached `Math.max` as `undefined` — a part a CI job hand-edited, or truncated, was believed.
|
|
4
4
|
|
|
5
|
-
import type { Finding } from './output';
|
|
5
|
+
import type { Finding, TestServicesState } from './output';
|
|
6
6
|
import type { TestCounts } from './test-counts';
|
|
7
7
|
|
|
8
8
|
export interface PartStep {
|
|
@@ -15,6 +15,7 @@ export interface PartStep {
|
|
|
15
15
|
readonly tests?: TestCounts;
|
|
16
16
|
readonly output?: string;
|
|
17
17
|
readonly warnings?: readonly string[];
|
|
18
|
+
readonly services?: TestServicesState;
|
|
18
19
|
readonly shard?: {
|
|
19
20
|
readonly index: number;
|
|
20
21
|
readonly total: number;
|
|
@@ -67,7 +68,7 @@ export function readPartStep(raw: unknown): PartStep | string {
|
|
|
67
68
|
if (!Array.isArray(findings) || !findings.every(isFinding)) {
|
|
68
69
|
return `holds step "${name}" whose findings are not each a code, a cause and a fix`;
|
|
69
70
|
}
|
|
70
|
-
const { tests, shard, output, workers, skipped, warnings } = raw;
|
|
71
|
+
const { tests, shard, output, workers, skipped, warnings, services } = raw;
|
|
71
72
|
if (tests !== undefined && !isTests(tests)) {
|
|
72
73
|
return `holds step "${name}" whose tests are not counts`;
|
|
73
74
|
}
|
|
@@ -83,6 +84,9 @@ export function readPartStep(raw: unknown): PartStep | string {
|
|
|
83
84
|
if (workers !== undefined && !isCount(workers)) {
|
|
84
85
|
return `holds step "${name}" whose workers is not a count`;
|
|
85
86
|
}
|
|
87
|
+
if (services !== undefined && services !== 'reached' && services !== 'unavailable') {
|
|
88
|
+
return `holds step "${name}" whose services is neither reached nor unavailable`;
|
|
89
|
+
}
|
|
86
90
|
return {
|
|
87
91
|
name,
|
|
88
92
|
ok: raw['ok'],
|
|
@@ -94,5 +98,6 @@ export function readPartStep(raw: unknown): PartStep | string {
|
|
|
94
98
|
...(output === undefined ? {} : { output }),
|
|
95
99
|
...(warnings === undefined ? {} : { warnings }),
|
|
96
100
|
...(shard === undefined ? {} : { shard }),
|
|
101
|
+
...(services === undefined ? {} : { services }),
|
|
97
102
|
};
|
|
98
103
|
}
|
package/src/verify-run.ts
CHANGED
|
@@ -340,7 +340,9 @@ async function runStep(
|
|
|
340
340
|
// share is judged by `x verify merge`, on the sum). A laptop without services stays a dev loop.
|
|
341
341
|
const skips =
|
|
342
342
|
outcome.shard === undefined && inCi(ctx.env ?? Bun.env)
|
|
343
|
-
? judgeSkips(step.name, tests, floor?.skipCeiling
|
|
343
|
+
? judgeSkips(step.name, tests, floor?.skipCeiling, {
|
|
344
|
+
strictWithDatabase: floor?.strict === true && required && outcome.services === 'reached',
|
|
345
|
+
})
|
|
344
346
|
: { findings: [], warnings: [] };
|
|
345
347
|
const warnings = [...(outcome.warnings ?? []), ...skips.warnings, ...staleWhy];
|
|
346
348
|
return {
|
|
@@ -362,6 +364,7 @@ async function runStep(
|
|
|
362
364
|
: { slowest: outcome.slowest }),
|
|
363
365
|
...(outcome.shard === undefined ? {} : { shard: outcome.shard }),
|
|
364
366
|
...(tests === undefined ? {} : { tests }),
|
|
367
|
+
...(outcome.services === undefined ? {} : { services: outcome.services }),
|
|
365
368
|
},
|
|
366
369
|
...(outcome.coverage === undefined ? {} : { coverage: outcome.coverage }),
|
|
367
370
|
...(outcome.measured === undefined ? {} : { measured: outcome.measured }),
|
|
@@ -58,9 +58,15 @@ export function judgeSkips(
|
|
|
58
58
|
step: string,
|
|
59
59
|
tests: TestCounts | undefined,
|
|
60
60
|
ceiling: SkipCeiling | undefined,
|
|
61
|
+
floor: { readonly strictWithDatabase?: boolean } = {},
|
|
61
62
|
): { readonly findings: readonly Finding[]; readonly warnings: readonly string[] } {
|
|
62
63
|
if (tests === undefined || tests.ran === 0) return { findings: [], warnings: [] };
|
|
63
|
-
|
|
64
|
+
// A `live` test that skipped with the database IN REACH is a test that proved nothing, and under
|
|
65
|
+
// a strict floor that requires the step an unwritten ceiling means 0. A run with no database is
|
|
66
|
+
// already `X_TEST_SERVICES_UNAVAILABLE`'s warning — a runner without one skips by design.
|
|
67
|
+
const allowed =
|
|
68
|
+
ceilingOf(ceiling, step) ??
|
|
69
|
+
(step === 'live' && floor.strictWithDatabase === true ? 0 : undefined);
|
|
64
70
|
if (allowed === undefined) {
|
|
65
71
|
return tests.skipped === 0
|
|
66
72
|
? { findings: [], warnings: [] }
|
package/src/verify-step.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { AppTestScope } from './affected-tests';
|
|
|
7
7
|
import type { CoverageMap } from './coverage-lcov';
|
|
8
8
|
import type { ExecResult, Runner } from './exec';
|
|
9
9
|
import { execOutput } from './exec';
|
|
10
|
-
import type { Finding, ShardFacts, SlowFile, StepResult } from './output';
|
|
10
|
+
import type { Finding, ShardFacts, SlowFile, StepResult, TestServicesState } from './output';
|
|
11
11
|
import type { TestCounts } from './test-counts';
|
|
12
12
|
import type { StepTimeouts } from './verify-deadline';
|
|
13
13
|
import type { MachinePace } from './verify-pace';
|
|
@@ -198,6 +198,8 @@ export interface StepOutcome {
|
|
|
198
198
|
* a green step's `output`, so the numbers ride in `data.coverage` where a reader can find them.
|
|
199
199
|
*/
|
|
200
200
|
readonly measured?: CoverageNumbers;
|
|
201
|
+
/** Set by `withTestServices` (`verify-live.ts`): whether the step's database answered. */
|
|
202
|
+
readonly services?: TestServicesState;
|
|
201
203
|
}
|
|
202
204
|
|
|
203
205
|
/** The two percentages a judged run measured, and the source files they are over. */
|
package/wiki/Testing.md
CHANGED
|
@@ -676,6 +676,12 @@ describeIslandState(counterStates, 'idle', island, (mounted) => {
|
|
|
676
676
|
The props are the manifest's, so the picture `x shot --island` takes and the test are of one
|
|
677
677
|
component. `mountIsland` stays the call for props no state declares. `As of 2026-10`.
|
|
678
678
|
|
|
679
|
+
A builder you wrap keys its memo by `options.coverage`. Under `x verify`'s coverage run a mount
|
|
680
|
+
builds twice — covered to run, shipped for `code` — so `bundle ??= buildIslands(root, options)`
|
|
681
|
+
hands the covered chunk to every `code.length` ceiling: green under `bun test`, red in the gate.
|
|
682
|
+
`describeIslandState` already builds once per file; pass `buildIslands` itself. A memo that
|
|
683
|
+
returns the same bundle for both is refused: `X_TEST_ISLAND_BUILD_REUSED`. `As of 2026-11`.
|
|
684
|
+
|
|
679
685
|
A realtime island's page outlives its mount: the socket, the record store and the outbox sit on
|
|
680
686
|
`globalThis`, shared by every bundle. Between files (or cases that need a fresh page) call
|
|
681
687
|
`resetPageRealtime()` from `@ultimat3/realtime` in `afterAll` — it closes the socket the CHUNK's copy
|
package/wiki/Upgrading.md
CHANGED
|
@@ -302,6 +302,7 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
302
302
|
| `overrides` an app carries for `seroval`, `seroval-plugins` or `source-map-js` are no longer needed from **31.28.0**: `@ultimat3/ui`'s `solid-js` peer is `^1.9.18`, which requires the patched `seroval`; `source-map-js` and `immutable` arrive through `sass` and need a refreshed lockfile. `x doctor` warns below each floor (`X_ADVISORY_FLOOR_UNMET`) | drop those `overrides`, then `x upgrade --json` (its `solid-floor` codemod raises `solid-js`) and `bun update source-map-js immutable` |
|
|
303
303
|
| two shipped guards report more (**31.40.0**), built in: `raw-colour` (`X_RAW_COLOUR`) also reads a component's inline `style` (`style={{ color: '#f00' }}`, a quoted CSS string), and `untranslated-string` (`X_UNTRANSLATED_STRING`) also reads typed user-facing attributes (`aria-label`, `title`, `placeholder`, `alt`, …). A third, `undeclared-env` (`X_UNDECLARED_ENV`), is new: a raw `process.env.X` / `Bun.env.X` that `app.config.ts` does not declare. Every app runs them on its next install; a copy still in `guards/` keeps the old rule until `x upgrade` migrates it to the release after 31.39.0 | each finding names its edit: a semantic token, a `t('…')` key, or the `envSchema` entry to add; `"<name>": "off"` in `guards/shipped.json` opts out |
|
|
304
304
|
| the shipped `undeclared-env` guard reports less (**31.41.0**), built in: a name quoted inside a string (a generated docs file holding `process.env.X` as text) and a read of the OS's own `PATH`, `HOME`, `TMPDIR`, `USER`, `SHELL`, `PWD`, `LANG` or `HOSTNAME` are no longer `X_UNDECLARED_ENV`. A read inside a template's `${…}` still is | nothing, for the built-in guard. A vendored `guards/undeclared-env.ts` you never edited: `x upgrade` migrates it. An edited one keeps your rule; compare it with `x g guard undeclared-env --force`'s diff |
|
|
305
|
+
| `live` under a strict floor holds its skips at **0** in CI (**31.42.0**) when `x.verify.json` writes no `skipCeiling.live` and the run reached its database: `X_VERIFY_SKIPS_OVER_CEILING` names the step and the count. A run with no database (no services on the runner) is unchanged: `X_TEST_SERVICES_UNAVAILABLE`, a warning | make each skipped `live` test run — it needs a service the stack does not start, or skips on a condition it should not — or write the ceiling you accept, with its reason: `"skipCeiling": { "live": <n> }` in `x.verify.json`. Then `x verify --only live` |
|
|
305
306
|
|
|
306
307
|
## 29.x → 30.0.0, entry by entry
|
|
307
308
|
|