@ultimat3/cli 31.34.0 → 31.36.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/package.json +29 -29
- package/src/affected.ts +3 -1
- package/src/async-pages.ts +1 -1
- package/src/cdp-shot-errors.ts +4 -4
- package/src/cmd-deploy-helm.ts +1 -1
- package/src/cmd-env.ts +1 -1
- package/src/cmd-mcp.ts +5 -3
- package/src/coverage-floor.ts +5 -4
- package/src/db-subscribes.ts +2 -3
- package/src/db-ungeneratable.ts +3 -3
- package/src/dev-lock.ts +1 -1
- package/src/dev-supervisor.ts +1 -1
- package/src/docs-section.ts +2 -2
- package/src/doctor-database.ts +5 -4
- package/src/doctor-offline.ts +5 -2
- package/src/document-styles.ts +1 -1
- package/src/error-contract.ts +160 -32
- package/src/error-unthrown.ts +44 -16
- package/src/exec.ts +3 -2
- package/src/fix-sequence.ts +1 -14
- package/src/flag-reads.ts +4 -1
- package/src/generate-grant-findings.ts +14 -4
- package/src/generate-write.ts +1 -1
- package/src/gh.ts +1 -1
- package/src/guards.ts +2 -2
- package/src/handle-registration.ts +4 -3
- package/src/hold.ts +1 -1
- package/src/i18n-index.ts +1 -1
- package/src/index.ts +5 -1
- package/src/island-capture.ts +1 -1
- package/src/island-harness-route.ts +1 -1
- package/src/island-routes.ts +1 -1
- package/src/island-shot-errors.ts +2 -2
- package/src/job-registration.ts +1 -1
- package/src/live-routes.ts +8 -7
- package/src/mcp-host-shell.ts +1 -1
- package/src/mcp-ui.ts +1 -1
- package/src/measure-paths.ts +1 -1
- package/src/permission-grants.ts +1 -1
- package/src/publish-closure.ts +2 -1
- package/src/role-load.ts +1 -1
- package/src/role-realtime.ts +1 -1
- package/src/runtime-cache.ts +2 -2
- package/src/runtime-storage-boot.ts +2 -2
- package/src/style-routes.ts +1 -1
- package/src/tsconfig-references.ts +1 -1
- package/src/verify-role-load.ts +1 -1
- package/src/worker-bundle.ts +1 -1
- package/src/workspace-checks.ts +11 -7
- package/src/workspace-graph.ts +2 -2
- package/wiki/CLI-Reference.md +3 -3
- package/wiki/N-Plus-One-Detection.md +1 -1
- package/wiki/Queries-And-Live-Queries.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/cli",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.36.0",
|
|
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.36.0",
|
|
57
|
+
"@ultimat3/admin": "31.36.0",
|
|
58
|
+
"@ultimat3/ai": "31.36.0",
|
|
59
|
+
"@ultimat3/auth": "31.36.0",
|
|
60
|
+
"@ultimat3/cache": "31.36.0",
|
|
61
|
+
"@ultimat3/core": "31.36.0",
|
|
62
|
+
"@ultimat3/db": "31.36.0",
|
|
63
|
+
"@ultimat3/entity": "31.36.0",
|
|
64
|
+
"@ultimat3/flags": "31.36.0",
|
|
65
|
+
"@ultimat3/http": "31.36.0",
|
|
66
|
+
"@ultimat3/i18n": "31.36.0",
|
|
67
|
+
"@ultimat3/jobs": "31.36.0",
|
|
68
|
+
"@ultimat3/mail": "31.36.0",
|
|
69
|
+
"@ultimat3/manifest": "31.36.0",
|
|
70
|
+
"@ultimat3/mcp": "31.36.0",
|
|
71
|
+
"@ultimat3/money": "31.36.0",
|
|
72
|
+
"@ultimat3/notify": "31.36.0",
|
|
73
|
+
"@ultimat3/policy": "31.36.0",
|
|
74
|
+
"@ultimat3/pwa": "31.36.0",
|
|
75
|
+
"@ultimat3/query": "31.36.0",
|
|
76
|
+
"@ultimat3/realtime": "31.36.0",
|
|
77
|
+
"@ultimat3/render": "31.36.0",
|
|
78
|
+
"@ultimat3/schema": "31.36.0",
|
|
79
|
+
"@ultimat3/scraping": "31.36.0",
|
|
80
|
+
"@ultimat3/seo": "31.36.0",
|
|
81
|
+
"@ultimat3/storage": "31.36.0",
|
|
82
|
+
"@ultimat3/testing": "31.36.0",
|
|
83
|
+
"@ultimat3/time": "31.36.0",
|
|
84
84
|
"babel-preset-solid": "^1.9.16"
|
|
85
85
|
}
|
|
86
86
|
}
|
package/src/affected.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { execOutput } from './exec';
|
|
|
22
22
|
import type { JsonValue } from './output';
|
|
23
23
|
import type { ParsedArgs } from './parse';
|
|
24
24
|
import { flagBool, flagString } from './parse';
|
|
25
|
+
import { quoteArg } from './shell-quote';
|
|
25
26
|
import type { WorkspaceNode } from './workspace-graph';
|
|
26
27
|
import { readWorkspaceGraph } from './workspace-graph';
|
|
27
28
|
|
|
@@ -274,7 +275,8 @@ export async function changedFiles(
|
|
|
274
275
|
throw new UltimateError({
|
|
275
276
|
code: 'X_CLI_UNEXPECTED',
|
|
276
277
|
cause: `"${failed.command.join(' ')}" exited ${failed.code} in ${options.cwd}: ${singleLine(execOutput(failed))}`,
|
|
277
|
-
|
|
278
|
+
// Every run above is `git(…)`, so its head is always `git`: the fix opens with it and quotes the rest.
|
|
279
|
+
fix: `git -C ${quoteArg(options.cwd)} ${quoteArg(failed.command.slice(1))} # run it yourself to see why`,
|
|
278
280
|
});
|
|
279
281
|
}
|
|
280
282
|
return [...new Set(runs.flatMap((run) => paths(run.stdout)))].sort();
|
package/src/async-pages.ts
CHANGED
|
@@ -17,7 +17,7 @@ export function asyncPageFinding(file: string): Finding {
|
|
|
17
17
|
return {
|
|
18
18
|
code: 'X_ROUTE_ASYNC_PAGE',
|
|
19
19
|
cause: `${file} exports an async Page, so its data read bypasses load's caching and meta`,
|
|
20
|
-
fix: `in ${file}: move each await in Page
|
|
20
|
+
fix: `export const load = (ctx) => … // in ${file}: move each await in Page here, and read it with the page's data prop`,
|
|
21
21
|
at: file,
|
|
22
22
|
};
|
|
23
23
|
}
|
package/src/cdp-shot-errors.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// host it may open, which element it was pointed at, and which key it was asked to press. Their
|
|
6
6
|
// codes and titles are registered with every other CLI code, in `error-codes.ts` — never a second
|
|
7
7
|
// registration here.
|
|
8
|
-
import { renderCauseValue, UltimateError } from '@ultimat3/core';
|
|
8
|
+
import { renderCauseValue, renderFixLiteral, UltimateError } from '@ultimat3/core';
|
|
9
9
|
|
|
10
10
|
/** A navigation to a host the run did not allow. Refused before a byte leaves. */
|
|
11
11
|
export class ShotHostRefusedError extends UltimateError {
|
|
@@ -29,7 +29,7 @@ export class ShotElementMissingError extends UltimateError {
|
|
|
29
29
|
super({
|
|
30
30
|
code: 'X_SHOT_ELEMENT_MISSING',
|
|
31
31
|
cause: `nothing on ${renderCauseValue(input.url)} matched ${renderCauseValue(input.selector)} within ${String(input.timeoutMs)}ms`,
|
|
32
|
-
fix: '
|
|
32
|
+
fix: '{ "route": "<the route>", "selectors": ["main", "button"] } // ui.inspect\'s input: copy a selector it reports with count >= 1',
|
|
33
33
|
meta: { selector: input.selector },
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -45,7 +45,7 @@ export class ShotElementUnreadyError extends UltimateError {
|
|
|
45
45
|
super({
|
|
46
46
|
code: 'X_SHOT_ELEMENT_UNREADY',
|
|
47
47
|
cause: `${renderCauseValue(input.selector)} was still ${renderCauseValue(input.problem)} after ${String(input.timeoutMs)}ms`,
|
|
48
|
-
fix:
|
|
48
|
+
fix: `{ "route": "<the route>", "selectors": [${renderFixLiteral(input.selector, '"<selector>"')}], "a11y": true } // ui.inspect's input: see what covers or disables it, then act on that element first`,
|
|
49
49
|
meta: { selector: input.selector, problem: input.problem },
|
|
50
50
|
});
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ export class ShotKeyInvalidError extends UltimateError {
|
|
|
57
57
|
super({
|
|
58
58
|
code: 'X_SHOT_KEY_INVALID',
|
|
59
59
|
cause: `the key chord ${renderCauseValue(input.chord)} ${input.reason}`,
|
|
60
|
-
fix: "
|
|
60
|
+
fix: "{ press: 'Meta+K' } // modifiers then one key, in the browser's names — or 'Control+Enter', 'Shift+Tab', 'Escape'",
|
|
61
61
|
meta: { chord: input.chord },
|
|
62
62
|
});
|
|
63
63
|
}
|
package/src/cmd-deploy-helm.ts
CHANGED
|
@@ -78,7 +78,7 @@ export async function readReleaseName(root: string, flag: string | undefined): P
|
|
|
78
78
|
: config === undefined
|
|
79
79
|
? `${root} has no app.config.ts, and x deploy --method helm names the release after its config.name`
|
|
80
80
|
: 'app.config.ts exports no config.name, and x deploy --method helm names the release after it',
|
|
81
|
-
fix: '
|
|
81
|
+
fix: 'x deploy --method helm --release my-app --json # names the release explicitly',
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
|
package/src/cmd-env.ts
CHANGED
|
@@ -33,7 +33,7 @@ export class EnvSchemaMissingError extends UltimateError {
|
|
|
33
33
|
super({
|
|
34
34
|
code: 'X_CONFIG_INVALID',
|
|
35
35
|
cause: `x env ${input.subcommand} needs the env declaration, and app.config.ts exports no "envSchema"`,
|
|
36
|
-
fix: "
|
|
36
|
+
fix: "export const envSchema = { DATABASE_URL: { type: 'url', description: 'Postgres connection URL' } } satisfies EnvSchema; export const env = defineEnv(envSchema); // in app.config.ts",
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
}
|
package/src/cmd-mcp.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { msg } from './messages';
|
|
|
27
27
|
import { isAddressInUse } from './metrics-endpoint';
|
|
28
28
|
import type { CommandResult } from './output';
|
|
29
29
|
import { flagString } from './parse';
|
|
30
|
+
import { quoteArg } from './shell-quote';
|
|
30
31
|
|
|
31
32
|
const TRANSPORTS = ['stdio', 'http'] as const;
|
|
32
33
|
type Transport = (typeof TRANSPORTS)[number];
|
|
@@ -61,12 +62,13 @@ async function catalog(host: CliMcpServer): Promise<CommandResult> {
|
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
/** `endpoint` is where this server IS reached, as `mcpHostRefused` is handed it. */
|
|
66
|
+
const notFound = (endpoint: string): Response =>
|
|
65
67
|
new Response(
|
|
66
68
|
JSON.stringify({
|
|
67
69
|
code: 'X_MCP_PROTOCOL',
|
|
68
70
|
cause: 'the MCP server answers exactly one route',
|
|
69
|
-
fix: `POST ${
|
|
71
|
+
fix: `curl -sS -X POST ${quoteArg(endpoint)} -H 'authorization: Bearer <the token x mcp serve printed>' -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'`,
|
|
70
72
|
}),
|
|
71
73
|
{ status: 404, headers: { 'content-type': 'application/json' } },
|
|
72
74
|
);
|
|
@@ -128,7 +130,7 @@ export async function startMcpHttp(host: CliMcpServer, port: number): Promise<Mc
|
|
|
128
130
|
// Before anything else, as `/_x` does: this server serves this machine, and a rebound name
|
|
129
131
|
// reaches it with a Host and an Origin that agree, which no Origin rule can tell apart.
|
|
130
132
|
if (!isLoopbackHostname(url.hostname)) return mcpHostRefused(endpoint);
|
|
131
|
-
if (url.pathname !== route.path) return notFound(
|
|
133
|
+
if (url.pathname !== route.path) return notFound(endpoint);
|
|
132
134
|
// `@ultimat3/http`'s own 405, the one the pipeline answers on an app's mounted `/mcp`.
|
|
133
135
|
if (request.method !== route.method) {
|
|
134
136
|
return jsonResponse(toProblem(methodNotAllowed(request.method, route.path, ['POST'])), {
|
package/src/coverage-floor.ts
CHANGED
|
@@ -244,7 +244,7 @@ export function coverageFindings(
|
|
|
244
244
|
{
|
|
245
245
|
code: 'X_COVERAGE_FLOOR_UNSTATED',
|
|
246
246
|
cause: `${FLOOR_FILE} states no coverage floor; the unit suite covers ${measured} of this app's own source (${String(measure.files)} files, one no test loads counted at 0%)`,
|
|
247
|
-
fix: `
|
|
247
|
+
fix: `{ ${floorLine(measure)} } // in ${FLOOR_FILE}, beside its other keys`,
|
|
248
248
|
docs: ERROR_DOCS_URL,
|
|
249
249
|
at: FLOOR_FILE,
|
|
250
250
|
},
|
|
@@ -257,7 +257,7 @@ export function coverageFindings(
|
|
|
257
257
|
findings.push({
|
|
258
258
|
code: 'X_COVERAGE_FLOOR_UNSTATED',
|
|
259
259
|
cause: `${FLOOR_FILE} states a coverage floor of ${stated}, under the ${String(COVERAGE_BAR)}% bar, and no reason for it`,
|
|
260
|
-
fix: `
|
|
260
|
+
fix: `{ "${COVERAGE_FIELD}": { "why": "${WHY_PLACEHOLDER}" } } // in ${FLOOR_FILE}, beside its numbers — or raise both numbers to ${String(COVERAGE_BAR)}`,
|
|
261
261
|
docs: ERROR_DOCS_URL,
|
|
262
262
|
at: FLOOR_FILE,
|
|
263
263
|
});
|
|
@@ -282,7 +282,8 @@ export function coverageFindings(
|
|
|
282
282
|
: options.exists(test)
|
|
283
283
|
? // Quoted: a route directory is `[id]`, which a shell reads as a glob.
|
|
284
284
|
`bun test --coverage ${quoteArg(test)}`
|
|
285
|
-
:
|
|
285
|
+
: // Line 1 is real: the file does not exist yet, so the edit starts it.
|
|
286
|
+
`edit ${test}:1 — no test sits beside ${first?.file ?? test}; write one that fails when the source is broken, then: bun test --coverage ${quoteArg(test)}`,
|
|
286
287
|
docs: ERROR_DOCS_URL,
|
|
287
288
|
...(first === undefined ? {} : { at: first.file }),
|
|
288
289
|
});
|
|
@@ -297,7 +298,7 @@ export function coverageFindings(
|
|
|
297
298
|
findings.push({
|
|
298
299
|
code: 'X_COVERAGE_FLOOR_STALE',
|
|
299
300
|
cause: `the unit suite now covers ${measured}, more than ${String(FLOOR_SLACK)} points over the floor of ${stated} in ${FLOOR_FILE} — the floor only rises`,
|
|
300
|
-
fix: `
|
|
301
|
+
fix: `{ "${COVERAGE_FIELD}": { "lines": ${String(lines)}, "funcs": ${String(funcs)} } } // in ${FLOOR_FILE}, set inside "${COVERAGE_FIELD}"${cleared ? ', and delete its "why"' : ''}`,
|
|
301
302
|
docs: ERROR_DOCS_URL,
|
|
302
303
|
at: FLOOR_FILE,
|
|
303
304
|
});
|
package/src/db-subscribes.ts
CHANGED
|
@@ -45,9 +45,8 @@ export class QuerySubscribesUnknownError extends UltimateError {
|
|
|
45
45
|
`the query "${input.query}" declares subscribes: ["${input.table}"] and no entity ` +
|
|
46
46
|
'declares a table with that name',
|
|
47
47
|
fix:
|
|
48
|
-
|
|
49
|
-
`(${offer(input.tables)})
|
|
50
|
-
'name no table has can never match what the read selects from (X_QUERY_SUBSCRIBES_DRIFT)',
|
|
48
|
+
// One literal: the scan reads each piece of a `+` chain as its own fix line.
|
|
49
|
+
`subscribes: ['<table>'] // on the query "${input.query}", a table this app declares (${offer(input.tables)}) — or drop the name, then x db gen "fix subscribes" --json; a name no table has can never match what the read selects from (X_QUERY_SUBSCRIBES_DRIFT)`,
|
|
51
50
|
meta: { query: input.query, table: input.table },
|
|
52
51
|
});
|
|
53
52
|
}
|
package/src/db-ungeneratable.ts
CHANGED
|
@@ -86,9 +86,9 @@ export class MigrationUngeneratableError extends UltimateError {
|
|
|
86
86
|
`${input.file} holds ${found} statement${found === 1 ? '' : 's'} x db gen could not have ` +
|
|
87
87
|
`written and declares ${input.declared}${first}`,
|
|
88
88
|
fix:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
// Line 1 is real: the header is whatever precedes the first statement, so it may open there.
|
|
90
|
+
// One literal: the scan reads each piece of a `+` chain as its own fix line.
|
|
91
|
+
`edit ${input.file}:1 — add the header line "${ungeneratableMarker(found)}", so a squash carries these statements by hand — or re-declare what an entity can express (an enum is a text column plus a check invariant) and regenerate: x db gen "<name>"`,
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}
|
package/src/dev-lock.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class DevAlreadyRunningError extends UltimateError {
|
|
|
130
130
|
code: 'X_DEV_ALREADY_RUNNING',
|
|
131
131
|
cause: `pid ${input.lock.pid} is already running x dev on ${input.lock.url} and holds ${input.stateDir}${single}`,
|
|
132
132
|
// `x stop`, not `kill <pid>`: a kill returns before the drain ends and the next boot refuses.
|
|
133
|
-
fix: `use the one already running at ${input.lock.url}
|
|
133
|
+
fix: `x stop --json # or use the one already running at ${input.lock.url}`,
|
|
134
134
|
meta: { pid: input.lock.pid, port: input.lock.port, stateDir: input.stateDir },
|
|
135
135
|
});
|
|
136
136
|
}
|
package/src/dev-supervisor.ts
CHANGED
|
@@ -232,7 +232,7 @@ export function restartFinding(root: string, pins: readonly StalePin[]): Finding
|
|
|
232
232
|
return {
|
|
233
233
|
code: 'X_DEV_RESTART_REQUIRED',
|
|
234
234
|
cause: `${restartReason(root, pins)} — a module that defines a primitive still holds the code before the save, and re-importing it would register a second definition`,
|
|
235
|
-
fix: '
|
|
235
|
+
fix: 'x stop --json && x dev # restart it — a supervised `x dev` restarts itself; an embedded startDev() passes onRestart',
|
|
236
236
|
at: first === undefined ? '' : posixRelative(root, first.pinned),
|
|
237
237
|
};
|
|
238
238
|
}
|
package/src/docs-section.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// why: Bun ships no path module; the page is joined onto the wiki directory the CLI resolved.
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
-
import { wikiSection } from '@ultimat3/manifest';
|
|
7
|
+
import { isErrorCodesPage, wikiSection } from '@ultimat3/manifest';
|
|
8
8
|
import type { WikiSource } from './docs-sources';
|
|
9
9
|
import { msg } from './messages';
|
|
10
10
|
import type { CommandResult } from './output';
|
|
@@ -35,7 +35,7 @@ export async function sectionResult(
|
|
|
35
35
|
topic: WikiTopic,
|
|
36
36
|
query: string,
|
|
37
37
|
): Promise<CommandResult | undefined> {
|
|
38
|
-
if (topic.page
|
|
38
|
+
if (isErrorCodesPage(topic.page)) return undefined;
|
|
39
39
|
const file = Bun.file(join(wiki.dir, `${topic.page}.md`));
|
|
40
40
|
if (!(await file.exists())) return undefined;
|
|
41
41
|
const text = wikiSection(await file.text(), topic.anchor);
|
package/src/doctor-database.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { dirname, join, resolve, sep } from 'node:path';
|
|
7
7
|
import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
8
|
-
import { checkDb, PGLITE_FIX, PGLITE_MISSING, postgresClient } from '@ultimat3/db';
|
|
8
|
+
import { checkDb, dbUnavailable, PGLITE_FIX, PGLITE_MISSING, postgresClient } from '@ultimat3/db';
|
|
9
9
|
import type { Finding } from './output';
|
|
10
10
|
import { findingFrom } from './output';
|
|
11
11
|
|
|
@@ -111,9 +111,10 @@ export async function probeDatabase(
|
|
|
111
111
|
return finding(
|
|
112
112
|
'X_DB_UNAVAILABLE',
|
|
113
113
|
`DATABASE_URL does not answer \`select 1\`: ${report.error ?? 'no reason reported'}`,
|
|
114
|
-
// `dbUnavailable`'s own
|
|
115
|
-
// answers to "what do I do", and this one is reached first, before any command opens a
|
|
116
|
-
|
|
114
|
+
// `dbUnavailable`'s own fix, read off it rather than copied: a second wording for one condition
|
|
115
|
+
// is two answers to "what do I do", and this one is reached first, before any command opens a
|
|
116
|
+
// pool. A copy drifted once already.
|
|
117
|
+
dbUnavailable('').fix,
|
|
117
118
|
);
|
|
118
119
|
} finally {
|
|
119
120
|
await client.close();
|
package/src/doctor-offline.ts
CHANGED
|
@@ -90,7 +90,7 @@ export function offlineFallbackFinding(fact: OfflineFallbackFact): Finding | und
|
|
|
90
90
|
if (fallback === null) {
|
|
91
91
|
return finding(
|
|
92
92
|
'no pwa.offline.fallback is declared, so no service worker is emitted and an offline navigation falls back to the browser error page',
|
|
93
|
-
`
|
|
93
|
+
`pwa: { offline: { fallback: '/offline' } } // in ${APP_CONFIG_FILE}`,
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
if (fact.routes.some((route) => route.path === fallback && NAVIGABLE.has(route.surface))) {
|
|
@@ -99,7 +99,10 @@ export function offlineFallbackFinding(fact: OfflineFallbackFact): Finding | und
|
|
|
99
99
|
const cause = `pwa.offline.fallback is "${fallback}" and no site/ route serves it, so an offline navigation falls back to the browser error page`;
|
|
100
100
|
const name = GENERATABLE.exec(fallback)?.[1];
|
|
101
101
|
return name === undefined
|
|
102
|
-
? finding(
|
|
102
|
+
? finding(
|
|
103
|
+
cause,
|
|
104
|
+
`pwa: { offline: { fallback: '<a path a site/ route serves>' } } // in ${APP_CONFIG_FILE}`,
|
|
105
|
+
)
|
|
103
106
|
: finding(cause, `x g route ${quoteArg(name)} --surface site`);
|
|
104
107
|
}
|
|
105
108
|
|
package/src/document-styles.ts
CHANGED
|
@@ -49,7 +49,7 @@ export function checkDocumentStyles(documents: readonly SurfaceDocument[]): read
|
|
|
49
49
|
.map((document) => ({
|
|
50
50
|
code: 'X_STYLES_GLOBAL_MISSING',
|
|
51
51
|
cause: `a ${document.surface}/ document carries ${document.css.length} characters of CSS and defines no :root custom properties, so every var(--color-*) and var(--space-*) in it resolves to nothing`,
|
|
52
|
-
fix: `
|
|
52
|
+
fix: `import './global.scss'; // as apps/web/${APP_GLOBAL_MODULE}, beside apps/web/${APP_GLOBAL_STYLESHEET} holding @use '@ultimat3/ui/global.scss';`,
|
|
53
53
|
docs: ERROR_DOCS_URL,
|
|
54
54
|
at: `apps/web/${APP_GLOBAL_STYLESHEET}`,
|
|
55
55
|
}));
|