@c9up/chronos 0.1.6 → 0.1.7

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/atlas.d.ts CHANGED
@@ -80,21 +80,14 @@ import { DateTime } from "./DateTime.js";
80
80
  * this adapter; configure your DB / driver to emit Z-suffixed strings or
81
81
  * `Date` instances, or pre-process via `DateTime.fromSQL`.
82
82
  *
83
- * **Stacking caveat with `@column.dateTime({ autoCreate, autoUpdate })`:**
84
- * the auto-timestamp decorator (story 32.8) writes `new Date()` (a JS `Date`)
85
- * to the entity property when `autoCreate` / `autoUpdate` is set. If you
86
- * ALSO tag the same property with `@Column(dateTimeAtlasAdapter)`, `prepare`
87
- * will receive a `Date` and throw the "expected a DateTime instance"
88
- * `TypeError` at INSERT / UPDATE time. **Only the `autoCreate` / `autoUpdate`
89
- * flags conflict** plain `@column.dateTime()` (no flags) does not write
90
- * anything and is safe to stack. Mitigations when you need auto-timestamps:
91
- * - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
92
- * and assign manually (e.g., in a model hook:
93
- * `entity.createdAt = DateTime.now()`).
94
- * - **`@column.dateTime({ ... })` only**: drop the adapter and manually
95
- * wrap reads with `new DateTime(row.createdAt)` at the call site.
96
- * The adapter does NOT silently coerce `Date` → `DateTime` because that
97
- * would mask the inconsistency between the two mechanisms.
83
+ * **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
84
+ * hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
85
+ * by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
86
+ * `DateTime.now()` (not a JS `Date`). So tagging the same property with this
87
+ * adapter is redundant (the default already produces DateTime) and no longer
88
+ * throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
89
+ * when you want DateTime semantics on a column atlas would NOT treat as a date
90
+ * column (e.g. a plain `@Column()` storing a timestamp).
98
91
  *
99
92
  * The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
100
93
  * `@Column(dateTimeAtlasAdapter)` is identical to
@@ -1 +1 @@
1
- {"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,eAAO,MAAM,oBAAoB;iBACnB,OAAO,GAAG,QAAQ,GAAG,IAAI;mBAWvB,OAAO,GAAG,MAAM,GAAG,IAAI;EAUrC,CAAC"}
1
+ {"version":3,"file":"atlas.d.ts","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsBzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,eAAO,MAAM,oBAAoB;iBACnB,OAAO,GAAG,QAAQ,GAAG,IAAI;mBAWvB,OAAO,GAAG,MAAM,GAAG,IAAI;EAUrC,CAAC"}
package/dist/atlas.js CHANGED
@@ -101,21 +101,14 @@ function isDateTimeLike(value) {
101
101
  * this adapter; configure your DB / driver to emit Z-suffixed strings or
102
102
  * `Date` instances, or pre-process via `DateTime.fromSQL`.
103
103
  *
104
- * **Stacking caveat with `@column.dateTime({ autoCreate, autoUpdate })`:**
105
- * the auto-timestamp decorator (story 32.8) writes `new Date()` (a JS `Date`)
106
- * to the entity property when `autoCreate` / `autoUpdate` is set. If you
107
- * ALSO tag the same property with `@Column(dateTimeAtlasAdapter)`, `prepare`
108
- * will receive a `Date` and throw the "expected a DateTime instance"
109
- * `TypeError` at INSERT / UPDATE time. **Only the `autoCreate` / `autoUpdate`
110
- * flags conflict** plain `@column.dateTime()` (no flags) does not write
111
- * anything and is safe to stack. Mitigations when you need auto-timestamps:
112
- * - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
113
- * and assign manually (e.g., in a model hook:
114
- * `entity.createdAt = DateTime.now()`).
115
- * - **`@column.dateTime({ ... })` only**: drop the adapter and manually
116
- * wrap reads with `new DateTime(row.createdAt)` at the call site.
117
- * The adapter does NOT silently coerce `Date` → `DateTime` because that
118
- * would mask the inconsistency between the two mechanisms.
104
+ * **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
105
+ * hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
106
+ * by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
107
+ * `DateTime.now()` (not a JS `Date`). So tagging the same property with this
108
+ * adapter is redundant (the default already produces DateTime) and no longer
109
+ * throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
110
+ * when you want DateTime semantics on a column atlas would NOT treat as a date
111
+ * column (e.g. a plain `@Column()` storing a timestamp).
119
112
  *
120
113
  * The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
121
114
  * `@Column(dateTimeAtlasAdapter)` is identical to
package/dist/atlas.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"atlas.js","sourceRoot":"","sources":["../src/atlas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,SAAS,cAAc,CAAC,KAAc;IACrC,IAAI,KAAK,YAAY,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,GAAG,GAAG,KAA8C,CAAC;IAC3D,OAAO,OAAO,GAAG,CAAC,KAAK,KAA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AAQ,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE,MAAM,IAAI,SAAS,CAClB,iGAAiG,OAAO,GAAG,EAAE,CAC7G,CAAC;IACH,CAAC;IACD,OAAO,CAAC,KAAc;QACrB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACvD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,SAAS,CAClB,mEAAmE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI;gBACtJ,gGAAgG,CACjG,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACD,CAAC,CAAC"}
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c9up/chronos",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Chronos — advanced date/time and recurrence engine (TypeScript + Rust N-API)",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/atlas.ts CHANGED
@@ -102,21 +102,14 @@ function isDateTimeLike(value: unknown): value is DateTime {
102
102
  * this adapter; configure your DB / driver to emit Z-suffixed strings or
103
103
  * `Date` instances, or pre-process via `DateTime.fromSQL`.
104
104
  *
105
- * **Stacking caveat with `@column.dateTime({ autoCreate, autoUpdate })`:**
106
- * the auto-timestamp decorator (story 32.8) writes `new Date()` (a JS `Date`)
107
- * to the entity property when `autoCreate` / `autoUpdate` is set. If you
108
- * ALSO tag the same property with `@Column(dateTimeAtlasAdapter)`, `prepare`
109
- * will receive a `Date` and throw the "expected a DateTime instance"
110
- * `TypeError` at INSERT / UPDATE time. **Only the `autoCreate` / `autoUpdate`
111
- * flags conflict** plain `@column.dateTime()` (no flags) does not write
112
- * anything and is safe to stack. Mitigations when you need auto-timestamps:
113
- * - **Adapter only**: drop `@column.dateTime({ autoCreate, autoUpdate })`
114
- * and assign manually (e.g., in a model hook:
115
- * `entity.createdAt = DateTime.now()`).
116
- * - **`@column.dateTime({ ... })` only**: drop the adapter and manually
117
- * wrap reads with `new DateTime(row.createdAt)` at the call site.
118
- * The adapter does NOT silently coerce `Date` → `DateTime` because that
119
- * would mask the inconsistency between the two mechanisms.
105
+ * **Auto-timestamps stack cleanly.** As of the atlas date-engine switch, atlas
106
+ * hydrates every `@column.date()` / `@column.dateTime()` to a Chronos `DateTime`
107
+ * by default and `@column.dateTime({ autoCreate, autoUpdate })` stamps
108
+ * `DateTime.now()` (not a JS `Date`). So tagging the same property with this
109
+ * adapter is redundant (the default already produces DateTime) and no longer
110
+ * throws — `prepare` receives a `DateTime`. Reach for this explicit adapter only
111
+ * when you want DateTime semantics on a column atlas would NOT treat as a date
112
+ * column (e.g. a plain `@Column()` storing a timestamp).
120
113
  *
121
114
  * The shape `{ prepare, consume }` is **passable directly** to `@Column(...)`:
122
115
  * `@Column(dateTimeAtlasAdapter)` is identical to