diff --git a/design/typemap.blend b/design/typemap.blend index cf51136..f2223f8 100644 Binary files a/design/typemap.blend and b/design/typemap.blend differ diff --git a/design/typemap.blend1 b/design/typemap.blend1 index 58ea741..f270d64 100644 Binary files a/design/typemap.blend1 and b/design/typemap.blend1 differ diff --git a/example/prototypes/effect.ts b/example/prototypes/effect.ts index f65d5da..9727b54 100644 --- a/example/prototypes/effect.ts +++ b/example/prototypes/effect.ts @@ -4,7 +4,7 @@ // The MIT License (MIT) -// Copyright (c) 2024 Haydn Paterson (sinclair) +// Copyright (c) 2024-2025 Haydn Paterson (sinclair) // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/license b/license index 81365c2..9c14fc3 100644 --- a/license +++ b/license @@ -2,7 +2,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index a229daf..27d4009 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@sinclair/typemap", "version": "0.8.0", - "description": "Unified Syntax Frontend and Type Remapping System for TypeBox, Valibot and Zod", + "description": "Unified Syntax Frontend and Type Remapping Library for TypeBox, Valibot and Zod", "author": "sinclairzx81", "license": "MIT", "repository": { diff --git a/readme.md b/readme.md index a7ad5aa..2ac2a3b 100644 --- a/readme.md +++ b/readme.md @@ -2,16 +2,16 @@

TypeMap

-

Unified Syntax Frontend and Type Remapping System for TypeBox, Valibot and Zod

+

Unified Syntax Frontend and Type Remapping Library for TypeBox, Valibot and Zod

- +

-[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypebox-adapter.svg?1)](https://badge.fury.io/js/%40sinclair%2Ftypebox-adapter) -[![Downloads](https://img.shields.io/npm/dm/%40sinclair%2Ftypebox-adapter.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypebox-adapter) -[![Build](https://github.com/sinclairzx81/typebox-adapter/actions/workflows/build.yml/badge.svg)](https://github.com/sinclairzx81/typebox-adapter/actions/workflows/build.yml) +[![npm version](https://badge.fury.io/js/%40sinclair%2Ftypemap.svg)](https://badge.fury.io/js/%40sinclair%2Ftypemap) +[![Downloads](https://img.shields.io/npm/dm/%40sinclair%2F2Ftypemap.svg)](https://www.npmjs.com/package/%40sinclair%2Ftypemap) +[![Build](https://github.com/sinclairzx81/typemap/actions/workflows/build.yml/badge.svg)](https://github.com/sinclairzx81/typemap/actions/workflows/build.yml) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) @@ -24,10 +24,12 @@ $ npm install @sinclair/typemap --save ## Example -Use syntax to construct types for TypeBox, Valibot and Zod ... +Use TypeScript syntax to construct types for TypeBox, Valibot and Zod ... + +[Example Link](https://www.typescriptlang.org/play/?moduleResolution=99&module=199#code/JYWwDg9gTgLgBAbzgFQJ5gKYCEIA8A0cAWhACaEBqAhgDbABGE8AvnAGZQQhwDkAAgGdgAOwDGNKsCgB6GOgwgqYHgCgV06XFERhA+MgBcKAPL0AVhlEwAPEgB0DuMwB8a7bv1wAvCnk5cABQABkgqcHC4RsIAriD0GFD4YXCoUbHxickAXmlxCSrMQQCU4aVl5WoaWjp6cBRGphZWAMqiABYKVLZwDnZOrirutRTedbQMTMGh4ZFwMXmZ4alz6QlJ4TkrCwXFlZpD8ERGJKSNljb2ji5uNYejJ1NwybPzGespuW-Zn-mFRUA) ```typescript -import { TypeBox, Zod, Valibot } from '@sinclair/typemap' +import { TypeBox, Valibot, Zod } from '@sinclair/typemap' // const T: TObject<{ ... }> @@ -56,6 +58,8 @@ const Z = Zod(`{ ... or structurally remap types from one library to another +[Example Link](https://www.typescriptlang.org/play/?moduleResolution=99&module=199#code/JYWwDg9gTgLgBAbzgFQJ5gKYCEIA8A0cAagIYA2wARhDIQFoQAmcAvnAGZQQhwDkAAgGdgAOwDGZEsCgB6GOgwgSYXgChVMmXADKqETBK44APjgNmp0hWrxTaTDlzqxEEYPjI4AXhQLHACisqGn9zfwADBFU4OFwALjgRAFcQSgwofGi4VATk1PTMmIAvXJS0qFUWcIBKWqA) + ```typescript import { TypeBox, Valibot, Zod } from '@sinclair/typemap' @@ -70,6 +74,8 @@ const T = TypeBox(Valibot(Zod(`{ ... or compile types for high performance runtime type checking +[Example Link](https://www.typescriptlang.org/play/?moduleResolution=99&module=199#code/JYWwDg9gTgLgBAbzgYQuYAbApnAvnAMyjTgHIABAZ2ADsBjDAQ2CgHoYBPMLERsUgFADQkWHABehYiDLiIAE0EC6EGpXgAVOAF4JAOggAjAFZY6MABRI4N23butWcFWs0AufQC0FAeRNmYAB4kARsADw9xPRoAVxBDLCgLAEoAGnsMzLhHWwivBQA5OISoVNC4Dkjo4sSU9KyG7KcbSvz5IvjEsptxKtjOpLTGhpyequ92mtKBXGTh+cac3AA+IRd1FB0UNDBMLAsNOYWm51UN5A8ANUYMYHlGGGhAjT9Tc2Dy46+HZrg8jQ6JW63xBJxaHgBU2BoK+owkEMBiU+MIWS2Wy1sazO8AASltkHpkAALMwAays3xy61xHkMEAg2EYNDgAFo4AAJYAAcyJcAACokCNBePQcMSybQuQBCcp5ACMwNaACZ0uVenAAMwzZJAA) + ```typescript import { Compile } from '@sinclair/typemap' @@ -98,9 +104,9 @@ const R = C.Check({ // const R: boolean - High Performance Checki ## Overview -TypeMap is an type mapping library developed for TypeBox, Valibot and Zod. It enables quick compatibility between each library by structurally remapping type representations from one library to another. In addition,TypeMap offers a uniform syntax for type construction as well as high-performance runtime type checking for Valibot and Zod via the TypeBox compiler infrastructure. +TypeMap is a type mapping library developed for the [TypeBox](https://github.com/sinclairzx81/typebox), [Valibot](https://github.com/fabian-hiller/valibot) and [Zod](https://github.com/colinhacks/zod) runtime type libraries. It is designed to make these libraries cross compatible by structurally remapping types from one library to another. TypeMap also provides a uniform frontend syntax for creating types, as well as uniform type compilation for high-performance validation via the TypeBox compiler infrastructure. -TypeMap is designed to be a simple tool to enable Valibot and Zod to integrate with TypeBox and Json Schema validation infrastructure. It is also written to allow TypeBox to integrate with systems leveraging Valibot and Zod for validation. The frontend syntax provided by TypeMap seeks to explore a uniform API surface for runtime type libraries. +TypeMap is built to be a simple tool to let Valibot and Zod to integrate with TypeBox and Json Schema infrastructure. It is also written to enable TypeBox to integrate with systems using Valibot and Zod for validation. License: MIT diff --git a/src/compile/compile.ts b/src/compile/compile.ts index 3ada75a..66b518d 100644 --- a/src/compile/compile.ts +++ b/src/compile/compile.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/compile/environment.ts b/src/compile/environment.ts index 5c5f934..6875dc4 100644 --- a/src/compile/environment.ts +++ b/src/compile/environment.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/guard.ts b/src/guard.ts index bd5432a..8e62da1 100644 --- a/src/guard.ts +++ b/src/guard.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/index.ts b/src/index.ts index 9d18a76..feff60e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/static.ts b/src/static.ts index 51412c7..95e6cf6 100644 --- a/src/static.ts +++ b/src/static.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/typebox/typebox-from-syntax.ts b/src/typebox/typebox-from-syntax.ts index a115292..122b7fd 100644 --- a/src/typebox/typebox-from-syntax.ts +++ b/src/typebox/typebox-from-syntax.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/typebox/typebox-from-typebox.ts b/src/typebox/typebox-from-typebox.ts index e06d011..8d8ea2d 100644 --- a/src/typebox/typebox-from-typebox.ts +++ b/src/typebox/typebox-from-typebox.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/typebox/typebox-from-valibot.ts b/src/typebox/typebox-from-valibot.ts index f562795..faf2e30 100644 --- a/src/typebox/typebox-from-valibot.ts +++ b/src/typebox/typebox-from-valibot.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/typebox/typebox-from-zod.ts b/src/typebox/typebox-from-zod.ts index eda6a1d..1621c40 100644 --- a/src/typebox/typebox-from-zod.ts +++ b/src/typebox/typebox-from-zod.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/typebox/typebox.ts b/src/typebox/typebox.ts index fe8ee84..6e5bb69 100644 --- a/src/typebox/typebox.ts +++ b/src/typebox/typebox.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/common.ts b/src/valibot/common.ts index b34f3cc..dad120f 100644 --- a/src/valibot/common.ts +++ b/src/valibot/common.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/valibot-from-syntax.ts b/src/valibot/valibot-from-syntax.ts index eec3a1d..185cfa9 100644 --- a/src/valibot/valibot-from-syntax.ts +++ b/src/valibot/valibot-from-syntax.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/valibot-from-typebox.ts b/src/valibot/valibot-from-typebox.ts index 755b020..e8e653a 100644 --- a/src/valibot/valibot-from-typebox.ts +++ b/src/valibot/valibot-from-typebox.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/valibot-from-valibot.ts b/src/valibot/valibot-from-valibot.ts index 9e1eb24..2e77ba2 100644 --- a/src/valibot/valibot-from-valibot.ts +++ b/src/valibot/valibot-from-valibot.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/valibot-from-zod.ts b/src/valibot/valibot-from-zod.ts index 7f44417..3f79661 100644 --- a/src/valibot/valibot-from-zod.ts +++ b/src/valibot/valibot-from-zod.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/valibot/valibot.ts b/src/valibot/valibot.ts index 59d6209..18b27a7 100644 --- a/src/valibot/valibot.ts +++ b/src/valibot/valibot.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/zod/zod-from-syntax.ts b/src/zod/zod-from-syntax.ts index 7af48fd..42554d2 100644 --- a/src/zod/zod-from-syntax.ts +++ b/src/zod/zod-from-syntax.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/zod/zod-from-typebox.ts b/src/zod/zod-from-typebox.ts index 93e735c..da1aa2d 100644 --- a/src/zod/zod-from-typebox.ts +++ b/src/zod/zod-from-typebox.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/zod/zod-from-valibot.ts b/src/zod/zod-from-valibot.ts index c1e9c2b..eb91575 100644 --- a/src/zod/zod-from-valibot.ts +++ b/src/zod/zod-from-valibot.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/zod/zod-from-zod.ts b/src/zod/zod-from-zod.ts index 1b69867..fda6fc3 100644 --- a/src/zod/zod-from-zod.ts +++ b/src/zod/zod-from-zod.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/zod/zod.ts b/src/zod/zod.ts index 074ae1b..cba9229 100644 --- a/src/zod/zod.ts +++ b/src/zod/zod.ts @@ -4,7 +4,7 @@ The MIT License (MIT) -Copyright (c) 2024 Haydn Paterson (sinclair) +Copyright (c) 2024-2025 Haydn Paterson (sinclair) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/typemap.png b/typemap.png index 843b674..530bcd4 100644 Binary files a/typemap.png and b/typemap.png differ