@cosmicdrift/kumiko-server-runtime 0.368.0 → 0.370.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/dist/boot/boot-crypto.js +17 -11
- package/dist/boot/worker-boot-core.d.ts +1 -1
- package/dist/boot-options/billing-option.d.ts +34 -0
- package/dist/boot-options/billing-option.js +35 -0
- package/dist/boot-options/demo-mode.d.ts +51 -0
- package/dist/boot-options/demo-mode.js +64 -0
- package/dist/boot-options/file-storage-option.d.ts +30 -0
- package/dist/boot-options/file-storage-option.js +52 -0
- package/dist/boot-options/kms-mode.d.ts +27 -0
- package/dist/boot-options/kms-mode.js +40 -0
- package/dist/boot-options/mail-option.d.ts +30 -0
- package/dist/boot-options/mail-option.js +44 -0
- package/dist/boot-options/option-env-schema.d.ts +7 -0
- package/dist/boot-options/option-env-schema.js +113 -0
- package/dist/boot-options/process-signals.d.ts +23 -0
- package/dist/boot-options/process-signals.js +58 -0
- package/dist/boot-options/resolve-boot-options.d.ts +44 -0
- package/dist/boot-options/resolve-boot-options.js +88 -0
- package/dist/boot-options/seed-shortcuts.d.ts +49 -0
- package/dist/boot-options/seed-shortcuts.js +92 -0
- package/dist/boot-options/stack-boot-requirements.d.ts +6 -0
- package/dist/boot-options/stack-boot-requirements.js +63 -0
- package/dist/build-prod-bundle.d.ts +4 -0
- package/dist/build-prod-bundle.js +41 -2
- package/dist/csp-hashes.d.ts +15 -0
- package/dist/csp-hashes.js +46 -0
- package/dist/index.d.ts +18 -9
- package/dist/index.js +1 -0
- package/dist/rate-limit-defaults.d.ts +19 -0
- package/dist/rate-limit-defaults.js +13 -0
- package/dist/resolve-unsubscribe-wiring.d.ts +17 -0
- package/dist/resolve-unsubscribe-wiring.js +24 -0
- package/dist/run-bootstrap.d.ts +2 -2
- package/dist/run-prod-app-boot-context.d.ts +5 -3
- package/dist/run-prod-app-boot-context.js +4 -2
- package/dist/run-prod-app-static-files.d.ts +6 -2
- package/dist/run-prod-app-static-files.js +22 -1
- package/dist/run-prod-app.d.ts +77 -32
- package/dist/run-prod-app.js +172 -120
- package/dist/run-worker-app.d.ts +2 -2
- package/dist/security-headers.d.ts +16 -5
- package/dist/security-headers.js +56 -5
- package/package.json +18 -9
- package/src/changes.json +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-server-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.370.0",
|
|
4
4
|
"description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold tooling.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -81,21 +81,26 @@
|
|
|
81
81
|
"./build-prod-bundle": {
|
|
82
82
|
"types": "./dist/build-prod-bundle.d.ts",
|
|
83
83
|
"default": "./dist/build-prod-bundle.js"
|
|
84
|
+
},
|
|
85
|
+
"./boot-options/billing": {
|
|
86
|
+
"types": "./dist/boot-options/billing-option.d.ts",
|
|
87
|
+
"default": "./dist/boot-options/billing-option.js"
|
|
84
88
|
}
|
|
85
89
|
},
|
|
86
90
|
"dependencies": {
|
|
87
|
-
"@cosmicdrift/kumiko-bundled-features": "0.
|
|
88
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
89
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
90
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.
|
|
91
|
-
"@cosmicdrift/kumiko-renderer-web": "0.
|
|
92
|
-
"@cosmicdrift/kumiko-types": "0.
|
|
91
|
+
"@cosmicdrift/kumiko-bundled-features": "0.370.0",
|
|
92
|
+
"@cosmicdrift/kumiko-framework": "0.370.0",
|
|
93
|
+
"@cosmicdrift/kumiko-headless": "0.370.0",
|
|
94
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.370.0",
|
|
95
|
+
"@cosmicdrift/kumiko-renderer-web": "0.370.0",
|
|
96
|
+
"@cosmicdrift/kumiko-types": "0.370.0",
|
|
93
97
|
"bun-types": "^1.3.13",
|
|
94
98
|
"ioredis": "^5.10.1",
|
|
95
|
-
"temporal-polyfill": "^0.3.2"
|
|
99
|
+
"temporal-polyfill": "^0.3.2",
|
|
100
|
+
"zod": "^4.4.3"
|
|
96
101
|
},
|
|
97
102
|
"devDependencies": {
|
|
98
|
-
"@cosmicdrift/kumiko-testing": "0.
|
|
103
|
+
"@cosmicdrift/kumiko-testing": "0.370.0"
|
|
99
104
|
},
|
|
100
105
|
"publishConfig": {
|
|
101
106
|
"registry": "https://registry.npmjs.org",
|
|
@@ -164,6 +169,10 @@
|
|
|
164
169
|
"./build-prod-bundle": {
|
|
165
170
|
"types": "./dist/build-prod-bundle.d.ts",
|
|
166
171
|
"default": "./dist/build-prod-bundle.js"
|
|
172
|
+
},
|
|
173
|
+
"./boot-options/billing": {
|
|
174
|
+
"types": "./dist/boot-options/billing-option.d.ts",
|
|
175
|
+
"default": "./dist/boot-options/billing-option.js"
|
|
167
176
|
}
|
|
168
177
|
}
|
|
169
178
|
},
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,47 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.370.0",
|
|
4
|
+
"type": "breaking",
|
|
5
|
+
"title": "runProdApp requires envSchema",
|
|
6
|
+
"detail": "envSchema on runProdApp is no longer optional. Without it the boot throws a KumikoBootError that points to composeEnvSchema. An app without its own variables passes composeEnvSchema({ core: frameworkCoreEnvSchema, features }).",
|
|
7
|
+
"migration": "Pass envSchema: composeEnvSchema({ core: frameworkCoreEnvSchema, features }) to runProdApp, with composeEnvSchema from @cosmicdrift/kumiko-framework/env and frameworkCoreEnvSchema from @cosmicdrift/kumiko-dev-server/env-schema. App-level variables go into extend. Delete hand-written env checks that ran before runProdApp; the schema covers them."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"version": "0.370.0",
|
|
11
|
+
"type": "improvement",
|
|
12
|
+
"title": "KUMIKO_DRY_RUN_ENV=boot prints an env table and exits 0 on missing values",
|
|
13
|
+
"detail": "The boot dry run lists every variable of the composed schema with its feature, whether it is required, and whether it is set, missing or invalid. DATABASE_URL, REDIS_URL and JWT_SECRET appear with source server-runtime when the schema does not declare them, since runProdApp reads them itself. Values are never printed, and a validation message that quotes the value is replaced. A keyring the master-key provider cannot use fails the dry run. An invalid value exits 1. A missing required value exits 0 and says the feature wiring was not validated; with every variable present the dry run validates the wiring as before. NODE_ENV=production does not change this. The MFA secret binding and other env reads run after this exit, so an empty env no longer crashes the dry run."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"version": "0.370.0",
|
|
17
|
+
"type": "improvement",
|
|
18
|
+
"title": "runProdApp names the stack and the boot option it is missing",
|
|
19
|
+
"detail": "Features returned by the compose*Stack helpers carry bootRequires ({ stack, options }), a new optional FeatureDefinition field; BootOptionName and StackBootRequirement are exported from @cosmicdrift/kumiko-framework/engine. runProdApp checks them before it wires the boot options and fails with \"[runProdApp] stacks in `features` need boot options that are not set:\" followed by one line per gap, for example \"composeSaasStack needs the boot option `billing`: set billing: { stripe: { priceToTier }, defaultTier }\". composeMailStack and composeUserDataRightsStack need mail (or a mounted channel-email), composeFileStack without providers needs fileStorage (or a mounted file provider), composeGdprStack and composeSecurityStack need kmsMode (or kms / allowPlaintextPii), composeSecurityStack also fails with rateLimit: false, composeSaasStack with billing \"stripe\" needs billing (or a mounted subscription provider). composeFileStack takes providers as optional now. The renderer, pages, ops and identity stacks need no option. resolveBillingOption is exported from @cosmicdrift/kumiko-server-runtime/boot-options/billing for tests that mount the billing wiring on a test stack."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.370.0",
|
|
23
|
+
"type": "improvement",
|
|
24
|
+
"title": "runProdApp effectiveFeatures is deprecated",
|
|
25
|
+
"detail": "effectiveFeatures stays for one release. createTierEngineFeature({ tierMap }), or composeSaasStack, builds the per-tenant feature resolver at boot, and the prod-only features come from the mail, fileStorage and billing options."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"version": "0.370.0",
|
|
29
|
+
"type": "improvement",
|
|
30
|
+
"title": "runProdApp boot options for mail, kmsMode, fileStorage, billing, demoMode, seeds and signals",
|
|
31
|
+
"detail": "New optional runProdApp fields replace hand-wired bin/main.ts code. mail ({ transport: \"smtp-env\" | \"inmemory\" | EmailTransport, from?, resolveEmail?, tenantTransport? }) mounts channel-email and routes the auth mails through it; needs delivery. kmsMode (\"required\" | \"optional\" | { plaintextReason }) builds KMS and blind-index key from PLATFORM_KEK, SUBJECT_KEYS_DATABASE_URL and KUMIKO_BLIND_INDEX_KEY and cannot be combined with kms, blindIndexKey or allowPlaintextPii. fileStorage ({ provider: \"s3-env\" | \"inmemory\" | \"auto\" }) mounts the file provider; auto picks S3 when S3_* is complete and aborts a production boot on a partial S3 env; needs file-foundation. billing ({ stripe: { priceToTier, webhookPath? }, defaultTier }) mounts subscription-stripe and the tier-sync webhook route; needs billing-foundation and tier-engine. demoMode ({ readOnly, notice? }) serves GET /demo-mode and answers writes with 403 demo_read_only while readOnly; demo account credentials are published only when listed in notice.accounts. seeds also takes { demoTenant, demoAdminFromEnv, sysadminFromEnv, run }; the array form still works, but code indexing RunProdAppOptions[\"seeds\"][number] must switch to ProdSeedFn. SIGTERM/SIGINT now run stop() with a 25 s drain timeout (signals: { drainTimeoutMs }) and exit 1 on timeout or error instead of always 0; signals: false hands the signals to the host. The env blocks the options read (SMTP_* for mail smtp-env, S3_* for fileStorage s3-env/auto, the KMS block for kmsMode, STRIPE_* for billing, DEMO_* for the seed shortcuts) join the app's envSchema for the boot dry run and the env validation without the app composing them; keys the option cannot run without (SMTP_HOST, the four S3 keys under s3-env, the seeded accounts) are required there. Without the new fields the boot behaves as before. createSubscriptionTierSync().createWebhookRoute takes an optional { path }. kmsEnvSchema is also exported from @cosmicdrift/kumiko-bundled-features/crypto-shredding/env, which loads without the crypto-shredding feature. Recipe: samples/recipes/prod-boot-options."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"version": "0.370.0",
|
|
35
|
+
"type": "improvement",
|
|
36
|
+
"title": "runProdApp sets a Content-Security-Policy and L1/L2 rate limits without configuration",
|
|
37
|
+
"detail": "Without options, runProdApp now sends a default CSP (default-src 'self'; script-src 'self' plus the sha256 hashes of the build's inline scripts; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none') and limits requests per client IP to 600/60 s (L1) and 30/60 s on /api/auth/* (L2). kumiko build writes dist/csp-hashes.json from every HTML file it outputs; without that file the CSP has no hashes and boot warns. securityHeaders.csp takes false (off), a string (replaces the default) or { extend: { directive: [sources] } }. rateLimit: false disables both layers, partial values override only the named fields. Apps with their own CSP set the header through securityHeaders.csp as a string or move their additions to extend; apps that need neither opt out with csp: false and rateLimit: false. Behind a reverse proxy set trustedProxyHops, otherwise all clients share one rate-limit bucket. Details in docs/reference/security-defaults.md."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"version": "0.370.0",
|
|
41
|
+
"type": "improvement",
|
|
42
|
+
"title": "makeSeedCreateFileRef is exported",
|
|
43
|
+
"detail": "makeSeedCreateFileRef and the SeedCreateFileRef type are exported from @cosmicdrift/kumiko-server-runtime, so app seed scripts can create file references the same way the bootstrap seeder does."
|
|
44
|
+
},
|
|
2
45
|
{
|
|
3
46
|
"version": "0.365.0",
|
|
4
47
|
"type": "fix",
|