@kurotako/ir 0.1.0 → 0.3.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/CHANGELOG.md +55 -0
- package/dist/index.cjs +548 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -54
- package/dist/index.d.ts +118 -54
- package/dist/index.js +541 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# @kurotako/ir
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9fe08b3: Add an `array` field type to the IR and bump the IR format to `'4'`.
|
|
8
|
+
|
|
9
|
+
- `@kurotako/ir`: new `{ kind: 'array', element: FieldType }` field type, so an
|
|
10
|
+
array-typed type alias, union variant or map value can be represented (the
|
|
11
|
+
boolean `Field.list` fast path stays as an optimisation for a plain
|
|
12
|
+
`property: { type: 'array', items: <scalar|ref> }`). Builders (`.array(...)`),
|
|
13
|
+
validation, reference traversal, cycle analysis and TypeScript-type helpers
|
|
14
|
+
recurse through it. The strict compatibility check now requires `irVersion` `'4'`.
|
|
15
|
+
- `@kurotako/gen-zod`: renders an array as `z.array(<element>)` and its TS type as
|
|
16
|
+
`<element>[]`.
|
|
17
|
+
- `@kurotako/gen-typescript`: renders an array as `<element>[]`, parenthesising a
|
|
18
|
+
union element.
|
|
19
|
+
- `@kurotako/gen-angular`: renders an array field as `FormControl<<element>[]>`
|
|
20
|
+
seeded with `[]`.
|
|
21
|
+
- `@kurotako/parser-openapi`: an array schema that is not a plain object property
|
|
22
|
+
(an array-typed response/component alias, a nested array, an array inside a
|
|
23
|
+
`oneOf`/`additionalProperties`) now maps to the `array` field type instead of
|
|
24
|
+
silently dropping the array wrapper. Nested arrays are supported.
|
|
25
|
+
- ecdb02c: Add the OpenAPI parser and IR typed maps.
|
|
26
|
+
|
|
27
|
+
- `@kurotako/ir`: adds the `{ kind: 'map', value: FieldType }`
|
|
28
|
+
field type and the optional `Entity.additionalProperties` slot. Builders,
|
|
29
|
+
validation, reference traversal, cycle analysis and TypeScript-type helpers
|
|
30
|
+
recurse through both.
|
|
31
|
+
- `@kurotako/gen-zod`: renders map values as `z.record(z.string(), value)` and an
|
|
32
|
+
entity catch-all as `.catchall(value)`.
|
|
33
|
+
- `@kurotako/gen-typescript`: renders map values as `Record<string, Value>` and an
|
|
34
|
+
entity catch-all as an index signature.
|
|
35
|
+
- `@kurotako/gen-angular`: renders a map field as `FormControl<Record<string, Value>>`
|
|
36
|
+
seeded with `{}`; entity-level catch-all values stay under the emitted Zod validator.
|
|
37
|
+
- `@kurotako/parser-openapi`: new package. Turns an OpenAPI 3.0/3.1 document (local
|
|
38
|
+
JSON/YAML or an unauthenticated HTTP(S) URL) into one `SourceIR`, mapping component
|
|
39
|
+
and inline operation schemas to deterministic entities, aliases, enums and typed maps.
|
|
40
|
+
|
|
41
|
+
## 0.2.0
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- 7a50439: IR union type support: `FieldType` gains `ref` and `union` kinds (recursive,
|
|
46
|
+
`v.lazy`-wrapped schema, hand-written type), a `TypeAlias` registry
|
|
47
|
+
(`SourceIR.typeAliases?`), the builder API (`f.ref`, `f.union` with
|
|
48
|
+
`UnionBuilder`, `addTypeAlias`), resolution helpers (`resolveRef`,
|
|
49
|
+
`resolveTypeAlias`, `iterTypeAliases`, `flattenUnion`) and an exhaustive
|
|
50
|
+
`scalarTsType`. Validation walks field types recursively (`unresolved_ref`,
|
|
51
|
+
`unresolved_type_alias`, `type_alias_key_mismatch`), tolerates degenerate
|
|
52
|
+
unions and reference cycles through a new non-fatal `info` channel on
|
|
53
|
+
`IrValidation` (`degenerate_union`, `union_cycle`).
|
|
54
|
+
|
|
55
|
+
Bumps `IR_VERSION` from `1` to `2`; `isCompatible` stays strict equality, so a
|
|
56
|
+
persisted `irVersion: '1'` dump is rejected with `version_incompatible`.
|
|
57
|
+
|
|
3
58
|
## 0.1.0
|
|
4
59
|
|
|
5
60
|
### Minor Changes
|