@ultimat3/cli 31.26.0 → 31.27.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/CLAUDE.md +44 -36
- package/README.md +5 -4
- package/package.json +29 -29
- package/src/app-mcp.ts +17 -3
- package/src/cmd-cache-spec.ts +5 -2
- package/src/cmd-db-spec.ts +2 -3
- package/src/cmd-db.ts +0 -2
- package/src/cmd-deploy-verify-sample.ts +93 -0
- package/src/cmd-deploy-verify.ts +2 -41
- package/src/cmd-dev-spec.ts +15 -1
- package/src/cmd-dev.ts +31 -4
- package/src/cmd-doctor.ts +4 -1
- package/src/cmd-exercise-spec.ts +7 -1
- package/src/cmd-exercise.ts +22 -10
- package/src/cmd-generate.ts +2 -0
- package/src/cmd-jobs-spec.ts +3 -6
- package/src/cmd-jobs.ts +1 -7
- package/src/cmd-logs-spec.ts +2 -1
- package/src/cmd-logs.ts +9 -28
- package/src/cmd-planned.ts +11 -45
- package/src/cmd-profile-frames.ts +99 -0
- package/src/cmd-profile-spec.ts +24 -0
- package/src/cmd-profile.ts +164 -0
- package/src/cmd-status-sample.ts +57 -0
- package/src/cmd-status-spec.ts +30 -0
- package/src/cmd-status.ts +108 -0
- package/src/cmd-token-spec.ts +5 -2
- package/src/cmd-token.ts +7 -3
- package/src/coverage-island.ts +121 -0
- package/src/coverage-lcov.ts +49 -5
- package/src/coverage-remap.ts +146 -0
- package/src/db-replay-engine-prepared.ts +66 -0
- package/src/db-replay-engine-template.ts +156 -0
- package/src/db-replay-engine.ts +4 -0
- package/src/db-replay-scratch-reap.ts +54 -0
- package/src/deploy-verify-flags.ts +9 -2
- package/src/deploy-verify-grade.ts +10 -3
- package/src/dev-boot.ts +14 -1
- package/src/dev-dashboard-guard.ts +57 -10
- package/src/dev-host.ts +46 -0
- package/src/dev-tls-cache.ts +103 -0
- package/src/dev-tls-der.ts +69 -0
- package/src/dev-tls.ts +120 -0
- package/src/doctor-browser.ts +60 -0
- package/src/error-codes-verify.ts +47 -0
- package/src/error-codes.ts +14 -23
- package/src/exercise-database.ts +40 -7
- package/src/exercise-push-device.ts +51 -0
- package/src/exercise-route-api.ts +74 -0
- package/src/exercise-routes.ts +14 -5
- package/src/exercise-services.ts +3 -1
- package/src/exercise-shard-flag.ts +47 -0
- package/src/fix-command.ts +2 -2
- package/src/generate-factories.ts +5 -11
- package/src/generate-feature-required.ts +9 -4
- package/src/generate-files.ts +20 -2
- package/src/generate-kinds.ts +5 -1
- package/src/guards.ts +21 -6
- package/src/island-bundle-options.ts +48 -0
- package/src/island-bundle.ts +18 -46
- package/src/island-link.ts +5 -0
- package/src/island-outputs.ts +5 -0
- package/src/mcp-errors-verify.ts +35 -0
- package/src/mcp-errors.ts +10 -19
- package/src/mcp-host-logs.ts +121 -0
- package/src/mcp-host.ts +12 -73
- package/src/messages-floor.ts +19 -0
- package/src/messages-status.ts +10 -0
- package/src/messages.ts +21 -0
- package/src/registry.ts +4 -0
- package/src/role-start-types.ts +7 -0
- package/src/role-start.ts +4 -0
- package/src/serve-boot.ts +7 -1
- package/src/serve-env-tls.ts +57 -0
- package/src/solid-loader.ts +27 -10
- package/src/templates/generate-export-rows.ts +136 -0
- package/src/templates/generate-import-rows.ts +186 -0
- package/src/templates/generate-rows-slice.ts +95 -0
- package/src/templates/github/ci.yml.ts +4 -0
- package/src/templates/scaffold-db-package.ts +3 -0
- package/src/templates/scaffold-docs.ts +8 -6
- package/src/templates/scaffold-repo.ts +2 -7
- package/src/templates/scaffold-site.ts +4 -1
- package/src/templates/scaffold-suites.ts +72 -0
- package/src/templates/scaffold-test-services.ts +35 -10
- package/src/templates/scaffold-verify-floor.ts +53 -31
- package/src/templates/shapes/api.ts +4 -0
- package/src/templates/slice-foundation.ts +3 -3
- package/src/unthrown-codes.ts +1 -1
- package/src/upgrade-gate.ts +6 -1
- package/src/upgrade-guards-baseline.ts +43 -0
- package/src/upgrade-guards.ts +37 -2
- package/src/upgrade-report.ts +3 -0
- package/src/verify-coverage-run.ts +42 -11
- package/src/verify-e2e.ts +115 -4
- package/src/verify-floor.ts +27 -0
- package/src/verify-guard-baseline.ts +109 -0
- package/src/verify-live.ts +72 -0
- package/src/verify-merge-skips.ts +51 -0
- package/src/verify-merge.ts +36 -2
- package/src/verify-run.ts +48 -7
- package/src/verify-services.ts +287 -0
- package/src/verify-skip-reason.ts +53 -0
- package/src/verify-strict.ts +108 -0
- package/src/verify-test-command.ts +129 -0
- package/src/verify-tests.ts +39 -126
- package/types/babel-modules.d.ts +2 -0
- package/wiki/CLI-Reference.md +142 -23
- package/wiki/Caching-And-Invalidation.md +1 -1
- package/wiki/Entities-And-Migrations.md +1 -1
- package/wiki/Jobs-And-Workflows.md +3 -3
- package/wiki/Known-Gaps.md +5 -1
- package/wiki/MCP-And-AI.md +1 -1
- package/wiki/PWA-And-Offline.md +1 -1
- package/wiki/Troubleshooting.md +3 -3
- package/wiki/Tutorial-05-Deploy-Free.md +2 -2
- package/wiki/Upgrading.md +3 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The device every actor holds in `x exercise`: the pass's push store answers each actor's stored
|
|
2
|
+
// subscriptions, else one stand-in on a listed push service with real P-256 keys, so a notifier's
|
|
3
|
+
// push is encrypted, signed and sent to the captured service — and recorded as a `push` effect by
|
|
4
|
+
// the room. As the memory mail driver accepts every address: a pusher that sends nothing shows.
|
|
5
|
+
|
|
6
|
+
import type { PushSubscriptionRecord, PushSubscriptionStore } from '@ultimat3/pwa';
|
|
7
|
+
|
|
8
|
+
/** A host `pushHostAllowed` lists, under a path no real browser hands out. */
|
|
9
|
+
const STAND_IN_ENDPOINT = 'https://fcm.googleapis.com/fcm/send/x-exercise-';
|
|
10
|
+
|
|
11
|
+
const base64Url = (bytes: Uint8Array): string => bytes.toBase64({ alphabet: 'base64url' });
|
|
12
|
+
|
|
13
|
+
/** One receiver key pair for the whole pass: the private half is never read, only the public. */
|
|
14
|
+
async function standInKeys(): Promise<PushSubscriptionRecord['keys']> {
|
|
15
|
+
const pair = await crypto.subtle.generateKey({ name: 'ECDH', namedCurve: 'P-256' }, true, [
|
|
16
|
+
'deriveBits',
|
|
17
|
+
]);
|
|
18
|
+
const point = new Uint8Array(await crypto.subtle.exportKey('raw', pair.publicKey));
|
|
19
|
+
return { p256dh: base64Url(point), auth: base64Url(crypto.getRandomValues(new Uint8Array(16))) };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* `store`, with one stand-in device for an actor it holds none for. Never written: a subscribe the
|
|
24
|
+
* pass runs stores its row in `store`, and a stand-in's removal (a 404 the captured service never
|
|
25
|
+
* answers) removes nothing.
|
|
26
|
+
*/
|
|
27
|
+
export function withStandInDevice(store: PushSubscriptionStore): PushSubscriptionStore {
|
|
28
|
+
let keys: Promise<PushSubscriptionRecord['keys']> | undefined;
|
|
29
|
+
return {
|
|
30
|
+
save: (record) => store.save(record),
|
|
31
|
+
async listFor(actorId) {
|
|
32
|
+
const held = await store.listFor(actorId);
|
|
33
|
+
if (held.length > 0) return held;
|
|
34
|
+
keys ??= standInKeys();
|
|
35
|
+
const device: PushSubscriptionRecord = {
|
|
36
|
+
endpoint: `${STAND_IN_ENDPOINT}${encodeURIComponent(actorId)}`,
|
|
37
|
+
keys: await keys,
|
|
38
|
+
locale: 'en',
|
|
39
|
+
timeZone: 'UTC',
|
|
40
|
+
actorId,
|
|
41
|
+
createdAt: 0,
|
|
42
|
+
expirationTime: null,
|
|
43
|
+
};
|
|
44
|
+
return [device];
|
|
45
|
+
},
|
|
46
|
+
remove: (endpoint, actorId) =>
|
|
47
|
+
endpoint.startsWith(STAND_IN_ENDPOINT)
|
|
48
|
+
? Promise.resolve(false)
|
|
49
|
+
: store.remove(endpoint, actorId),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// A route `load` that reads through the app's own typed client (`queries.orgPosts(…)` over
|
|
2
|
+
// `APP_URL`) answered IN PROCESS during `x exercise`, as the build's measurement render is
|
|
3
|
+
// (`measure-scope.ts`): core's `withInProcessFetch` hands each call to the app's own API pipeline,
|
|
4
|
+
// authenticated as the actor the load runs as — so its statements are the load's, counted and swept.
|
|
5
|
+
|
|
6
|
+
import type { Actor } from '@ultimat3/core';
|
|
7
|
+
import { asyncContext, isAnonymous, tryUseContext, withInProcessFetch } from '@ultimat3/core';
|
|
8
|
+
import { defineHttpConfig, httpPipeline, httpRouter } from '@ultimat3/http';
|
|
9
|
+
import type { RouteLoadSubject } from '@ultimat3/testing';
|
|
10
|
+
import { apiRoutes } from './api-routes';
|
|
11
|
+
|
|
12
|
+
/** The origin the typed client is told when the app's env names none: never dialled. */
|
|
13
|
+
export const EXERCISE_APP_URL = 'http://localhost:3000';
|
|
14
|
+
|
|
15
|
+
/** Who the in-process request authenticates as: the load's own actor, read at the call. */
|
|
16
|
+
const caller = asyncContext<Actor | null>('the exercise in-process caller');
|
|
17
|
+
|
|
18
|
+
/** One dispatcher over the app's API table, built on first use: the registries are full by then. */
|
|
19
|
+
function dispatcher(): (url: string, init: RequestInit) => Promise<Response> {
|
|
20
|
+
// No rate limit: every request is the pass's own, as a build's are (`measure-scope.ts`).
|
|
21
|
+
const config = defineHttpConfig({
|
|
22
|
+
buildId: process.env['BUILD_ID'] ?? 'dev',
|
|
23
|
+
rateLimit: { enabled: false },
|
|
24
|
+
});
|
|
25
|
+
const pipeline = httpPipeline({
|
|
26
|
+
table: httpRouter(apiRoutes()),
|
|
27
|
+
config,
|
|
28
|
+
hooks: { authenticate: () => caller.get() ?? null },
|
|
29
|
+
});
|
|
30
|
+
return (url, init) => {
|
|
31
|
+
// A `prerender()` runs in no request: nobody, as a published read is (`publicScope`).
|
|
32
|
+
const actor = tryUseContext()?.actor;
|
|
33
|
+
// The page's own server calling its own API: same-origin by construction, so it says so —
|
|
34
|
+
// a write with neither `origin` nor `sec-fetch-site` is `X_CSRF_BLOCKED`, as it should be.
|
|
35
|
+
const headers = new Headers(init.headers);
|
|
36
|
+
if (!headers.has('origin')) headers.set('origin', new URL(url).origin);
|
|
37
|
+
return caller.run(actor === undefined || isAnonymous(actor) ? null : actor, () =>
|
|
38
|
+
pipeline.handle(new Request(url, { ...init, headers }), { role: 'web' }),
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The app's own origin — `APP_URL` as the typed client reads it, at the call: only its urls are
|
|
45
|
+
* the app's to answer. Any other host is a call out, left to the pass's sealed network, which
|
|
46
|
+
* refuses and records it as one (`exercise-report.ts`).
|
|
47
|
+
*/
|
|
48
|
+
const ownOrigin = (url: string): boolean => {
|
|
49
|
+
const base = process.env['APP_URL'] || EXERCISE_APP_URL;
|
|
50
|
+
try {
|
|
51
|
+
return new URL(url).origin === new URL(base).origin;
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** `routes`, each load's (and `prerender()`'s) typed-client calls answered by the app's API here. */
|
|
58
|
+
export function servedInProcess(routes: readonly RouteLoadSubject[]): readonly RouteLoadSubject[] {
|
|
59
|
+
let dispatch: ReturnType<typeof dispatcher> | undefined;
|
|
60
|
+
const served = (url: string, init: RequestInit): Promise<Response> => {
|
|
61
|
+
dispatch ??= dispatcher();
|
|
62
|
+
return dispatch(url, init);
|
|
63
|
+
};
|
|
64
|
+
return routes.map((route) => {
|
|
65
|
+
const { samples } = route;
|
|
66
|
+
return {
|
|
67
|
+
...route,
|
|
68
|
+
load: (ctx) => withInProcessFetch(served, () => route.load(ctx), ownOrigin),
|
|
69
|
+
...(samples === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: { samples: () => withInProcessFetch(served, () => samples.call(route), ownOrigin) }),
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
package/src/exercise-routes.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// each naming the route file or the primitive. Warnings on `main` — a page read was never judged
|
|
4
4
|
// before, and an app that has not opted in stays green (X_BREAKING_ON_MAIN); red needs a floor key.
|
|
5
5
|
|
|
6
|
+
import { renderFixLiteral } from '@ultimat3/core';
|
|
6
7
|
import type { ExerciseRecord, RouteLoadRecord } from '@ultimat3/testing';
|
|
7
8
|
|
|
8
9
|
const where = (record: RouteLoadRecord): string => `route ${record.name} (${record.file})`;
|
|
@@ -10,10 +11,13 @@ const where = (record: RouteLoadRecord): string => `route ${record.name} (${reco
|
|
|
10
11
|
/** Each route's load as warning lines: a loop, a call over the ceiling, a seq scan, or unrun. */
|
|
11
12
|
export function routeLoadWarnings(records: readonly RouteLoadRecord[]): readonly string[] {
|
|
12
13
|
return records.flatMap((record): readonly string[] => {
|
|
14
|
+
// `off` is declared, with its reason, in the report: nothing left to say.
|
|
15
|
+
if (record.outcome === 'off') return [];
|
|
13
16
|
if (record.outcome !== 'reached') {
|
|
14
17
|
return [`${where(record)} · load not exercised: ${record.reason ?? record.outcome}`];
|
|
15
18
|
}
|
|
16
19
|
const lines: string[] = [];
|
|
20
|
+
if (vacuous(record) && record.empty === undefined) lines.push(emptyRouteLine(record));
|
|
17
21
|
if (record.scale?.verdict === 'grows') {
|
|
18
22
|
for (const shape of record.scale.shapes) {
|
|
19
23
|
lines.push(
|
|
@@ -35,6 +39,14 @@ export function routeLoadWarnings(records: readonly RouteLoadRecord[]): readonly
|
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
41
|
|
|
42
|
+
/** Reached with no statement and no effect: every proof on it is vacuous. */
|
|
43
|
+
const vacuous = (record: ExerciseRecord | RouteLoadRecord): boolean =>
|
|
44
|
+
record.outcome === 'reached' && record.statements === 0 && record.effects.length === 0;
|
|
45
|
+
|
|
46
|
+
/** The route's own line: its entry is keyed by pattern, so the paste names it. */
|
|
47
|
+
const emptyRouteLine = (record: RouteLoadRecord): string =>
|
|
48
|
+
`${where(record)} · ${EMPTY_REACH} its load sent no statement and had no effect, so its proofs prove nothing — fix: edit exercise.ts: defineExercise({…}, { routes: { ${renderFixLiteral(record.name, '<pattern>')}: { empty: '<why it reads nothing>' } } }), or give it the params that reach its read`;
|
|
49
|
+
|
|
38
50
|
/** How many names an empty-reach line lists before it says how many more. */
|
|
39
51
|
const NAMED = 5;
|
|
40
52
|
|
|
@@ -46,14 +58,11 @@ const EMPTY_REACH = 'X_EXERCISE_EMPTY_REACH';
|
|
|
46
58
|
* is "flat", a tenant proof over nothing is "proven". Said once, with the first few named.
|
|
47
59
|
*/
|
|
48
60
|
export function emptyReachWarnings(records: readonly ExerciseRecord[]): readonly string[] {
|
|
49
|
-
const empty = records.filter(
|
|
50
|
-
(record) =>
|
|
51
|
-
record.outcome === 'reached' && record.statements === 0 && record.effects.length === 0,
|
|
52
|
-
);
|
|
61
|
+
const empty = records.filter((record) => vacuous(record) && record.empty === undefined);
|
|
53
62
|
if (empty.length === 0) return [];
|
|
54
63
|
const named = empty.slice(0, NAMED).map((record) => `${record.kind} ${record.name}`);
|
|
55
64
|
const more = empty.length > NAMED ? `, and ${String(empty.length - NAMED)} more` : '';
|
|
56
65
|
return [
|
|
57
|
-
`${EMPTY_REACH} ${String(empty.length)} reached primitive(s) sent no statement and had no effect, so their proofs prove nothing: ${named.join(', ')}${more} — fix: edit exercise.ts: give each an input that reaches its work, or { off: '<why>' }`,
|
|
66
|
+
`${EMPTY_REACH} ${String(empty.length)} reached primitive(s) sent no statement and had no effect, so their proofs prove nothing: ${named.join(', ')}${more} — fix: edit exercise.ts: give each an input that reaches its work, { empty: '<why it touches nothing>' }, or { off: '<why>' }`,
|
|
58
67
|
];
|
|
59
68
|
}
|
package/src/exercise-services.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
memoryStorageDriver,
|
|
14
14
|
resetStorage,
|
|
15
15
|
} from '@ultimat3/storage';
|
|
16
|
+
import { withStandInDevice } from './exercise-push-device';
|
|
16
17
|
import type { Env } from './runtime-bindings';
|
|
17
18
|
import { selectWebPush } from './runtime-push';
|
|
18
19
|
|
|
@@ -55,7 +56,8 @@ async function installPush(inputs: ExerciseServiceInputs): Promise<() => void> {
|
|
|
55
56
|
if (selection === undefined) return () => undefined;
|
|
56
57
|
const { installWebPush, postgresPushSubscriptionStore } = await import('@ultimat3/pwa');
|
|
57
58
|
return installWebPush({
|
|
58
|
-
|
|
59
|
+
// Every actor holds a device (`exercise-push-device.ts`): a sent push is an effect the room sees.
|
|
60
|
+
store: withStandInDevice(postgresPushSubscriptionStore({ executor: inputs.executor })),
|
|
59
61
|
keys: selection.resolved.keys,
|
|
60
62
|
subject: selection.subject,
|
|
61
63
|
pushHosts: selection.pushHosts,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// `x exercise --shard i/n`: one of n processes' slice of the pass (`@ultimat3/testing`'s
|
|
2
|
+
// `exercise-shard.ts`), each on its own scratch database. A slice writes its own report beside the
|
|
3
|
+
// whole pass's, and judges no whole-pass floor: a ratio over a third of the pass is not the pass's.
|
|
4
|
+
|
|
5
|
+
// why: Bun ships no path joiner.
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { EXERCISE_REPORT_FILE } from './exercise-findings';
|
|
8
|
+
import type { ParsedArgs } from './parse';
|
|
9
|
+
import { flagString } from './parse';
|
|
10
|
+
import type { ShardSpec } from './verify-shard';
|
|
11
|
+
import { parseShard, VerifyShardInvalidError } from './verify-shard';
|
|
12
|
+
|
|
13
|
+
const COMMAND = 'x exercise';
|
|
14
|
+
|
|
15
|
+
/** `--shard`, read: absent, the whole pass. Refused beside a `<name>`, which is a slice already. */
|
|
16
|
+
export function readExerciseShard(
|
|
17
|
+
args: ParsedArgs,
|
|
18
|
+
only: string | undefined,
|
|
19
|
+
): ShardSpec | undefined {
|
|
20
|
+
const raw = flagString(args, 'shard');
|
|
21
|
+
if (raw === undefined) return undefined;
|
|
22
|
+
let spec: ShardSpec;
|
|
23
|
+
try {
|
|
24
|
+
spec = parseShard(raw, COMMAND);
|
|
25
|
+
} catch {
|
|
26
|
+
// The verify step's fix names `--only`, which this command has not: the reason, with ours.
|
|
27
|
+
throw new VerifyShardInvalidError({
|
|
28
|
+
reason: 'expects i/n with 1 <= i <= n (e.g. 2/4)',
|
|
29
|
+
fix: `${COMMAND} --shard 1/2 --json`,
|
|
30
|
+
command: COMMAND,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (only !== undefined) {
|
|
34
|
+
throw new VerifyShardInvalidError({
|
|
35
|
+
reason: 'a shard is a slice of the whole pass, and a <name> already runs one primitive',
|
|
36
|
+
fix: `${COMMAND} --shard ${String(spec.index)}/${String(spec.total)} --json`,
|
|
37
|
+
command: COMMAND,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return spec;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Where a slice's report goes: `.x/exercise.2-of-4.json`, never over the whole pass's file. */
|
|
44
|
+
export const shardReportFile = (shard: ShardSpec | undefined): string =>
|
|
45
|
+
shard === undefined
|
|
46
|
+
? EXERCISE_REPORT_FILE
|
|
47
|
+
: join('.x', `exercise.${String(shard.index)}-of-${String(shard.total)}.json`);
|
package/src/fix-command.ts
CHANGED
|
@@ -147,8 +147,8 @@ export interface CommandCatalog {
|
|
|
147
147
|
* one is a defect; a doc page may legitimately *say* a command is planned, and a rule that refused
|
|
148
148
|
* that would delete `wiki/CLI-Reference.md`'s planned table one true row at a time.
|
|
149
149
|
*
|
|
150
|
-
* `allowPlanned` covers `PLANNED_SUBCOMMANDS` as well as `PLANNED_COMMANDS
|
|
151
|
-
*
|
|
150
|
+
* `allowPlanned` covers `PLANNED_SUBCOMMANDS` as well as `PLANNED_COMMANDS`. The subcommand table is
|
|
151
|
+
* empty `As of 2026-11-15`; the rule stays so the next planned subcommand needs no second one.
|
|
152
152
|
*/
|
|
153
153
|
export interface CitationRules {
|
|
154
154
|
readonly allowPlanned?: boolean;
|
|
@@ -27,7 +27,7 @@ export const FACTORY_GENERATORS: readonly FactoryGenerator[] = [
|
|
|
27
27
|
{ factory: 'agent', none: MODEL },
|
|
28
28
|
{
|
|
29
29
|
factory: 'agentJob',
|
|
30
|
-
none:
|
|
30
|
+
none: "a worker runs a job as its tenant alone, with no grant, so an agentJob over any action x g action writes (policy: can('<feature>:write')) is X_FORBIDDEN on every attempt unless its actor() re-reads the member who asked — and how a member is found (its id on the input, the app's own member table and roles) is the app's convention; paste agentJob(<action>, { name, tenant, retry, actor }) beside the action, as examples/dummy/apps/web/app/posts/jobs/review-draft-later.ts does",
|
|
31
31
|
},
|
|
32
32
|
{ factory: 'backfill', generator: 'backfill' },
|
|
33
33
|
{
|
|
@@ -39,15 +39,9 @@ export const FACTORY_GENERATORS: readonly FactoryGenerator[] = [
|
|
|
39
39
|
factory: 'deviceSocket',
|
|
40
40
|
none: 'a websocket mount speaking the app’s own device protocol; the protocol is the whole of the declaration, and only the app knows it',
|
|
41
41
|
},
|
|
42
|
-
{
|
|
43
|
-
factory: 'exportRows',
|
|
44
|
-
none: 'reads one table through the app’s typed handle into a storage disk; deferred (plan 101 U6) until x g can refuse a slice whose table is not the scaffolded one under its own code',
|
|
45
|
-
},
|
|
42
|
+
{ factory: 'exportRows', generator: 'export-rows' },
|
|
46
43
|
{ factory: 'hive', none: MODEL },
|
|
47
|
-
{
|
|
48
|
-
factory: 'importRows',
|
|
49
|
-
none: 'writes an uploaded file into one table through the app’s typed handle; deferred (plan 101 U6) on the same refusal exportRows waits for',
|
|
50
|
-
},
|
|
44
|
+
{ factory: 'importRows', generator: 'import-rows' },
|
|
51
45
|
{
|
|
52
46
|
factory: 'ledger',
|
|
53
47
|
none: 'the attempt table a webhook() delivery writes, declared once beside that webhook — it has no meaning without one, so it ships with it',
|
|
@@ -96,7 +90,7 @@ export const FACTORY_GENERATORS: readonly FactoryGenerator[] = [
|
|
|
96
90
|
},
|
|
97
91
|
{
|
|
98
92
|
factory: 'rollup',
|
|
99
|
-
none: 'counts a source table into a
|
|
93
|
+
none: 'counts a source table into a DESTINATION entity by bucket, with that entity’s key columns as the upsert key — two tables, one of them new, so the declaration is an entity, a migration (x db gen) and the call, never one call; x g entity <name>-daily writes the destination, then the rollup is pasted beside it',
|
|
100
94
|
},
|
|
101
95
|
{
|
|
102
96
|
factory: 'scrape',
|
|
@@ -120,7 +114,7 @@ export const FACTORY_GENERATORS: readonly FactoryGenerator[] = [
|
|
|
120
114
|
},
|
|
121
115
|
{
|
|
122
116
|
factory: 'webhook',
|
|
123
|
-
none: 'one signed delivery to an endpoint the app stores, with its
|
|
117
|
+
none: 'one signed delivery to an endpoint the app stores, read per attempt with its secret, plus the ledger() table every attempt is written to — the endpoint and event tables are the app’s own schema and the ledger is a migration, so the declaration is two tables and the call, never one call',
|
|
124
118
|
},
|
|
125
119
|
{ factory: 'webhookReceiver', generator: 'webhook-receiver' },
|
|
126
120
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
// `x g query`
|
|
2
|
-
// handed one
|
|
3
|
-
//
|
|
1
|
+
// `x g query`, `backfill`, `export-rows` and `import-rows` read a table, so a slice with no
|
|
2
|
+
// `entity.ts` is refused rather than handed one: `x g query order` wrote 14 files and `next: x db
|
|
3
|
+
// gen "create orders"`. Only `x g entity` and `x g resource` create a feature's data.
|
|
4
4
|
|
|
5
5
|
import { existsSync } from 'node:fs'; // why: a synchronous file probe, as the slice's own guard.
|
|
6
6
|
import { UltimateError } from '@ultimat3/core';
|
|
@@ -11,7 +11,12 @@ import { containedPath } from './generate-write';
|
|
|
11
11
|
import { quoteArg } from './shell-quote';
|
|
12
12
|
|
|
13
13
|
/** The generators whose whole body reads a table the slice declares. */
|
|
14
|
-
const READS_A_TABLE: ReadonlySet<Generator> = new Set<Generator>([
|
|
14
|
+
export const READS_A_TABLE: ReadonlySet<Generator> = new Set<Generator>([
|
|
15
|
+
'query',
|
|
16
|
+
'backfill',
|
|
17
|
+
'export-rows',
|
|
18
|
+
'import-rows',
|
|
19
|
+
]);
|
|
15
20
|
|
|
16
21
|
/** Declared beside its one thrower: `errors.ts` sits at its 500-line ceiling. */
|
|
17
22
|
export class FeatureRequiredError extends UltimateError {
|
package/src/generate-files.ts
CHANGED
|
@@ -30,6 +30,8 @@ import {
|
|
|
30
30
|
import { adminCatalogFiles } from './templates/admin-catalog';
|
|
31
31
|
import { helmDashboardFiles } from './templates/chart-dashboard';
|
|
32
32
|
import { cronJobFiles } from './templates/generate-cron-job';
|
|
33
|
+
import { exportRowsFiles } from './templates/generate-export-rows';
|
|
34
|
+
import { importRowsFiles } from './templates/generate-import-rows';
|
|
33
35
|
import { purgeFiles } from './templates/generate-purge';
|
|
34
36
|
import { webhookReceiverFiles } from './templates/generate-webhook-receiver';
|
|
35
37
|
import { inviteFiles } from './templates/invite';
|
|
@@ -200,14 +202,30 @@ export function generate(options: GenerateOptions): readonly GeneratedFile[] {
|
|
|
200
202
|
...(options.sliceRepo === undefined ? {} : { sliceRepo: options.sliceRepo }),
|
|
201
203
|
}),
|
|
202
204
|
);
|
|
203
|
-
// A primitive factory's one call, in the feature's slice.
|
|
204
|
-
// no table of its own, so it compiles in a feature that has no entity yet.
|
|
205
|
+
// A primitive factory's one call, in the feature's slice. These three read no slice: each
|
|
206
|
+
// declares no table of its own, so it compiles in a feature that has no entity yet.
|
|
205
207
|
case 'cron-job':
|
|
206
208
|
return dedupe(cronJobFiles(options.name, target));
|
|
207
209
|
case 'purge':
|
|
208
210
|
return dedupe(purgeFiles(options.name, target));
|
|
209
211
|
case 'webhook-receiver':
|
|
210
212
|
return dedupe(webhookReceiverFiles(options.name, target));
|
|
213
|
+
// These two DO read the slice: each moves its own scaffolded table through storage, so a slice
|
|
214
|
+
// shaped otherwise is refused, and one with no entity has it planted — `backfill`'s rule.
|
|
215
|
+
case 'export-rows':
|
|
216
|
+
case 'import-rows': {
|
|
217
|
+
const rows = {
|
|
218
|
+
...target,
|
|
219
|
+
...(options.locales === undefined ? {} : { locales: options.locales }),
|
|
220
|
+
...(options.sliceEntity === undefined ? {} : { sliceEntity: options.sliceEntity }),
|
|
221
|
+
...(options.sliceRepo === undefined ? {} : { sliceRepo: options.sliceRepo }),
|
|
222
|
+
};
|
|
223
|
+
return dedupe(
|
|
224
|
+
options.kind === 'export-rows'
|
|
225
|
+
? exportRowsFiles(options.name, rows)
|
|
226
|
+
: importRowsFiles(options.name, rows),
|
|
227
|
+
);
|
|
228
|
+
}
|
|
211
229
|
case 'entity':
|
|
212
230
|
// With the labels the admin reads for it: the entity is an admin screen once it is in the
|
|
213
231
|
// handle, whether or not a resource was generated around it.
|
package/src/generate-kinds.ts
CHANGED
|
@@ -19,11 +19,13 @@ export const GENERATORS = [
|
|
|
19
19
|
'action',
|
|
20
20
|
'mutator',
|
|
21
21
|
'backfill',
|
|
22
|
-
//
|
|
22
|
+
// Five primitive factories, each its one call in the feature's `jobs/`. Which factories have a
|
|
23
23
|
// generator, and why the rest have none, is `FACTORY_GENERATORS` (`generate-factories.ts`).
|
|
24
24
|
'cron-job',
|
|
25
25
|
'purge',
|
|
26
26
|
'webhook-receiver',
|
|
27
|
+
'export-rows',
|
|
28
|
+
'import-rows',
|
|
27
29
|
'job',
|
|
28
30
|
'route',
|
|
29
31
|
'policy',
|
|
@@ -291,6 +293,8 @@ const EXAMPLE_NAME: Readonly<Record<Generator, string>> = {
|
|
|
291
293
|
'cron-job': 'nightly-report',
|
|
292
294
|
purge: 'purge-retained',
|
|
293
295
|
'webhook-receiver': 'billing-events',
|
|
296
|
+
'export-rows': 'export-posts --feature post',
|
|
297
|
+
'import-rows': 'import-posts --feature post',
|
|
294
298
|
job: 'send-digest',
|
|
295
299
|
route: 'posts',
|
|
296
300
|
policy: 'post',
|
package/src/guards.ts
CHANGED
|
@@ -13,6 +13,9 @@ import { ERROR_DOCS_URL, renderCauseValue, renderThrowable } from '@ultimat3/cor
|
|
|
13
13
|
import { fixProblem } from './error-contract';
|
|
14
14
|
import { type GuardSources, guardSources } from './guard-sources';
|
|
15
15
|
import type { Finding } from './output';
|
|
16
|
+
import { readVerifyFloor } from './verify-floor';
|
|
17
|
+
import type { GuardBaseline } from './verify-guard-baseline';
|
|
18
|
+
import { judgeGuardBaseline, orphanedBaselineFindings } from './verify-guard-baseline';
|
|
16
19
|
|
|
17
20
|
/** The directory IS the registration. An app-side list is a list an app can forget to add to. */
|
|
18
21
|
export const GUARD_DIR = 'guards';
|
|
@@ -167,7 +170,12 @@ export interface GuardReport {
|
|
|
167
170
|
const refused = (finding: Finding): GuardReport => ({ findings: [finding], warnings: [] });
|
|
168
171
|
|
|
169
172
|
/** One guard: import it, run it, and hold what it returns to the contract. Never throws. */
|
|
170
|
-
async function runGuard(
|
|
173
|
+
async function runGuard(
|
|
174
|
+
root: string,
|
|
175
|
+
path: string,
|
|
176
|
+
sources: GuardSources,
|
|
177
|
+
baseline: GuardBaseline | undefined,
|
|
178
|
+
): Promise<GuardReport> {
|
|
171
179
|
let loaded: unknown;
|
|
172
180
|
try {
|
|
173
181
|
loaded = await import(pathToFileURL(join(root, path)).href);
|
|
@@ -201,9 +209,11 @@ async function runGuard(root: string, path: string, sources: GuardSources): Prom
|
|
|
201
209
|
broken.push(findingInvalid(path, `it could not be read: ${messageOf(error)}`));
|
|
202
210
|
}
|
|
203
211
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
if (exported.severity === 'warning') return { findings: broken, warnings: held };
|
|
213
|
+
// A gating guard under its `guardBaseline` (`verify-guard-baseline.ts`): a broken finding is
|
|
214
|
+
// never counted against it — the contract fails either way.
|
|
215
|
+
const judged = judgeGuardBaseline(path, held, baseline);
|
|
216
|
+
return { findings: [...broken, ...judged.findings], warnings: judged.notices };
|
|
207
217
|
}
|
|
208
218
|
|
|
209
219
|
/**
|
|
@@ -221,11 +231,16 @@ export const guardReport = async (
|
|
|
221
231
|
const findings: Finding[] = [];
|
|
222
232
|
const warnings: Finding[] = [];
|
|
223
233
|
const sources = guardSources(root, seed);
|
|
224
|
-
|
|
225
|
-
|
|
234
|
+
// Read here, not passed in: every caller of this seam — the step, `x upgrade`'s measuring run —
|
|
235
|
+
// judges the same committed counts, and a floor problem is the `manifest` step's to report.
|
|
236
|
+
const baseline = (await readVerifyFloor(root))?.guardBaseline;
|
|
237
|
+
const paths = await guardPaths(root);
|
|
238
|
+
for (const path of paths) {
|
|
239
|
+
const report = await runGuard(root, path, sources, baseline);
|
|
226
240
|
findings.push(...report.findings);
|
|
227
241
|
warnings.push(...report.warnings);
|
|
228
242
|
}
|
|
243
|
+
findings.push(...orphanedBaselineFindings(paths, baseline));
|
|
229
244
|
return { findings, warnings };
|
|
230
245
|
};
|
|
231
246
|
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// What a caller may ask of `buildIslands`: one island, the split, the cache, the realtime answer,
|
|
2
|
+
// Solid as a vendor, and a coverage build. Split from `island-bundle.ts`, which builds.
|
|
3
|
+
|
|
4
|
+
export interface BuildIslandsOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Build ONE island, named app-root-relative — the whole option surface. A test that mounts a
|
|
7
|
+
* single island otherwise pays every OTHER island's Babel pass and `Bun.build` on every file,
|
|
8
|
+
* and the reference app is the one that feels it.
|
|
9
|
+
*
|
|
10
|
+
* Optional, and it must stay optional: `buildIslands` is on `@ultimat3/cli`'s public surface and
|
|
11
|
+
* `@ultimat3/testing`'s `IslandBuilder` satisfies it STRUCTURALLY as `(root: string) => …`, which
|
|
12
|
+
* is what keeps the `cli -> testing` edge pointing the one legal way.
|
|
13
|
+
*/
|
|
14
|
+
readonly only?: string;
|
|
15
|
+
/**
|
|
16
|
+
* One split build over every island (`app.config.ts`'s `islands.sharedChunks`, off by default),
|
|
17
|
+
* or one build per route group (`island-groups.ts`). Passed, it overrides the app's config — the
|
|
18
|
+
* seam a test asks both questions of one fixture through.
|
|
19
|
+
*/
|
|
20
|
+
readonly sharedChunks?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Reuse a group's output from `.x/cache/islands/` while every file it read is unchanged
|
|
23
|
+
* (`island-group-cache.ts`) — on by default. `false` is the seam a determinism test builds
|
|
24
|
+
* through: a reused byte string proves nothing about the bundler that emitted it.
|
|
25
|
+
*/
|
|
26
|
+
readonly reuse?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the app persists records (`appPersistsRecords`), asked only by a group one of whose
|
|
29
|
+
* islands reaches realtime, and once per call. `x dev` builds islands BESIDE the app load
|
|
30
|
+
* (`buildGeneration`), so it passes the answer the registry gives once the load settles; read
|
|
31
|
+
* any earlier it is the empty registry's `undefined`, and every reader islands is held. Absent,
|
|
32
|
+
* the registry is read as it stands: the caller loaded the app first.
|
|
33
|
+
*/
|
|
34
|
+
readonly persists?: () => Promise<boolean | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Solid as ONE shared output every island imports (`island-vendor.ts`), off by default. Measured
|
|
37
|
+
* As of 2026-11-12 (Bun 1.4.4, solid-js 1.9.17): each island inlines a tree-shaken ~14 kB of
|
|
38
|
+
* Solid, the whole vendor is 48,083 B, so every Solid route of the three tracked apps grew
|
|
39
|
+
* +33,572…+38,769 B with it on; it pays only where a page renders four or more Solid islands
|
|
40
|
+
* that are built apart.
|
|
41
|
+
*/
|
|
42
|
+
readonly vendorSolid?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A build for `mountIsland` under a coverage run: whitespace kept, Babel's lines kept, the map on
|
|
45
|
+
* every chunk — so the chunk's lines count for the island's source. Never cached, never shipped.
|
|
46
|
+
*/
|
|
47
|
+
readonly coverage?: boolean;
|
|
48
|
+
}
|
package/src/island-bundle.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { loadAppConfig } from './app-config-load';
|
|
|
27
27
|
import type { IslandResolve } from './document-options';
|
|
28
28
|
import { IslandBuildFailedError } from './errors';
|
|
29
29
|
import { boundedMap } from './island-build-pool';
|
|
30
|
+
import type { BuildIslandsOptions } from './island-bundle-options';
|
|
30
31
|
import {
|
|
31
32
|
environmentDigest,
|
|
32
33
|
inputDigester,
|
|
@@ -61,8 +62,10 @@ import { islandStylesPlugin, stylesheetsOf } from './island-styles';
|
|
|
61
62
|
import type { Vendors } from './island-vendor';
|
|
62
63
|
import { loadingVendor, vendorBuilder, vendorExternalPlugin, vendorShared } from './island-vendor';
|
|
63
64
|
import { hasPathSegment } from './path-segments';
|
|
64
|
-
import { solidJsxPlugin } from './solid-loader';
|
|
65
|
+
import { solidJsxCoveragePlugin, solidJsxPlugin } from './solid-loader';
|
|
65
66
|
|
|
67
|
+
// `dev-rebuild.ts` names the options type here, where it lived before the split.
|
|
68
|
+
export type { BuildIslandsOptions } from './island-bundle-options';
|
|
66
69
|
export { ISLAND_BASE_PATH } from './island-outputs';
|
|
67
70
|
|
|
68
71
|
/**
|
|
@@ -92,6 +95,8 @@ export interface IslandChunk {
|
|
|
92
95
|
readonly imports: readonly string[];
|
|
93
96
|
/** The files on disk it was built from (`island-sources.ts`). Absent on a chunk not built here. */
|
|
94
97
|
readonly sources?: SourcePaths;
|
|
98
|
+
/** The external source map — a coverage build's only (`BuildIslandsOptions.coverage`). */
|
|
99
|
+
readonly map?: string;
|
|
95
100
|
/**
|
|
96
101
|
* Absent unless the island's graph reaches `@ultimat3/realtime`: then whether it has page state
|
|
97
102
|
* to restore or only follows the socket (`island-realtime-state.ts`). On the chunk, so the
|
|
@@ -109,6 +114,7 @@ export interface SharedChunk {
|
|
|
109
114
|
/** The islands (app-root-relative) that load it — for a finding that names what an author edits. */
|
|
110
115
|
readonly importers: readonly string[];
|
|
111
116
|
readonly sources?: SourcePaths;
|
|
117
|
+
readonly map?: string;
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
export interface IslandBundle {
|
|
@@ -188,7 +194,9 @@ async function buildAll(
|
|
|
188
194
|
// `[dir]` keeps two islands sharing a filename apart and maps an output back to its island;
|
|
189
195
|
// a chunk's Bun hash is only a placeholder — `island-link.ts` renames every one by its bytes.
|
|
190
196
|
naming: { entry: '[dir]/[name].[ext]', chunk: 'chunk-[hash].[ext]' },
|
|
191
|
-
|
|
197
|
+
// A coverage build keeps the lines its map names, and only them: identifiers and syntax are
|
|
198
|
+
// minified as shipped, so the code a test mounts is the shipped code laid out on lines.
|
|
199
|
+
minify: context.coverage ? { whitespace: false, syntax: true, identifiers: true } : true,
|
|
192
200
|
// A build with no `plugins` is a build with no JSX transform: `Bun.plugin` installs into the
|
|
193
201
|
// RUNTIME's loader and `Bun.build` walks its own graph, so render's `.tsx` loader never sees
|
|
194
202
|
// an island. The app's tsconfig says `jsx: "preserve"`, which makes the bundler fall back to
|
|
@@ -212,7 +220,7 @@ async function buildAll(
|
|
|
212
220
|
: [islandRealtimePlugin(root, runtime, follows, live.length === files.length)]),
|
|
213
221
|
solidDedupePlugin(root),
|
|
214
222
|
...frameworkDedupePlugins(root),
|
|
215
|
-
solidJsxPlugin,
|
|
223
|
+
context.coverage ? solidJsxCoveragePlugin : solidJsxPlugin,
|
|
216
224
|
context.styles,
|
|
217
225
|
],
|
|
218
226
|
// The third one, and it is a `define` rather than the plugin this used to be: Bun selects
|
|
@@ -256,7 +264,9 @@ async function buildAll(
|
|
|
256
264
|
}
|
|
257
265
|
await refuseDuplicatedModules(files.join(', '), built.metafile, context.io);
|
|
258
266
|
const sources = new Map<string, SourcePaths>();
|
|
259
|
-
const linked = linkOutputs(
|
|
267
|
+
const linked = linkOutputs(
|
|
268
|
+
await builtOutputs(root, files, built.outputs, sources, context.coverage),
|
|
269
|
+
);
|
|
260
270
|
const entries = loadingRuntime(entryChunks(files, linked, sources), live, runtime).map(
|
|
261
271
|
(chunk): IslandChunk => {
|
|
262
272
|
const kind = kinds.get(chunk.file);
|
|
@@ -318,47 +328,8 @@ interface BuildContext {
|
|
|
318
328
|
readonly io: ModuleIdentityIo;
|
|
319
329
|
/** Solid as one shared output (`island-vendor.ts`); `undefined` bundles it into each build. */
|
|
320
330
|
readonly vendors: Vendors | undefined;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
export interface BuildIslandsOptions {
|
|
324
|
-
/**
|
|
325
|
-
* Build ONE island, named app-root-relative — the whole option surface. A test that mounts a
|
|
326
|
-
* single island otherwise pays every OTHER island's Babel pass and `Bun.build` on every file,
|
|
327
|
-
* and the reference app is the one that feels it.
|
|
328
|
-
*
|
|
329
|
-
* Optional, and it must stay optional: `buildIslands` is on `@ultimat3/cli`'s public surface and
|
|
330
|
-
* `@ultimat3/testing`'s `IslandBuilder` satisfies it STRUCTURALLY as `(root: string) => …`, which
|
|
331
|
-
* is what keeps the `cli -> testing` edge pointing the one legal way.
|
|
332
|
-
*/
|
|
333
|
-
readonly only?: string;
|
|
334
|
-
/**
|
|
335
|
-
* One split build over every island (`app.config.ts`'s `islands.sharedChunks`, off by default),
|
|
336
|
-
* or one build per route group (`island-groups.ts`). Passed, it overrides the app's config — the
|
|
337
|
-
* seam a test asks both questions of one fixture through.
|
|
338
|
-
*/
|
|
339
|
-
readonly sharedChunks?: boolean;
|
|
340
|
-
/**
|
|
341
|
-
* Reuse a group's output from `.x/cache/islands/` while every file it read is unchanged
|
|
342
|
-
* (`island-group-cache.ts`) — on by default. `false` is the seam a determinism test builds
|
|
343
|
-
* through: a reused byte string proves nothing about the bundler that emitted it.
|
|
344
|
-
*/
|
|
345
|
-
readonly reuse?: boolean;
|
|
346
|
-
/**
|
|
347
|
-
* Whether the app persists records (`appPersistsRecords`), asked only by a group one of whose
|
|
348
|
-
* islands reaches realtime, and once per call. `x dev` builds islands BESIDE the app load
|
|
349
|
-
* (`buildGeneration`), so it passes the answer the registry gives once the load settles; read
|
|
350
|
-
* any earlier it is the empty registry's `undefined`, and every reader islands is held. Absent,
|
|
351
|
-
* the registry is read as it stands: the caller loaded the app first.
|
|
352
|
-
*/
|
|
353
|
-
readonly persists?: () => Promise<boolean | undefined>;
|
|
354
|
-
/**
|
|
355
|
-
* Solid as ONE shared output every island imports (`island-vendor.ts`), off by default. Measured
|
|
356
|
-
* As of 2026-11-12 (Bun 1.4.4, solid-js 1.9.17): each island inlines a tree-shaken ~14 kB of
|
|
357
|
-
* Solid, the whole vendor is 48,083 B, so every Solid route of the three tracked apps grew
|
|
358
|
-
* +33,572…+38,769 B with it on; it pays only where a page renders four or more Solid islands
|
|
359
|
-
* that are built apart.
|
|
360
|
-
*/
|
|
361
|
-
readonly vendorSolid?: boolean;
|
|
331
|
+
/** `BuildIslandsOptions.coverage`. */
|
|
332
|
+
readonly coverage: boolean;
|
|
362
333
|
}
|
|
363
334
|
|
|
364
335
|
/** The `islands` block off the one loader (`app-config-load.ts`) — both off with no config file. */
|
|
@@ -388,6 +359,7 @@ export async function buildIslands(
|
|
|
388
359
|
styles: islandStylesPlugin(),
|
|
389
360
|
io: memoizedIo(hostIo()),
|
|
390
361
|
vendors: vendorSolid ? vendorBuilder(root, ISLAND_BASE_PATH) : undefined,
|
|
362
|
+
coverage: options.coverage === true,
|
|
391
363
|
};
|
|
392
364
|
let asked: Promise<boolean | undefined> | undefined;
|
|
393
365
|
const persistsOnce = (): Promise<boolean | undefined> => {
|
|
@@ -401,7 +373,7 @@ export async function buildIslands(
|
|
|
401
373
|
const everyIsland =
|
|
402
374
|
files.length > 0 && (options.sharedChunks ?? configured?.sharedChunks ?? false);
|
|
403
375
|
const groups = everyIsland ? [files] : files.length === 0 ? [] : await islandGroups(root, files);
|
|
404
|
-
const reuse = options.reuse ?? true;
|
|
376
|
+
const reuse = (options.reuse ?? true) && options.coverage !== true;
|
|
405
377
|
const cache = {
|
|
406
378
|
environment: reuse ? await environmentDigest(root) : '',
|
|
407
379
|
digestOf: inputDigester(),
|