@alint-js/plugin-js 0.1.5 → 0.3.0

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.
@@ -3192,7 +3192,8 @@ var ZodPromise = class extends ZodType {
3192
3192
  });
3193
3193
  return INVALID;
3194
3194
  }
3195
- return OK((ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data)).then((data) => {
3195
+ const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
3196
+ return OK(promisified.then((data) => {
3196
3197
  return this._def.type.parseAsync(data, {
3197
3198
  path: ctx.path,
3198
3199
  errorMap: ctx.common.contextualErrorMap
@@ -3672,9 +3673,7 @@ function parseBigintDef(def, refs) {
3672
3673
  setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
3673
3674
  }
3674
3675
  break;
3675
- case "multipleOf":
3676
- setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
3677
- break;
3676
+ case "multipleOf": setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
3678
3677
  }
3679
3678
  return res;
3680
3679
  }
@@ -3721,9 +3720,7 @@ const integerDateParser = (def, refs) => {
3721
3720
  case "min":
3722
3721
  setResponseValueAndErrors(res, "minimum", check.value, check.message, refs);
3723
3722
  break;
3724
- case "max":
3725
- setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
3726
- break;
3723
+ case "max": setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
3727
3724
  }
3728
3725
  return res;
3729
3726
  };
@@ -3875,9 +3872,7 @@ function parseStringDef(def, refs) {
3875
3872
  case "format:idn-email":
3876
3873
  addFormat(res, "idn-email", check.message, refs);
3877
3874
  break;
3878
- case "pattern:zod":
3879
- addPattern(res, zodPatterns.email, check.message, refs);
3880
- break;
3875
+ case "pattern:zod": addPattern(res, zodPatterns.email, check.message, refs);
3881
3876
  }
3882
3877
  break;
3883
3878
  case "url":
@@ -3948,16 +3943,10 @@ function parseStringDef(def, refs) {
3948
3943
  case "contentEncoding:base64":
3949
3944
  setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
3950
3945
  break;
3951
- case "pattern:zod":
3952
- addPattern(res, zodPatterns.base64, check.message, refs);
3953
- break;
3946
+ case "pattern:zod": addPattern(res, zodPatterns.base64, check.message, refs);
3954
3947
  }
3955
3948
  break;
3956
3949
  case "nanoid": addPattern(res, zodPatterns.nanoid, check.message, refs);
3957
- case "toLowerCase":
3958
- case "toUpperCase":
3959
- case "trim": break;
3960
- default:
3961
3950
  }
3962
3951
  return res;
3963
3952
  }
@@ -4304,9 +4293,7 @@ function parseNumberDef(def, refs) {
4304
4293
  setResponseValueAndErrors(res, "maximum", check.value, check.message, refs);
4305
4294
  }
4306
4295
  break;
4307
- case "multipleOf":
4308
- setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
4309
- break;
4296
+ case "multipleOf": setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
4310
4297
  }
4311
4298
  return res;
4312
4299
  }
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_dd15987b5d347427ac15b31bb7305983/node_modules/xsschema/dist/index-DoHiaFQM.js
1
+ //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_2fbd9cf5ae1608dbd5cb0576dee823ee/node_modules/xsschema/dist/index-DoHiaFQM.js
2
2
  const strictJsonSchema = (schema) => ({
3
3
  ...schema,
4
4
  additionalProperties: false,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-B-1-B7_t.mjs";
2
- import { n as strictJsonSchema } from "./index-DoHiaFQM-9scNuUlY.mjs";
1
+ import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DC62tzP2.mjs";
2
+ import { n as strictJsonSchema } from "./index-DoHiaFQM-DimeKT70.mjs";
3
3
  import { isAbsolute, normalize, relative, resolve, sep } from "node:path";
4
4
  import * as nativeFs from "fs";
5
5
  import { readdir, readdirSync, realpath, realpathSync, stat, statSync } from "fs";
@@ -1721,7 +1721,7 @@ const rawGenerateText = async (options) => {
1721
1721
  };
1722
1722
  const generateText = async (options) => trampoline(async () => rawGenerateText(options));
1723
1723
  //#endregion
1724
- //#region ../../node_modules/.pnpm/@xsai+tool@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3____927f6822d23b3a98d537f6f3dbeccc01/node_modules/@xsai/tool/dist/index.js
1724
+ //#region ../../node_modules/.pnpm/@xsai+tool@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3____f38a8212ad071b3d82e34970cca0a89a/node_modules/@xsai/tool/dist/index.js
1725
1725
  const rawTool = ({ description, execute, name, parameters, strict }) => ({
1726
1726
  execute,
1727
1727
  function: {
@@ -1775,6 +1775,7 @@ async function generateStructured(options) {
1775
1775
  try {
1776
1776
  options.signal?.throwIfAborted();
1777
1777
  response = await generateText({
1778
+ ...options.model.params,
1778
1779
  abortSignal: options.signal,
1779
1780
  baseURL: options.model.provider.endpoint,
1780
1781
  headers: options.model.provider.headers,
@@ -2651,7 +2652,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2651
2652
  };
2652
2653
  module.exports = {
2653
2654
  DEFAULT_MAX_EXTGLOB_RECURSION,
2654
- MAX_LENGTH: 1024 * 64,
2655
+ MAX_LENGTH: 65536,
2655
2656
  POSIX_REGEX_SOURCE: {
2656
2657
  __proto__: null,
2657
2658
  alnum: "a-zA-Z0-9",
@@ -5021,7 +5022,8 @@ function deduplicateFindings(findings) {
5021
5022
  });
5022
5023
  }
5023
5024
  function repositoryRelativePath(cwd, filePath) {
5024
- return normalize(cwd && isAbsolute(filePath) ? relative(cwd, filePath) : filePath).split(sep).join("/");
5025
+ const relativePath = cwd && isAbsolute(filePath) ? relative(cwd, filePath) : filePath;
5026
+ return normalize(relativePath).split(sep).join("/");
5025
5027
  }
5026
5028
  function withNumberedReads(tools) {
5027
5029
  return tools.map((tool) => tool.name === "read_file" ? {
@@ -25,7 +25,7 @@ var __copyProps = (to, from, except, desc) => {
25
25
  }
26
26
  return to;
27
27
  };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
29
  value: mod,
30
30
  enumerable: true
31
31
  }) : target, mod));
@@ -0,0 +1,8 @@
1
+ import { r as tryImport } from "./index-DoHiaFQM-DimeKT70.mjs";
2
+ //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_2fbd9cf5ae1608dbd5cb0576dee823ee/node_modules/xsschema/dist/sury-BoOvxlMw.js
3
+ const getToJsonSchemaFn = async () => {
4
+ const { toJSONSchema } = await tryImport(import("./S-0EivakUR.mjs"), "sury");
5
+ return (schema) => toJSONSchema(schema);
6
+ };
7
+ //#endregion
8
+ export { getToJsonSchemaFn };
@@ -1,5 +1,5 @@
1
- import { r as tryImport } from "./index-DoHiaFQM-9scNuUlY.mjs";
2
- //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_dd15987b5d347427ac15b31bb7305983/node_modules/xsschema/dist/valibot-_ibN3zSD.js
1
+ import { r as tryImport } from "./index-DoHiaFQM-DimeKT70.mjs";
2
+ //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_2fbd9cf5ae1608dbd5cb0576dee823ee/node_modules/xsschema/dist/valibot-_ibN3zSD.js
3
3
  const getToJsonSchemaFn = async () => {
4
4
  const { toJsonSchema } = await tryImport(import("./index.mjs").then((n) => n.t), "@valibot/to-json-schema");
5
5
  return (schema) => toJsonSchema(schema);
@@ -1,5 +1,5 @@
1
- import { t as missingDependenciesUrl } from "./index-DoHiaFQM-9scNuUlY.mjs";
2
- //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_dd15987b5d347427ac15b31bb7305983/node_modules/xsschema/dist/zod-DjyNjMBF.js
1
+ import { t as missingDependenciesUrl } from "./index-DoHiaFQM-DimeKT70.mjs";
2
+ //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_2fbd9cf5ae1608dbd5cb0576dee823ee/node_modules/xsschema/dist/zod-DjyNjMBF.js
3
3
  const getToJsonSchemaFn = async () => {
4
4
  let zodV4toJSONSchema = (_schema) => {
5
5
  throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${missingDependenciesUrl}`);
@@ -14,7 +14,7 @@ const getToJsonSchemaFn = async () => {
14
14
  if (err instanceof Error) console.error(err.message);
15
15
  }
16
16
  try {
17
- const { zodToJsonSchema } = await import("./esm-Dk08cWwM.mjs");
17
+ const { zodToJsonSchema } = await import("./esm-MMZUo8EB.mjs");
18
18
  zodV3ToJSONSchema = zodToJsonSchema;
19
19
  } catch (err) {
20
20
  if (err instanceof Error) console.error(err.message);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alint-js/plugin-js",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.3.0",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.mts",
@@ -16,9 +16,9 @@
16
16
  "@valibot/to-json-schema": "^1.7.1",
17
17
  "apeira": "^0.0.7",
18
18
  "valibot": "^1.4.2",
19
- "@alint-js/core": "0.1.5",
20
- "@alint-js/tools-fs": "0.1.5",
21
- "@alint-js/plugin": "0.1.5"
19
+ "@alint-js/core": "0.3.0",
20
+ "@alint-js/tools-fs": "0.3.0",
21
+ "@alint-js/plugin": "0.3.0"
22
22
  },
23
23
  "scripts": {
24
24
  "build": "tsdown",
@@ -1,8 +0,0 @@
1
- import { r as tryImport } from "./index-DoHiaFQM-9scNuUlY.mjs";
2
- //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_dd15987b5d347427ac15b31bb7305983/node_modules/xsschema/dist/effect-Df2gY8Wx.js
3
- const getToJsonSchemaFn = async () => {
4
- const { JSONSchema } = await tryImport(import("./esm-GXtgvsKv.mjs"), "effect");
5
- return (schema) => JSONSchema.make(schema);
6
- };
7
- //#endregion
8
- export { getToJsonSchemaFn };
@@ -1,8 +0,0 @@
1
- import { r as tryImport } from "./index-DoHiaFQM-9scNuUlY.mjs";
2
- //#region ../../node_modules/.pnpm/xsschema@0.5.0-beta.7_@valibot+to-json-schema@1.7.1_valibot@1.4.2_typescript@6.0.3___ef_dd15987b5d347427ac15b31bb7305983/node_modules/xsschema/dist/sury-BoOvxlMw.js
3
- const getToJsonSchemaFn = async () => {
4
- const { toJSONSchema } = await tryImport(import("./S-CK_sYI4B.mjs"), "sury");
5
- return (schema) => toJSONSchema(schema);
6
- };
7
- //#endregion
8
- export { getToJsonSchemaFn };