Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9f34ba2
init(json-schema): initializes the `@traversable/json-schema` package
ahrjarrett Jul 20, 2025
eb516b2
init(json-schema-test): initializes `@traversable/json-schema-test` p…
ahrjarrett Jul 20, 2025
b65b11e
feat(json-schema): adds json schema types
ahrjarrett Jul 21, 2025
cc74480
init(json-schema-types): initializes `@traversable/json-schema-types`…
ahrjarrett Jul 21, 2025
1ab8b94
feat(json-schema-types): adds JsonSchema functor
ahrjarrett Jul 21, 2025
d26cf0d
fix(json-schema-types): fix Functor types
ahrjarrett Jul 21, 2025
693b12c
chore(json-schema-test,zod-test,typebox-test): deletes unused `params…
ahrjarrett Jul 21, 2025
1baa48f
fix(json-schema-test): fixes types
ahrjarrett Jul 21, 2025
5d6636e
chore(json-schema-test): cleans up comments
ahrjarrett Jul 21, 2025
d35ac8b
feat(json-schema-types): adds `JsonSchema.check`, fuzz tests
ahrjarrett Jul 22, 2025
410631b
chore: removes comments
ahrjarrett Jul 22, 2025
82750ba
chore(json-schema-test): cleans up comments
ahrjarrett Jul 22, 2025
5acd458
chore: commits changeset
ahrjarrett Jul 22, 2025
46e7d45
feat(registry): modifies signature of `fn.catamorphism` to support bo…
ahrjarrett Jul 22, 2025
169a234
feat(json-schema): adds `JsonSchema.toType`, fuzz + type-level tests …
ahrjarrett Jul 22, 2025
699398d
test(typebox): adds fuzz tests for `box.equals`
ahrjarrett Jul 22, 2025
4aeb1ef
test(typebox): turns off `numRuns: 10_000` in `box.equals` suite
ahrjarrett Jul 22, 2025
81ab902
chore(typebox): cleans up unused import
ahrjarrett Jul 22, 2025
11a6ed7
feat(json-schema): `JsonSchema.check` now works with jit compilation
ahrjarrett Jul 22, 2025
e672f7e
feat(json-schema): adds `JsonSchema.equals` and `JsonSchema.equals.wr…
ahrjarrett Jul 23, 2025
009c43b
fix(json-schema): fixes record schema bug in `JsonSchema.equals`
ahrjarrett Jul 23, 2025
2fa72b2
fix(json-schema): adds support for optional fields in JsonSchema.equals
ahrjarrett Jul 23, 2025
315f3ae
fix(json-schema): fix bug in `JsonSchema.equals` for "const" schemas
ahrjarrett Jul 23, 2025
6b2928b
fix(json): fix json fold types
ahrjarrett Jul 23, 2025
1af6c81
test(json-schema): fuzzes `JsonSchema.equals`
ahrjarrett Jul 23, 2025
8cfec5b
chore: commits changeset
ahrjarrett Jul 23, 2025
86083a3
init(zod-types): breaks utilities, types & zx.Functor out into separa…
ahrjarrett Jul 23, 2025
e032665
chore: commits changesets
ahrjarrett Jul 23, 2025
58f8783
chore: removes comment
ahrjarrett Jul 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fair-moons-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/json-schema": patch
---

init(json-schema): initializes `@traversable/json-schema`
14 changes: 14 additions & 0 deletions .changeset/lazy-chefs-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@traversable/schema-to-json-schema": patch
"@traversable/json-schema-types": patch
"@traversable/json-schema-test": patch
"@traversable/typebox-test": patch
"@traversable/json-schema": patch
"@traversable/schema-seed": patch
"@traversable/registry": patch
"@traversable/zod-test": patch
"@traversable/schema": patch
"@traversable/zod": patch
---

feat(json-schema-types): adds fuzz-tested Json Schema validator via `JsonSchema.check`
5 changes: 5 additions & 0 deletions .changeset/major-melons-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/typebox-test": patch
---

init(typebox-test): initializes `@traversable/typebox-test`
5 changes: 5 additions & 0 deletions .changeset/mighty-seas-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/json-schema-types": patch
---

init(json-schema-types): initializes `@traversable/json-schema-types`
5 changes: 5 additions & 0 deletions .changeset/orange-trees-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/json-schema-test": patch
---

init(json-schema-test): initializes `@traversable/json-schema-test`
18 changes: 18 additions & 0 deletions .changeset/shaggy-actors-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@traversable/schema-to-json-schema": patch
"@traversable/json-schema-types": patch
"@traversable/json-schema-test": patch
"@traversable/schema-compiler": patch
"@traversable/schema-errors": patch
"@traversable/typebox-test": patch
"@traversable/json-schema": patch
"@traversable/schema-seed": patch
"@traversable/registry": patch
"@traversable/zod-test": patch
"@traversable/typebox": patch
"@traversable/schema": patch
"@traversable/json": patch
"@traversable/zod": patch
---

feat(json-schema): adds fuzz-tested `JsonSchema.equals`
5 changes: 5 additions & 0 deletions .changeset/stale-rocks-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/zod-test": patch
---

init(zod-test): initializes `@traversable/zod-test`
5 changes: 5 additions & 0 deletions .changeset/tall-bikes-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@traversable/zod-types": patch
---

init(zod-types): initializes `@traversable/zod-types`
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Let's look at a concrete example of how `@traversable/schema` can be used as a r

For this example, we'll be using [`@traversable/zod`](https://github.com/traversable/schema/tree/main/packages/zod), since zod is the library most users are familiar with.

Let's write a function that takes an arbitrary zod schema as input an stringifies it.
Let's write a function that takes an arbitrary zod schema as input and stringifies it.

> [!NOTE]
> This functionality is already available off-the shelf via `zx.toString`.
Expand Down Expand Up @@ -496,8 +496,11 @@ let toAPI = User.encode(fromAPI)

```mermaid
flowchart TD
json-schema(json-schema)
json-schema-test(json-schema-test)
registry(registry)
zod(zod)
zod-types(zod-types)
json(json) -.-> registry(registry)
schema(schema) -.-> registry(registry)
typebox-test(typebox-test) -.-> registry(registry)
Expand All @@ -510,6 +513,8 @@ flowchart TD
derive-validators(derive-validators) -.-> json(json)
derive-validators(derive-validators) -.-> registry(registry)
derive-validators(derive-validators) -.-> schema(schema)
json-schema-types(json-schema-types) -.-> json(json)
json-schema-types(json-schema-types) -.-> registry(registry)
schema-compiler(schema-compiler) -.-> json(json)
schema-compiler(schema-compiler) -.-> registry(registry)
schema-compiler(schema-compiler) -.-> schema(schema)
Expand Down
6 changes: 5 additions & 1 deletion config/__generated__/package-list.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions packages/json-schema-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<br>
<h1 align="center">ᯓ𝘁𝗿𝗮𝘃𝗲𝗿𝘀𝗮𝗯𝗹𝗲/𝗷𝘀𝗼𝗻-𝘀𝗰𝗵𝗲𝗺𝗮-𝘁𝗲𝘀𝘁</h1>
<br>

<p align="center">
Testing utility that generates arbitrary, <a href="https://en.wikipedia.org/wiki/Pseudorandomness" target="_blank">pseudorandom</a> <a href="https://json-schema.org" target="_blank">Json Schema</a> documents, powered by <a href="https://github.com/dubzzz/fast-check" target="_blank"><code>fast-check</code></a>
</p>

<div align="center">
<img alt="NPM Version" src="https://img.shields.io/npm/v/%40traversable%2Fjson-schema-test?style=flat-square&logo=npm&label=npm&color=blue">
&nbsp;
<img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-5.5%2B-blue?style=flat-square&logo=TypeScript&logoColor=4a9cf6">
&nbsp;
<img alt="Static Badge" src="https://img.shields.io/badge/license-MIT-a094a2?style=flat-square">
&nbsp;
<img alt="npm" src="https://img.shields.io/npm/dt/@traversable/json-schema-test?style=flat-square">
&nbsp;
</div>

<div align="center">
<!-- <img alt="npm bundle size (scoped)" src="https://img.shields.io/bundlephobia/minzip/%40traversable/json-schema-test?style=flat-square&label=size">
&nbsp; -->
<img alt="Static Badge" src="https://img.shields.io/badge/ESM-supported-2d9574?style=flat-square&logo=JavaScript">
&nbsp;
<img alt="Static Badge" src="https://img.shields.io/badge/CJS-supported-2d9574?style=flat-square&logo=Node.JS">
&nbsp;
</div>
<br>
<br>
44 changes: 44 additions & 0 deletions packages/json-schema-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "@traversable/json-schema-test",
"type": "module",
"version": "0.0.0",
"private": false,
"description": "",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/traversable/schema.git",
"directory": "packages/json-schema-test"
},
"bugs": {
"url": "https://github.com/traversable/schema/issues",
"email": "ahrjarrett@gmail.com"
},
"@traversable": {
"generateExports": { "include": ["**/*.ts"] },
"generateIndex": { "include": ["**/*.ts"] }
},
"publishConfig": {
"access": "public",
"directory": "dist",
"registry": "https://registry.npmjs.org"
},
"scripts": {
"bench": "echo NOTHING TO BENCH",
"build": "pnpm build:esm && pnpm build:cjs && pnpm build:annotate",
"build:annotate": "babel build --plugins annotate-pure-calls --out-dir build --source-maps",
"build:esm": "tsc -b tsconfig.build.json",
"build:cjs": "babel build/esm --plugins @babel/transform-export-namespace-from --plugins @babel/transform-modules-commonjs --out-dir build/cjs --source-maps",
"check": "tsc -b tsconfig.json",
"clean": "pnpm run \"/^clean:.*/\"",
"clean:build": "rm -rf .tsbuildinfo dist build",
"clean:deps": "rm -rf node_modules",
"test": "vitest"
},
"dependencies": {
"@traversable/json": "workspace:^",
"@traversable/json-schema-types": "workspace:^",
"@traversable/registry": "workspace:^"
},
"devDependencies": {}
}
44 changes: 44 additions & 0 deletions packages/json-schema-test/src/__generated__/__manifest__.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions packages/json-schema-test/src/exports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export * from './version.js'

export type Seed<T = unknown> = import('./generator-seed.js').Seed<T>
export * as Seed from './generator-seed.js'

export {
Builder,
SchemaGenerator,
SeedGenerator,
SeedValidDataGenerator,
SeedInvalidDataGenerator,
seedToValidDataGenerator,
seedToInvalidDataGenerator,
seedToSchema,
seedToValidData,
seedToInvalidData,
seedsThatPreventGeneratingValidData,
seedsThatPreventGeneratingInvalidData,
} from './generator.js'
Loading