@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
|
@@ -21,7 +21,7 @@ export class IslandStatesFileEmptyError extends UltimateError {
|
|
|
21
21
|
super({
|
|
22
22
|
code: 'X_SHOT_ISLAND_STATES_EMPTY',
|
|
23
23
|
cause: `${renderCauseValue(input.file)} exports no defineIslandStates() result, so it declares no picture`,
|
|
24
|
-
fix: `
|
|
24
|
+
fix: `export const states = defineIslandStates({ island: '…', states: [...] }) // in ${renderFixLiteral(input.file, STATES_PLACEHOLDER)}`,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -66,7 +66,7 @@ export class IslandRequestUnstubbedError extends UltimateError {
|
|
|
66
66
|
super({
|
|
67
67
|
code: 'X_SHOT_ISLAND_UNSTUBBED_REQUEST',
|
|
68
68
|
cause: `${input.island} in state ${renderCauseValue(input.state)} made ${input.requests.length} request(s) no stub answers: ${input.requests.join(', ')}`,
|
|
69
|
-
fix: `
|
|
69
|
+
fix: `routes: [{ match: ${renderFixLiteral(input.requests[0], "'GET /api/x'")}, respond: { kind: 'json', body: {} } }] // on that state, in ${renderFixLiteral(input.statesFile, STATES_PLACEHOLDER)}`,
|
|
70
70
|
meta: { island: input.island, state: input.state, requests: [...input.requests] },
|
|
71
71
|
});
|
|
72
72
|
}
|
package/src/job-registration.ts
CHANGED
|
@@ -29,7 +29,7 @@ export function unregisteredJobFinding(name: string): Finding {
|
|
|
29
29
|
return {
|
|
30
30
|
code: 'X_JOB_UNREGISTERED',
|
|
31
31
|
cause: `${name} is a ${kind === 'tasks' ? 'task' : 'job'} no defineApi() call names, so it carries the positional name ${kind === 'tasks' ? 'task()' : 'job()'} minted — on the queue row, in the manifest and in every dead-letter trace, and it moves when the import order does`,
|
|
32
|
-
fix: `
|
|
32
|
+
fix: `import * as <module> from '<its file>'; // in apps/web/api/index.ts, and <module> added to ${kind}: [...] there — then x manifest`,
|
|
33
33
|
at: 'apps/web/api/index.ts',
|
|
34
34
|
};
|
|
35
35
|
}
|
package/src/live-routes.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type { RouteEntry } from '@ultimat3/render';
|
|
|
14
14
|
import { ISLAND_EXTENSION, routeEntries } from '@ultimat3/render';
|
|
15
15
|
import { discoverIslands } from './island-bundle';
|
|
16
16
|
import type { Finding } from './output';
|
|
17
|
+
import { quoteArg } from './shell-quote';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* The exports that only work in a booted browser page: each one reads the page's store, its socket
|
|
@@ -161,12 +162,6 @@ export interface LiveRouteGap extends LiveReach {
|
|
|
161
162
|
readonly islands: readonly string[];
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
/** The `x g island` invocation that fixes it, built from this route's own file — never a placeholder. */
|
|
165
|
-
const generatorFor = (file: string): string => {
|
|
166
|
-
const dir = posix.dirname(file);
|
|
167
|
-
return `x g island ${posix.basename(dir)} --at ${dir}`;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
165
|
/**
|
|
171
166
|
* Every browser-only read a route's SERVER graph holds that no browser will ever run. A page's
|
|
172
167
|
* imports are server-rendered — an island is reached by a `src` string, never an import — so a
|
|
@@ -199,6 +194,12 @@ export async function liveRouteGaps(
|
|
|
199
194
|
return gaps;
|
|
200
195
|
}
|
|
201
196
|
|
|
197
|
+
/**
|
|
198
|
+
* The `x g island` invocation that fixes it, built from this route's own file — never a
|
|
199
|
+
* placeholder. Each value quoted where it is spliced, so the shell-arg scan can see it.
|
|
200
|
+
*/
|
|
201
|
+
const dirOf = (gap: LiveRouteGap): string => posix.dirname(gap.file);
|
|
202
|
+
|
|
202
203
|
export const liveRouteFindingFor = (gap: LiveRouteGap): Finding => ({
|
|
203
204
|
code: 'X_LIVE_ROUTE_NO_ISLAND',
|
|
204
205
|
cause:
|
|
@@ -206,7 +207,7 @@ export const liveRouteFindingFor = (gap: LiveRouteGap): Finding => ({
|
|
|
206
207
|
(gap.hydrate === 'never' ? `sits on a route declaring hydrate: 'never'` : 'no island imports') +
|
|
207
208
|
' — so it only ever runs on the server, where it answers its server state (nothing, or loading) forever, at 200',
|
|
208
209
|
fix:
|
|
209
|
-
`
|
|
210
|
+
`x g island ${quoteArg(posix.basename(dirOf(gap)))} --at ${quoteArg(dirOf(gap))} # moves it into an island: import ${gap.at} from that island's mount(), and declare it with island({ src: './${posix.basename(posix.dirname(gap.file))}${ISLAND_EXTENSION}' }) in ${gap.file}` +
|
|
210
211
|
(gap.hydrate === 'never' ? `, with a hydrate other than 'never'` : ''),
|
|
211
212
|
docs: ERROR_DOCS_URL,
|
|
212
213
|
at: gap.at,
|
package/src/mcp-host-shell.ts
CHANGED
|
@@ -54,7 +54,7 @@ export function testRunArgs(filter: string | undefined): readonly string[] {
|
|
|
54
54
|
flag: 'filter',
|
|
55
55
|
command: 'mcp serve',
|
|
56
56
|
reason: `test.run's filter "${filter}" starts with "-", which x test would read as its own flag`,
|
|
57
|
-
fix: '
|
|
57
|
+
fix: '{ "filter": "packages/cli/src" } // test.run\'s input: a path filter, or no filter at all',
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
return ['test', '--filter', filter];
|
package/src/mcp-ui.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function assertBudgetedRoute(raw: string, declared: readonly DeclaredRout
|
|
|
73
73
|
throw new UltimateError({
|
|
74
74
|
code: 'X_UI_SHOT_ROUTE_UNBUDGETED',
|
|
75
75
|
cause: `${hit.file} declares no budget.js, so x verify would refuse it as X_BUDGET_UNMEASURED — a picture of it would be a picture of a draft`,
|
|
76
|
-
fix: `
|
|
76
|
+
fix: `budget: { js: '<n>kb' } // in ${hit.file}, then: x build --target static --json && x verify --only budgets --json`,
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
return route;
|
package/src/measure-paths.ts
CHANGED
|
@@ -44,7 +44,7 @@ export function paramsUndeclared(entry: RouteEntry, listed: boolean): Unmeasured
|
|
|
44
44
|
reason: cause,
|
|
45
45
|
code: 'X_BUDGET_PARAMS_UNDECLARED',
|
|
46
46
|
cause,
|
|
47
|
-
fix: `
|
|
47
|
+
fix: `prerender: () => [{ ${example} }] // on defineRoute in ${quoteArg(entry.file)}, then x build --target static`,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
|
package/src/permission-grants.ts
CHANGED
|
@@ -112,7 +112,7 @@ export function ungrantedFinding(rule: UngrantedRequirement, rolesAt: string | u
|
|
|
112
112
|
const finding: Finding = {
|
|
113
113
|
code: 'X_PERMISSION_UNGRANTED',
|
|
114
114
|
cause: `${rule.by} requires ${quoteArg(rule.permission)}, and no role in the app's role map grants it — no actor a role mints can ever pass`,
|
|
115
|
-
fix: `
|
|
115
|
+
fix: `grants: [..., '${rule.permission}'] // one role's, in ${where} — then x verify --only policy`,
|
|
116
116
|
};
|
|
117
117
|
return rolesAt === undefined ? finding : { ...finding, at: rolesAt };
|
|
118
118
|
}
|
package/src/publish-closure.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ERROR_DOCS_URL } from '@ultimat3/core';
|
|
|
7
7
|
import type { ClosureHost } from './import-closure';
|
|
8
8
|
import { importClosure } from './import-closure';
|
|
9
9
|
import type { Finding } from './output';
|
|
10
|
+
import { quoteArg } from './shell-quote';
|
|
10
11
|
|
|
11
12
|
/** The suffix `FIXTURE_EXCLUSION` removes from a tarball. */
|
|
12
13
|
export const FIXTURE_SUFFIX = '-fixture.ts';
|
|
@@ -95,7 +96,7 @@ export const fixtureReachFinding = (
|
|
|
95
96
|
): Finding => ({
|
|
96
97
|
code: 'X_PACKAGE_SHAPE',
|
|
97
98
|
cause: `packages/${dir}/${fixture} is loaded from the package's entry points (${entries.join(', ')}), and "files" leaves every *${FIXTURE_SUFFIX} out of the tarball — the published package would fail on import`,
|
|
98
|
-
fix: `
|
|
99
|
+
fix: `git mv ${quoteArg(`packages/${dir}/${fixture}`)} ${quoteArg(`packages/${dir}/${fixture.slice(0, -FIXTURE_SUFFIX.length)}-support.ts`)} # any name not ending in ${FIXTURE_SUFFIX}: it is shipped source, not test code — then update the imports that name it`,
|
|
99
100
|
docs: ERROR_DOCS_URL,
|
|
100
101
|
at: `packages/${dir}/${fixture}`,
|
|
101
102
|
});
|
package/src/role-load.ts
CHANGED
|
@@ -54,7 +54,7 @@ export class RoleLoadIncompleteError extends UltimateError {
|
|
|
54
54
|
super({
|
|
55
55
|
code: 'X_ROLE_LOAD_INCOMPLETE',
|
|
56
56
|
cause: `the ${input.role} role imported ${API_INDEX} and every module that reaches no component or stylesheet, and ${MANIFEST_FILE} names ${String(input.missing.length)} job(s) or task(s) that load did not register (${input.missing.join(', ')}), so the whole app was imported instead`,
|
|
57
|
-
fix: `
|
|
57
|
+
fix: `import * as <module> from '<the file that declares it>'; // in ${API_INDEX}, with <module> in jobs: [...] or tasks: [...] — then x manifest`,
|
|
58
58
|
meta: { role: input.role, missing: input.missing },
|
|
59
59
|
});
|
|
60
60
|
}
|
package/src/role-realtime.ts
CHANGED
|
@@ -32,7 +32,7 @@ export function rolesUnderRealtime(
|
|
|
32
32
|
throw new ConfigInvalidError({
|
|
33
33
|
cause: `role ${dropped.join(',')} was asked for and realtime.enabled is false in app.config.ts, so this process would serve nothing`,
|
|
34
34
|
fix: dev
|
|
35
|
-
? '
|
|
35
|
+
? 'realtime: { enabled: true } // in app.config.ts — or run a role that is not realtime: x dev --role web,worker,scheduler'
|
|
36
36
|
: 'ROLE=web bun apps/web/server.ts — a role that is not realtime; or set realtime: { enabled: true } in app.config.ts and rebuild the image, or drop the role from the deploy (the chart: roles.<role>.enabled: false in values.yaml)',
|
|
37
37
|
meta: { key: 'realtime.enabled', roles: dropped },
|
|
38
38
|
});
|
package/src/runtime-cache.ts
CHANGED
|
@@ -166,7 +166,7 @@ function buildTier(name: CacheTierName, options: CacheTiersOptions): CacheTier {
|
|
|
166
166
|
driver: 'redis',
|
|
167
167
|
cause:
|
|
168
168
|
'cache.tiers names it and REDIS_URL (or VALKEY_URL) is unset, so this process would read a per-process ladder while the config declares a shared one',
|
|
169
|
-
fix: '
|
|
169
|
+
fix: 'REDIS_URL=redis://localhost:6379 # in .env — or drop the redis tier from cache.tiers in app.config.ts',
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
return redisTier({ client: lazyRedis(source.url, options.redisClient ?? redisClient) });
|
|
@@ -180,7 +180,7 @@ function buildTier(name: CacheTierName, options: CacheTiersOptions): CacheTier {
|
|
|
180
180
|
driver: 'cdn',
|
|
181
181
|
cause:
|
|
182
182
|
'cache.tiers names it and no CDN credential is set, so every invalidation report would claim keys an edge that does not exist had accepted',
|
|
183
|
-
fix: '
|
|
183
|
+
fix: "FASTLY_API_TOKEN='<token>' FASTLY_SERVICE_ID='<service id>' # in .env — or CLOUDFLARE_API_TOKEN and CLOUDFLARE_ZONE_ID, or drop the cdn tier from cache.tiers in app.config.ts",
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
return cdnTier({ purge: options.purge });
|
|
@@ -86,7 +86,7 @@ export function startStorage(services: DevServices, env: Env, override?: Storage
|
|
|
86
86
|
if (bucket === '') {
|
|
87
87
|
throw new StorageUnwritableError(
|
|
88
88
|
`S3_ENDPOINT is set to ${binding.url} but S3_BUCKET is empty, so there is no disk to write to`,
|
|
89
|
-
'
|
|
89
|
+
"S3_BUCKET='<bucket>' # the bucket name, in the env — or unset S3_ENDPOINT to use the embedded disk",
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
return bootDefine({
|
|
@@ -133,7 +133,7 @@ export function startStorage(services: DevServices, env: Env, override?: Storage
|
|
|
133
133
|
const detail = renderThrowable(cause);
|
|
134
134
|
throw new StorageUnwritableError(
|
|
135
135
|
`the embedded storage disk needs ${root} and it could not be created: ${detail}`,
|
|
136
|
-
`mount a writable volume at ${root}
|
|
136
|
+
`S3_ENDPOINT='<url>' S3_BUCKET='<bucket>' # object storage instead — or mount a writable volume at ${root}`,
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
// The guard three lines up reads `env`; so must the disk it guards. Otherwise the boot's
|
package/src/style-routes.ts
CHANGED
|
@@ -41,7 +41,7 @@ export function styleRoutes(source: StyleSource): readonly Route[] {
|
|
|
41
41
|
cause: `no surface stylesheet is registered at ${request.pathname} — the document that asked for it was rendered against an older build`,
|
|
42
42
|
// No `x` citation, for `island-routes.ts`' reason: this route is mounted in
|
|
43
43
|
// exactly two places (`cmd-dev.ts`, `serve.ts`) and neither reads `.x/static`.
|
|
44
|
-
fix: 'reload the
|
|
44
|
+
fix: 'location.reload() // in the browser — this process serves only the stylesheet its own modules registered, and the document holding this URL came from an earlier build',
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
{ status: 404 },
|
|
@@ -80,7 +80,7 @@ async function referencedPaths(root: string): Promise<ReadonlySet<string> | unde
|
|
|
80
80
|
export const unreferencedFinding = (dir: string): Finding => ({
|
|
81
81
|
code: 'X_PACKAGE_UNREFERENCED',
|
|
82
82
|
cause: `packages/${dir} is a published workspace and ${ROOT_TSCONFIG} has no reference to it, so tsc -b never builds it`,
|
|
83
|
-
fix: `
|
|
83
|
+
fix: `{ "path": "./packages/${dir}" } // in "references" of ${ROOT_TSCONFIG}, then: bunx tsc -b --pretty false`,
|
|
84
84
|
docs: ERROR_DOCS_URL,
|
|
85
85
|
at: ROOT_TSCONFIG,
|
|
86
86
|
});
|
package/src/verify-role-load.ts
CHANGED
|
@@ -99,7 +99,7 @@ export function roleLoadFinding(missing: MissingRegistration): Finding {
|
|
|
99
99
|
return {
|
|
100
100
|
code: 'X_ROLE_LOAD_INCOMPLETE',
|
|
101
101
|
cause: `${missing.kind} ${JSON.stringify(missing.name)} is registered by importing ${missing.module}, which reaches a component or a stylesheet and which ${API_INDEX} does not import — so a worker and a scheduler, which import no document, run without it`,
|
|
102
|
-
fix: `
|
|
102
|
+
fix: `import '${specifierFor(missing.module)}'; // in ${API_INDEX} — or move the ${missing.kind} out of ${missing.module} into a module that imports no .tsx and no stylesheet`,
|
|
103
103
|
docs: ERROR_DOCS_URL,
|
|
104
104
|
at: missing.module,
|
|
105
105
|
};
|
package/src/worker-bundle.ts
CHANGED
|
@@ -216,7 +216,7 @@ function scriptRoute(
|
|
|
216
216
|
error: {
|
|
217
217
|
code: 'X_ROUTE_NOT_FOUND',
|
|
218
218
|
cause: `no ${what} is built at ${request.pathname} — the document that named it was rendered against another build`,
|
|
219
|
-
fix: `reload the
|
|
219
|
+
fix: `location.reload() // in the browser — this process serves only the ${what} it built`,
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
{ status: 404 },
|
package/src/workspace-checks.ts
CHANGED
|
@@ -102,7 +102,7 @@ export const missingFileFinding = (dir: string, file: string, scaffolder: boolea
|
|
|
102
102
|
cause: `packages/${dir} has no ${file}`,
|
|
103
103
|
fix: scaffolder
|
|
104
104
|
? `bun run scripts/new-package.ts ${quoteArg(dir)} --only ${quoteArg(file)}`
|
|
105
|
-
: `add packages/${dir}/${file}
|
|
105
|
+
: `ls packages/*/${quoteArg(file)} # a sibling's: add packages/${dir}/${file} shaped like it`,
|
|
106
106
|
docs: ERROR_DOCS_URL,
|
|
107
107
|
at: `packages/${dir}/${file}`,
|
|
108
108
|
});
|
|
@@ -121,7 +121,7 @@ export const badVersionFinding = (dir: string, found: unknown): Finding => ({
|
|
|
121
121
|
// Bare `JSON.stringify` throws on a bigint and a cycle and runs any `toJSON`, which would replace
|
|
122
122
|
// this finding with a TypeError from inside the gate.
|
|
123
123
|
cause: `packages/${dir}/package.json has no semver "version" (found ${renderCauseValue(found)})`,
|
|
124
|
-
fix: `
|
|
124
|
+
fix: `{ "version": "0.0.0" } // a semver one, in packages/${dir}/package.json — then: bun run verify`,
|
|
125
125
|
docs: ERROR_DOCS_URL,
|
|
126
126
|
at: `packages/${dir}/package.json`,
|
|
127
127
|
});
|
|
@@ -227,10 +227,14 @@ export const FIXTURE_EXCLUSION = '!src/**/*-fixture.ts';
|
|
|
227
227
|
/** Every exclusion a published package's `files` carries, in the order it is written. */
|
|
228
228
|
export const TEST_CODE_EXCLUSIONS: readonly string[] = [TEST_EXCLUSION, FIXTURE_EXCLUSION];
|
|
229
229
|
|
|
230
|
-
export const missingPublishedFileFinding = (
|
|
230
|
+
export const missingPublishedFileFinding = (
|
|
231
|
+
dir: string,
|
|
232
|
+
entry: string,
|
|
233
|
+
files: readonly string[],
|
|
234
|
+
): Finding => ({
|
|
231
235
|
code: 'X_PACKAGE_SHAPE',
|
|
232
236
|
cause: `packages/${dir}/package.json ships "${entry}" in "files", but packages/${dir}/${entry} does not exist`,
|
|
233
|
-
fix: `
|
|
237
|
+
fix: `{ "files": ${JSON.stringify(files.filter((kept) => kept !== entry))} } // in packages/${dir}/package.json, "${entry}" dropped — or add packages/${dir}/${entry}`,
|
|
234
238
|
docs: ERROR_DOCS_URL,
|
|
235
239
|
at: `packages/${dir}/package.json`,
|
|
236
240
|
});
|
|
@@ -238,7 +242,7 @@ export const missingPublishedFileFinding = (dir: string, entry: string): Finding
|
|
|
238
242
|
export const publishesTestsFinding = (dir: string, exclusion: string): Finding => ({
|
|
239
243
|
code: 'X_PACKAGE_SHAPE',
|
|
240
244
|
cause: `packages/${dir}/package.json does not exclude ${exclusion} from "files"`,
|
|
241
|
-
fix: `
|
|
245
|
+
fix: `{ "files": ["src", "${exclusion}", …] } // in packages/${dir}/package.json — "${exclusion}" after "src"`,
|
|
242
246
|
docs: ERROR_DOCS_URL,
|
|
243
247
|
at: `packages/${dir}/package.json`,
|
|
244
248
|
});
|
|
@@ -272,7 +276,7 @@ export const buildArtifactsFinding = (dir: string, count: number): Finding => ({
|
|
|
272
276
|
export const noFilesAllowlistFinding = (dir: string): Finding => ({
|
|
273
277
|
code: 'X_PACKAGE_SHAPE',
|
|
274
278
|
cause: `packages/${dir}/package.json publishes with no "files" allowlist, so the tarball carries whatever is in the directory`,
|
|
275
|
-
fix: `
|
|
279
|
+
fix: `{ "files": ["src", ${TEST_CODE_EXCLUSIONS.map((entry) => `"${entry}"`).join(', ')}, "README.md", "LICENSE"] } // in packages/${dir}/package.json`,
|
|
276
280
|
docs: ERROR_DOCS_URL,
|
|
277
281
|
at: `packages/${dir}/package.json`,
|
|
278
282
|
});
|
|
@@ -306,7 +310,7 @@ export function checkPublishShape(root: string, manifests: readonly ManifestFact
|
|
|
306
310
|
// A negation removes files; only a positive literal can promise one that is not there.
|
|
307
311
|
if (entry.startsWith('!') || /[*?[\]]/.test(entry)) continue;
|
|
308
312
|
if (existsSync(join(root, 'packages', manifest.dir, entry))) continue;
|
|
309
|
-
findings.push(missingPublishedFileFinding(manifest.dir, entry));
|
|
313
|
+
findings.push(missingPublishedFileFinding(manifest.dir, entry, manifest.files));
|
|
310
314
|
}
|
|
311
315
|
for (const exclusion of TEST_CODE_EXCLUSIONS) {
|
|
312
316
|
if (!manifest.files.includes(exclusion)) {
|
package/src/workspace-graph.ts
CHANGED
|
@@ -185,7 +185,7 @@ export function importedPackages(source: string, path = 'source.ts'): readonly s
|
|
|
185
185
|
export const unreadableWorkspaceFinding = (path: string): Finding => ({
|
|
186
186
|
code: 'X_APP_PACKAGE_INVALID',
|
|
187
187
|
cause: `${path} is claimed by the root "workspaces" globs and supplies no readable "name"`,
|
|
188
|
-
fix: `repair the JSON and the "name"
|
|
188
|
+
fix: `bun --print ${quoteArg(`JSON.parse(await Bun.file(${JSON.stringify(path)}).text()).name`)} # must print its name: repair the JSON and the "name" until it does — or drop its directory from "workspaces" in package.json`,
|
|
189
189
|
docs: ERROR_DOCS_URL,
|
|
190
190
|
at: path,
|
|
191
191
|
});
|
|
@@ -199,7 +199,7 @@ export const undeclaredWorkspaceDepFinding = (
|
|
|
199
199
|
cause: `${at} imports ${to.name}, which ${from.dir}/package.json does not declare`,
|
|
200
200
|
// The exact line to paste, at the version the target really carries: a `workspace:*` range would
|
|
201
201
|
// resolve and then fail `checkLockstep`, which compares a sibling pin against the version.
|
|
202
|
-
fix: `
|
|
202
|
+
fix: `{ "${at.endsWith(FIXTURE_SUFFIX) ? 'devDependencies' : 'dependencies'}": { "${to.name}": "${to.version ?? '0.0.0'}" } } // merge into ${from.dir}/package.json`,
|
|
203
203
|
docs: ERROR_DOCS_URL,
|
|
204
204
|
at: `${from.dir}/package.json`,
|
|
205
205
|
});
|
package/wiki/CLI-Reference.md
CHANGED
|
@@ -634,7 +634,7 @@ Errors, seed: `X_DECLARATION_UNKNOWN` (no seed of that name — the cause lists
|
|
|
634
634
|
|
|
635
635
|
Errors, schema: `X_DB_DRIFT`, `X_SCHEMA_DUMP_DRIFT`, `X_DB_GEN_FAILED`, `X_DB_MIGRATE_FAILED`, `X_DB_BRANCH_FAILED`, `X_MIGRATION_CONFLICT`, `X_MIGRATION_IRREVERSIBLE`, `X_MIGRATION_VIEW_DEPENDS`, `X_MIGRATE_CONCURRENT`, `X_NOT_IMPLEMENTED`. `X_DB_STUDIO_FAILED` is reserved and no longer thrown — `studio` left `x db` `As of 2026-11-15` ([Known gaps](Known-Gaps#open-by-decision)).
|
|
636
636
|
|
|
637
|
-
Errors, backfill: `X_BACKFILL_PENDING` (`--pending`, and the only one that is not a refusal — the sweep simply has not run), `X_BACKFILL_UNKNOWN`, `X_BACKFILL_ENVIRONMENT`, `X_BACKFILL_MIGRATION_PENDING`, `X_BACKFILL_APPLIED`, `X_BACKFILL_RUNNING`. All six are `@ultimat3/jobs`', carry a one-line runnable `fix:`, and are what a non-zero exit from these shapes means — full wording in [Error codes →
|
|
637
|
+
Errors, backfill: `X_BACKFILL_PENDING` (`--pending`, and the only one that is not a refusal — the sweep simply has not run), `X_BACKFILL_UNKNOWN`, `X_BACKFILL_ENVIRONMENT`, `X_BACKFILL_MIGRATION_PENDING`, `X_BACKFILL_APPLIED`, `X_BACKFILL_RUNNING`. All six are `@ultimat3/jobs`', carry a one-line runnable `fix:`, and are what a non-zero exit from these shapes means — full wording in [Error codes → `@ultimat3/jobs`](Error-Codes-jobs). `X_BACKFILL_STALLED` is the seventh and never reaches this command: it is raised by the pass, on a worker, so it surfaces through `x jobs show <id>`.
|
|
638
638
|
|
|
639
639
|
## x verify
|
|
640
640
|
|
|
@@ -2040,9 +2040,9 @@ The [Error codes](Error-Codes) table, programmatically. Runs outside an app: tri
|
|
|
2040
2040
|
$ x errors explain X_CURSOR_INVALID --json
|
|
2041
2041
|
{"ok":true,"command":"errors","summary":"X_CURSOR_INVALID — pagination cursor is malformed…",
|
|
2042
2042
|
"data":{"code":"X_CURSOR_INVALID","cause":"pagination cursor is malformed, tampered with or from
|
|
2043
|
-
another query","fix":"drop the cursor and request the first page again
|
|
2043
|
+
another query","fix":"after: null // drop the cursor and request the first page again",
|
|
2044
2044
|
"docs":"https://github.com/developerz-ai/ultimate/wiki/Error-Codes",
|
|
2045
|
-
"site":{"at":"@ultimat3/core/src/cursor.ts","line":
|
|
2045
|
+
"site":{"at":"@ultimat3/core/src/cursor.ts","line":28}}}
|
|
2046
2046
|
```
|
|
2047
2047
|
|
|
2048
2048
|
`site` is the CLI locating a throw site in the tree — it is **not** a field the thrown error
|
|
@@ -25,7 +25,7 @@ Who *raises* it is a separate question, and the answer differs by surface:
|
|
|
25
25
|
|
|
26
26
|
`packages/cli/src/statement-loop.ts` is what keeps them identical: it calls `@ultimat3/entity`'s
|
|
27
27
|
`nPlusOne` and reads `code`/`cause`/`fix` off the resulting error rather than restating any of it.
|
|
28
|
-
Full row, verbatim: [Error codes →
|
|
28
|
+
Full row, verbatim: [Error codes → `@ultimat3/entity`](Error-Codes-entity).
|
|
29
29
|
|
|
30
30
|
## Before / after
|
|
31
31
|
|
|
@@ -422,7 +422,7 @@ Load shedding is a decision with a typed error, not a fall-over.
|
|
|
422
422
|
|---|---|---|
|
|
423
423
|
| `X_SUBSCRIPTION_LIMIT` | a socket, tenant or node reached a cap; the error names which scope refused, and which knob | `raise maxPerSocket / maxPerTenant / maxEntries on the LiveQueryRegistry (per socket, default 128), or unsubscribe unused live queries` — and a **channel topic** cap answers `maxTopicsPerSocket` / `maxTopicsPerNode` on the `ChannelHub`. All constructor options, none an `app.config.ts` field |
|
|
424
424
|
| `X_CURSOR_STALE` | resume cursor outside the change buffer and no snapshot path supplied | `pass 'snapshot' to resumeFrom() so the fallback path can re-snapshot instead of failing` |
|
|
425
|
-
| `X_TRANSPORT_UNAVAILABLE` | the fanout bus is unreachable | `
|
|
425
|
+
| `X_TRANSPORT_UNAVAILABLE` | the fanout bus is unreachable | point `NATS_URL` at a reachable nats-server |
|
|
426
426
|
|
|
427
427
|
Verbatim shapes: [`packages/realtime/src/errors.ts`](https://github.com/developerz-ai/ultimate/blob/main/packages/realtime/src/errors.ts). Full index: [Error codes](Error-Codes).
|
|
428
428
|
|