@ultimat3/cli 27.16.0 → 28.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/cli",
3
- "version": "27.16.0",
3
+ "version": "28.0.0",
4
4
  "description": "The `x` binary: new, dev, build, verify, generate, db, mcp, doctor, deploy",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,7 +30,7 @@
30
30
  "LICENSE"
31
31
  ],
32
32
  "engines": {
33
- "bun": ">=1.4.2"
33
+ "bun": ">=1.4.3"
34
34
  },
35
35
  "scripts": {
36
36
  "typecheck": "tsc --noEmit -p tsconfig.json",
@@ -39,33 +39,33 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@babel/core": "^8.0.1",
42
- "@ultimat3/action": "27.16.0",
43
- "@ultimat3/admin": "27.16.0",
44
- "@ultimat3/ai": "27.16.0",
45
- "@ultimat3/auth": "27.16.0",
46
- "@ultimat3/cache": "27.16.0",
47
- "@ultimat3/core": "27.16.0",
48
- "@ultimat3/db": "27.16.0",
49
- "@ultimat3/entity": "27.16.0",
50
- "@ultimat3/flags": "27.16.0",
51
- "@ultimat3/http": "27.16.0",
52
- "@ultimat3/i18n": "27.16.0",
53
- "@ultimat3/jobs": "27.16.0",
54
- "@ultimat3/mail": "27.16.0",
55
- "@ultimat3/manifest": "27.16.0",
56
- "@ultimat3/mcp": "27.16.0",
57
- "@ultimat3/money": "27.16.0",
58
- "@ultimat3/notify": "27.16.0",
59
- "@ultimat3/policy": "27.16.0",
60
- "@ultimat3/pwa": "27.16.0",
61
- "@ultimat3/query": "27.16.0",
62
- "@ultimat3/realtime": "27.16.0",
63
- "@ultimat3/render": "27.16.0",
64
- "@ultimat3/schema": "27.16.0",
65
- "@ultimat3/seo": "27.16.0",
66
- "@ultimat3/storage": "27.16.0",
67
- "@ultimat3/testing": "27.16.0",
68
- "@ultimat3/time": "27.16.0",
42
+ "@ultimat3/action": "28.0.0",
43
+ "@ultimat3/admin": "28.0.0",
44
+ "@ultimat3/ai": "28.0.0",
45
+ "@ultimat3/auth": "28.0.0",
46
+ "@ultimat3/cache": "28.0.0",
47
+ "@ultimat3/core": "28.0.0",
48
+ "@ultimat3/db": "28.0.0",
49
+ "@ultimat3/entity": "28.0.0",
50
+ "@ultimat3/flags": "28.0.0",
51
+ "@ultimat3/http": "28.0.0",
52
+ "@ultimat3/i18n": "28.0.0",
53
+ "@ultimat3/jobs": "28.0.0",
54
+ "@ultimat3/mail": "28.0.0",
55
+ "@ultimat3/manifest": "28.0.0",
56
+ "@ultimat3/mcp": "28.0.0",
57
+ "@ultimat3/money": "28.0.0",
58
+ "@ultimat3/notify": "28.0.0",
59
+ "@ultimat3/policy": "28.0.0",
60
+ "@ultimat3/pwa": "28.0.0",
61
+ "@ultimat3/query": "28.0.0",
62
+ "@ultimat3/realtime": "28.0.0",
63
+ "@ultimat3/render": "28.0.0",
64
+ "@ultimat3/schema": "28.0.0",
65
+ "@ultimat3/seo": "28.0.0",
66
+ "@ultimat3/storage": "28.0.0",
67
+ "@ultimat3/testing": "28.0.0",
68
+ "@ultimat3/time": "28.0.0",
69
69
  "babel-preset-solid": "^1.9.15"
70
70
  }
71
71
  }
package/src/app-root.ts CHANGED
@@ -36,7 +36,7 @@ export const MANIFEST_FILE = 'x.manifest.json';
36
36
  * declared supported would hang on graceful shutdown the moment its database went away. The full
37
37
  * measurement is in `.github/actions/setup/action.yml`; read it before lowering this.
38
38
  */
39
- export const REQUIRED_BUN = '1.4.2';
39
+ export const REQUIRED_BUN = '1.4.3';
40
40
 
41
41
  export interface AppRoot {
42
42
  readonly dir: string;
@@ -0,0 +1,44 @@
1
+ // A single-file executable whose graph carries the framework's own source: the `x` image
2
+ // (`docker/Dockerfile`, through `scripts/compile-x.ts`) and the boot e2e that proves it. One
3
+ // `Bun.build`, because the CLI's `bun build --compile` takes no plugin and this graph needs one.
4
+
5
+ import { serverTsxBuildPlugin } from '@ultimat3/render/server';
6
+ import { COMPILE_EXTERNALS } from './compile-externals';
7
+ import { ExecutableCompileFailedError } from './errors';
8
+
9
+ export interface CompileExecutableOptions {
10
+ readonly entry: string;
11
+ readonly outfile: string;
12
+ /** `--define` pairs: each value is a JS expression, so a string arrives `JSON.stringify`-ed. */
13
+ readonly define?: Readonly<Record<string, string>>;
14
+ readonly minify?: boolean;
15
+ readonly sourcemap?: boolean;
16
+ }
17
+
18
+ /**
19
+ * The CLI registry reaches every admin screen and `@ultimat3/ui` component (`cmd-dev` → the dev
20
+ * dashboard, `cmd-i18n` → the admin catalog): 92 `.tsx`, measured on 1.4.3. Compiled by Bun's own
21
+ * transform each one imports `jsxDEV` from `solid-js/jsx-dev-runtime`, which exports no such name,
22
+ * and Bun 1.4.3 refuses the build (issue #883) — through 1.4.2 it shipped a `React.createElement`
23
+ * nobody defines. `serverTsxBuildPlugin` compiles them to the server factory, as the runtime
24
+ * loader does for the same files off disk.
25
+ */
26
+ export async function compileExecutable(options: CompileExecutableOptions): Promise<void> {
27
+ const built = await Bun.build({
28
+ entrypoints: [options.entry],
29
+ compile: { outfile: options.outfile },
30
+ minify: options.minify ?? false,
31
+ sourcemap: options.sourcemap === true ? 'linked' : 'none',
32
+ define: { ...options.define },
33
+ external: [...COMPILE_EXTERNALS],
34
+ plugins: [serverTsxBuildPlugin],
35
+ throw: false,
36
+ });
37
+ if (!built.success) {
38
+ throw new ExecutableCompileFailedError({
39
+ entry: options.entry,
40
+ outfile: options.outfile,
41
+ logs: built.logs.map(String).join('\n'),
42
+ });
43
+ }
44
+ }
@@ -1,6 +1,7 @@
1
- // The specifiers every `bun build --compile` in this repo must refuse to resolve. One list, because
2
- // the flag is repeated at each compile site — `binaryArgs`, `docker/Dockerfile`, the boot e2e — and
3
- // three copies of a resolver allowlist is three chances for one of them to be the stale one.
1
+ // The specifiers every `--compile` in this repo must refuse to resolve. One list, because there are
2
+ // two compile sites — `binaryArgs` (the CLI's flag) and `compile-executable.ts` (`docker/Dockerfile`
3
+ // and the boot e2e, through `Bun.build`) — and two copies of a resolver allowlist is two chances
4
+ // for one of them to be the stale one.
4
5
 
5
6
  /**
6
7
  * `@babel/preset-typescript` is reached from `@babel/core`'s `.cts`-config loader and from nowhere
package/src/errors.ts CHANGED
@@ -335,6 +335,20 @@ export class FrameworkScriptBuildFailedError extends UltimateError {
335
335
  }
336
336
  }
337
337
 
338
+ /**
339
+ * A single-file executable would not compile (`compile-executable.ts`). The same code as every
340
+ * other bundle the framework builds; the cause carries the bundler's own log, which names the file.
341
+ */
342
+ export class ExecutableCompileFailedError extends UltimateError {
343
+ constructor(input: { entry: string; outfile: string; logs: string }) {
344
+ super({
345
+ code: 'X_BUILD_FAILED',
346
+ cause: `${input.entry} would not compile to the executable ${input.outfile}: ${input.logs}`,
347
+ fix: 'bun run scripts/compile-x.ts --outfile <path> # the same compile, its log in full',
348
+ });
349
+ }
350
+ }
351
+
338
352
  /**
339
353
  * A static build over an app whose modules did not all import. The route registry is filled BY the
340
354
  * import, so a page whose module threw is not skipped but absent — and an export without it, with
@@ -32,16 +32,16 @@ const dockerfile = (
32
32
  # from the file itself, and without it the frozen install cannot find what the lockfile names.
33
33
  # The tag names the series for the reader; the digest is what builds — a tag is a pointer its
34
34
  # publisher can move. Dependabot's docker ecosystem moves the digest together with the tag.
35
- # The digest is \`oven/bun:1.4.2-alpine\`'s, the patch the framework that wrote this file was
35
+ # The digest is \`oven/bun:1.4.3-alpine\`'s, the patch the framework that wrote this file was
36
36
  # tested on — the same patch as \`engines.bun\` in package.json.
37
- FROM oven/bun:1.4-alpine@sha256:d888c0ae6c86d7866ff10c5aafdd9077b36aee6455b33dd270fb93c0dd5cef6f AS manifests
37
+ FROM oven/bun:1.4-alpine@sha256:629e17411f1f129dbec3af78d5af9c9f2a937435c80349437206c6b0b7422373 AS manifests
38
38
  WORKDIR /app
39
39
  COPY . .
40
40
  RUN find . ! -type d ! -name package.json ! -name bunfig.toml ! -name '*.tgz' -delete \\
41
41
  && find . -type d -empty -delete
42
42
 
43
43
  # ---------- deps: runtime dependencies only, cached on the lockfile and the manifests ----------
44
- FROM oven/bun:1.4-alpine@sha256:d888c0ae6c86d7866ff10c5aafdd9077b36aee6455b33dd270fb93c0dd5cef6f AS deps
44
+ FROM oven/bun:1.4-alpine@sha256:629e17411f1f129dbec3af78d5af9c9f2a937435c80349437206c6b0b7422373 AS deps
45
45
  WORKDIR /app
46
46
  COPY --from=manifests /app ./
47
47
  COPY bun.lock ./