@ai-sdk/valibot 3.0.0-beta.2 → 3.0.0-beta.21

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/CHANGELOG.md CHANGED
@@ -1,5 +1,142 @@
1
1
  # @ai-sdk/valibot
2
2
 
3
+ ## 3.0.0-beta.21
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [add1126]
8
+ - @ai-sdk/provider-utils@5.0.0-beta.21
9
+
10
+ ## 3.0.0-beta.20
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [b3976a2]
15
+ - Updated dependencies [ff5eba1]
16
+ - @ai-sdk/provider-utils@5.0.0-beta.20
17
+
18
+ ## 3.0.0-beta.19
19
+
20
+ ### Major Changes
21
+
22
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [ef992f8]
27
+ - @ai-sdk/provider-utils@5.0.0-beta.19
28
+
29
+ ## 3.0.0-beta.18
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [90e2d8a]
34
+ - @ai-sdk/provider-utils@5.0.0-beta.18
35
+
36
+ ## 3.0.0-beta.17
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [3ae1786]
41
+ - @ai-sdk/provider-utils@5.0.0-beta.17
42
+
43
+ ## 3.0.0-beta.16
44
+
45
+ ### Patch Changes
46
+
47
+ - @ai-sdk/provider-utils@5.0.0-beta.16
48
+
49
+ ## 3.0.0-beta.15
50
+
51
+ ### Patch Changes
52
+
53
+ - @ai-sdk/provider-utils@5.0.0-beta.15
54
+
55
+ ## 3.0.0-beta.14
56
+
57
+ ### Patch Changes
58
+
59
+ - @ai-sdk/provider-utils@5.0.0-beta.14
60
+
61
+ ## 3.0.0-beta.13
62
+
63
+ ### Patch Changes
64
+
65
+ - Updated dependencies [b0c2869]
66
+ - Updated dependencies [7e26e81]
67
+ - @ai-sdk/provider-utils@5.0.0-beta.13
68
+
69
+ ## 3.0.0-beta.12
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [46d1149]
74
+ - @ai-sdk/provider-utils@5.0.0-beta.12
75
+
76
+ ## 3.0.0-beta.11
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [6fd51c0]
81
+ - @ai-sdk/provider-utils@5.0.0-beta.11
82
+
83
+ ## 3.0.0-beta.10
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [c29a26f]
88
+ - @ai-sdk/provider-utils@5.0.0-beta.10
89
+
90
+ ## 3.0.0-beta.9
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [2e17091]
95
+ - @ai-sdk/provider-utils@5.0.0-beta.9
96
+
97
+ ## 3.0.0-beta.8
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [986c6fd]
102
+ - Updated dependencies [493295c]
103
+ - @ai-sdk/provider-utils@5.0.0-beta.8
104
+
105
+ ## 3.0.0-beta.7
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [1f509d4]
110
+ - @ai-sdk/provider-utils@5.0.0-beta.7
111
+
112
+ ## 3.0.0-beta.6
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [3887c70]
117
+ - @ai-sdk/provider-utils@5.0.0-beta.6
118
+
119
+ ## 3.0.0-beta.5
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [776b617]
124
+ - @ai-sdk/provider-utils@5.0.0-beta.5
125
+
126
+ ## 3.0.0-beta.4
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [61753c3]
131
+ - @ai-sdk/provider-utils@5.0.0-beta.4
132
+
133
+ ## 3.0.0-beta.3
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [f7d4f01]
138
+ - @ai-sdk/provider-utils@5.0.0-beta.3
139
+
3
140
  ## 3.0.0-beta.2
4
141
 
5
142
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,53 +1,16 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- valibotSchema: () => valibotSchema
34
- });
35
- module.exports = __toCommonJS(index_exports);
36
-
37
1
  // src/valibot-schema.ts
38
- var import_to_json_schema = require("@valibot/to-json-schema");
39
- var import_provider_utils = require("@ai-sdk/provider-utils");
40
- var v = __toESM(require("valibot"));
2
+ import { toJsonSchema as valibotToJsonSchema } from "@valibot/to-json-schema";
3
+ import { jsonSchema } from "@ai-sdk/provider-utils";
4
+ import * as v from "valibot";
41
5
  function valibotSchema(valibotSchema2) {
42
- return (0, import_provider_utils.jsonSchema)((0, import_to_json_schema.toJsonSchema)(valibotSchema2), {
6
+ return jsonSchema(valibotToJsonSchema(valibotSchema2), {
43
7
  validate: (value) => {
44
8
  const result = v.safeParse(valibotSchema2, value);
45
9
  return result.success ? { success: true, value: result.output } : { success: false, error: new v.ValiError(result.issues) };
46
10
  }
47
11
  });
48
12
  }
49
- // Annotate the CommonJS export names for ESM import in node:
50
- 0 && (module.exports = {
13
+ export {
51
14
  valibotSchema
52
- });
15
+ };
53
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/valibot-schema.ts"],"sourcesContent":["export { valibotSchema } from './valibot-schema';\n","import { toJsonSchema as valibotToJsonSchema } from '@valibot/to-json-schema';\nimport { jsonSchema, Schema } from '@ai-sdk/provider-utils';\nimport * as v from 'valibot';\n\nexport function valibotSchema<\n SCHEMA extends v.GenericSchema<unknown, unknown, v.BaseIssue<unknown>>,\n>(valibotSchema: SCHEMA): Schema<v.InferOutput<SCHEMA>> {\n return jsonSchema(valibotToJsonSchema(valibotSchema), {\n validate: value => {\n const result = v.safeParse(valibotSchema, value);\n return result.success\n ? { success: true, value: result.output }\n : { success: false, error: new v.ValiError(result.issues) };\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAoD;AACpD,4BAAmC;AACnC,QAAmB;AAEZ,SAAS,cAEdA,gBAAsD;AACtD,aAAO,sCAAW,sBAAAC,cAAoBD,cAAa,GAAG;AAAA,IACpD,UAAU,WAAS;AACjB,YAAM,SAAW,YAAUA,gBAAe,KAAK;AAC/C,aAAO,OAAO,UACV,EAAE,SAAS,MAAM,OAAO,OAAO,OAAO,IACtC,EAAE,SAAS,OAAO,OAAO,IAAM,YAAU,OAAO,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["valibotSchema","valibotToJsonSchema"]}
1
+ {"version":3,"sources":["../src/valibot-schema.ts"],"sourcesContent":["import { toJsonSchema as valibotToJsonSchema } from '@valibot/to-json-schema';\nimport { jsonSchema, Schema } from '@ai-sdk/provider-utils';\nimport * as v from 'valibot';\n\nexport function valibotSchema<\n SCHEMA extends v.GenericSchema<unknown, unknown, v.BaseIssue<unknown>>,\n>(valibotSchema: SCHEMA): Schema<v.InferOutput<SCHEMA>> {\n return jsonSchema(valibotToJsonSchema(valibotSchema), {\n validate: value => {\n const result = v.safeParse(valibotSchema, value);\n return result.success\n ? { success: true, value: result.output }\n : { success: false, error: new v.ValiError(result.issues) };\n },\n });\n}\n"],"mappings":";AAAA,SAAS,gBAAgB,2BAA2B;AACpD,SAAS,kBAA0B;AACnC,YAAY,OAAO;AAEZ,SAAS,cAEdA,gBAAsD;AACtD,SAAO,WAAW,oBAAoBA,cAAa,GAAG;AAAA,IACpD,UAAU,WAAS;AACjB,YAAM,SAAW,YAAUA,gBAAe,KAAK;AAC/C,aAAO,OAAO,UACV,EAAE,SAAS,MAAM,OAAO,OAAO,OAAO,IACtC,EAAE,SAAS,OAAO,OAAO,IAAM,YAAU,OAAO,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["valibotSchema"]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ai-sdk/valibot",
3
- "version": "3.0.0-beta.2",
3
+ "version": "3.0.0-beta.21",
4
+ "type": "module",
4
5
  "license": "Apache-2.0",
5
6
  "sideEffects": false,
6
7
  "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
8
  "types": "./dist/index.d.ts",
9
9
  "files": [
10
10
  "dist/**/*",
@@ -20,12 +20,12 @@
20
20
  "./package.json": "./package.json",
21
21
  ".": {
22
22
  "types": "./dist/index.d.ts",
23
- "import": "./dist/index.mjs",
24
- "require": "./dist/index.js"
23
+ "import": "./dist/index.js",
24
+ "default": "./dist/index.js"
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@ai-sdk/provider-utils": "5.0.0-beta.2"
28
+ "@ai-sdk/provider-utils": "5.0.0-beta.21"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "20.17.24",
@@ -60,8 +60,6 @@
60
60
  "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
61
61
  "build:watch": "pnpm clean && tsup --watch",
62
62
  "clean": "del-cli dist *.tsbuildinfo",
63
- "lint": "eslint \"./**/*.ts*\"",
64
- "type-check": "tsc --build",
65
- "prettier-check": "prettier --check \"./**/*.ts*\""
63
+ "type-check": "tsc --build"
66
64
  }
67
65
  }
package/dist/index.d.mts DELETED
@@ -1,6 +0,0 @@
1
- import { Schema } from '@ai-sdk/provider-utils';
2
- import * as v from 'valibot';
3
-
4
- declare function valibotSchema<SCHEMA extends v.GenericSchema<unknown, unknown, v.BaseIssue<unknown>>>(valibotSchema: SCHEMA): Schema<v.InferOutput<SCHEMA>>;
5
-
6
- export { valibotSchema };
package/dist/index.mjs DELETED
@@ -1,16 +0,0 @@
1
- // src/valibot-schema.ts
2
- import { toJsonSchema as valibotToJsonSchema } from "@valibot/to-json-schema";
3
- import { jsonSchema } from "@ai-sdk/provider-utils";
4
- import * as v from "valibot";
5
- function valibotSchema(valibotSchema2) {
6
- return jsonSchema(valibotToJsonSchema(valibotSchema2), {
7
- validate: (value) => {
8
- const result = v.safeParse(valibotSchema2, value);
9
- return result.success ? { success: true, value: result.output } : { success: false, error: new v.ValiError(result.issues) };
10
- }
11
- });
12
- }
13
- export {
14
- valibotSchema
15
- };
16
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/valibot-schema.ts"],"sourcesContent":["import { toJsonSchema as valibotToJsonSchema } from '@valibot/to-json-schema';\nimport { jsonSchema, Schema } from '@ai-sdk/provider-utils';\nimport * as v from 'valibot';\n\nexport function valibotSchema<\n SCHEMA extends v.GenericSchema<unknown, unknown, v.BaseIssue<unknown>>,\n>(valibotSchema: SCHEMA): Schema<v.InferOutput<SCHEMA>> {\n return jsonSchema(valibotToJsonSchema(valibotSchema), {\n validate: value => {\n const result = v.safeParse(valibotSchema, value);\n return result.success\n ? { success: true, value: result.output }\n : { success: false, error: new v.ValiError(result.issues) };\n },\n });\n}\n"],"mappings":";AAAA,SAAS,gBAAgB,2BAA2B;AACpD,SAAS,kBAA0B;AACnC,YAAY,OAAO;AAEZ,SAAS,cAEdA,gBAAsD;AACtD,SAAO,WAAW,oBAAoBA,cAAa,GAAG;AAAA,IACpD,UAAU,WAAS;AACjB,YAAM,SAAW,YAAUA,gBAAe,KAAK;AAC/C,aAAO,OAAO,UACV,EAAE,SAAS,MAAM,OAAO,OAAO,OAAO,IACtC,EAAE,SAAS,OAAO,OAAO,IAAM,YAAU,OAAO,MAAM,EAAE;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["valibotSchema"]}