@standard-community/standard-json 0.1.0 → 0.1.1

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 CHANGED
@@ -6,6 +6,21 @@
6
6
 
7
7
  Standard Schema Validator's JSON Schema Converter
8
8
 
9
+ ## Installation
10
+
11
+ Install the main package -
12
+
13
+ ```sh
14
+ pnpm add @standard-community/standard-json
15
+ ```
16
+
17
+ For some specific vendor, install the respective package also -
18
+
19
+ | Vendor | Package |
20
+ | ------- | ------- |
21
+ | Zod | `zod-to-json-schema` |
22
+ | Valibot | `@valibot/to-json-schema` |
23
+
9
24
  ## Usage
10
25
 
11
26
  ```ts
@@ -28,11 +43,14 @@ const jsonSchema = await toJsonSchema(schema);
28
43
 
29
44
  List of supported validators -
30
45
 
31
- | Vendor | Version |
46
+ | Vendor | Supported |
32
47
  | ------- | ------- |
33
- | Zod | 3.24.0+ |
34
- | Valibot | 1.0+ |
35
- | ArkType | 2.0+ |
48
+ | Zod | |
49
+ | Valibot | |
50
+ | ArkType | |
51
+ | Effect Schema | 🛠️ |
52
+
53
+ You can check the compatibility versions at [standardschema.dev](https://standardschema.dev/)
36
54
 
37
55
  ## Credit
38
56
 
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty;var t=(o,c)=>e(o,"name",{value:c,configurable:!0});const n=t(o=>o.toJsonSchema(),"toJsonSchema");export{n as toJsonSchema};
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var s=(o,t)=>c(o,"name",{value:t,configurable:!0});const e=s(o=>o.toJsonSchema(),"toJsonSchema");exports.toJsonSchema=e;
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var c=(e,t)=>a(e,"name",{value:t,configurable:!0});var o=require("effect");const s=c(e=>o.JSONSchema.make(e),"toJsonSchema");exports.toJsonSchema=s;
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var m=(o,e)=>t(o,"name",{value:e,configurable:!0});import{JSONSchema as a}from"effect";const c=m(o=>a.make(o),"toJsonSchema");export{c as toJsonSchema};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var n=(e,r)=>o(e,"name",{value:r,configurable:!0});const s=n(async e=>{const r=e["~standard"].vendor;let t;switch(r){case"arktype":t=Promise.resolve().then(function(){return require("./arktype-BLC3CdrE.cjs")});break;case"valibot":t=Promise.resolve().then(function(){return require("./valibot-KN6if2LL.cjs")});break;case"zod":t=Promise.resolve().then(function(){return require("./zod-BnLkqCQl.cjs")});break;default:throw new Error(`standard-json: Unsupported schema vendor "${r}"`)}return(await(await t).toJsonSchema())(e)},"toJsonSchema");exports.toJsonSchema=s;
1
+ "use strict";var o=Object.defineProperty;var t=(r,n)=>o(r,"name",{value:n,configurable:!0});const s=t(async r=>{const n=r["~standard"].vendor;let e;switch(n){case"arktype":e=Promise.resolve().then(function(){return require("./arktype-Dlvt2KS_.cjs")});break;case"effect":e=Promise.resolve().then(function(){return require("./effect-DhPQdyvU.cjs")});break;case"valibot":e=Promise.resolve().then(function(){return require("./valibot--kGNOzEb.cjs")});break;case"zod":e=Promise.resolve().then(function(){return require("./zod-CaS8MF0R.cjs")});break;default:throw new Error(`standard-json: Unsupported schema vendor "${n}"`)}return(await e).toJsonSchema(r)},"toJsonSchema");exports.toJsonSchema=s;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty;var t=(a,o)=>e(a,"name",{value:o,configurable:!0});const n=t(async a=>{const o=a["~standard"].vendor;let r;switch(o){case"arktype":r=import("./arktype-ZJN3SbO2.js");break;case"valibot":r=import("./valibot-BKk6QhzV.js");break;case"zod":r=import("./zod-CcYrCVyl.js");break;default:throw new Error(`standard-json: Unsupported schema vendor "${o}"`)}return(await(await r).toJsonSchema())(a)},"toJsonSchema");export{n as toJsonSchema};
1
+ var a=Object.defineProperty;var t=(r,o)=>a(r,"name",{value:o,configurable:!0});const n=t(async r=>{const o=r["~standard"].vendor;let e;switch(o){case"arktype":e=import("./arktype-CqF_-yop.js");break;case"effect":e=import("./effect-pZiNZiGm.js");break;case"valibot":e=import("./valibot-bjxbIVdF.js");break;case"zod":e=import("./zod-BgKiXEg9.js");break;default:throw new Error(`standard-json: Unsupported schema vendor "${o}"`)}return(await e).toJsonSchema(r)},"toJsonSchema");export{n as toJsonSchema};
@@ -0,0 +1 @@
1
+ "use strict";var t=Object.defineProperty;var e=(o,s)=>t(o,"name",{value:s,configurable:!0});var c=require("@valibot/to-json-schema");const a=e(o=>c.toJsonSchema(o),"toJsonSchema");exports.toJsonSchema=a;
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var t=(o,m)=>s(o,"name",{value:m,configurable:!0});import{toJsonSchema as a}from"@valibot/to-json-schema";const c=t(o=>a(o),"toJsonSchema");export{c as toJsonSchema};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var m=(o,t)=>c(o,"name",{value:t,configurable:!0});import{zodToJsonSchema as e}from"zod-to-json-schema";const n=m(o=>e(o),"toJsonSchema");export{n as toJsonSchema};
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var e=(o,s)=>c(o,"name",{value:s,configurable:!0});var a=require("zod-to-json-schema");const n=e(o=>a.zodToJsonSchema(o),"toJsonSchema");exports.toJsonSchema=n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@standard-community/standard-json",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs",
@@ -29,27 +29,25 @@
29
29
  "url": "https://github.com/standard-community/standard-json/issues"
30
30
  },
31
31
  "exports": {
32
- ".": {
33
- "import": {
34
- "types": "./dist/index.d.ts",
35
- "default": "./dist/index.js"
36
- },
37
- "require": {
38
- "types": "./dist/index.d.cts",
39
- "default": "./dist/index.cjs"
40
- }
32
+ "import": {
33
+ "types": "./dist/index.d.ts",
34
+ "default": "./dist/index.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/index.d.cts",
38
+ "default": "./dist/index.cjs"
41
39
  }
42
40
  },
43
41
  "peerDependencies": {
44
42
  "@valibot/to-json-schema": "^1.0.0-rc.0",
45
- "arktype": "^2.0.4",
43
+ "effect": "^3.13.10",
46
44
  "zod-to-json-schema": "^3.24.1"
47
45
  },
48
46
  "peerDependenciesMeta": {
49
47
  "@valibot/to-json-schema": {
50
48
  "optional": true
51
49
  },
52
- "arktype": {
50
+ "effect": {
53
51
  "optional": true
54
52
  },
55
53
  "zod-to-json-schema": {
@@ -59,7 +57,10 @@
59
57
  "devDependencies": {
60
58
  "@standard-schema/spec": "^1.0.0",
61
59
  "@types/json-schema": "^7.0.15",
62
- "pkgroll": "^2.5.1"
60
+ "arktype": "^2.0.4",
61
+ "pkgroll": "^2.5.1",
62
+ "valibot": "^1.0.0-rc.4",
63
+ "zod": "^3.24.2"
63
64
  },
64
65
  "scripts": {
65
66
  "build": "pkgroll --minify --clean-dist"
@@ -1 +0,0 @@
1
- "use strict";var t=Object.defineProperty;var s=(o,c)=>t(o,"name",{value:c,configurable:!0});const n=s(async()=>o=>o.toJsonSchema(),"toJsonSchema");exports.toJsonSchema=n;
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var c=(o,n)=>s(o,"name",{value:n,configurable:!0});const t=c(async()=>o=>o.toJsonSchema(),"toJsonSchema");export{t as toJsonSchema};
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var t=(o,n)=>s(o,"name",{value:n,configurable:!0});const a=t(async()=>{try{const{toJsonSchema:o}=await import("@valibot/to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "@valibot/to-json-schema"')}},"toJsonSchema");export{a as toJsonSchema};
@@ -1 +0,0 @@
1
- "use strict";var r=Object.create;var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var e=(o,t)=>a(o,"name",{value:t,configurable:!0});var J=(o,t,s,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of i(t))!d.call(o,n)&&n!==s&&a(o,n,{get:()=>t[n],enumerable:!(c=h(t,n))||c.enumerable});return o};var S=(o,t,s)=>(s=o!=null?r(m(o)):{},J(t||!o||!o.__esModule?a(s,"default",{value:o,enumerable:!0}):s,o));const w=e(async()=>{try{const{toJsonSchema:o}=await import("@valibot/to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "@valibot/to-json-schema"')}},"toJsonSchema");exports.toJsonSchema=w;
@@ -1 +0,0 @@
1
- "use strict";var r=Object.create;var c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var i=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var a=(o,s)=>c(o,"name",{value:s,configurable:!0});var w=(o,s,n,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let t of h(s))!m.call(o,t)&&t!==n&&c(o,t,{get:()=>s[t],enumerable:!(e=d(s,t))||e.enumerable});return o};var J=(o,s,n)=>(n=o!=null?r(i(o)):{},w(s||!o||!o.__esModule?c(n,"default",{value:o,enumerable:!0}):n,o));const S=a(async()=>{try{const{zodToJsonSchema:o}=await import("zod-to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "zod-to-json-schema"')}},"toJsonSchema");exports.toJsonSchema=S;
@@ -1 +0,0 @@
1
- var t=Object.defineProperty;var n=(o,s)=>t(o,"name",{value:s,configurable:!0});const e=n(async()=>{try{const{zodToJsonSchema:o}=await import("zod-to-json-schema");return o}catch{throw new Error('standard-json: Missing dependencies "zod-to-json-schema"')}},"toJsonSchema");export{e as toJsonSchema};