@cosmicdrift/kumiko-dev-server 0.341.0 → 0.343.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="bun-types" preserve="true" />
|
|
2
2
|
import { type AuthRoutesConfig, type ExtraRouteDefinition } from "@cosmicdrift/kumiko-framework/api";
|
|
3
3
|
import { type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
+
import type { ErrorDocsConfig } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
5
|
import { type TestStack, type TestStackOptions } from "@cosmicdrift/kumiko-framework/stack";
|
|
5
6
|
import { type PageHeadResolver, type PageHeadSystemQuery } from "@cosmicdrift/kumiko-headless/apex";
|
|
6
7
|
import { type SystemWireDeps } from "@cosmicdrift/kumiko-server-runtime/extra-routes-deps";
|
|
@@ -163,6 +164,8 @@ export type CreateKumikoServerOptions = {
|
|
|
163
164
|
* `ServerOptions.trustedProxyHops`. Dev usually runs unproxied, so this
|
|
164
165
|
* is normally left unset (default 0). */
|
|
165
166
|
readonly trustedProxyHops?: number;
|
|
167
|
+
/** Links the app's own error reasons to its own docs (`docsUrl` in error responses); framework reasons keep the framework docs link. */
|
|
168
|
+
readonly errorDocs?: ErrorDocsConfig;
|
|
166
169
|
/** Hook for app-wired co-running components that need the system-write
|
|
167
170
|
* dispatcher — runs after buildServer, before onAfterSetup (seeds), with
|
|
168
171
|
* NO `app` (routes are declared via `extraRoutes`, not wired here). */
|
|
@@ -602,6 +602,7 @@ export async function createKumikoServer(options) {
|
|
|
602
602
|
}),
|
|
603
603
|
...(options.extraRoutes !== undefined && { extraRoutes: options.extraRoutes }),
|
|
604
604
|
...(options.trustedProxyHops !== undefined && { trustedProxyHops: options.trustedProxyHops }),
|
|
605
|
+
...(options.errorDocs && { errorDocs: options.errorDocs }),
|
|
605
606
|
// jobs.consumerLane unset = enqueuer-only; startDevJobRunners below is
|
|
606
607
|
// the sole consumer/cron-scheduler per lane, so runOnBoot/cron jobs
|
|
607
608
|
// don't double-fire. queueNamePrefix keeps this boot's queues isolated
|
package/dist/run-dev-app.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type SeedAdminOptions } from "@cosmicdrift/kumiko-bundled-features/auth
|
|
|
2
2
|
import type { PostAuthLandingResolver } from "@cosmicdrift/kumiko-framework/api";
|
|
3
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 { ErrorDocsConfig } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
6
|
import type { EnvelopeCipher, MasterKeyProvider } from "@cosmicdrift/kumiko-framework/secrets";
|
|
6
7
|
import type { TestStack } from "@cosmicdrift/kumiko-framework/stack";
|
|
7
8
|
import type { PageHeadResolver } from "@cosmicdrift/kumiko-headless/apex";
|
|
@@ -169,6 +170,8 @@ export type RunDevAppOptions = {
|
|
|
169
170
|
* env var. Dev usually runs unproxied, so this is normally left unset
|
|
170
171
|
* (default 0). */
|
|
171
172
|
readonly trustedProxyHops?: number;
|
|
173
|
+
/** Links the app's own error reasons to its own docs (`docsUrl` in error responses); framework reasons keep the framework docs link. */
|
|
174
|
+
readonly errorDocs?: ErrorDocsConfig;
|
|
172
175
|
};
|
|
173
176
|
export declare function runDevApp(options: RunDevAppOptions): Promise<KumikoServerHandle>;
|
|
174
177
|
export declare function mergeConfigResolverDefault(ctx: CreateKumikoServerOptions["extraContext"], registry: Registry, envSource: Record<string, string | undefined>, cipher?: EnvelopeCipher): CreateKumikoServerOptions["extraContext"];
|
package/dist/run-dev-app.js
CHANGED
|
@@ -32,7 +32,7 @@ import { assertSessionBootInvariants } from "@cosmicdrift/kumiko-server-runtime/
|
|
|
32
32
|
import { watchAndRegenerate } from "./codegen/index.js";
|
|
33
33
|
import { createKumikoServer, } from "./create-kumiko-server.js";
|
|
34
34
|
import { renderWelcomeBanner } from "./welcome-banner.js";
|
|
35
|
-
import { addConfigAccessorFactory, buildBootExtraContext, requireEnv, resolveAuthMail, } from "@cosmicdrift/kumiko-server-runtime/run-prod-app";
|
|
35
|
+
import { addConfigAccessorFactory, buildBootExtraContext, loggerFromExtraContext, requireEnv, resolveAuthMail, } from "@cosmicdrift/kumiko-server-runtime/run-prod-app";
|
|
36
36
|
export async function runDevApp(options) {
|
|
37
37
|
// Auto-mix Standard-Features im auth-mode via composeFeatures (single
|
|
38
38
|
// source of truth — auch runProdApp und der per-app drizzle-Schema-
|
|
@@ -156,6 +156,8 @@ export async function runDevApp(options) {
|
|
|
156
156
|
// mit hasAuth:false (configResolver kommt schon aus cfgExtra), App-Werte
|
|
157
157
|
// (cfgExtra) gewinnen über die Boot-Defaults.
|
|
158
158
|
const extraContext = (deps) => {
|
|
159
|
+
const base = typeof cfgExtra === "function" ? cfgExtra(deps) : (cfgExtra ?? {});
|
|
160
|
+
const bootLogger = loggerFromExtraContext(base);
|
|
159
161
|
const boot = buildBootExtraContext({
|
|
160
162
|
db: deps.db,
|
|
161
163
|
features,
|
|
@@ -164,8 +166,8 @@ export async function runDevApp(options) {
|
|
|
164
166
|
hasAuth: false,
|
|
165
167
|
sseBroker: deps.sseBroker,
|
|
166
168
|
crypto: bootCrypto,
|
|
169
|
+
...(bootLogger && { log: bootLogger }),
|
|
167
170
|
});
|
|
168
|
-
const base = typeof cfgExtra === "function" ? cfgExtra(deps) : (cfgExtra ?? {});
|
|
169
171
|
return {
|
|
170
172
|
...boot,
|
|
171
173
|
...(options.defaultLocale !== undefined && { defaultLocale: options.defaultLocale }),
|
|
@@ -219,6 +221,7 @@ export async function runDevApp(options) {
|
|
|
219
221
|
const handle = await createKumikoServer({
|
|
220
222
|
features,
|
|
221
223
|
...(options.clientEntry !== undefined && { clientEntry: options.clientEntry }),
|
|
224
|
+
...(options.errorDocs && { errorDocs: options.errorDocs }),
|
|
222
225
|
...(options.clientEntries !== undefined && { clientEntries: options.clientEntries }),
|
|
223
226
|
...(options.hostDispatch !== undefined && { hostDispatch: options.hostDispatch }),
|
|
224
227
|
...(options.resolvePageHead !== undefined && { resolvePageHead: options.resolvePageHead }),
|
package/dist/scaffold-app.js
CHANGED
|
@@ -37,6 +37,8 @@ export async function scaffoldApp(options) {
|
|
|
37
37
|
files.push("package.json");
|
|
38
38
|
write(join(destination, "tsconfig.json"), renderTsconfig());
|
|
39
39
|
files.push("tsconfig.json");
|
|
40
|
+
write(join(destination, "kumiko.json"), renderKumikoManifest());
|
|
41
|
+
files.push("kumiko.json");
|
|
40
42
|
write(join(destination, "biome.json"), renderBiomeJson());
|
|
41
43
|
files.push("biome.json");
|
|
42
44
|
if (testSetup === undefined) {
|
|
@@ -752,6 +754,16 @@ function renderKumikoSchema() {
|
|
|
752
754
|
"",
|
|
753
755
|
].join("\n");
|
|
754
756
|
}
|
|
757
|
+
// `kumiko check` fails a kind "app" without uiRoots, so a fresh app must declare them.
|
|
758
|
+
function renderKumikoManifest() {
|
|
759
|
+
return `${JSON.stringify({
|
|
760
|
+
kind: "app",
|
|
761
|
+
sourceRoots: ["src", "bin"],
|
|
762
|
+
testGlobs: ["src/**/*.{test,integration}.{ts,tsx}"],
|
|
763
|
+
uiRoots: ["src/features/*/web"],
|
|
764
|
+
excludes: ["**/node_modules/**", "**/dist/**"],
|
|
765
|
+
}, null, 2)}\n`;
|
|
766
|
+
}
|
|
755
767
|
function renderBinKumiko() {
|
|
756
768
|
return [
|
|
757
769
|
"#!/usr/bin/env bun",
|
|
@@ -761,8 +773,10 @@ function renderBinKumiko() {
|
|
|
761
773
|
"// consumer status|restart <name>` to recover a dead event consumer without",
|
|
762
774
|
"// ad-hoc SQL. kumiko-build bundles this file to dist-server/kumiko.js.",
|
|
763
775
|
"",
|
|
776
|
+
'import { frameworkCoreEnvSchema } from "@cosmicdrift/kumiko-dev-server/env-schema";',
|
|
764
777
|
'import { composeFeatures } from "@cosmicdrift/kumiko-server-runtime/compose-features";',
|
|
765
778
|
'import { runConsumerCli } from "@cosmicdrift/kumiko-framework/consumer-cli";',
|
|
779
|
+
'import { composeEnvSchema, kmsSlotsOf } from "@cosmicdrift/kumiko-framework/env";',
|
|
766
780
|
'import { runSchemaCli } from "@cosmicdrift/kumiko-framework/schema-cli";',
|
|
767
781
|
'import { APP_FEATURES, HAS_AUTH } from "../src/run-config";',
|
|
768
782
|
"",
|
|
@@ -772,7 +786,8 @@ function renderBinKumiko() {
|
|
|
772
786
|
"",
|
|
773
787
|
'if (cmd === "schema") {',
|
|
774
788
|
" const features = composeFeatures([...APP_FEATURES], { includeBundled: HAS_AUTH });",
|
|
775
|
-
"
|
|
789
|
+
" const kmsSlots = kmsSlotsOf(composeEnvSchema({ core: frameworkCoreEnvSchema, features }).schema);",
|
|
790
|
+
" process.exit(await runSchemaCli(rest, process.env.INIT_CWD ?? process.cwd(), out, { features, kmsSlots }));",
|
|
776
791
|
"}",
|
|
777
792
|
"",
|
|
778
793
|
'if (cmd === "consumer") {',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-dev-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.343.0",
|
|
4
4
|
"description": "Dev-tooling for Kumiko apps: local dev-server bootstrap (runDevApp), scaffolding, codegen. Its compose-stacks/env-schema subpaths are consumed at prod boot too — see @cosmicdrift/kumiko-server-runtime for the prod runner itself.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"kumiko-upgrade": "./bin/kumiko-upgrade.ts"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
68
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
69
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
70
|
-
"@cosmicdrift/kumiko-renderer-web": "0.
|
|
71
|
-
"@cosmicdrift/kumiko-server-runtime": "0.
|
|
67
|
+
"@cosmicdrift/kumiko-bundled-features": "0.343.0",
|
|
68
|
+
"@cosmicdrift/kumiko-framework": "0.343.0",
|
|
69
|
+
"@cosmicdrift/kumiko-headless": "0.343.0",
|
|
70
|
+
"@cosmicdrift/kumiko-renderer-web": "0.343.0",
|
|
71
|
+
"@cosmicdrift/kumiko-server-runtime": "0.343.0",
|
|
72
72
|
"bun-types": "^1.3.13",
|
|
73
73
|
"ts-morph": "^28.0.0",
|
|
74
74
|
"zod": "^4.4.3"
|