@dokebi/cli 0.4.37 → 0.4.38
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/AI.md +1 -1
- package/catalog.json +5 -55
- package/dist/dev-watch.d.ts +0 -21
- package/dist/dev-watch.js +0 -21
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/dist/server.js +6 -12
- package/package.json +1 -1
package/AI.md
CHANGED
|
@@ -93,7 +93,7 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
|
|
|
93
93
|
| `dokebi app remove <name>` · `app link <app> <domain> [--template] [--seal]` · `app unlink <domain>` · `app list` | Manage apps and domains. `app remove` fails with `APP_IN_USE` while a domain still points to the app (unlink first); it removes the registration and `options.dokebi-app.apps.<name>` (D-0061 per-app settings) from dokebi.yaml and the sample (0.2.5; otherwise the next start fails with `UNKNOWN_APP`) and the app's recorded view from `.dokebi/recipe.json`. The folder stays (user code; the result lists it in `preserved` with the warning `APP_FOLDER_KEPT`) |
|
|
94
94
|
| `dokebi module add <name> [--no-views]` · `module remove` · `module list` | Feature modules `src/shared/modules/<name>` (D-0032). `--no-views`: the routes answer JSON |
|
|
95
95
|
| `dokebi settings add <section>` · `settings sync` · `settings remove <section>` · `settings list` | The settings of the application itself in `options.<section>` (D-0155): `add` writes `src/shared/settings/<section>.ts` (core's `defineSettings` with a `defineOptions` declaration; an existing one default-exporting it is adopted), its schema `src/shared/settings/<section>.schema.json`, the defaults in dokebi.yaml and the example (with the `# reloadable` marks), and registers it, so the app checks the section at start and `config show/set/unset/secret`, doctor and reloads treat it like a plugin section. Code reads `<name>Settings.read(context.app.config)` (typed, cached per configuration, new after a reload). After changing the declaration run `settings sync` (doctor warns `SETTINGS_SCHEMA_STALE`). A value that is still the default the CLI wrote (the old schema's, such as the `pageSize: 50` and `workers: 2` placeholders of `settings add`) follows a changed default, in dokebi.yaml and the example (`sections[].followed`); a value set by hand stays. Then each section is checked against the new schema as doctor checks it: a missing required value is `configRequired`, anything else (a value set by hand above a lowered maximum, a value of an option the declaration dropped) is `INVALID_PLUGIN_OPTIONS` with `details.paths` and a `fix` (`npx dokebi config unset <paths>` or correct it by hand, then sync again), and nothing is written (AI-M49 D2: sync answered ok on what doctor and the app refuse). A section of a plugin, `logging` or `reload` is `SETTINGS_SECTION_CONFLICT`; `remove` keeps the files and the options. A section nothing declares has one code in every config command: `UNDECLARED_SECTION` (`UNKNOWN_PLUGIN` when the name is a plugin that is not installed); `config set` and `secret` refuse it, `config show` (text values hidden) and `unset` work on what is there and warn with it, and doctor and `dokebi check` (`undeclared-section`) report it |
|
|
96
|
-
| `dokebi dev` | Development run (in the foreground). The app leads a process group of its own: what it started and left running when it stops (a restart, Ctrl+C) or crashes is ended (SIGTERM, SIGKILL after 2 s) and dev says so, so a restart never meets a port a helper of the old app holds. When `src/` or `.env` change it drains and starts again; when only `dokebi.yaml` changed it first asks the running app to read it again (D-0154): every changed option reloadable → applied without a restart (`dokebi.yaml reloaded without a restart: <paths>`), an invalid file → the app keeps its settings, anything else (an option that needs a restart, an app without reloads) → a restart as before. With a Vite config and template-inertia ≥0.1.2 it serves views from the Vite dev server with `DOKEBI_VITE_DEV=1` for **HMR** (no build needed; `.vue` and `views/` changes need no restart, D-0045). With
|
|
96
|
+
| `dokebi dev` | Development run (in the foreground). The app leads a process group of its own: what it started and left running when it stops (a restart, Ctrl+C) or crashes is ended (SIGTERM, SIGKILL after 2 s) and dev says so, so a restart never meets a port a helper of the old app holds. When `src/` or `.env` change it drains and starts again; when only `dokebi.yaml` changed it first asks the running app to read it again (D-0154): every changed option reloadable → applied without a restart (`dokebi.yaml reloaded without a restart: <paths>`), an invalid file → the app keeps its settings, anything else (an option that needs a restart, an app without reloads) → a restart as before. With a Vite config and template-inertia ≥0.1.2 it serves views from the Vite dev server with `DOKEBI_VITE_DEV=1` for **HMR** (no build needed; `.vue` and `views/` changes need no restart, D-0045). With template-inertia 0.4.0 that Vite is one host process per dev session, shared by every cluster worker and kept across app restarts (`DOKEBI_VITE_DEV_URL`, `DOKEBI_VITE_DEV_KEY`, D-0045 addendum 3); with 0.1.2 to 0.3 it runs inside the app. With an older template-inertia: a watch build and restarts. The app gets `DOKEBI_DEV=1`, so a cluster app runs one worker (`DOKEBI_DEV_WORKERS`, D-0044, D-0045), and the project's `.env`, read again at every restart (§2.2). What dev shows (the app, Vite and its own `[dokebi dev]` lines) is also written to `.dokebi/run/dev.log` (the previous session and one past 16 MB move to `dev.log.1`) and dev writes its pid to `.dokebi/run/dev.pid`, so `dokebi logs [-f]` shows the dev session from another shell (D-0201); with a terminal the app gets `DOKEBI_LOG_COLOR=1`, so the logger keeps its colours through the pipe |
|
|
97
97
|
| `dokebi reload [--timeout-ms <ms>]` | Makes the background app (`dokebi start`) read dokebi.yaml again (D-0154): SIGHUP to the proven pid (through its log writer when this shell may not signal it), then the outcome the app wrote (`.dokebi/run/reload.json`, whatever its log level). `outcome: applied` (with `paths` and `revision`) or `unchanged`; `RELOAD_RESTART_REQUIRED` (`details.restartRequired`: nothing applied, restart to apply), `RELOAD_INVALID` (the app keeps its settings; `details` names the line or paths), `RELOAD_FAILED`, `RELOAD_UNSUPPORTED` (core older than 0.4.2, or `src/main.ts` gives the app no `configFile` or changed after the start: no signal is sent, it would end the app). Not running: exit 3. A running app also reads the file when it is saved (`options.reload.watch`) |
|
|
98
98
|
| `dokebi start [--foreground] [--wait-ms <ms>] [--log-max-mb <MB>] [--log-files <n>]` · `stop [--timeout-ms <ms>] [--force]` · `status` · `logs [-n <lines>] [-f]` | Background run, stop, state, logs and log rotation (§2.1 below, D-0044, D-0053) |
|
|
99
99
|
|
package/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Generated by scripts/catalog/build.ts from package.json dokebiCatalog fields and packages/cli/catalog-src (D-0065). Do not edit; run node scripts/catalog/build.ts.",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"cli": "0.4.
|
|
4
|
+
"cli": "0.4.38",
|
|
5
5
|
"core": {
|
|
6
6
|
"package": "@dokebi/core",
|
|
7
7
|
"version": "0.4.6"
|
|
@@ -343,10 +343,6 @@
|
|
|
343
343
|
"summary": "load shedding with 503 and Retry-After when the event loop stalls or memory runs high, health routes served",
|
|
344
344
|
"en": "overload load shedding under pressure event loop delay backpressure 503"
|
|
345
345
|
},
|
|
346
|
-
"web.pages": {
|
|
347
|
-
"summary": "app definition files (app.yaml, pages, layouts and components in HTML with Tailwind classes) drawn on the server with module widgets, sent through Inertia one page at a time, read again in development",
|
|
348
|
-
"en": "pages site builder editor html tailwind layout widget app definition no-code"
|
|
349
|
-
},
|
|
350
346
|
"web.routing": {
|
|
351
347
|
"summary": "routes grouped under a prefix (mount)",
|
|
352
348
|
"en": "router routes prefix"
|
|
@@ -819,7 +815,7 @@
|
|
|
819
815
|
{
|
|
820
816
|
"id": null,
|
|
821
817
|
"package": "@dokebi/cli",
|
|
822
|
-
"version": "0.4.
|
|
818
|
+
"version": "0.4.38",
|
|
823
819
|
"kind": "cli",
|
|
824
820
|
"summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
|
|
825
821
|
"description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
|
|
@@ -1960,7 +1956,7 @@
|
|
|
1960
1956
|
{
|
|
1961
1957
|
"id": "dokebi-mcp",
|
|
1962
1958
|
"package": "@dokebi/mcp",
|
|
1963
|
-
"version": "0.1.
|
|
1959
|
+
"version": "0.1.2",
|
|
1964
1960
|
"kind": "plugin",
|
|
1965
1961
|
"summary": "MCP server on @dokebi/oauth: stateless Streamable HTTP at /mcp, tool classes with checked input schemas and scopes, a forced result envelope with paging, per-grant limits and coded tool errors",
|
|
1966
1962
|
"description": "MCP server for @dokebi/web on @dokebi/oauth: stateless Streamable HTTP, tool classes with checked schemas, a forced result envelope, per-grant limits and coded tool errors.",
|
|
@@ -2080,7 +2076,7 @@
|
|
|
2080
2076
|
{
|
|
2081
2077
|
"id": "dokebi-migrate",
|
|
2082
2078
|
"package": "@dokebi/migrate",
|
|
2083
|
-
"version": "0.4.
|
|
2079
|
+
"version": "0.4.6",
|
|
2084
2080
|
"kind": "plugin",
|
|
2085
2081
|
"summary": "Migration and seed runner for dokebi-db connections (dokebi-migrate up in the deploy step)",
|
|
2086
2082
|
"description": "Migrations and seeds for dokebi-db connections: history and lock for PostgreSQL, MySQL, MariaDB and MongoDB, run from the deployment.",
|
|
@@ -2117,7 +2113,6 @@
|
|
|
2117
2113
|
"optional": [],
|
|
2118
2114
|
"optionKeys": [
|
|
2119
2115
|
"connections",
|
|
2120
|
-
"directories",
|
|
2121
2116
|
"directory",
|
|
2122
2117
|
"lockRetries",
|
|
2123
2118
|
"lockRetryDelayMs",
|
|
@@ -2138,7 +2133,7 @@
|
|
|
2138
2133
|
{
|
|
2139
2134
|
"id": "dokebi-module",
|
|
2140
2135
|
"package": "@dokebi/module",
|
|
2141
|
-
"version": "0.4.
|
|
2136
|
+
"version": "0.4.3",
|
|
2142
2137
|
"kind": "plugin",
|
|
2143
2138
|
"summary": "Modules that hold one feature each (src/shared/modules/<module>); an app attaches them under a prefix",
|
|
2144
2139
|
"description": "Feature modules for Dokebi apps: controllers, models, views and routes in one folder mounted under a prefix.",
|
|
@@ -2385,51 +2380,6 @@
|
|
|
2385
2380
|
},
|
|
2386
2381
|
"install": "npx dokebi add @dokebi/outbox"
|
|
2387
2382
|
},
|
|
2388
|
-
{
|
|
2389
|
-
"id": "dokebi-pages",
|
|
2390
|
-
"package": "@dokebi/pages",
|
|
2391
|
-
"version": "0.1.0",
|
|
2392
|
-
"kind": "plugin",
|
|
2393
|
-
"summary": "App definition files (app.yaml, pages, layouts and components in HTML with Tailwind classes, theme.css) drawn on the server with module widgets, sent to an Inertia app as one page at a time (the layout once) or as HTML, read again in development",
|
|
2394
|
-
"description": "App definition files for @dokebi/app apps: app.yaml, pages, layouts and components in HTML with Tailwind classes, drawn on the server with module widgets, sent through Inertia or as HTML, read again when they change.",
|
|
2395
|
-
"keywords": [
|
|
2396
|
-
"dokebi",
|
|
2397
|
-
"dokebi-plugin",
|
|
2398
|
-
"web",
|
|
2399
|
-
"pages",
|
|
2400
|
-
"site",
|
|
2401
|
-
"tailwind",
|
|
2402
|
-
"builder"
|
|
2403
|
-
],
|
|
2404
|
-
"maturity": "experimental",
|
|
2405
|
-
"core": "^0.4.2",
|
|
2406
|
-
"provides": [
|
|
2407
|
-
"web.pages"
|
|
2408
|
-
],
|
|
2409
|
-
"variants": [],
|
|
2410
|
-
"doesNot": [
|
|
2411
|
-
"No scripts in pages: script, style, iframe, on… attributes and javascript: addresses are refused",
|
|
2412
|
-
"No editor: the files are written by people, the Dokebi Solution editor or AI tools"
|
|
2413
|
-
],
|
|
2414
|
-
"recipes": [],
|
|
2415
|
-
"requires": [],
|
|
2416
|
-
"optional": [
|
|
2417
|
-
{
|
|
2418
|
-
"id": "dokebi-module",
|
|
2419
|
-
"range": "^0.4.2"
|
|
2420
|
-
}
|
|
2421
|
-
],
|
|
2422
|
-
"optionKeys": [
|
|
2423
|
-
"maxSites",
|
|
2424
|
-
"watch",
|
|
2425
|
-
"watchPollMs"
|
|
2426
|
-
],
|
|
2427
|
-
"docs": {
|
|
2428
|
-
"ai": "AI.md",
|
|
2429
|
-
"readme": "README.md"
|
|
2430
|
-
},
|
|
2431
|
-
"install": "npx dokebi add @dokebi/pages"
|
|
2432
|
-
},
|
|
2433
2383
|
{
|
|
2434
2384
|
"id": "dokebi-payment",
|
|
2435
2385
|
"package": "@dokebi/payment",
|
package/dist/dev-watch.d.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/** Files the Vite dev server owns: a change reaches the browser by HMR, not by a restart. */
|
|
2
|
-
export declare const VIEW_FILE: RegExp;
|
|
3
|
-
/**
|
|
4
|
-
* Site folders of @dokebi/pages (D-0198): `apps/<app>/site/…` under src. The plugin reads them again
|
|
5
|
-
* itself and keeps the last good version when a save has problems; a restart would lose that (the
|
|
6
|
-
* start refuses a site with problems, so one broken save stopped the app).
|
|
7
|
-
*/
|
|
8
|
-
export declare const SITE_FILE: RegExp;
|
|
9
|
-
/**
|
|
10
|
-
* Whether a change of `name` (relative to src) reaches the app without a restart: a view through
|
|
11
|
-
* the Vite dev server (`hot`) or a watch build (`builds`), a site file through @dokebi/pages
|
|
12
|
-
* (`pages`: the package is installed) — only while the app runs (`running`, default true): an app
|
|
13
|
-
* that is not running, because a site with problems refused its start, must start again when the
|
|
14
|
-
* site is saved.
|
|
15
|
-
*/
|
|
16
|
-
export declare function reachesWithoutRestart(name: string, has: {
|
|
17
|
-
readonly hot: boolean;
|
|
18
|
-
readonly builds: boolean;
|
|
19
|
-
readonly pages: boolean;
|
|
20
|
-
readonly running?: boolean;
|
|
21
|
-
}): boolean;
|
|
22
1
|
/**
|
|
23
2
|
* The recorded state of the watched paths. `changed(path)` answers whether a reported path really
|
|
24
3
|
* changed since it was recorded (or since its last change) and records its new state.
|
package/dist/dev-watch.js
CHANGED
|
@@ -15,27 +15,6 @@
|
|
|
15
15
|
import { readdirSync, statSync } from 'node:fs';
|
|
16
16
|
import { basename, join, sep } from 'node:path';
|
|
17
17
|
import { debug, isMissing, reportError } from './diagnostics.js';
|
|
18
|
-
/** Files the Vite dev server owns: a change reaches the browser by HMR, not by a restart. */
|
|
19
|
-
export const VIEW_FILE = /(^|[\\/])views[\\/].*\.(js|mjs|ts)$|\.(vue|css|scss|sass|less)$/;
|
|
20
|
-
/**
|
|
21
|
-
* Site folders of @dokebi/pages (D-0198): `apps/<app>/site/…` under src. The plugin reads them again
|
|
22
|
-
* itself and keeps the last good version when a save has problems; a restart would lose that (the
|
|
23
|
-
* start refuses a site with problems, so one broken save stopped the app).
|
|
24
|
-
*/
|
|
25
|
-
export const SITE_FILE = /^apps[\\/][^\\/]+[\\/]site(?:[\\/]|$)/;
|
|
26
|
-
/**
|
|
27
|
-
* Whether a change of `name` (relative to src) reaches the app without a restart: a view through
|
|
28
|
-
* the Vite dev server (`hot`) or a watch build (`builds`), a site file through @dokebi/pages
|
|
29
|
-
* (`pages`: the package is installed) — only while the app runs (`running`, default true): an app
|
|
30
|
-
* that is not running, because a site with problems refused its start, must start again when the
|
|
31
|
-
* site is saved.
|
|
32
|
-
*/
|
|
33
|
-
export function reachesWithoutRestart(name, has) {
|
|
34
|
-
// A site file (its theme.css too) is decided by the site alone, never as a Vite style.
|
|
35
|
-
if (has.pages && SITE_FILE.test(name))
|
|
36
|
-
return has.running !== false;
|
|
37
|
-
return ((has.hot && VIEW_FILE.test(name)) || (has.builds && /\.(vue|css|scss|sass|less)$/.test(name)));
|
|
38
|
-
}
|
|
39
18
|
/** Entries recorded at most; past it, unknown paths count as changed. */
|
|
40
19
|
const DEFAULT_LIMIT = 100_000;
|
|
41
20
|
/** A folder is its identity (what is in it is compared entry by entry); a file also its content. */
|
package/dist/output.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.4.
|
|
1
|
+
export declare const CLI_VERSION = "0.4.38";
|
|
2
2
|
export declare function envelope(command: string, result: unknown, ok?: boolean): object;
|
|
3
3
|
export declare function failure(command: string, error: unknown, mutationStarted: boolean): object;
|
package/dist/output.js
CHANGED
package/dist/server.js
CHANGED
|
@@ -37,7 +37,7 @@ import { promisify } from 'node:util';
|
|
|
37
37
|
import { appUrls, readAppHosts } from './app-urls.js';
|
|
38
38
|
import { CONFIG_FILE, configTarget, parseProjectConfig, readProjectSettings, } from './configuration.js';
|
|
39
39
|
import { DevLog, devRunning, writeDevPid } from './dev-log.js';
|
|
40
|
-
import {
|
|
40
|
+
import { WatchedState } from './dev-watch.js';
|
|
41
41
|
import { debug, debugEnabled, describeError, isMissing, reportError } from './diagnostics.js';
|
|
42
42
|
import { appEnvironment, envFileWarnings, readEnvFile } from './env-file.js';
|
|
43
43
|
import { CliError } from './errors.js';
|
|
@@ -1516,6 +1516,8 @@ function inertiaDevServer(root) {
|
|
|
1516
1516
|
const [major, minor, patch] = version;
|
|
1517
1517
|
return major > 0 || minor > 1 || (minor === 1 && patch >= 2);
|
|
1518
1518
|
}
|
|
1519
|
+
/** Files the Vite dev server owns: a change reaches the browser by HMR, not by a restart. */
|
|
1520
|
+
const VIEW_FILE = /(^|[\\/])views[\\/].*\.(js|mjs|ts)$|\.(vue|css|scss|sass|less)$/;
|
|
1519
1521
|
let devReloadId = 0;
|
|
1520
1522
|
/**
|
|
1521
1523
|
* D-0154: asks the app `dokebi dev` runs to read dokebi.yaml again (through the IPC channel of
|
|
@@ -1834,17 +1836,9 @@ export async function dev(root, print) {
|
|
|
1834
1836
|
// dev-watch.ts: macOS also reports writes made before the watch started). An event without a
|
|
1835
1837
|
// name cannot be checked and restarts.
|
|
1836
1838
|
const source = join(root, 'src');
|
|
1837
|
-
// Styles and components reach the app through Vite (HMR, or the watch builds that restart it)
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
hot,
|
|
1841
|
-
builds: helpers.length > 0,
|
|
1842
|
-
pages: installedVersion(root, '@dokebi/pages') !== undefined,
|
|
1843
|
-
};
|
|
1844
|
-
// A site file reaches only a running app: one that is not running (a site with problems refuses
|
|
1845
|
-
// the start, PAGES_INVALID) starts again on the save that fixes it.
|
|
1846
|
-
const appRunning = () => app !== undefined && app.exitCode === null && app.signalCode === null;
|
|
1847
|
-
const viewFile = (name) => reachesWithoutRestart(name, { ...reaches, running: appRunning() });
|
|
1839
|
+
// Styles and components reach the app through Vite (HMR, or the watch builds that restart it).
|
|
1840
|
+
const viewFile = (name) => (hot && VIEW_FILE.test(name)) ||
|
|
1841
|
+
(helpers.length > 0 && /\.(vue|css|scss|sass|less)$/.test(name));
|
|
1848
1842
|
const watched = new WatchedState({ skip: (path) => viewFile(relative(source, path)) });
|
|
1849
1843
|
const watchers = [
|
|
1850
1844
|
watch(source, { recursive: true }, (_event, name) => {
|