@dokebi/cli 0.4.1 → 0.4.26
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 +262 -57
- package/README.md +35 -10
- package/catalog.json +2519 -257
- package/describe.schema.json +748 -0
- package/dist/api-app.d.ts +2 -0
- package/dist/api-app.js +35 -0
- package/dist/app-urls.js +3 -2
- package/dist/bin.js +527 -35
- package/dist/capability-guide.d.ts +30 -0
- package/dist/capability-guide.js +122 -0
- package/dist/catalog.d.ts +16 -2
- package/dist/catalog.js +19 -7
- package/dist/check/asset-rules.d.ts +6 -0
- package/dist/check/asset-rules.js +163 -0
- package/dist/check/browser-sources.d.ts +20 -0
- package/dist/check/browser-sources.js +89 -0
- package/dist/check/console-rules.d.ts +6 -0
- package/dist/check/console-rules.js +40 -0
- package/dist/check/error-rules.d.ts +21 -0
- package/dist/check/error-rules.js +212 -0
- package/dist/check/form-rules.d.ts +12 -0
- package/dist/check/form-rules.js +69 -6
- package/dist/check/formatter-rules.d.ts +2 -0
- package/dist/check/formatter-rules.js +71 -0
- package/dist/check/i18n-rules.d.ts +27 -0
- package/dist/check/i18n-rules.js +353 -0
- package/dist/check/index.d.ts +15 -1
- package/dist/check/index.js +89 -11
- package/dist/check/mail-rules.d.ts +4 -0
- package/dist/check/mail-rules.js +72 -0
- package/dist/check/module-rules.d.ts +13 -0
- package/dist/check/module-rules.js +104 -0
- package/dist/check/packages.d.ts +8 -0
- package/dist/check/packages.js +16 -0
- package/dist/check/pool-rules.d.ts +8 -0
- package/dist/check/pool-rules.js +164 -0
- package/dist/check/problems.d.ts +6 -1
- package/dist/check/problems.js +100 -2
- package/dist/check/project-rules.d.ts +23 -3
- package/dist/check/project-rules.js +265 -23
- package/dist/check/seal-rules.d.ts +6 -0
- package/dist/check/seal-rules.js +68 -0
- package/dist/check/security-rules.d.ts +10 -0
- package/dist/check/security-rules.js +450 -0
- package/dist/check/shared-state-rules.d.ts +2 -0
- package/dist/check/shared-state-rules.js +114 -0
- package/dist/check/source-rules.d.ts +26 -3
- package/dist/check/source-rules.js +249 -28
- package/dist/check/structure-rules.d.ts +23 -0
- package/dist/check/structure-rules.js +502 -0
- package/dist/check/timer-rules.d.ts +7 -0
- package/dist/check/timer-rules.js +543 -0
- package/dist/check/typescript.d.ts +35 -5
- package/dist/check/typescript.js +163 -17
- package/dist/check/vite-rules.d.ts +2 -0
- package/dist/check/vite-rules.js +136 -0
- package/dist/check/wait-rules.d.ts +16 -0
- package/dist/check/wait-rules.js +337 -0
- package/dist/commands.d.ts +7 -0
- package/dist/commands.js +307 -31
- package/dist/config-diff.d.ts +42 -0
- package/dist/config-diff.js +289 -0
- package/dist/config-edit.d.ts +35 -2
- package/dist/config-edit.js +145 -13
- package/dist/config-init.d.ts +15 -0
- package/dist/config-init.js +61 -0
- package/dist/config-paths.d.ts +22 -0
- package/dist/config-paths.js +82 -0
- package/dist/config-show.d.ts +82 -0
- package/dist/config-show.js +563 -0
- package/dist/config-values.d.ts +8 -0
- package/dist/config-values.js +68 -0
- package/dist/configuration-scaffold.d.ts +42 -0
- package/dist/configuration-scaffold.js +258 -4
- package/dist/configuration.d.ts +63 -3
- package/dist/configuration.js +178 -4
- package/dist/deployment.d.ts +2 -0
- package/dist/deployment.js +111 -0
- package/dist/describe-db.d.ts +22 -0
- package/dist/describe-db.js +176 -0
- package/dist/describe.d.ts +92 -0
- package/dist/describe.js +417 -0
- package/dist/dev-compose.d.ts +20 -0
- package/dist/dev-compose.js +154 -0
- package/dist/dev-guard.js +44 -0
- package/dist/dev-host.d.ts +13 -0
- package/dist/dev-host.js +55 -0
- package/dist/dev-infra.d.ts +72 -4
- package/dist/dev-infra.js +237 -17
- package/dist/dev-watch.d.ts +34 -0
- package/dist/dev-watch.js +192 -0
- package/dist/diagnostics.d.ts +10 -7
- package/dist/diagnostics.js +22 -4
- package/dist/drift.d.ts +50 -0
- package/dist/drift.js +218 -0
- package/dist/env-file.d.ts +25 -1
- package/dist/env-file.js +64 -6
- package/dist/errors.d.ts +7 -1
- package/dist/example-config.d.ts +2 -0
- package/dist/example-config.js +3 -0
- package/dist/first-admin.d.ts +43 -0
- package/dist/first-admin.js +175 -0
- package/dist/formatter-ignore.d.ts +37 -0
- package/dist/formatter-ignore.js +344 -0
- package/dist/generator.d.ts +45 -3
- package/dist/generator.js +205 -15
- package/dist/guide.d.ts +1 -1
- package/dist/guide.js +42 -21
- package/dist/install-module.d.ts +29 -3
- package/dist/install-module.js +142 -13
- package/dist/install-plan.js +5 -3
- package/dist/layout.d.ts +12 -1
- package/dist/layout.js +19 -6
- package/dist/log-writer-control.d.ts +2 -0
- package/dist/log-writer-control.js +106 -27
- package/dist/log-writer.js +43 -10
- package/dist/logging-config.d.ts +8 -3
- package/dist/logging-config.js +19 -5
- package/dist/manifest.d.ts +29 -1
- package/dist/manifest.js +84 -6
- package/dist/merge-install-defaults.d.ts +0 -1
- package/dist/merge-install-defaults.js +13 -47
- package/dist/npm-client.d.ts +59 -4
- package/dist/npm-client.js +220 -16
- package/dist/npm-paths.js +18 -4
- package/dist/openapi.d.ts +27 -0
- package/dist/openapi.js +649 -0
- package/dist/option-fixes.d.ts +39 -0
- package/dist/option-fixes.js +130 -0
- package/dist/output.d.ts +1 -1
- package/dist/output.js +5 -5
- package/dist/plugin-lifecycle.d.ts +34 -2
- package/dist/plugin-lifecycle.js +206 -20
- package/dist/plugin-options.d.ts +19 -4
- package/dist/plugin-options.js +138 -6
- package/dist/plugins-command.js +44 -7
- package/dist/process-group.d.ts +39 -0
- package/dist/process-group.js +132 -0
- package/dist/project-guide.d.ts +19 -1
- package/dist/project-guide.js +119 -20
- package/dist/project-inspector.d.ts +15 -0
- package/dist/project-inspector.js +481 -33
- package/dist/project-state.d.ts +5 -0
- package/dist/project-state.js +8 -0
- package/dist/project.d.ts +203 -19
- package/dist/project.js +3016 -336
- package/dist/recipe-facts.d.ts +127 -0
- package/dist/recipe-facts.js +563 -0
- package/dist/recipe-login.d.ts +63 -0
- package/dist/recipe-login.js +464 -0
- package/dist/recipe-mail.d.ts +21 -0
- package/dist/recipe-mail.js +214 -0
- package/dist/recipe-members.d.ts +35 -0
- package/dist/recipe-members.js +178 -0
- package/dist/recipe-record.d.ts +82 -7
- package/dist/recipe-record.js +226 -22
- package/dist/recipe-reset.d.ts +2 -0
- package/dist/recipe-reset.js +117 -0
- package/dist/recipe-site.d.ts +48 -0
- package/dist/recipe-site.js +396 -0
- package/dist/recipe-step.d.ts +42 -0
- package/dist/recipe-step.js +89 -0
- package/dist/recipe.d.ts +56 -20
- package/dist/recipe.js +703 -131
- package/dist/registry.d.ts +98 -2
- package/dist/registry.js +171 -5
- package/dist/reloadable.d.ts +35 -0
- package/dist/reloadable.js +257 -0
- package/dist/server.d.ts +50 -4
- package/dist/server.js +790 -103
- package/dist/settings.d.ts +48 -0
- package/dist/settings.js +168 -0
- package/dist/site-auth.d.ts +39 -0
- package/dist/site-auth.js +195 -0
- package/dist/template-fixes.d.ts +26 -0
- package/dist/template-fixes.js +285 -0
- package/dist/test-reporter.d.ts +49 -0
- package/dist/test-reporter.js +190 -0
- package/dist/transaction.d.ts +67 -0
- package/dist/transaction.js +428 -46
- package/dist/verify-tests.d.ts +98 -0
- package/dist/verify-tests.js +449 -0
- package/dist/verify.d.ts +113 -4
- package/dist/verify.js +326 -28
- package/dist/view-choice.d.ts +58 -0
- package/dist/view-choice.js +131 -0
- package/dist/vite-watch.js +4 -2
- package/package.json +8 -6
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { FirstAdmin } from './first-admin.js';
|
|
2
|
+
import type { UserStoreProbe } from './site-auth.js';
|
|
3
|
+
/** What a fact notice is about; its arguments are words without spaces (domains, a mode). */
|
|
4
|
+
export type Fact = {
|
|
5
|
+
readonly id: 'site';
|
|
6
|
+
} | {
|
|
7
|
+
readonly id: 'csrf';
|
|
8
|
+
readonly mode: CsrfMode;
|
|
9
|
+
} | {
|
|
10
|
+
readonly id: 'seal';
|
|
11
|
+
readonly view: 'ejs' | 'inertia';
|
|
12
|
+
readonly domains: readonly string[];
|
|
13
|
+
} | {
|
|
14
|
+
readonly id: 'ssr-seal';
|
|
15
|
+
readonly domains: readonly string[];
|
|
16
|
+
} | {
|
|
17
|
+
readonly id: 'mail';
|
|
18
|
+
} | {
|
|
19
|
+
readonly id: 'session';
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The CSRF notice of a plan: `inertia` and `form-body` (EJS forms) for the blog, `site-api`
|
|
23
|
+
* (application API calls), `site-inertia` and `site-ejs` (the site's browser apps).
|
|
24
|
+
*/
|
|
25
|
+
export type CsrfMode = 'inertia' | 'form-body' | 'site-api' | 'site-inertia' | 'site-ejs';
|
|
26
|
+
/** The recorded form of a fact notice. */
|
|
27
|
+
export declare function factToken(fact: Fact): string;
|
|
28
|
+
/** The fact of a recorded token; undefined for any other notice (or a token this CLI does not know). */
|
|
29
|
+
export declare function parseFact(notice: string): Fact | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* How the forms of a plan send the CSRF token (D-0076 §6): @dokebi/csrf is installed for every
|
|
32
|
+
* write form, so the report says what each view does instead of "no CSRF protection".
|
|
33
|
+
*/
|
|
34
|
+
export declare function csrfNotice(inertia: boolean): string;
|
|
35
|
+
/** The seal head an EJS layout writes in its `<head>` (the shipped template-ejs layout's words). */
|
|
36
|
+
export declare const SEAL_HEAD = "<%- data.seal?.head ?? '' %>";
|
|
37
|
+
/**
|
|
38
|
+
* The browser module the generated Inertia entry (`views/app.js`) imports on sealed pages: it
|
|
39
|
+
* imports `@dokebi/seal/http`, which `dokebiInertia()` of the generated vite.config.ts maps to this
|
|
40
|
+
* served file (D-0062 addendum 2026-10-20).
|
|
41
|
+
*/
|
|
42
|
+
export declare const SEAL_HTTP_MODULE = "/dokebi/seal/http.mjs";
|
|
43
|
+
/**
|
|
44
|
+
* What the user must know about the sealed browser hosts of a plan (D-0092 §1, D-0062): the
|
|
45
|
+
* consumer convention seals every browser app. EJS forms keep working without per-form code;
|
|
46
|
+
* Inertia pages and visits go sealed through the bootstrap of the generated entry.
|
|
47
|
+
*/
|
|
48
|
+
export declare function sealNotice(domains: readonly string[], view?: 'ejs' | 'inertia'): string;
|
|
49
|
+
/**
|
|
50
|
+
* Why the browser hosts of a server-rendered Inertia plan stay unsealed (D-0062 §5): SSR writes
|
|
51
|
+
* the page props into the first HTML as plain text, so @dokebi/template-inertia refuses to start
|
|
52
|
+
* an SSR scope on a seal host (SEAL_SSR_CONFLICT). The user chose SSR; the convention still asks
|
|
53
|
+
* for Seal, so the user decides between the two.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ssrSealNotice(domains: readonly string[]): string;
|
|
56
|
+
/**
|
|
57
|
+
* Which hosts gain from seal (the @dokebi/seal guide, audit 2026-10-25): a host that only shows
|
|
58
|
+
* public pages needs no seal, so SSR there is no conflict to ask the user about.
|
|
59
|
+
*/
|
|
60
|
+
export declare const READ_ONLY_HOSTS = "Seal a host whose pages send data (forms, sealedFetch, Inertia visits). A host that only shows public pages (no writes, no signed-in JSON) gains nothing from seal: leave its domain without `seal: true`. Its pages then need no seal files and no 'wasm-unsafe-eval', and may use Inertia SSR.";
|
|
61
|
+
/** What @dokebi/session would add to an EJS blog without it (AI-M05 F3). */
|
|
62
|
+
export declare const SESSION_OFFER = "npx dokebi add @dokebi/session makes a refused form go back to its page with the typed values and the field messages";
|
|
63
|
+
/** The notice of an EJS plan without @dokebi/session (AI-M05 F3: not installed behind the user's back). */
|
|
64
|
+
export declare const SESSION_NOTICE = "Without @dokebi/session (not part of these choices), a form with invalid input shows an error page instead of coming back with what was typed; say if you want it added (npx dokebi add @dokebi/session).";
|
|
65
|
+
/** The parts of the site plan the planned site notice names (siteDefinition). */
|
|
66
|
+
export interface PlannedSite {
|
|
67
|
+
readonly apps: readonly string[];
|
|
68
|
+
readonly realms: Readonly<Record<string, string>>;
|
|
69
|
+
readonly worker: string;
|
|
70
|
+
}
|
|
71
|
+
/** What the plan does, for the recipe's report. */
|
|
72
|
+
export interface PlanFacts {
|
|
73
|
+
readonly recipe: string;
|
|
74
|
+
readonly site?: PlannedSite;
|
|
75
|
+
/** The login name of the first admin the plan writes (or keeps), when it has an admin login. */
|
|
76
|
+
readonly adminLogin?: string;
|
|
77
|
+
}
|
|
78
|
+
/** The notice of a fact as the plan makes it (the recipe's report). */
|
|
79
|
+
export declare function plannedText(fact: Fact, plan: PlanFacts): string;
|
|
80
|
+
/** What verify read from the project for the fact notices. */
|
|
81
|
+
export interface ProjectFacts {
|
|
82
|
+
readonly root: string;
|
|
83
|
+
/** The ids of the installed plugins (.dokebi/state.json). */
|
|
84
|
+
readonly installed: ReadonlySet<string>;
|
|
85
|
+
readonly options: Record<string, unknown>;
|
|
86
|
+
/** The id of the plugin that hosts apps (`dokebi-app`), when one is installed. */
|
|
87
|
+
readonly appsHost?: string;
|
|
88
|
+
/** The app verify started was ready: every plugin set up, every job queue bound. */
|
|
89
|
+
readonly started: boolean;
|
|
90
|
+
readonly firstAdmin: () => Promise<FirstAdmin>;
|
|
91
|
+
readonly userStores: (realms: readonly string[]) => Promise<UserStoreProbe>;
|
|
92
|
+
/**
|
|
93
|
+
* The settings file `options` was read from, as the CLI names it (M50: the one DOKEBI_CONFIG
|
|
94
|
+
* names, else dokebi.yaml, the default when left out); the notices name it.
|
|
95
|
+
*/
|
|
96
|
+
readonly settingsFile?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Reads the installed plugins and the settings file (DOKEBI_CONFIG, else dokebi.yaml) for `projectText`; undefined (and a debug line with
|
|
100
|
+
* the error) when either cannot be read, and the notices then say the CLI could not read them.
|
|
101
|
+
*/
|
|
102
|
+
export declare function readProjectFacts(root: string, input: Pick<ProjectFacts, 'started' | 'firstAdmin' | 'userStores'>): Promise<ProjectFacts | undefined>;
|
|
103
|
+
/** The notice of a fact when the project could not be read: that, and where to look. */
|
|
104
|
+
export declare function unreadText(fact: Fact, recipe: string): string;
|
|
105
|
+
/** The notice of a fact as the project is now; '' when nothing is left to say (the line is dropped). */
|
|
106
|
+
export declare function projectText(fact: Fact, entry: {
|
|
107
|
+
readonly recipe: string;
|
|
108
|
+
readonly answers: Readonly<Record<string, {
|
|
109
|
+
value: string;
|
|
110
|
+
}>>;
|
|
111
|
+
}, facts: ProjectFacts): Promise<string>;
|
|
112
|
+
/** What the probe of the realms' hooks found (site-auth.ts), in words. */
|
|
113
|
+
export declare function userStoreText(probe: UserStoreProbe): string;
|
|
114
|
+
/** The fact of a notice a record before D-0137 holds as a sentence; undefined for any other. */
|
|
115
|
+
export declare function recordedFact(notice: string): Fact | undefined;
|
|
116
|
+
/** The fact of a recorded notice: a token, or an old sentence; undefined for any other notice. */
|
|
117
|
+
export declare function factOf(notice: string): Fact | undefined;
|
|
118
|
+
/** The key of a fact notice of a recipe in the map verify fills (`factTexts`). */
|
|
119
|
+
export declare function factKey(recipe: string, fact: Fact): string;
|
|
120
|
+
/** Every fact notice of the recipes as the project is now (verify), by `factKey`. */
|
|
121
|
+
export declare function factTexts(recipes: readonly {
|
|
122
|
+
readonly recipe: string;
|
|
123
|
+
readonly notices: readonly string[];
|
|
124
|
+
readonly answers: Readonly<Record<string, {
|
|
125
|
+
value: string;
|
|
126
|
+
}>>;
|
|
127
|
+
}[], facts: ProjectFacts | undefined): Promise<Map<string, string>>;
|