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

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,135 @@
1
1
  # @ai-sdk/valibot
2
2
 
3
+ ## 3.0.0-beta.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b3976a2]
8
+ - Updated dependencies [ff5eba1]
9
+ - @ai-sdk/provider-utils@5.0.0-beta.20
10
+
11
+ ## 3.0.0-beta.19
12
+
13
+ ### Major Changes
14
+
15
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [ef992f8]
20
+ - @ai-sdk/provider-utils@5.0.0-beta.19
21
+
22
+ ## 3.0.0-beta.18
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [90e2d8a]
27
+ - @ai-sdk/provider-utils@5.0.0-beta.18
28
+
29
+ ## 3.0.0-beta.17
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [3ae1786]
34
+ - @ai-sdk/provider-utils@5.0.0-beta.17
35
+
36
+ ## 3.0.0-beta.16
37
+
38
+ ### Patch Changes
39
+
40
+ - @ai-sdk/provider-utils@5.0.0-beta.16
41
+
42
+ ## 3.0.0-beta.15
43
+
44
+ ### Patch Changes
45
+
46
+ - @ai-sdk/provider-utils@5.0.0-beta.15
47
+
48
+ ## 3.0.0-beta.14
49
+
50
+ ### Patch Changes
51
+
52
+ - @ai-sdk/provider-utils@5.0.0-beta.14
53
+
54
+ ## 3.0.0-beta.13
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [b0c2869]
59
+ - Updated dependencies [7e26e81]
60
+ - @ai-sdk/provider-utils@5.0.0-beta.13
61
+
62
+ ## 3.0.0-beta.12
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [46d1149]
67
+ - @ai-sdk/provider-utils@5.0.0-beta.12
68
+
69
+ ## 3.0.0-beta.11
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [6fd51c0]
74
+ - @ai-sdk/provider-utils@5.0.0-beta.11
75
+
76
+ ## 3.0.0-beta.10
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [c29a26f]
81
+ - @ai-sdk/provider-utils@5.0.0-beta.10
82
+
83
+ ## 3.0.0-beta.9
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [2e17091]
88
+ - @ai-sdk/provider-utils@5.0.0-beta.9
89
+
90
+ ## 3.0.0-beta.8
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [986c6fd]
95
+ - Updated dependencies [493295c]
96
+ - @ai-sdk/provider-utils@5.0.0-beta.8
97
+
98
+ ## 3.0.0-beta.7
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [1f509d4]
103
+ - @ai-sdk/provider-utils@5.0.0-beta.7
104
+
105
+ ## 3.0.0-beta.6
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [3887c70]
110
+ - @ai-sdk/provider-utils@5.0.0-beta.6
111
+
112
+ ## 3.0.0-beta.5
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [776b617]
117
+ - @ai-sdk/provider-utils@5.0.0-beta.5
118
+
119
+ ## 3.0.0-beta.4
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies [61753c3]
124
+ - @ai-sdk/provider-utils@5.0.0-beta.4
125
+
126
+ ## 3.0.0-beta.3
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [f7d4f01]
131
+ - @ai-sdk/provider-utils@5.0.0-beta.3
132
+
3
133
  ## 3.0.0-beta.2
4
134
 
5
135
  ### 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.20",
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.20"
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"]}