@fedify/vocab-tools 2.4.0-pr.936.41 → 2.5.0-dev.2271
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/README.md +39 -0
- package/deno.json +1 -1
- package/dist/mod.cjs +563 -118
- package/dist/mod.d.cts +14 -0
- package/dist/mod.d.ts +14 -0
- package/dist/mod.js +563 -118
- package/dist/schema.yaml +15 -0
- package/package.json +2 -2
- package/src/__snapshots__/class.test.ts.deno.snap +53887 -11652
- package/src/__snapshots__/class.test.ts.node.snap +53887 -11652
- package/src/__snapshots__/class.test.ts.snap +53887 -11652
- package/src/class.ts +115 -0
- package/src/codec.ts +133 -34
- package/src/constructor.ts +11 -0
- package/src/inspector.ts +4 -4
- package/src/property.ts +343 -70
- package/src/schema.ts +16 -0
- package/src/schema.yaml +15 -0
- package/src/type.ts +19 -7
package/README.md
CHANGED
|
@@ -25,3 +25,42 @@ pnpm add @fedify/vocab-tools
|
|
|
25
25
|
~~~~ bash
|
|
26
26
|
yarn add @fedify/vocab-tools
|
|
27
27
|
~~~~
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Development
|
|
31
|
+
-----------
|
|
32
|
+
|
|
33
|
+
Run development tasks from the repository root with [mise].
|
|
34
|
+
|
|
35
|
+
[mise]: https://mise.jdx.dev/
|
|
36
|
+
|
|
37
|
+
### Updating snapshots
|
|
38
|
+
|
|
39
|
+
The code generator has separate output snapshots for Deno, Node.js, and Bun.
|
|
40
|
+
When a change affects generated output, update all three from the repository
|
|
41
|
+
root:
|
|
42
|
+
|
|
43
|
+
~~~~ bash
|
|
44
|
+
mise run test:update_snapshots
|
|
45
|
+
~~~~
|
|
46
|
+
|
|
47
|
+
Review and commit every changed snapshot file. Updating only one runtime
|
|
48
|
+
leaves the other test suites with stale expectations.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Conditional contexts and metadata trust
|
|
52
|
+
---------------------------------------
|
|
53
|
+
|
|
54
|
+
A property schema can set `extraContext` to a context URL. The generated
|
|
55
|
+
serializer adds it to its default context when the property's expanded IRI
|
|
56
|
+
appears after compaction, including inside nested objects. A caller-provided
|
|
57
|
+
context takes precedence. When populated, such a property uses the JSON-LD
|
|
58
|
+
processor so context container rules, including `@set`, are respected.
|
|
59
|
+
|
|
60
|
+
A type schema can set `trustEmbeddedObjects: false` when its identifier is
|
|
61
|
+
metadata rather than a resource that establishes an origin. Its own
|
|
62
|
+
entity-valued accessors then fetch embedded objects with identifiers instead
|
|
63
|
+
of trusting a matching origin. Locally constructed values, previously fetched
|
|
64
|
+
values, and the explicit `crossOrigin: "trust"` option retain their usual
|
|
65
|
+
behavior. This does not verify id-less embedded objects or establish publishing
|
|
66
|
+
authority.
|