@cosmicdrift/kumiko-framework 0.141.0 → 0.142.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-framework",
3
- "version": "0.141.0",
3
+ "version": "0.142.0",
4
4
  "description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -189,7 +189,7 @@
189
189
  "zod": "^4.4.3"
190
190
  },
191
191
  "devDependencies": {
192
- "@cosmicdrift/kumiko-dispatcher-live": "0.141.0",
192
+ "@cosmicdrift/kumiko-dispatcher-live": "0.142.0",
193
193
  "bun-types": "^1.3.13",
194
194
  "pino-pretty": "^13.1.3"
195
195
  },
@@ -95,11 +95,7 @@ describe("buildTarget — Compile-Time-Safety (verified via @ts-expect-error)",
95
95
 
96
96
  test("falsche args-shape wird vom Compiler abgelehnt", () => {
97
97
  // @ts-expect-error — slug muss string sein, nicht number
98
- buildTarget({
99
- target: textContentStub,
100
- action: "edit",
101
- args: { slug: 42 },
102
- });
98
+ buildTarget({ target: textContentStub, action: "edit", args: { slug: 42 } });
103
99
  // Runtime: korrekt-typed args liefern valid TargetRef
104
100
  const ref = buildTarget({
105
101
  target: textContentStub,
@@ -110,12 +106,8 @@ describe("buildTarget — Compile-Time-Safety (verified via @ts-expect-error)",
110
106
  });
111
107
 
112
108
  test("args bei NoArgs-Action wird vom Compiler abgelehnt", () => {
113
- buildTarget({
114
- target: textContentStub,
115
- action: "list",
116
- // @ts-expect-error — list hat keine args, args-Feld nicht erlaubt
117
- args: { x: 1 },
118
- });
109
+ // @ts-expect-error — list hat keine args, args-Feld nicht erlaubt
110
+ buildTarget({ target: textContentStub, action: "list", args: { x: 1 } });
119
111
  // Runtime: NoArgs-Action ohne args-Feld liefert valid TargetRef
120
112
  const ref = buildTarget({ target: textContentStub, action: "list" });
121
113
  expect("args" in ref).toBe(false);
@@ -139,18 +139,10 @@ describe("Schicht-1↔Schicht-2 Bridge — buildTarget against real defineFeatur
139
139
  buildTarget({ target: textContent.exports.handle, action: "delet", args: { slug: "x" } });
140
140
 
141
141
  // @ts-expect-error — slug muss string sein, nicht number
142
- buildTarget({
143
- target: textContent.exports.handle,
144
- action: "edit",
145
- args: { slug: 42 },
146
- });
142
+ buildTarget({ target: textContent.exports.handle, action: "edit", args: { slug: 42 } });
147
143
 
148
- buildTarget({
149
- target: textContent.exports.handle,
150
- action: "list",
151
- // @ts-expect-error — list hat keine args, args-Feld nicht erlaubt
152
- args: { x: 1 },
153
- });
144
+ // @ts-expect-error — list hat keine args, args-Feld nicht erlaubt
145
+ buildTarget({ target: textContent.exports.handle, action: "list", args: { x: 1 } });
154
146
 
155
147
  // @ts-expect-error — edit braucht args, fehlt
156
148
  buildTarget({ target: textContent.exports.handle, action: "edit" });
package/src/time/index.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  export { warnIfNonUtcServerTimeZone } from "./boot-tz-warning";
13
13
  export type { GeoAddress, GeoCoordinates, GeoTzProvider } from "./geo-tz";
14
14
  export { isValidIanaTimeZone } from "./iana";
15
+ export { instantToLegacyDate, legacyDateToInstant } from "./legacy-date";
15
16
  export { ensureTemporalPolyfill, getTemporal } from "./polyfill";
16
17
  export {
17
18
  createTzContext,
@@ -0,0 +1,18 @@
1
+ import { Temporal } from "temporal-polyfill";
2
+
3
+ // Temporal→Date-Bridge für Lib-APIs die JS-Date verlangen (imapflow
4
+ // search({since}), nodemailer-Header, ...). Gegenstück zur
5
+ // dateToInstant-Richtung der DB-/Event-Store-Boundaries: Feature-Code
6
+ // rechnet in Temporal, konvertiert erst am Aufruf der Fremd-API — der
7
+ // no-date-api-Guard bleibt für Feature-Code scharf, die Konstruktion
8
+ // lebt hier im allowlisteten Time-Layer.
9
+
10
+ export function instantToLegacyDate(instant: Temporal.Instant): Date {
11
+ return new Date(instant.epochMilliseconds);
12
+ }
13
+
14
+ /** Gegenrichtung: Date aus einer Fremd-Lib (imapflow INTERNALDATE,
15
+ * mailparser Date-Header) → Temporal.Instant. */
16
+ export function legacyDateToInstant(date: Date): Temporal.Instant {
17
+ return Temporal.Instant.fromEpochMilliseconds(date.getTime());
18
+ }