@ultimat3/cli 1.0.0 → 1.2.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 +23 -23
- package/src/app-load.ts +10 -0
- package/src/cmd-build.ts +28 -4
- package/src/cmd-dev.ts +4 -1
- package/src/dev-render.ts +8 -4
- package/src/dev-roles.ts +40 -2
- package/src/dev-services.ts +6 -1
- package/src/errors.ts +59 -0
- package/src/index.ts +30 -4
- package/src/mcp-errors.ts +6 -0
- package/src/metrics-endpoint.ts +72 -0
- package/src/migrations.ts +45 -0
- package/src/prerender.ts +71 -0
- package/src/serve.ts +200 -0
- package/src/templates/index.ts +1 -0
- package/src/templates/scaffold-app.ts +55 -0
- package/src/templates/scaffold-container.ts +264 -0
- package/src/templates/scaffold-docs.ts +5 -27
- package/src/templates/scaffold-repo.ts +13 -3
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
// The config half of what `x new` writes: the one config file, the tooling configs and the
|
|
2
2
|
// workspace packages. Committed defaults only — a fresh clone boots with `x dev` and no env
|
|
3
|
-
// scavenger hunt. The docs
|
|
3
|
+
// scavenger hunt. The docs and shims live in scaffold-docs.ts, the container files in
|
|
4
|
+
// scaffold-container.ts.
|
|
4
5
|
|
|
5
6
|
import type { GeneratedFile, NameSet } from './naming';
|
|
6
7
|
import { docsFiles } from './scaffold-docs';
|
|
7
8
|
import { i18nFiles } from './scaffold-i18n';
|
|
8
9
|
import { packageShapeFiles } from './scaffold-package-shape';
|
|
9
10
|
|
|
11
|
+
// `version` is not decoration: the manifest's app version IS the contract's compatibility gate,
|
|
12
|
+
// and the manifest never fabricates one — so an app scaffolded without it failed `x manifest`,
|
|
13
|
+
// the `manifest` verify step and every production boot with X_APP_PACKAGE_INVALID.
|
|
10
14
|
const rootPackage = (app: NameSet, version: string): string => `{
|
|
11
15
|
"name": "${app.kebab}",
|
|
16
|
+
"version": "0.1.0",
|
|
12
17
|
"private": true,
|
|
13
18
|
"type": "module",
|
|
14
19
|
"workspaces": [
|
|
@@ -64,6 +69,8 @@ const rootTsconfig = (app: NameSet): string => `{
|
|
|
64
69
|
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
65
70
|
"types": ["bun"],
|
|
66
71
|
"paths": {
|
|
72
|
+
"@${app.kebab}/web/*": ["./apps/web/*"],
|
|
73
|
+
"@${app.kebab}/admin/*": ["./apps/admin/*"],
|
|
67
74
|
"@${app.kebab}/*": ["./packages/*/src"]
|
|
68
75
|
},
|
|
69
76
|
"strict": true,
|
|
@@ -105,10 +112,13 @@ export const config = defineConfig({
|
|
|
105
112
|
});
|
|
106
113
|
`;
|
|
107
114
|
|
|
115
|
+
// `biome.json` is strict JSON — Biome's own parser rejects a `//` comment in it, which made every
|
|
116
|
+
// scaffolded app fail its first `x verify` on the config rather than on the code. The note that
|
|
117
|
+
// used to be a comment lives here, where it is read by the person who would have changed the line:
|
|
118
|
+
// x.manifest.json and openapi.json are emitted byte-for-byte by `x manifest`, so a formatter
|
|
119
|
+
// rewriting them puts `x manifest` and `x verify` in a loop neither can win.
|
|
108
120
|
const biome = (): string => `{
|
|
109
121
|
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
|
|
110
|
-
// x.manifest.json and openapi.json are emitted byte-for-byte by \`x manifest\`; a formatter
|
|
111
|
-
// rewriting them puts \`x manifest\` and \`x verify\` in a loop neither can win.
|
|
112
122
|
"files": { "includes": ["**", "!x.manifest.json", "!openapi.json"] },
|
|
113
123
|
"formatter": { "indentStyle": "space", "indentWidth": 2, "lineWidth": 100 },
|
|
114
124
|
"linter": {
|