@cosmicdrift/kumiko-dev-server 0.386.0 → 0.388.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.
Files changed (56) hide show
  1. package/LICENSE +21 -57
  2. package/dist/build-server-bundle.d.ts +7 -7
  3. package/dist/build-server-bundle.js +53 -53
  4. package/dist/build.js +3 -3
  5. package/dist/compose-stacks.d.ts +2 -2
  6. package/dist/compose-stacks.js +1 -2
  7. package/dist/crash-tracker.d.ts +3 -7
  8. package/dist/crash-tracker.js +4 -13
  9. package/dist/create-kumiko-server-client-bundles.d.ts +21 -0
  10. package/dist/create-kumiko-server-client-bundles.js +97 -0
  11. package/dist/create-kumiko-server-html.d.ts +21 -0
  12. package/dist/create-kumiko-server-html.js +132 -0
  13. package/dist/create-kumiko-server-public-files.d.ts +6 -0
  14. package/dist/create-kumiko-server-public-files.js +96 -0
  15. package/dist/create-kumiko-server-reload.d.ts +14 -0
  16. package/dist/create-kumiko-server-reload.js +73 -0
  17. package/dist/create-kumiko-server-routes.d.ts +16 -0
  18. package/dist/create-kumiko-server-routes.js +206 -0
  19. package/dist/create-kumiko-server-shutdown.d.ts +14 -0
  20. package/dist/create-kumiko-server-shutdown.js +72 -0
  21. package/dist/create-kumiko-server-stack.d.ts +12 -0
  22. package/dist/create-kumiko-server-stack.js +101 -0
  23. package/dist/create-kumiko-server-stylesheet.d.ts +10 -0
  24. package/dist/create-kumiko-server-stylesheet.js +137 -0
  25. package/dist/create-kumiko-server-watcher.d.ts +22 -0
  26. package/dist/create-kumiko-server-watcher.js +155 -0
  27. package/dist/create-kumiko-server.d.ts +53 -71
  28. package/dist/create-kumiko-server.js +59 -1076
  29. package/dist/dev-server-runtime.d.ts +5 -0
  30. package/dist/dev-server-runtime.js +11 -0
  31. package/dist/env-schema.d.ts +1 -1
  32. package/dist/env-schema.js +4 -4
  33. package/dist/index.d.ts +3 -1
  34. package/dist/index.js +17 -15
  35. package/dist/managed-files/app-jobs.js +1 -1
  36. package/dist/managed-files/check.js +1 -1
  37. package/dist/run-dev-app-auth.d.ts +38 -0
  38. package/dist/run-dev-app-auth.js +155 -0
  39. package/dist/run-dev-app-config.d.ts +26 -0
  40. package/dist/run-dev-app-config.js +185 -0
  41. package/dist/run-dev-app-server-options.d.ts +13 -0
  42. package/dist/run-dev-app-server-options.js +49 -0
  43. package/dist/run-dev-app.d.ts +52 -50
  44. package/dist/run-dev-app.js +100 -471
  45. package/dist/scaffold-app-feature.js +5 -4
  46. package/dist/scaffold-app.js +5 -7
  47. package/dist/schema-apply.d.ts +3 -3
  48. package/dist/schema-apply.js +16 -16
  49. package/dist/schema-tables-auth-mode.js +16 -15
  50. package/dist/schema-tables-minimal.js +7 -7
  51. package/dist/setup-test-stack-from-features.js +1 -1
  52. package/dist/welcome-banner.js +2 -2
  53. package/dist/write-server-lockfile.js +23 -16
  54. package/package.json +10 -10
  55. package/src/changes.json +30 -0
  56. package/templates/managed/ci-public.yml.template +4 -0
@@ -1,12 +1,12 @@
1
- import { type SeedAdminOptions } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/seeding";
1
+ import type { SeedAdminOptions } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/seeding";
2
2
  import type { PostAuthLandingResolver } from "@cosmicdrift/kumiko-framework/api";
3
- import { type KmsAdapter } from "@cosmicdrift/kumiko-framework/crypto";
3
+ import type { KmsAdapter } from "@cosmicdrift/kumiko-framework/crypto";
4
4
  import { type FeatureDefinition, type Registry, type ValidateBootOptions } from "@cosmicdrift/kumiko-framework/engine";
5
- import { type ComposedEnvSchema } from "@cosmicdrift/kumiko-framework/env";
5
+ import type { ComposedEnvSchema } from "@cosmicdrift/kumiko-framework/env";
6
6
  import type { ErrorDocsConfig } from "@cosmicdrift/kumiko-framework/errors";
7
7
  import type { EnvelopeCipher, MasterKeyProvider } from "@cosmicdrift/kumiko-framework/secrets";
8
8
  import type { PageHeadResolver } from "@cosmicdrift/kumiko-renderer/headless/apex";
9
- import { type BillingBootOption, type DemoModeOption, type FileStorageBootOption, type KmsMode, type MailBootOption, type ProdSeedsConfig } from "@cosmicdrift/kumiko-server-runtime";
9
+ import type { BillingBootOption, DemoModeOption, FileStorageBootOption, KmsMode, MailBootOption, ProdSeedsConfig } from "@cosmicdrift/kumiko-server-runtime";
10
10
  import type { TestStack } from "@cosmicdrift/kumiko-testing/stack";
11
11
  import { type CreateKumikoServerOptions, type KumikoServerHandle } from "./create-kumiko-server.ts";
12
12
  export type { AccountLockoutSetup, AccountUnlockSetup, AuthMailOptions, EmailVerificationSetup, InviteSetup, PasswordResetSetup, SignupSetup, } from "@cosmicdrift/kumiko-server-runtime/run-prod-app";
@@ -19,16 +19,16 @@ export type RunDevAppAuthOptions = {
19
19
  /** Optional override of the login error → HTTP status map. Default
20
20
  * maps invalidCredentials → 401, noMembership → 403. */
21
21
  readonly loginErrorStatusMap?: Readonly<Record<string, number>>;
22
- /** Auth-Mail-Convenience — symmetrisch zu RunProdAppAuthOptions.mail.
23
- * Verdrahtet alle 4 Mail-Flows aus env-SMTP + Standard-Templates;
24
- * hmacSecret = `JWT_SECRET`-env (Dev-Fallback wenn ungesetzt). Ohne
25
- * `SMTP_HOST`-env bleiben die Flows unverdrahtet (Null-Transport-Guard).
26
- * Explizite Flow-Setups gewinnen über den mail-Default. */
22
+ /** Auth-mail convenience, symmetric with RunProdAppAuthOptions.mail.
23
+ * Wires all four mail flows from env-based SMTP settings and the default
24
+ * templates; hmacSecret is the `JWT_SECRET` environment value, with a dev
25
+ * fallback when unset. Without `SMTP_HOST`, the flows remain unwired
26
+ * (the null-transport guard). Explicit flow setups override the mail default. */
27
27
  readonly mail?: AuthMailOptions;
28
- /** Password-reset flow. Wenn gesetzt werden /api/auth/request-password-
29
- * reset + /api/auth/reset-password als Public-Routes gemounted UND
30
- * der request/confirm-Handler im auth-email-password-Feature wird
31
- * registriert. Symmetrisch zu RunProdAppAuthOptions.passwordReset. */
28
+ /** Password-reset flow. When set, mounts /api/auth/request-password-
29
+ * reset and /api/auth/reset-password as public routes and registers the
30
+ * request/confirm handlers in the auth-email-password feature. Symmetric
31
+ * with RunProdAppAuthOptions.passwordReset. */
32
32
  readonly passwordReset?: PasswordResetSetup;
33
33
  /** Email-verification flow. Symmetric to passwordReset. */
34
34
  readonly emailVerification?: EmailVerificationSetup;
@@ -36,11 +36,11 @@ export type RunDevAppAuthOptions = {
36
36
  readonly signup?: SignupSetup;
37
37
  /** Tenant-invite flow (magic link). Symmetric. */
38
38
  readonly invite?: InviteSetup;
39
- /** Account-unlock flow (#1266). Symmetric to RunProdAppAuthOptions. */
39
+ /** Account-unlock flow. Symmetric to RunProdAppAuthOptions. */
40
40
  readonly accountUnlock?: AccountUnlockSetup;
41
41
  /** Brute-force guard on the login handler (maxFailedAttempts,
42
42
  * lockoutDurationMinutes). Mounts no routes. Symmetric to
43
- * RunProdAppAuthOptions.accountLockout (kumiko-framework#1627). */
43
+ * RunProdAppAuthOptions.accountLockout. */
44
44
  readonly accountLockout?: AccountLockoutSetup;
45
45
  /** Domain attribute for both auth cookies (see
46
46
  * AuthRoutesConfig.cookieDomain). Symmetric to RunProdAppAuthOptions. */
@@ -55,7 +55,7 @@ export type RunDevAppAuthOptions = {
55
55
  /** Opt out of the Origin guard. Symmetric to RunProdAppAuthOptions. */
56
56
  readonly unsafeSkipOriginCheck?: boolean;
57
57
  /** Number of trusted reverse-proxy hops for client-IP derivation (see
58
- * AuthRoutesConfig.trustedProxyHops, kumiko-framework#1539). Symmetric to
58
+ * AuthRoutesConfig.trustedProxyHops). Symmetric to
59
59
  * RunProdAppAuthOptions — dev usually runs unproxied, so this is normally
60
60
  * left unset (default 0). */
61
61
  readonly trustedProxyHops?: number;
@@ -72,9 +72,9 @@ export type RunDevAppSeedsConfig = Omit<ProdSeedsConfig, "run"> & {
72
72
  readonly run?: readonly SeedFn[];
73
73
  };
74
74
  export type RunDevAppOptions = {
75
- /** App-spezifische Features. Im auth-mode werden config/user/tenant/
76
- * auth-email-password automatisch dazu gemischt — KEIN doppeltes
77
- * manuelles Hinzufügen nötig. */
75
+ /** App-specific features. In auth mode, config/user/tenant/
76
+ * auth-email-password are mixed in automatically, so they must not be
77
+ * added manually as well. */
78
78
  readonly features: readonly FeatureDefinition[];
79
79
  /** Opt-in boot-validator warnings — see ValidateBootOptions. */
80
80
  readonly validateBootOptions?: ValidateBootOptions;
@@ -94,38 +94,39 @@ export type RunDevAppOptions = {
94
94
  * through `runDevApp` show the same resolved head prod does. See
95
95
  * `CreateKumikoServerOptions.resolvePageHead` for the full contract. */
96
96
  readonly resolvePageHead?: PageHeadResolver;
97
- /** CSS-Entry. Default: package-export `@cosmicdrift/kumiko-renderer/web/styles.css`
98
- * wenn ein client-Entry gesetzt ist. `false` deaktiviert die CSS-Pipeline. */
97
+ /** CSS entry. Defaults to the package export
98
+ * `@cosmicdrift/kumiko-renderer/web/styles.css` when a client entry is set.
99
+ * `false` disables the CSS pipeline. */
99
100
  readonly stylesheet?: string | false;
100
101
  /** Tailwind `--watch` process on/off, see `CreateKumikoServerOptions.stylesheetWatch`. */
101
102
  readonly stylesheetWatch?: boolean;
102
- /** Eigenes HTML-Template; sonst minimal-Default (#root + client.js).
103
- * Im Multi-Entry-Mode ist es das Fallback-Template, wenn ein einzelner
104
- * Entry kein eigenes htmlPath setzt. */
103
+ /** Custom HTML template; otherwise uses a minimal default (#root + client.js).
104
+ * In multi-entry mode, this is the fallback template when an entry does not
105
+ * define its own htmlPath. */
105
106
  readonly htmlPath?: string;
106
- /** Listen-Port. Default 4173 (oder $PORT). */
107
+ /** Listening port. Defaults to 4173, or `$PORT` when set. */
107
108
  readonly port?: number;
108
- /** Extra-Verzeichnisse für den File-Watcher (Trigger Hot-Reload). */
109
+ /** Additional directories for the file watcher to trigger hot reload. */
109
110
  readonly watchDirs?: readonly string[];
110
- /** SIGINT/SIGTERM-Handler installieren (Default true; in Tests auf
111
- * false damit repeated boots keine Listener akkumulieren). */
111
+ /** Installs SIGINT/SIGTERM handlers. Defaults to true; tests can disable
112
+ * them so repeated boots do not accumulate listeners. */
112
113
  readonly installSignalHandlers?: boolean;
113
114
  /** Auth mode: standard features mixed in, auth routes wired, seedAdminGuarded
114
115
  * runs in onAfterSetup. Without `auth` the server stays in auto-mint JWT mode. */
115
116
  readonly auth?: RunDevAppAuthOptions;
116
- /** Eigene Seed-Funktionen, laufen nach dem Admin (wenn auth) in
117
- * Array-Reihenfolge. */
117
+ /** App-defined seed functions, run after the admin seed when auth is active,
118
+ * in array order. */
118
119
  readonly seeds?: readonly SeedFn[] | RunDevAppSeedsConfig;
119
- /** Extra-AppContext-Keys. `templateResolver` (immer) + `secrets` (wenn das
120
- * secrets-Feature gemountet ist) + `configResolver` (auth-mode) werden
121
- * automatisch ergänzt — App-Werte gewinnen. Symmetrisch zu runProdApp. */
120
+ /** Additional AppContext keys. `templateResolver` is always added; `secrets`
121
+ * is added when the secrets feature is mounted; and `configResolver` is
122
+ * added in auth mode. App values take precedence. Symmetric with runProdApp. */
122
123
  /** Boot default locale (BCP-47) for ctx.locale when the request carries
123
124
  * no locale signal. Merged into AppContext before extraContext (app wins). */
124
125
  readonly defaultLocale?: string;
125
126
  readonly extraContext?: CreateKumikoServerOptions["extraContext"];
126
- /** MasterKeyProvider für die auto-verdrahtete `ctx.secrets`. Default:
127
- * `createEnvMasterKeyProvider`. Override für KMS-Backends. Nur relevant
128
- * wenn das secrets-Feature gemountet ist. Symmetrisch zu runProdApp. */
127
+ /** MasterKeyProvider for the automatically wired `ctx.secrets`. Defaults to
128
+ * `createEnvMasterKeyProvider`; override it for KMS backends. Only relevant
129
+ * when the secrets feature is mounted. Symmetric with runProdApp. */
129
130
  readonly masterKey?: MasterKeyProvider;
130
131
  /** Subject KMS for PII-annotated fields, the dev counterpart of runProdApp({ kms }).
131
132
  * Unset: an ephemeral DB gets an InMemoryKmsAdapter plus a throwaway blind-index key;
@@ -133,32 +134,33 @@ export type RunDevAppOptions = {
133
134
  * createPgKmsAdapter against that DB there (in-memory DEKs vanish on restart).
134
135
  * `false`: explicit plaintext, with the boot warning. */
135
136
  readonly kms?: KmsAdapter | false;
136
- /** 32-Byte-Key (base64) für Blind-Index-HMACs — Pflicht sobald `kms`
137
- * gesetzt ist und lookupable-Felder gemountet sind (sonst Boot-Abbruch,
138
- * symmetrisch zu runProdApp). */
137
+ /** 32-byte base64 key for blind-index HMACs. Required when `kms` is set and
138
+ * lookupable fields are mounted; otherwise boot aborts. Symmetric with
139
+ * runProdApp. */
139
140
  readonly blindIndexKey?: string;
140
- /** Env-Quelle für die ENV→config-app-override-Brücke (Keys mit `env:`
141
- * bekommen ihren env-Wert als app-override-Default — symmetrisch zu
142
- * runProdApp). Default `process.env`. Injizierbar als Test-Seam, damit
143
- * Tests eigene env-Werte reichen statt `process.env` global zu mutieren. */
141
+ /** Environment source for the ENV-to-config app-override bridge. Keys with
142
+ * `env:` receive their environment value as the app-override default,
143
+ * symmetric with runProdApp.
144
+ * Defaults to `process.env`; injectable as a test seam so tests can provide
145
+ * custom environment values without mutating the global `process.env`. */
144
146
  readonly envSource?: Record<string, string | undefined>;
145
- /** Anonymous-Access für Public-Endpoints — Requests ohne JWT laufen
146
- * als Pseudo-User mit Rolle `anonymous` durch, wenn der Handler die
147
- * Rolle in `access.roles` führt. */
147
+ /** Anonymous access for public endpoints. Requests without a JWT proceed as
148
+ * a pseudo-user with the `anonymous` role when the handler includes that
149
+ * role in `access.roles`. */
148
150
  readonly anonymousAccess?: CreateKumikoServerOptions["anonymousAccess"];
149
151
  /** File-Storage-Provider — aktiviert die Upload-Routes (/api/files) +
150
152
  * `ctx.files`. Demos: `{ storageProvider: createInMemoryFileProvider() }`. */
151
153
  readonly files?: CreateKumikoServerOptions["files"];
152
- /** App-eigene HTTP-Routes (z.B. /feed.xml, /sitemap.xml) — wird ans
153
- * Hono-app gehängt, läuft VOR dem static-asset-Pfad. Symmetrisch zur
154
- * gleichnamigen Option in runProdApp. */
154
+ /** App-defined HTTP routes, such as /feed.xml and /sitemap.xml. They are
155
+ * attached to the Hono app before the static-asset path. Symmetric with the
156
+ * same-named option in runProdApp. */
155
157
  readonly extraRoutes?: CreateKumikoServerOptions["extraRoutes"];
156
158
  /** Framework-managed unsubscribe links and routes, same contract as
157
159
  * `RunProdAppOptions.unsubscribe`; the link base URL comes from `auth.mail.baseUrl`
158
160
  * or `APP_BASE_URL` (dev has no `auth.publicOrigin`). */
159
161
  readonly unsubscribe?: UnsubscribeOption;
160
162
  /** Hook for app-wired co-running components — symmetric to
161
- * runProdApp.wire (kumiko-framework#3050). */
163
+ * runProdApp.wire. */
162
164
  readonly wire?: CreateKumikoServerOptions["wire"];
163
165
  /** Same as `RunProdAppOptions["mail"]`: mounts `channel-email` and wires the auth mail flows. */
164
166
  readonly mail?: MailBootOption;