@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.
- package/LICENSE +21 -57
- package/dist/build-server-bundle.d.ts +7 -7
- package/dist/build-server-bundle.js +53 -53
- package/dist/build.js +3 -3
- package/dist/compose-stacks.d.ts +2 -2
- package/dist/compose-stacks.js +1 -2
- package/dist/crash-tracker.d.ts +3 -7
- package/dist/crash-tracker.js +4 -13
- package/dist/create-kumiko-server-client-bundles.d.ts +21 -0
- package/dist/create-kumiko-server-client-bundles.js +97 -0
- package/dist/create-kumiko-server-html.d.ts +21 -0
- package/dist/create-kumiko-server-html.js +132 -0
- package/dist/create-kumiko-server-public-files.d.ts +6 -0
- package/dist/create-kumiko-server-public-files.js +96 -0
- package/dist/create-kumiko-server-reload.d.ts +14 -0
- package/dist/create-kumiko-server-reload.js +73 -0
- package/dist/create-kumiko-server-routes.d.ts +16 -0
- package/dist/create-kumiko-server-routes.js +206 -0
- package/dist/create-kumiko-server-shutdown.d.ts +14 -0
- package/dist/create-kumiko-server-shutdown.js +72 -0
- package/dist/create-kumiko-server-stack.d.ts +12 -0
- package/dist/create-kumiko-server-stack.js +101 -0
- package/dist/create-kumiko-server-stylesheet.d.ts +10 -0
- package/dist/create-kumiko-server-stylesheet.js +137 -0
- package/dist/create-kumiko-server-watcher.d.ts +22 -0
- package/dist/create-kumiko-server-watcher.js +155 -0
- package/dist/create-kumiko-server.d.ts +53 -71
- package/dist/create-kumiko-server.js +59 -1076
- package/dist/dev-server-runtime.d.ts +5 -0
- package/dist/dev-server-runtime.js +11 -0
- package/dist/env-schema.d.ts +1 -1
- package/dist/env-schema.js +4 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +17 -15
- package/dist/managed-files/app-jobs.js +1 -1
- package/dist/managed-files/check.js +1 -1
- package/dist/run-dev-app-auth.d.ts +38 -0
- package/dist/run-dev-app-auth.js +155 -0
- package/dist/run-dev-app-config.d.ts +26 -0
- package/dist/run-dev-app-config.js +185 -0
- package/dist/run-dev-app-server-options.d.ts +13 -0
- package/dist/run-dev-app-server-options.js +49 -0
- package/dist/run-dev-app.d.ts +52 -50
- package/dist/run-dev-app.js +100 -471
- package/dist/scaffold-app-feature.js +5 -4
- package/dist/scaffold-app.js +5 -7
- package/dist/schema-apply.d.ts +3 -3
- package/dist/schema-apply.js +16 -16
- package/dist/schema-tables-auth-mode.js +16 -15
- package/dist/schema-tables-minimal.js +7 -7
- package/dist/setup-test-stack-from-features.js +1 -1
- package/dist/welcome-banner.js +2 -2
- package/dist/write-server-lockfile.js +23 -16
- package/package.json +10 -10
- package/src/changes.json +30 -0
- package/templates/managed/ci-public.yml.template +4 -0
package/dist/run-dev-app.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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-
|
|
23
|
-
*
|
|
24
|
-
* hmacSecret
|
|
25
|
-
* `SMTP_HOST
|
|
26
|
-
*
|
|
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.
|
|
29
|
-
* reset
|
|
30
|
-
*
|
|
31
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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-
|
|
76
|
-
* auth-email-password
|
|
77
|
-
*
|
|
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
|
|
98
|
-
*
|
|
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
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
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
|
-
/**
|
|
107
|
+
/** Listening port. Defaults to 4173, or `$PORT` when set. */
|
|
107
108
|
readonly port?: number;
|
|
108
|
-
/**
|
|
109
|
+
/** Additional directories for the file watcher to trigger hot reload. */
|
|
109
110
|
readonly watchDirs?: readonly string[];
|
|
110
|
-
/** SIGINT/SIGTERM
|
|
111
|
-
*
|
|
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
|
-
/**
|
|
117
|
-
*
|
|
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
|
-
/**
|
|
120
|
-
* secrets
|
|
121
|
-
*
|
|
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
|
|
127
|
-
* `createEnvMasterKeyProvider
|
|
128
|
-
*
|
|
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-
|
|
137
|
-
*
|
|
138
|
-
*
|
|
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
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
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
|
|
146
|
-
*
|
|
147
|
-
*
|
|
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-
|
|
153
|
-
* Hono
|
|
154
|
-
*
|
|
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
|
|
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;
|