@amritk/adapters 0.6.8 → 0.6.10

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.
Files changed (3) hide show
  1. package/AI.md +6 -4
  2. package/README.md +1 -1
  3. package/package.json +4 -4
package/AI.md CHANGED
@@ -28,12 +28,14 @@ const jsonSchema = await adapter.toJSONSchema(User) // always await
28
28
  3. **`getAdapter('json')` throws** — `'json'` is a valid `SourceFormat` but has no
29
29
  adapter (JSON Schema is read directly). Only `typebox` / `zod` / `valibot` /
30
30
  `effect` / `avro` resolve.
31
- 4. **Source libraries are optional peer deps**, imported dynamically. **Zod must
32
- be v4+** (`toJSONSchema` doesn't exist earlier). Always `await` — even
31
+ 4. **Source libraries are optional peer deps**, imported dynamically. **Zod 4+
32
+ is preferred** (native `toJSONSchema`); Zod 3 works only with the
33
+ `zod-to-json-schema` package installed alongside it. Always `await` — even
33
34
  TypeBox's synchronous path is typed to allow a Promise.
34
35
  5. **Unrepresentable constructs widen to `{}`** with a stderr `[mjst]` warning
35
- (Effect throws on nested ones). `date` / `bigint` become `x-mjst` hints. Pass
36
- `{ strict: true }` to throw instead of widening.
36
+ (Effect throws instead, on any leaf it cannot rescue). `date` / `bigint`
37
+ become `x-mjst` hints. Pass `{ strict: true }` to throw instead of widening
38
+ (Zod, Valibot, Avro).
37
39
  6. **Avro takes a parsed `.avsc`, not a module, and needs no peer dep.** Pick the
38
40
  encoding deliberately: `avroToJsonSchema(avro)` describes the idiomatic
39
41
  decoded object (nullable unions, base64 bytes, defaulted fields optional);
package/README.md CHANGED
@@ -291,7 +291,7 @@ So: want a generated `Date`? Author `Schema.DateFromSelf`. Want a string that Ef
291
291
  ## Related packages
292
292
 
293
293
  - [`@amritk/mjst`](../cli) — CLI that ingests these formats via `--input <format>`
294
- - [`@amritk/validation`](../parsers) · [`@amritk/generate-markdown`](../generate-markdown) · [`@amritk/generate-examples`](../generate-examples) — the generators these adapters feed
294
+ - [`@amritk/validation`](../validation) · [`@amritk/generate-markdown`](../generate-markdown) · [`@amritk/generate-examples`](../generate-examples) — the generators these adapters feed
295
295
  - [`@amritk/helpers`](../helpers) — defines the shared `x-mjst` extension
296
296
 
297
297
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amritk/adapters",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "description": "Convert schemas from external libraries (TypeBox, Zod, Avro, ...) into JSON Schema for mjst.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -44,11 +44,11 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "json-schema-typed": "^8.0.1",
47
- "@amritk/helpers": "^0.24.0"
47
+ "@amritk/helpers": "^0.26.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@amritk/validation": "^0.4.0",
51
- "@amritk/runtime-validators": "^0.15.1"
50
+ "@amritk/validation": "^0.6.1",
51
+ "@amritk/runtime-validators": "^0.15.2"
52
52
  },
53
53
  "exports": {
54
54
  "./package.json": "./package.json",