xsschema 0.5.1 → 1.0.0-beta.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.
Files changed (2) hide show
  1. package/README.md +22 -1
  2. package/package.json +4 -6
package/README.md CHANGED
@@ -1 +1,22 @@
1
- https://xsai.js.org/docs/packages-top/xsschema
1
+ # xsschema
2
+
3
+ <!-- automd:file src="/docs/snippets/xsschema.md" -->
4
+
5
+ ```sh
6
+ pnpm add xsschema zod
7
+ ```
8
+
9
+ ```ts
10
+ import { toJsonSchema, validate } from 'xsschema'
11
+
12
+ import * as z from 'zod'
13
+
14
+ const schema = z.object({ name: z.string() })
15
+
16
+ console.log(await toJsonSchema(schema))
17
+ console.log(await validate(schema, { name: 'Ada' }))
18
+ ```
19
+
20
+ <!-- /automd -->
21
+
22
+ Read the [documentation](https://xsai.js.org/xsschema).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xsschema",
3
3
  "type": "module",
4
- "version": "0.5.1",
4
+ "version": "1.0.0-beta.1",
5
5
  "description": "extra-small, Standard Schema-based alternative to typeschema.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/moeru-ai/xsai.git",
12
- "directory": "packages-top/xsschema"
12
+ "directory": "packages/xsschema"
13
13
  },
14
14
  "bugs": "https://github.com/moeru-ai/xsai/issues",
15
15
  "keywords": [
@@ -17,9 +17,7 @@
17
17
  "standard-schema",
18
18
  "typeschema"
19
19
  ],
20
- "sideEffects": [
21
- "src/to-json-schema/sync.ts"
22
- ],
20
+ "sideEffects": false,
23
21
  "exports": {
24
22
  ".": {
25
23
  "types": "./dist/index.d.ts",
@@ -70,7 +68,7 @@
70
68
  "zod-to-json-schema": "^3.25.0"
71
69
  },
72
70
  "scripts": {
73
- "build": "pkgroll",
71
+ "build": "pkgroll --clean-dist",
74
72
  "test": "vitest run",
75
73
  "test:watch": "vitest"
76
74
  },