@cosmicdrift/kumiko-dev-server 0.290.0 → 0.292.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-dev-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.292.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>",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"kumiko-upgrade": "./bin/kumiko-upgrade.ts"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
63
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
64
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
65
|
-
"@cosmicdrift/kumiko-server-runtime": "0.
|
|
62
|
+
"@cosmicdrift/kumiko-bundled-features": "0.292.0",
|
|
63
|
+
"@cosmicdrift/kumiko-framework": "0.292.0",
|
|
64
|
+
"@cosmicdrift/kumiko-headless": "0.292.0",
|
|
65
|
+
"@cosmicdrift/kumiko-server-runtime": "0.292.0",
|
|
66
66
|
"ts-morph": "^28.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.291.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "renderWriteHandlerTypes emits the WriteHandlerQn union in stable order",
|
|
6
|
+
"detail": "`renderWriteHandlerTypes` now sorts `handlerQns` before rendering, like its sibling renderers in the same file. The dev-server passes registration order (`collectWriteHandlerQns`) while the CLI/build path passes manifest order, so the same feature set produced a differently ordered `WriteHandlerQn` union in `.kumiko/define.ts` and `.kumiko/types.generated.d.ts` depending on which one ran last. Consumer apps that commit those generated files no longer get order-only diffs after a local `bun dev`."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.289.0",
|
|
4
10
|
"type": "improvement",
|
|
@@ -90,4 +90,11 @@ describe("renderWriteHandlerTypes", () => {
|
|
|
90
90
|
expect(out).toContain("export type WriteHandlerQn =");
|
|
91
91
|
expect(out).toContain('| "tenant:write:create"');
|
|
92
92
|
});
|
|
93
|
+
|
|
94
|
+
test("output does not depend on input order", () => {
|
|
95
|
+
const out = renderWriteHandlerTypes(["a:write:x", "b:write:y"]);
|
|
96
|
+
|
|
97
|
+
expect(renderWriteHandlerTypes(["b:write:y", "a:write:x"])).toBe(out);
|
|
98
|
+
expect(out.indexOf('| "a:write:x"')).toBeLessThan(out.indexOf('| "b:write:y"'));
|
|
99
|
+
});
|
|
93
100
|
});
|
package/src/codegen/render.ts
CHANGED
|
@@ -296,7 +296,9 @@ export function renderDefineFile(handlerQns: readonly string[] = []): string {
|
|
|
296
296
|
export function renderWriteHandlerTypes(handlerQns: readonly string[]): string {
|
|
297
297
|
if (handlerQns.length === 0) return "";
|
|
298
298
|
|
|
299
|
-
|
|
299
|
+
// Stable order — callers pass registration order (dev-server) or manifest
|
|
300
|
+
// order (CLI); bare sort keeps both byte-identical.
|
|
301
|
+
const lines = [...handlerQns].sort().map((qn) => ` | "${qn}"`);
|
|
300
302
|
return ["", WRITE_HANDLER_QN_MARKER, `export type WriteHandlerQn =`, ...lines, ";", ""].join(
|
|
301
303
|
"\n",
|
|
302
304
|
);
|
package/src/run-dev-app.ts
CHANGED
|
@@ -58,11 +58,14 @@ import {
|
|
|
58
58
|
createRegistry,
|
|
59
59
|
type EffectiveFeaturesResolver,
|
|
60
60
|
type FeatureDefinition,
|
|
61
|
+
FILE_STORAGE_PROVIDER_BOOT_SENTINEL,
|
|
62
|
+
FILE_STORAGE_PROVIDER_ENV,
|
|
61
63
|
findTierResolverUsage,
|
|
62
64
|
type Registry,
|
|
63
65
|
type SessionUser,
|
|
64
66
|
type TenantId,
|
|
65
67
|
type TierResolverPlugin,
|
|
68
|
+
type ValidateBootOptions,
|
|
66
69
|
validateAppCustomScreenWriteQns,
|
|
67
70
|
validateBoot,
|
|
68
71
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
@@ -171,6 +174,8 @@ export type RunDevAppOptions = {
|
|
|
171
174
|
* auth-email-password automatisch dazu gemischt — KEIN doppeltes
|
|
172
175
|
* manuelles Hinzufügen nötig. */
|
|
173
176
|
readonly features: readonly FeatureDefinition[];
|
|
177
|
+
/** Opt-in boot-validator warnings — see ValidateBootOptions. */
|
|
178
|
+
readonly validateBootOptions?: ValidateBootOptions;
|
|
174
179
|
/** Pfad zum Browser-Entry-Modul. Bun.build bündelt es zu /client.js.
|
|
175
180
|
* Mutually exclusive mit `clientEntries`. */
|
|
176
181
|
readonly clientEntry?: string;
|
|
@@ -286,9 +291,9 @@ export async function runDevApp(options: RunDevAppOptions): Promise<KumikoServer
|
|
|
286
291
|
// permanent process.env mutation, so a second runDevApp call in the same
|
|
287
292
|
// process (no files this time) doesn't fall through the gate falsely.
|
|
288
293
|
const setFileStorageProviderEnv =
|
|
289
|
-
options.files !== undefined && process.env[
|
|
294
|
+
options.files !== undefined && process.env[FILE_STORAGE_PROVIDER_ENV] === undefined;
|
|
290
295
|
if (setFileStorageProviderEnv) {
|
|
291
|
-
process.env[
|
|
296
|
+
process.env[FILE_STORAGE_PROVIDER_ENV] = FILE_STORAGE_PROVIDER_BOOT_SENTINEL;
|
|
292
297
|
}
|
|
293
298
|
|
|
294
299
|
// Boot-Validation als allererstes — vor fs-Watcher und Server. Dieselbe
|
|
@@ -297,9 +302,9 @@ export async function runDevApp(options: RunDevAppOptions): Promise<KumikoServer
|
|
|
297
302
|
// CrashLoopBackOff sterben ließ (#359). Wirft synchron, bevor ein
|
|
298
303
|
// Socket oder Watcher (codegen-Write) aufgeht.
|
|
299
304
|
try {
|
|
300
|
-
validateBoot(features);
|
|
305
|
+
validateBoot(features, options.validateBootOptions);
|
|
301
306
|
} finally {
|
|
302
|
-
if (setFileStorageProviderEnv) delete process.env[
|
|
307
|
+
if (setFileStorageProviderEnv) delete process.env[FILE_STORAGE_PROVIDER_ENV];
|
|
303
308
|
}
|
|
304
309
|
warnIfNonUtcServerTimeZone();
|
|
305
310
|
validateAppCustomScreenWriteQns(process.cwd(), collectWriteHandlerQns(features));
|