@ultimat3/cli 31.4.1 → 31.4.2
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/guard-sources.ts +22 -2
- package/src/templates/guard-local-binding.ts +4 -4
- package/wiki/Upgrading.md +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/cli",
|
|
3
|
-
"version": "31.4.
|
|
3
|
+
"version": "31.4.2",
|
|
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.9",
|
|
56
|
-
"@ultimat3/action": "31.4.
|
|
57
|
-
"@ultimat3/admin": "31.4.
|
|
58
|
-
"@ultimat3/ai": "31.4.
|
|
59
|
-
"@ultimat3/auth": "31.4.
|
|
60
|
-
"@ultimat3/cache": "31.4.
|
|
61
|
-
"@ultimat3/core": "31.4.
|
|
62
|
-
"@ultimat3/db": "31.4.
|
|
63
|
-
"@ultimat3/entity": "31.4.
|
|
64
|
-
"@ultimat3/flags": "31.4.
|
|
65
|
-
"@ultimat3/http": "31.4.
|
|
66
|
-
"@ultimat3/i18n": "31.4.
|
|
67
|
-
"@ultimat3/jobs": "31.4.
|
|
68
|
-
"@ultimat3/mail": "31.4.
|
|
69
|
-
"@ultimat3/manifest": "31.4.
|
|
70
|
-
"@ultimat3/mcp": "31.4.
|
|
71
|
-
"@ultimat3/money": "31.4.
|
|
72
|
-
"@ultimat3/notify": "31.4.
|
|
73
|
-
"@ultimat3/policy": "31.4.
|
|
74
|
-
"@ultimat3/pwa": "31.4.
|
|
75
|
-
"@ultimat3/query": "31.4.
|
|
76
|
-
"@ultimat3/realtime": "31.4.
|
|
77
|
-
"@ultimat3/render": "31.4.
|
|
78
|
-
"@ultimat3/schema": "31.4.
|
|
79
|
-
"@ultimat3/scraping": "31.4.
|
|
80
|
-
"@ultimat3/seo": "31.4.
|
|
81
|
-
"@ultimat3/storage": "31.4.
|
|
82
|
-
"@ultimat3/testing": "31.4.
|
|
83
|
-
"@ultimat3/time": "31.4.
|
|
56
|
+
"@ultimat3/action": "31.4.2",
|
|
57
|
+
"@ultimat3/admin": "31.4.2",
|
|
58
|
+
"@ultimat3/ai": "31.4.2",
|
|
59
|
+
"@ultimat3/auth": "31.4.2",
|
|
60
|
+
"@ultimat3/cache": "31.4.2",
|
|
61
|
+
"@ultimat3/core": "31.4.2",
|
|
62
|
+
"@ultimat3/db": "31.4.2",
|
|
63
|
+
"@ultimat3/entity": "31.4.2",
|
|
64
|
+
"@ultimat3/flags": "31.4.2",
|
|
65
|
+
"@ultimat3/http": "31.4.2",
|
|
66
|
+
"@ultimat3/i18n": "31.4.2",
|
|
67
|
+
"@ultimat3/jobs": "31.4.2",
|
|
68
|
+
"@ultimat3/mail": "31.4.2",
|
|
69
|
+
"@ultimat3/manifest": "31.4.2",
|
|
70
|
+
"@ultimat3/mcp": "31.4.2",
|
|
71
|
+
"@ultimat3/money": "31.4.2",
|
|
72
|
+
"@ultimat3/notify": "31.4.2",
|
|
73
|
+
"@ultimat3/policy": "31.4.2",
|
|
74
|
+
"@ultimat3/pwa": "31.4.2",
|
|
75
|
+
"@ultimat3/query": "31.4.2",
|
|
76
|
+
"@ultimat3/realtime": "31.4.2",
|
|
77
|
+
"@ultimat3/render": "31.4.2",
|
|
78
|
+
"@ultimat3/schema": "31.4.2",
|
|
79
|
+
"@ultimat3/scraping": "31.4.2",
|
|
80
|
+
"@ultimat3/seo": "31.4.2",
|
|
81
|
+
"@ultimat3/storage": "31.4.2",
|
|
82
|
+
"@ultimat3/testing": "31.4.2",
|
|
83
|
+
"@ultimat3/time": "31.4.2",
|
|
84
84
|
"babel-preset-solid": "^1.9.16"
|
|
85
85
|
}
|
|
86
86
|
}
|
package/src/guard-sources.ts
CHANGED
|
@@ -40,6 +40,13 @@ export interface GuardSources {
|
|
|
40
40
|
compileError?(path: string): Promise<string | undefined>;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* `@ultimat3/render`'s asset resolver slot (`asset.ts`): global by design, so every copy of render
|
|
45
|
+
* reads the one table installed. Read here only to put back what a compile found; a renamed key
|
|
46
|
+
* fails `guard-sources.test.ts`' restore case, which goes through render's own `asset()`.
|
|
47
|
+
*/
|
|
48
|
+
const RESOLVER_SLOT = Symbol.for('ultimate.render.assetResolver');
|
|
49
|
+
|
|
43
50
|
/** Path segments that are never the app's own source. */
|
|
44
51
|
const NOT_SOURCE = /(?:^|\/)(?:node_modules|dist|\.x|\.git)\//;
|
|
45
52
|
|
|
@@ -84,8 +91,21 @@ export function guardSources(
|
|
|
84
91
|
// Imported here, not at the top: Sass loads on the first compile, and a gate run whose
|
|
85
92
|
// guards compile nothing must not pay for the compiler (`sass-lazy.test.ts`).
|
|
86
93
|
const { compileStylesheet } = await import('@ultimat3/render/server');
|
|
87
|
-
const {
|
|
88
|
-
|
|
94
|
+
const { setAssetResolver } = await import('@ultimat3/render');
|
|
95
|
+
const { siteAssetTable } = await import('./site-assets');
|
|
96
|
+
// A sheet's `asset()` resolves through the table `loadApp` installs for the build — the same
|
|
97
|
+
// table, so a file the app holds compiles and one it does not is `X_ASSET_MISSING`. Installed
|
|
98
|
+
// around the one synchronous compile and handed back after: no await runs in between, so no
|
|
99
|
+
// other code ever sees it, and a table a caller had installed is the one it still has.
|
|
100
|
+
const table = siteAssetTable(root);
|
|
101
|
+
const previous: unknown = Reflect.get(globalThis, RESOLVER_SLOT);
|
|
102
|
+
setAssetResolver((asset) => table.resolve(asset).url);
|
|
103
|
+
try {
|
|
104
|
+
const { css, classes } = compileStylesheet(join(root, path), source);
|
|
105
|
+
return { css, classes };
|
|
106
|
+
} finally {
|
|
107
|
+
Reflect.set(globalThis, RESOLVER_SLOT, previous);
|
|
108
|
+
}
|
|
89
109
|
} catch (error) {
|
|
90
110
|
// The compiler's own words: render's `X_PRERENDER_FAILED` carries them in its cause behind
|
|
91
111
|
// the absolute path, which names a temp root in a test and a different checkout in CI.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// The source text of `bindsLocally()`, spliced into each shipped guard that refuses a call to a
|
|
2
2
|
// global by name (`confirm(`, `fetch(`, `setInterval(`): a file that declares its own binding of
|
|
3
|
-
// that name calls its own function, never the global.
|
|
4
|
-
//
|
|
3
|
+
// that name calls its own function, never the global. `String.raw` keeps the regexes as written;
|
|
4
|
+
// the text holds no backtick and is ASCII only: Bun escapes `—` and `String.raw` keeps `\u2014`.
|
|
5
5
|
|
|
6
6
|
export const LOCAL_BINDING_SOURCE = String.raw`const DECLARED = /\b(?:const|let|var|class|function\s*\*?)\s+([A-Za-z_$][\w$]*)/g;
|
|
7
7
|
const ARROW_PARAMETER = /(?<![\w$.])([A-Za-z_$][\w$]*)\s*=>/g;
|
|
8
8
|
const IMPORT_CLAUSE = /\bimport\s+([^;]*?)\bfrom\b/g;
|
|
9
|
-
/** A name an import clause binds: 'a', '{ a }', '* as a', '{ b as a }'
|
|
9
|
+
/** A name an import clause binds: 'a', '{ a }', '* as a', '{ b as a }', never the 'b' of 'b as a'. */
|
|
10
10
|
const IMPORTED = /(?<![\w$])([A-Za-z_$][\w$]*)(?![\w$])(?!\s+as\b)/g;
|
|
11
11
|
const IDENTIFIER = /(?<![\w$.])[A-Za-z_$][\w$]*(?![\w$])/g;
|
|
12
12
|
/** After a pattern's closing bracket: '=' closes a destructuring, '=>' or a body a parameter list. */
|
|
@@ -57,7 +57,7 @@ const inPattern = (text: string, at: number, name: string): boolean => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Whether the file binds 'name' itself
|
|
60
|
+
* Whether the file binds 'name' itself (declared, imported, a parameter or destructured), so a
|
|
61
61
|
* bare 'name(' is its own function and not the global. File-wide, not scoped: a guard is a regex.
|
|
62
62
|
*/
|
|
63
63
|
const bindsLocally = (text: string, name: string): boolean => {
|
package/wiki/Upgrading.md
CHANGED
|
@@ -197,7 +197,13 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
|
|
|
197
197
|
| `x exercise` reports `X_AUDIT_SINK_MISSING` (`X_QUERY_AUDIT_SINK_MISSING` for a query) on every `audit: true` primitive, and `x build` lists each page whose render runs one under `unmeasured`: entry 43 moved `auditSink` into `runtime.ts`, and neither pass installs `runtime.ts` | fixed in **31.2.0**: both read `apps/<app>/runtime.ts` through the boot's own loader, a memory sink standing in for the declared one so neither writes to it. On 31.0.0–31.1.0, install a memory sink at the top of `apps/web/exercise.ts` and `apps/web/prerender.ts` — `installAuditSink(memoryAuditSink())`, `installAuditSink` from `@ultimat3/core/adapter`, `memoryAuditSink` from `@ultimat3/action`; on 31.2.0, delete it |
|
|
198
198
|
| `defineFactory` (`@ultimat3/testing`, entry 40) widens a string literal in `defaults` or a trait to `string`, so an `enumerated([…])` column is TS2322 — `Type 'string' is not assignable to type '"closed" \| "open"'` | `'open' as const` on the literal. Fixed in **31.2.0**: from it, an `as const` or per-literal annotation added for this TS2322 can be deleted — kept, it is harmless |
|
|
199
199
|
| `disk('<name>')` is `X_STORAGE_DISK_UNKNOWN` for a disk your own `defineStorage({ disks: { … } })` declares, when an app module reached from `runtime.ts` makes that call: the boot installed its one-disk registry over it | fixed in **31.2.0**: the boot keeps a registry the app declared, and the app's `defineStorage()` wins over `runtime.storage`. Upgrade to it; no workaround is verified for 31.0.0–31.1.0 |
|
|
200
|
-
| `
|
|
200
|
+
| `@ultimat3/auth/schema` (**31.4.0**) exports `AUTH_TABLES`, `AUTH_TABLE_NAMES`, `AUTH_SERVER_TABLES`, `SQL_AUTH_SERVER_TABLES`, `SQL_AUTH_LIMIT_TABLES` and `SQL_TOTP_REPLAY_TABLE` and imports no auth runtime; `@ultimat3/auth` still exports all six | nothing. Optional: a module that reads only those names (a schema reader, a migrate-only script) imports them from `@ultimat3/auth/schema` and stops loading the auth barrel |
|
|
201
|
+
| `defineError` is exported from `@ultimat3/core/page` (**31.4.1**), and the refreshed `error-declared` guard refuses it imported from `@ultimat3/core`: `X_ERROR_DECLARED` at the import line. Through the barrel, every island that throws an app code carried both framework titles tables: 12,019 B against 6,507 B for one declaration thrown (`As of 2026-11`: Bun 1.4.4, minified) | `import { defineError } from '@ultimat3/core/page'` — the same function, so the swap is the import line only. A `/* @__PURE__ */` or `"sideEffects": false` added to keep the table out is no longer needed for that. `x new` and `x g` write the `./page` import from 31.4.1 |
|
|
202
|
+
| `x doctor` and `x upgrade` list up to twelve guards as differing from the shipped template after the **31.4.1** hop (`x doctor --json`: `.data.guards.differs[].refresh`). 31.4.1 changed `native-confirm`, `raw-fetch`, `raw-interval`, `unzoned-date`, `semantic-interactive`, `image-dimensions`, `untranslated-string`, `raw-motion`, `undeclared-custom-property`, `undefined-style-class`, `error-declared` and `bare-error` (its `fix:` now names `@ultimat3/core/page`). Your `guards/` copy is the app's own: `x upgrade` never rewrites it | `x g guard <name> --force` per name — it rewrites `guards/<name>.ts` **and** `guards/<name>.test.ts`, so review the diff and keep any rule you edited on purpose. Then `x verify` |
|
|
203
|
+
| after that refresh, `x verify`'s `boundaries` step reports findings the old guards never saw — all of them already in your code: `X_IMAGE_DIMENSIONS`, `X_SEMANTIC_INTERACTIVE` or `X_UNTRANSLATED_STRING` in `apps/*/shared/**/*.tsx` (the three scanned only `site/` and `app/`); `X_RAW_MOTION` on a raw duration or `cubic-bezier()` assigned to a custom property (`--my-ease: cubic-bezier(0, 0, 1, 1)`); `X_UNDECLARED_CUSTOM_PROPERTY` at a stylesheet that does not compile, `X_UNDEFINED_STYLE_CLASS` at the `.tsx` line importing one — while any sheet fails, `undeclared-custom-property` reports only the broken sheets and checks no `var()` read | fix each where its `fix:` points: the `shared/` component as you would in `app/`; `--my-ease: #{tokens.easing(out)}` for a motion value; the Sass at the compiler error the cause quotes. Then re-run `x verify` — a repaired sheet can surface the `var()` reads it was hiding |
|
|
204
|
+
| the same refresh drops findings that were false: a file's own function named `confirm`, `fetch` or `setInterval` (a declaration, import, parameter or destructured name), `Intl.DateTimeFormat().resolvedOptions().timeZone`, and a `role="option"` with `tabIndex={-1}` | nothing — a rename made only to quiet one of them can be reverted |
|
|
205
|
+
| `x doctor` lists `native-confirm`, `raw-fetch` and `raw-interval` as differing from the shipped template after the **31.4.2** hop: their copy from 31.4.1 shows `\u2014` where two comments meant a dash. Comments only; the rule is the same | optional: `x g guard native-confirm --force`, `x g guard raw-fetch --force`, `x g guard raw-interval --force` |
|
|
206
|
+
| `undeclared-custom-property` and `undefined-style-class` report `<sheet> does not compile: asset("assets/…") ran with no site asset table installed` on 31.4.1 for a sheet that calls Sass `asset()` and builds fine (on 31.4.0, `undeclared-custom-property` passed the whole app on nothing instead). From **31.4.2** a guard's compile resolves `asset()` through the site asset table the build uses, so the sheet compiles and an `asset()` naming a file missing from `apps/web/site/assets/` is still the finding. The fix is in `@ultimat3/cli`'s `GuardSources`, not in a template | nothing to refresh. Delete any placeholder asset table you installed around a guard to work around it, then `x verify` |
|
|
201
207
|
|
|
202
208
|
## 29.x → 30.0.0, entry by entry
|
|
203
209
|
|
|
@@ -461,7 +467,7 @@ Only an app that relied on the old behaviour has anything to do:
|
|
|
461
467
|
| `x jobs show` / `inspectJob(driver, id).input` is `'[redacted]'` for a job name this process has not registered with `job()` | to read such a payload, register the job again (a stub `job({ name, input: t.json(), … })`) in the process that inspects it |
|
|
462
468
|
| a field marked `.sensitive()` (last in the chain) is masked in the audit record and `x jobs show`; one reachable from an action `output` or a query `rows` fails boot with `X_SCHEMA_SENSITIVE_OUTPUT` | optional: mark what must never be written down. An app's own `logger.info('x', input)` is not covered: keep `redactKeys` or a `Secret` there |
|
|
463
469
|
| every builtin schema refusal carries `rule` (`SCHEMA_RULES`) and `params`, on the wire and on `FormIssue` | key a form's `messageFor` on `issue.rule`, not the English `issue.message`; keep a fallback, since a third-party schema library sends no `rule` |
|
|
464
|
-
| app codes declare with `defineError({ code, title, status \| offSocket, cause, fix })` from `@ultimat3/core`, which registers the status in the same call | optional: replace `class X extends UltimateError` with `defineError`; `X.is(error)` replaces `instanceof`, and a base class becomes a code prefix. `x g guard error-declared` adds the guard that keeps it so; `x g guard bare-error --force` refreshes the bare-error guard's fix. An app code with no status still answers 500 |
|
|
470
|
+
| app codes declare with `defineError({ code, title, status \| offSocket, cause, fix })` from `@ultimat3/core`, which registers the status in the same call | optional: replace `class X extends UltimateError` with `defineError`; `X.is(error)` replaces `instanceof`, and a base class becomes a code prefix. `x g guard error-declared` adds the guard that keeps it so; `x g guard bare-error --force` refreshes the bare-error guard's fix. An app code with no status still answers 500. From 31.4.1 the import is `@ultimat3/core/page` ([the `31.0.0` section's table](#not-breaking-but-you-will-see-it)) |
|
|
465
471
|
| the Sentry envelope carries `fingerprint: [errorFingerprint(report)]` | nothing: each existing issue reopens once under its new group. A reporter of your own groups the same way with `errorFingerprint(report)` |
|
|
466
472
|
| OTLP export retries 429, 502, 503, 504 and a transport failure, inside the exporter's `timeoutMs` (default 10 s) | lower `timeoutMs` if a shorter hold on the in-flight batch matters more than delivery. A collector that accepted a batch then answered 503 receives it twice; span ids dedupe it |
|
|
467
473
|
| `X_DEV_ALREADY_RUNNING`'s fix is `x stop --json` | a script that killed `x dev` by pid calls `x stop --json`, which returns once the next `x dev` can boot |
|