@cosmicdrift/kumiko-dev-server 0.152.0 → 0.153.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 +5 -8
- package/src/__tests__/build-prod-bundle.integration.test.ts +1 -1
- package/src/__tests__/compose-stacks.test.ts +1 -1
- package/src/__tests__/discover-format.test.ts +1 -1
- package/src/__tests__/env-schema.integration.test.ts +1 -1
- package/src/__tests__/walkthrough.integration.test.ts +1 -1
- package/src/build.ts +1 -1
- package/src/create-kumiko-server.ts +12 -6
- package/src/index.ts +4 -12
- package/src/run-dev-app.ts +12 -8
- package/src/scaffold-app.ts +9 -4
- package/src/schema-apply.ts +4 -1
- package/src/schema-check-core.ts +1 -1
- package/src/setup-test-stack-from-features.ts +4 -1
- package/src/__tests__/boot-extra-context.test.ts +0 -140
- package/src/__tests__/build-prod-bundle.test.ts +0 -278
- package/src/__tests__/cache-headers.test.ts +0 -83
- package/src/__tests__/compose-features-mfa-wiring.integration.test.ts +0 -308
- package/src/__tests__/compose-features-wiring.integration.test.ts +0 -382
- package/src/__tests__/compose-features.test.ts +0 -128
- package/src/__tests__/config-seed-boot.integration.test.ts +0 -158
- package/src/__tests__/inject-schema.test.ts +0 -62
- package/src/__tests__/pii-boot-gate.test.ts +0 -68
- package/src/__tests__/renderer-web-css-relocation.integration.test.ts +0 -85
- package/src/__tests__/renderer-web-shell-sentinel.test.ts +0 -35
- package/src/__tests__/require-env.test.ts +0 -29
- package/src/__tests__/resolve-auth-mail.test.ts +0 -69
- package/src/__tests__/resolve-tailwind-cli.test.ts +0 -81
- package/src/__tests__/run-prod-app-env-source.test.ts +0 -157
- package/src/__tests__/run-prod-app-spec.test.ts +0 -57
- package/src/__tests__/run-prod-app.integration.test.ts +0 -915
- package/src/__tests__/session-wiring.test.ts +0 -51
- package/src/__tests__/try-hono-first.test.ts +0 -63
- package/src/boot/__tests__/job-run-logger.test.ts +0 -26
- package/src/boot/apply-boot-seeds.ts +0 -19
- package/src/boot/boot-crypto.ts +0 -82
- package/src/boot/job-run-logger.ts +0 -51
- package/src/build-prod-bundle.ts +0 -692
- package/src/compose-features.ts +0 -164
- package/src/extra-routes-deps.ts +0 -47
- package/src/inject-schema.ts +0 -30
- package/src/pii-boot-gate.ts +0 -62
- package/src/resolve-tailwind-cli.ts +0 -45
- package/src/run-prod-app-boot-context.ts +0 -241
- package/src/run-prod-app-static-files.ts +0 -273
- package/src/run-prod-app.ts +0 -1158
- package/src/session-wiring.ts +0 -29
- package/src/try-hono-first.ts +0 -46
package/src/session-wiring.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* runProdApp session-wiring decision (extracted pure so it is testable without a
|
|
3
|
-
* full prod boot).
|
|
4
|
-
*
|
|
5
|
-
* Secure-by-default: mounting the `sessions` feature turns server-side session
|
|
6
|
-
* revocation + sessionStrictMode ON automatically — there is no separate opt-in. The
|
|
7
|
-
* `auth.sessions` option only overrides the config, and `auth.sessions: false` is the
|
|
8
|
-
* explicit opt-out (back to stateless JWTs).
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export type ProdSessionsConfig = { readonly expiresInMs?: number };
|
|
12
|
-
|
|
13
|
-
/** Config object to override defaults, or `false` to disable session wiring entirely. */
|
|
14
|
-
export type ProdSessionsOption = ProdSessionsConfig | false;
|
|
15
|
-
|
|
16
|
-
export function shouldWireProdSessions(
|
|
17
|
-
hasAuth: boolean,
|
|
18
|
-
sessionsFeatureMounted: boolean,
|
|
19
|
-
sessionsOption: ProdSessionsOption | undefined,
|
|
20
|
-
): boolean {
|
|
21
|
-
return hasAuth && sessionsFeatureMounted && sessionsOption !== false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** The config passed to buildProdSessionAuth — `false`/absent collapse to defaults. */
|
|
25
|
-
export function resolveProdSessionsConfig(
|
|
26
|
-
sessionsOption: ProdSessionsOption | undefined,
|
|
27
|
-
): ProdSessionsConfig {
|
|
28
|
-
return sessionsOption || {};
|
|
29
|
-
}
|
package/src/try-hono-first.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Shared helper für die "Hono-first, SPA-fallback wenn 404"-Strategie.
|
|
2
|
-
// Wird von dev (createKumikoServer.handleFetch) UND prod (runProdApp's
|
|
3
|
-
// fetch-handler) verwendet — identische Semantik, ein helper. Ohne den
|
|
4
|
-
// shared-Helper drifteten die beiden Pfade silent (genau der Bug der
|
|
5
|
-
// legal-pages im dev-server geshadowed hat — runProdApp's docs sagten
|
|
6
|
-
// "Hono matched VOR fallback", dev-server tat das NICHT).
|
|
7
|
-
//
|
|
8
|
-
// Pattern:
|
|
9
|
-
// 1. Try app.fetch(req) — wenn Hono eine route matcht, greift sie.
|
|
10
|
-
// 2. 404 vom Hono-stack → null returnen, caller macht SPA-fallback.
|
|
11
|
-
// 3. Sonstige status (200, 401, 500, ...) → response durchreichen.
|
|
12
|
-
//
|
|
13
|
-
// req.clone() weil downstream der req body nochmal lesbar sein muss
|
|
14
|
-
// (POST/PUT/PATCH future-proof — heute nur GET-routes betroffen).
|
|
15
|
-
|
|
16
|
-
export type HonoLikeApp = {
|
|
17
|
-
// Hono.app.fetch ist `(req) => Response | Promise<Response>` (sync wenn
|
|
18
|
-
// alle Handler sync sind, sonst Promise). createApiEntrypoint's
|
|
19
|
-
// apiHandler matcht dieselbe shape. Union accepts both — wir await
|
|
20
|
-
// unten, das funktioniert für beide Fälle.
|
|
21
|
-
readonly fetch: (req: Request) => Response | Promise<Response>;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type HonoFirstResult = {
|
|
25
|
-
/** True wenn Hono eine matchende Route hat (status !== 404).
|
|
26
|
-
* Caller returnt dann response direkt.
|
|
27
|
-
* False wenn keine Route matcht (status === 404). Caller macht den
|
|
28
|
-
* SPA-/static-fallback; response enthält den 404 als final-fallback
|
|
29
|
-
* falls auch der SPA-Pfad nichts liefert. */
|
|
30
|
-
readonly matched: boolean;
|
|
31
|
-
readonly response: Response;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Hono-first try: app.fetch ZUERST. Wenn matched (status !== 404), gibt
|
|
36
|
-
* der caller den response direkt zurück. Wenn nicht matched, fällt der
|
|
37
|
-
* caller in den eigenen SPA-/static-fallback zurück — der response (404)
|
|
38
|
-
* bleibt verfügbar als letztes Sicherheitsnetz.
|
|
39
|
-
*
|
|
40
|
-
* req.clone() weil downstream der req body nochmal lesbar sein muss
|
|
41
|
-
* (POST/PUT/PATCH future-proof — heute nur GET-routes betroffen).
|
|
42
|
-
*/
|
|
43
|
-
export async function tryHonoFirst(app: HonoLikeApp, req: Request): Promise<HonoFirstResult> {
|
|
44
|
-
const response = await app.fetch(req.clone());
|
|
45
|
-
return { matched: response.status !== 404, response };
|
|
46
|
-
}
|